4 ms·
If the claim that its performance will be similar to Rust's if you add type annotations, this could become a really attractive language! As easy as JavaScript
by brabel 3y ago
If the claim that its performance will be similar to Rust's if you add type annotations, this could become a really attractive language!
As easy as JavaScript to write, as fast as Rust when the extra effort to write it justifies it.
- wokwokwok 3y agoThere’s no claim to be as easy as javascript to write. Rusts “difficulty” stems from its single ownership model, and this model is “different” not “easier”. https://dada-lang.org/docs/dyn_tutorial/permissions https://dada-lang.org/docs/dyn_tutorial/permissions
- rubyfan 3y agoFrom what it looks more expressive and seems intuitive to me.
- DinaCoder99 3y agoI personally find the semantics of javascript a lot harder to internalize than rust due to its scoping and very unintuitive object system. I can't imagine this is any more difficult than that.
- jokethrowaway 3y agoI agree but most modern JS doesn't use prototypal inheritance. JS has plenty of bad parts you shouldn't use. Classes are the main one.
- iopq 3y agoI had a coworker who wrote return { ... } And JS helpfully inserted a semi-colon after return This is a feature you need to know about and you have to go out of your way not to get rekt by it
- DinaCoder99 3y agoEven checking the class of a given object feels quite flimsy to me, although this perhaps isn't a huge problem in a coherent codebase. This isn't meant to be an attack on javascript as a worthwhile tool to learn, by the way, just a testament to the fact that it's not an easy language to master in the slightest.
- usrusr 3y agoStill super weird, because the garbage collector tax that is avoided by the borrow checker that's decidedly not gone isn't all that big to begin with. But perhaps it's a viable "training wheels" approach for getting used to borrow-checker friendly patterns? And I guess a scripting interpreter option that is fully rust-aware in terms of lifetimes could be truly golden for certain use cases, even if it turns out to be completely hostile to users not fully in tune with the underlying Rust. Sometimes "no recompile" is very important. I wonder if the genesis story of the project might be hidden in "Dada has a required runtime": perhaps it started with the what-if of "how nice could we make Rust if we abandoned our strict "no runtime!" stance and went for making it runtime-heavy like e.g. Scala"? Then the runtime pulls in more and more responsibility until it's easier to consume a raw AST and from there it's not all that far to making types optional.
- speed_spread 3y agoGarbage collection is actually faster than generic malloc for allocating memory because it can work as a simple bump allocator. And there are ways to handle collection efficiently. Malloc is also not entirely deterministic in performance because the heap can get fragmented. Either way, if latency matters you end up having to care about (de)allocation patterns at the app level.
- nu11ptr 3y agoAgreed, it seems weird to me to avoid garbage collection in a high level language. It is one thing to use escape analysis to avoid creating garbage, but mallocing every object is going be slower than a well tuned GC.