A few days ago I started to learn Elm with the goal to create a new front end for lemmy.
At the same time I want to create tui applications, which are really modern.
So someone recommended Crate tui, which is a Rust library.
Should I keep learning Elm or should I switch to Rust or should I even learn both, even if it takes a lot of time and energy?
Are you making a web front end, command-line, desktop gui, or mobile app?
From the first post:
a new front end for lemmy.
I would like to do a new lemmy front end (web) and it would be very nice if it could be “converted” to a mobile app.
At the same time I want to create tui applications
I want to create a tui application (NOT CLI), which should work for unix based systems, like Linux.
These are both pretty massive, and separate projects. For a TUI, I would definitely recommend rust, but for a web front end, I’d probably do it in typescript, as none of the rust frameworks for building web apps are coming in very fast in benchmarks (that includes yew).
hmm… ok, it looks like I will learn Elm and Rust separately. Starting with Elm, trying to do some front end.
Huh, I never would have thought of using Elm for TUI apps, how does that work? Does it compile down to JavaScript that you feed into or bundle with Node.js?
Edit: nevermind, I misread and thought you were selecting a stack for a TUI app
I’d select the stack based on whatever project you are most-drawn to at this time: if you really want to build a web front-end, then you could do that in Rust, but it would be far easier in Elm
if you really want to build a web front-end, then you could do that in Rust, but it would be far easier in Elm
Yes, stuff like this is what I want to know (at least almost).
I want to know if it is enough to learn only one new language (Rust) to do whatever applications and not to learn several at once and because many stuff works on many platforms and it’s just hard to figure out what language is created for what, I had to ask questions.
But maybe fundamental questions would be better, because people get confused:
For what kind of applications is Rust for/used?
Rust is a very versatile language, so you can make almost any kind of app with it, although the ecosystem around certain use cases (e.g. CLI) is more developed
You could build a web front-end in Rust with these crates (the Rust word for “library”):
- https://crates.io/crates/yew
- https://tauri.app/ (alternative to Electron)
You could build a HTTP back-end in Rust with these crates:
- https://github.com/tokio-rs/axum
- https://github.com/SergioBenitez/Rocket
- https://github.com/seanmonstar/warp
I use these GUI apps written in Rust:
- https://github.com/alacritty/alacritty
- https://github.com/wez/wezterm
- https://github.com/elkowar/eww
- https://github.com/flxzt/rnote
- https://github.com/relulz/helvum
- https://github.com/Toqozz/wired-notify
- https://github.com/ifreund/waylock
I use these TUI apps that are written in Rust:
- https://github.com/orf/gping
- https://github.com/kdash-rs/kdash
- https://github.com/bvaisvil/zenith
- https://github.com/sayanarijit/xplr
I use these CLI tools written in Rust:
- https://git.sr.ht/~kennylevinsen/greetd
- https://www.nushell.sh/
- https://github.com/ducaale/xh
- https://github.com/ogham/dog
- https://github.com/bootandy/dust
- https://github.com/sharkdp/fd/
- https://github.com/BurntSushi/ripgrep
- https://github.com/dalance/procs
- https://github.com/chmln/sd
- https://github.com/zellij-org/zellij
- https://github.com/starship/starship
- https://github.com/ajeetdsouza/zoxide
- https://github.com/XAMPPRocky/tokei
- https://github.com/hatoo/oha
Other places Rust is used:
- Mozilla Firefox is very slowly being converted to Rust (rendering and SVG are some pieces that are already Rust, but there’s more)
- work being done to support writing Linux kernel drivers in Rust
- Amazon Web Services uses Rust in a lot of their services like Lambda
- parts of the NPM service (yes, the JavaScript package repository, even they don’t use JavaScript for everything)
- Tor is slowly and carefully being rewritten in Rust
- Matrix and Signal protocols have official Rust implementations
Great list, thanks for compiling all these, I’m gonna check some of them out.
Thanks for this great list. I went through a few, but couldn’t test a lot yet.
If it’s about web development, now I know that Rust can be used to create a back end and with Elm I could create a front end.
The question is: Is it a good combination?
Hehe, I actually just remembered that Lemmy itself is also written in Rust: https://github.com/LemmyNet/lemmy (the web front-end is TypeScript, I think)
I don’t know Elm at all really, but it might be worth going over what we think are characteristics of combinations of back-end and front-end stacks
Great:
- define types once, and be able to use them or generate them for the other side, e.g. protobuf, or generate types from JSON Schema, or use same language on both sides
- tooling available to generate front-end SDK based on OpenAPI/Swagger for the back-end
Fine:
- explicitly define the same types in multiple languages, manually keep them synchronised, e.g. probably the out-of-the-box experience whenever you use different languages in front and back
- manually create HTTP client helpers in front-end to talk to HTTP endpoints in back-end
Bad:
- a core type or data structure concept on one side is missing from the other, e.g. imagine if one side didn’t have arrays or booleans or something that you use all the time, so you had to do extra work just to get both sides to communicate
- no common protocols between technologies, e.g. one side doesn’t even speak HTTP
I’m trying to think of other characteristics, but coming up empty :) I’ll update if I think of more :)
I don’t know Elm very good yet, but as far as I know it, it is a perfect match :)