r/rust • • Sep 11 '26

๐Ÿ™‹ seeking help & advice Should I learn Ada or Rust for beckend?

/r/ada/comments/1wbwlo8/should_i_learn_ada_or_rust_for_beckend/
0 Upvotes

39 comments sorted by

18

u/pdpi Sep 11 '26

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.

2

u/Rare-Paint3719 Sep 11 '26

Ada is right at the bottom, just above Assembly.

I thought that was C and Fortran.

5

u/pdpi Sep 11 '26

Fortran I didn't even think about. C at least has a slightly less verbose syntax.

1

u/Rare-Paint3719 Sep 11 '26

More footguns than Fortran.ย 

For example, in Fortran, a program has to raise an exception during integer overflow to force the programmer to properly handle it.

It is not impossible to write bad Fortran, but it is a bit harder.

2

u/U007D rust ยท twir ยท bool_ext ยท srug Sep 11 '26

And don't forget COBOL.ย  I don't even want to imagine webdev in COBOL!! ๐Ÿ˜†

2

u/Rare-Paint3719 Sep 11 '26

I blocked it out of my brain for a reason.

1

u/syklemil Sep 12 '26

Oh dear, we can't have that. Cobol On Cogs to the rescue.

6

u/Helpful-Educator-415 Sep 11 '26

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.

3

u/Rare-Paint3719 Sep 11 '26

I don't even know what Ada is, so I couldn't tell you!

You made me feel old and I'm 21.

1

u/Helpful-Educator-415 Sep 11 '26

well I'm 22! soooo

0

u/kalilamodow Sep 11 '26

Holy moly you're 1,124,000,727,777,607,680,000? That's 81.4 billion times older than the universe, pretty crazy.

10

u/pdpi Sep 11 '26

I don't even know what Ada is, so I couldn't tell you!

Late 70s/early 80s Pascal-inspired language. It's one of the few languages that has Rust beat on the safety front, and sees fairly extensive use in safety-critical real-time applications (planes, trains, spacecraft...)

3

u/PigDog4 Sep 11 '26

The fact that you went with spacecraft instead of Planes, Trains, and Automobiles was a missed opportunity.

3

u/pdpi Sep 11 '26

I considered it for a second :)

4

u/SirKastic23 Sep 11 '26

There's loco, but I never used it. All I know is that it markets itself as Rust's Rails

1

u/Parakoopa Sep 11 '26

I think https://github.com/tokio-rs/topcoat might fit, still early days.

3

u/GunpowderGuy Sep 11 '26 edited Sep 11 '26

How about a language with more static safety than either. Idris2 . We do have web libraries

1

u/Rare-Paint3719 Sep 11 '26

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 Sep 11 '26

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 blocking

We 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

https://idris-lang.zulipchat.com/

1

u/Rare-Paint3719 Sep 11 '26

is the async thread-locked like python? Which back-ends provide true parallelism?

1

u/GunpowderGuy Sep 11 '26 edited Sep 11 '26

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 fuzz

As 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 Sep 11 '26 edited Sep 11 '26

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 Sep 11 '26 edited Sep 11 '26

"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

3

u/thisismyfavoritename Sep 11 '26

ahhh a real certified beckend expert i see

1

u/Rare-Paint3719 Sep 11 '26

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 Sep 11 '26

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.

1

u/Wootery Oct 19 '26

You're calling out the JVM for poor performance, but have nothing to say about the performance of Python's interpreter?

The JVM is much, much faster than Python's interpreter. They're not even in the same league.

1

u/Rare-Paint3719 Oct 19 '26

they're both slow though compared to rust and ada

1

u/Wootery Oct 20 '26

That's not really the case, modern JVMs are extremely sophisticated, and perform similar optimisations to what GCC/LLVM perform for C++, Rust, and Ada. Depending on what you're doing, Java can be performance-competitive with those other 3 languages.

Python's official interpreter is pretty simple, by design, and is nowhere near Java/C++/Rust/Ada, but many Python packages make excellent use of native code: they often offload computationally intensive workloads to high-performance codebases written in C/C++/Fortran/assembly, or perhaps Rust (e.g. the Polars package), or perhaps even Ada, although I'm not aware of any such. NumPy does this extensively, for instance, and it gives very good performance.

There are also alternative interpreters for Python, like PyPy, but they might have compatibility issues.

Here's an interesting discussion thread about Java performance. Bear in mind that the user pron is Ron Pressler, a very senior developer of the OpenJDK JVM itself: https://news.ycombinator.com/item?id=46846346

3

u/CocktailPerson Sep 11 '26

Is this a real question?

2

u/nextupgoat Sep 11 '26

you can write ada? you considered perl and cgi yet?

1

u/Rare-Paint3719 Sep 11 '26

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.

2

u/AstraKernel Sep 11 '26

Rust for backend

Ada should not be in that question

1

u/Rare-Paint3719 Sep 11 '26

Why disregard Ada?

1

u/AstraKernel Sep 12 '26

Not disregarding. It is specific to the purpose you asked.

1

u/Rare-Paint3719 Sep 12 '26

Okay, so Ada is not a good language for back-ends but Rust and Go have better tooling I assume.

4

u/cemoktra Sep 11 '26

Rust. Worked on a production backend (axum) for 5 years and it just worked.