3 ms·
My little language Newt is 7 kloc. Dunno if it's worth including, it's mostly an exercise to learn how these things work and is not as polished as I'd like. -
by dunham 8mo ago
My little language Newt is 7 kloc. Dunno if it's worth including, it's mostly an exercise to learn how these things work and is not as polished as I'd like.
- Self-hosted
- Compiles to javascript
- Bidirectional typechecking with NbE (based on elaboration zoo)
- Dependent type checking
- type classes
- ADTs with dependent pattern matching
- TCO (trampoline for mutually tail recursive functions)
- Erasure of compile-time only values (0, ω quantities, but not linear)
- Web playground
- LSP (added this month)
- Syntax is similar to Agda / Idris / Haskell
https://github.com/dunhamsteve/newt https://github.com/dunhamsteve/newt
- taolson 8mo agoEither newt was already in the list, or it got added. We talked a bit about using our languages for AoC 2024 -- looks like you've been keeping busy working on it!
- dunham 8mo agoYeah it has been fun. Lots of directions I can take it: Since I have an LSP, I've got faster turn around and can add editor functionality that requires poking at the compile state. That's my current thread. I have a C backend on hold, while I think about how I want to represent data without boxing everything and about whether I want to do reference counting or GC. (Reference counting unlocks "counting immutable beans" if I decide to give that a go, but I'd also like to try implementing GC someday.) I should do some browser interop stuff and write something other than a compiler in my language. And there are language enhancements: implementing "Do unchained" from Lean, automatic handling of lazy and/or async modalities, deriving implementations of classes, ...