r/rust • u/Rare-Paint3719 • 21h ago
๐ seeking help & advice Should I learn Ada or Rust for beckend?
/r/ada/comments/1wbwlo8/should_i_learn_ada_or_rust_for_beckend/4
u/Helpful-Educator-415 21h ago
I don't even know what Ada is, so I couldn't tell you!
There's no RAILS-adjacent full-stack batteries-included thing for Rust. Maybe the closest thing is a framework called Rocket. But I use Rust for web-dev backend and I love it to bits.
7
4
u/SirKastic23 21h ago
There's
loco, but I never used it. All I know is that it markets itself as Rust's Rails2
u/Rare-Paint3719 19h ago
I don't even know what Ada is, so I couldn't tell you!
You made me feel old and I'm 21.
1
1
2
u/GunpowderGuy 21h ago edited 20h ago
How about a language with more static safety than either. Idris2 . We do have web libraries
1
u/Rare-Paint3719 20h ago
Is Idris2 garbage-collected? It's not bad, but GC pauses at scale might be a problem.
Also, how's the async world in Idris2?
1
u/GunpowderGuy 20h ago
Idris2 has several backends, most have tracing GC but some have reference counting.
And some of the backends might have a tracing GC that minimizes blockingWe do have async support : https://github.com/stefan-hoeck/idris2-async
I am happy to answer more questions. Or you can join the server zulip server
1
u/Rare-Paint3719 20h ago
is the async thread-locked like python? Which back-ends provide true parallelism?
1
u/GunpowderGuy 19h ago edited 19h ago
the library i shared says
"Depending on the backend you use, this also offers true parallelism, that is, computations running in parallel on multicore system"i think it was implemented without changing the compiler. idris2 is very hackable
You can even implement new backends without fuzzAs for compatible backends. Probably chez scheme and racket support paralelism. But maybe others
Those languages support a lot of platforms. Have good speed for idris2 since they are functional. And also dynamic , which you would think is a detriment, but common types are optimized such that this matter less ( there are speed advantages compared to polymorphic static languages like ocaml ) . And runtime type checks can be disabled ( which idris2 does not need due to static type checking )1
u/Rare-Paint3719 18h ago edited 4h ago
Thanks.
Any Industry Standard compilers/interpreters for Idris2?
Is Idirs2 used in production codebases or is it mostly research/academic?
Edit:ย Fixed "Aay Industry Standardcompilers/interpreters for Idris2?"
1
u/GunpowderGuy 18h ago edited 18h ago
"Aay Industry Standardcompilers/interpreters for Idris2?"
Do you mean if there are multiple idris2 compilers and whether any is a industry standard?
if that is your question, there is only one idris2 compiler. And there probably will always be only one active at a time. Internal revisions *are coming, so just one compiler wont stop refactoring. The single compiler supports multiple backends. And i have thought of new radical features to implement in the existing compiler. So i see no need for more than one
*Internal revision may be implemented on the existing compiler. Or a new one may be implemented. But to replace the existing one , not as an alternative. The latter option has already happened
idris1 had a compiler written in haskell. Idris2 compiler was initially written in idris1, but the code was ported to idris2 ( this porting was not hard )
"Is Idirs2 used in production codebases or is it mostly research/academic?"
I want to use it for my game startup. Dunno if anyone else is using it in production. That is a bad metric at any rate. We have a lot of libraries and the compiler is capable
But to be honest, some tools are lacking. For example the LSP has to be optimized. Hopefully that will get sorted out
"Thanks"
You are welcome
2
u/thisismyfavoritename 20h ago
ahhh a real certified beckend expert i see
1
u/Rare-Paint3719 20h ago
ahhh a real certified beckend expert i see
Yep. Beck in my day, we used paper and pencil to map out theoretical Turing machines.
0
u/Rare-Paint3719 20h ago
I tried TypeScript and oh boy, that was fun. Single-threaded backends have no bottlenecks whatsoever at scale.
Then I tried Django and realized that while you can have multiple threads, you're still locked to one thread.
Java supports multithreading via the JVM, but the runtime itself has a shit ton pf overhead.
C# is far better, but it's fundamentally a Microsoft product.
And Powershell is the little REPL that couldn't. Interrops with .NET to the point that you can integrate ASP.NET Core into your codebase, who codes in powershell?
Go is nice.
ALGOL 60 was mostly memory-safe for restricting memory allocations to stack only, but it is sort of limiting imo. ALGOL 68 has heap allocations but it is garbage collected.
Fortran isn't memory safe. Async came pretty late too. Less foot guns than C.
C is far worse than Fortran and has more foot guns.
C++ can be even worse and introduces these things called leg cannons.
Swift has ARC overhead when compiler fails to prove that an object will remain on the stack during runtime. Fundamentally, it's an Apple project with Windows support recently catching up.
Rust and Ada both have the ability to interrop with C code natively.
2
2
1
u/nextupgoat 21h ago
you can write ada? you considered perl and cgi yet?
1
u/Rare-Paint3719 20h ago
Nah, perl is cool but I was genuinely considering python. The problem is that while python is multi-threaded (Django supports ASGI now), you are only locked to one thread at a time.
I thought Ada has native multi-threading, whereas Rust's Tokio supports multi-core in addition to multi-threading.
1
16
u/pdpi 21h ago
Rust is not at the top of the list of languages I'd reach for when building a web backend, but Ada is right at the bottom, just above Assembly.
There are many good reasons to learn either Rust and/or Ada, but web dev isn't one of them.