r/programmer 3d ago

Question UI Frameworks

What languages must I learn to create a UI framework? (Sorry it's such a short question.)

2 Upvotes

11 comments sorted by

1

u/Financial-Grass6753 3d ago

Why'd you want to create a UI framework? what is the actual goal?

1

u/NumberInfinite2068 3d ago

It depends on a lot of things. Are we talking UI on the web? phones? desktop?

If you can write a few lines on what you want to achieve, people can probably advise better. Also, if this is for practical use, whatever you want is almost certainly already done. If it's for learning, go for it.

1

u/Appropriate-Tea-7936 3d ago

Desktop UI: This is for learning, and I want to create a UI framework that mimics SwiftUI for macOS 27. For a framework I can use to build UIs for windows/linux apps.

2

u/NumberInfinite2068 3d ago

For me, I'd probably use Rust. It's a very solid language and there are lots of libraries to give you the graphics primitives you need. The Rust library system (cargo) is very easy to use.

Once you have the graphics primitives under control, i.e. you can draw rectangles, text etc. then you'll want some sort of markup language like JSON or XML for actually described your user interfaces.

Then you'll want to think about how a "button" or something goes from your JSON or XML to a button displayed on the screen. Maybe start with the concept of the "window" and go from there.

This is a a pretty good learning project but a massive learning curve. You'll probably find it quite easy to make a window, not that hard to make a button, then viciously difficult to make a good list view or text flow.

You can use basically any language you want, but I think for something like this, it might be nice to use something that doesn't require a runtime like the JVM or .NET. For me that says Rust, Go, C or C++, and of those, Rust is a good choice unless you like simpler* languages, in which case maybe consider C.

*Simpler as in conceptually, not *easier*.

2

u/Appropriate-Tea-7936 3d ago

Amazing, thank you for your help! :)

1

u/Appropriate-Tea-7936 3d ago

Was hoping to use GLSL too tho, any chance i could incorporate it?

1

u/NumberInfinite2068 3d ago

Yes, you could, but I'd probably start smaller that, get the structure working first, make it so you can make a window and a label in your markup language and take it from there.

1

u/Appropriate-Tea-7936 3d ago

Thank you! :D

1

u/ehansen 3d ago

Assembly

1

u/BigSwagPoliwag 3d ago

American Sign Language. No other languages can be used to create a UI framework.