Dirt
Dirt is an open-source, statically typed language that transpiles to Dart, and fully integrates into the Dart ecosystem.
Dirt is the continuation and successor of Dotlin, the Kotlin to Dart compiler.
Features
Please note that not all features are implemented yet.
- Clean, consistent syntax
- Fully integrates with the Dart build system
- Seamlessly use any dependency written in Dart
- Collection classes (
List
,Set
, etc.) have been split-up by mutability - Intersection & union types
- Dependent types
Design
Dirt is primarily inspired by Kotlin, Dart and TypeScript, with some unique features as well.
Please note that most features listed here are not implemented yet.
Differences
Compared to Dart, Dirt has:
- Consistent
when
expression (instead of Dart'sswitch
) - Trailing lambda's (e.g.
run { .. }
,something.let { .. }
const inline
functions- Collection classes which are split-up by mutablility (e.g.
MutableList<T>
) - And more.
Compared to Kotlin, Dirt has:
- No type erasure
const val
s,const class
es- More flexible
late
mechanism than Kotlin'slateinit
(and shorter keyword) - Records
- More flexible pattern matching
- And more.
Usage
Dirt, at this point in time, should not be used for any production projects. For now, you can try it out
by running and editing the tests located in packages/dirt/test/compile
Contributing
Since the project is at an early stage, a lot is still changing and therefore — for now — code contributions are not encouraged. However, in the future when Dirt is in a more stable state, this will definitely change.
When code contributions are encouraged, you are required to sign off all of your commits:
My commit message
Signed-off-by: Jan Jansen <jan@jansen.dev>
By contributing and signing off your commits, you agree to the Developer Certificate of Origin (DCO), which you can read here.
For now however, it is encouraged to try Dirt out, and if you notice anything odd, or want to request a feature/improvement, to create an issue.
License
Dirt itself is licensed under the AGPL.
Note that this does not apply to code generated by Dirt. Code generated by Dirt can be used in projects of any license.
All libraries used by consumers (e.g. the Dirt standard library additions) are licensed under the Apache 2.0.