Created by Niko Matsakis, a core Rust developer (Language Team leader) who was influential in its evolution. He wrote the last article I posted. Also worked on by Brian Anderson, another core developer who worked on Rust in its early stages, on critical features such as the Result
type as well as build system, testing support, and language websites.
Dada is a thought experiment. What if we were making a language like Rust, but one that was meant to feel more like Java or JavaScript, and less like C++? One that didn't aspire to being used in kernels or tiny embedded devices and was willing to require a minimal runtime. What might that look like?
...
Dada is an ownership-based language that is in some ways similar to Rust:
- Like Rust, Dada doesn't require a garbage collector.
- Like Rust, Dada guarantees memory safety and data-race freedom.
- Like Rust, Dada data structures can be allocated in the stack and use flat memory layouts.
In other ways, though, Dada is very different:
- Like TypeScript, Dada is a gradually typed language:
- That means you can start out using Dada in the interpreter, with no type annotations, to get a feel for how it works.
- Once you've gotten comfortable with it, you can add type annotations and use the compiler for performance comparable to Rust.
- Dada targets WebAssembly first and foremost:
- You can build native targets with Dada, but its FFI system is based on WebAssembly interface types.
- Dada is object-oriented, though not in a purist way:
- Dada combines OO with nice features like pattern matching, taking inspiration from languages like Scala.
Dada also has some limitations compared to Rust:
- Dada has a required runtime and does not target "bare metal systems" or kernels.
- Dada does not support inline assembly or arbitrary unsafe code.
Quite close. The fields part is spot on. The shared methods should be provided as a default by the parent and overriden by the child with no
super()
possible.Basically, inheritance should just be merging structs at compiler time to cause no runtime performance hit caused by looking up the parent.
should compile to
This could all be written manually, but changing something in the Parent would require copy-pasting everything to the descendants. Not DRY at all. If Dada did the generation of the types in the compiler, it would be amazing.
CC BY-NC-SA 4.0