๐ฆ
<?php
declare(strict_types=1)
๐ ๐
๐โโ๏ธ๐จ
Rust
With no context, this could be an honest attempt to learn about different tools, a thinly veiled set-up to promote a specific language, or an attempt to stir up drama. I canโt tell which.
Itโs curious how such specific conditions are embedded into the question with no explanation of why, yet โmemory safeโ is included among them without specifying what kind of memory safety.
Yeah, arguably the only answer to this question is Rust.
Java/C#/etc. are not fully compiled (you do have a compilation step, but then also an interpretation step). And while Java/C#/etc. are memory-safe in a single-threaded context, theyโre not in a multi-threaded context.
C# has native compilation capability, thanks to Native AOT
https://learn.microsoft.com/en-us/dotnet/core/deploying/native-aot/
I mean, yeah, valid point. JVM languages also have GraalVM for that purpose.
But Iโm playing devilโs advocate here. ๐
Arguably these donโt count, because theyโre not the normal way of using these languages. Reflection isnโt properly supported in them, for example, so you may not be able to use certain libraries that youโd normally use.
These also still require a minimal runtime thatโs baked into the binary, to handle garbage collection and such.
Personally, I enjoy fully compiled languages, because they generally donโt lock you into an ecosystem, i.e. you can use them to create a library which can be called from virtually any programming language, via the C ABI.
You cannot do that with a language that requires a (baked-in) runtime to run.
But yeah, obviously someone just specifying โcompiledโ probably wonโt have all these expectationsโฆ
Arguably modern c++ ( aka if you donโt use raw pointers), fits all categories.
I donโt know much about C++, but how would that do memory safety in a multi-threaded context? In Rust, thatโs one of the things resolved by ownership/borrowingโฆ
Or are you saying arguably, as in you could argue the definition of the categories to be less strict, allowing C++ as well as Java/C#/etc. to match it?
Thereโs nothing to prevent data races. I myself have fallen into the trap of using the same list from multiple threads.
Most people would consider it so, but it actually does not either fulfill the argument I posed there: https://forums.swift.org/t/what-language-is-more-memory-safe-swift-or-rust/31987
Yeah, I like subleq.
- compiler is extremely fast, faster even than
tinycc
- strongly statically typed: all values are
int
s. Since itโs all of them, you donโt even need to write it! - memory safe: the entire (virtual) address space is guaranteed to be accessible at all times so thereโs no way to leak any of it (canโt release it anyway) or to segfault (itโs all accessible).
Subleq is the obvious winner in my mind.
Gleam?
https://gleam.run/
Honest question, what would make you pick Gleam over Elixir? Both seem to have significant overlap