Hacker Newsnew | past | comments | ask | show | jobs | submit | taolson's commentslogin

Don't know if my language is considered Lil' enough for this, but it's a pure, lazy functional language based upon Miranda (progenitor language to Haskell) that compiles to x86-64 asm. ~6700 SLOC for the (self-hosted!) compiler, and ~3300 SLOC additional for the extensive library of functional data structures and functions.

https://github.com/taolson/Admiran


I really loved Miranda back when I learned about it. I still have the book. I think it never took off because it was quite expensive for universities to use. Im sure David Turner regrets his price model today. Now he has made Miranda available here https://www.cs.kent.ac.uk/people/staff/dat/miranda/


Yes, the open-source release he did is what introduced me to Miranda. I rewrote a lot of my previous Haskell solutions to Advent of Code puzzles with it, and liked it so much I decided to try to improve on it ;-)

That's what led to Admiran. I originally wrote Admiran in Miranda, then bootstrapped from that to self-hosting when it was stable enough to do so. The original Miranda combinator compiler / interpreter took 20 minutes to compile all of Admiran, while the self-hosted version now takes 20 seconds.

One of the grad students of David Turner has taken up maintenance on the original Miranda source; the repository is now at https://codeberg.org/DATurner/miranda


Either 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!


Yeah 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, ...


The logo for Smalltalk-80, and later Squeak, came from the Robert Tinney cover of the Byte issue which introduced Smalltalk. The story behind it is documented here:

https://wiki.squeak.org/squeak/3459


Also this one, which originally came from Usenet days:

https://old.reddit.com/r/talesfromtechsupport/comments/cp48t...


The author includes some easter-eggs (printing random facts about Zen and various C constructs) which trigger randomly -- check out the file src/zen/zen_facts.c in the repository...


>I made my own, with a Haskell+Bash flavor and a REPL that reloads with each keystroke

That was impressive! Do you have a public repo with your language, anywhere?


yep, https://github.com/lukechampine/slouch. Fair warning, it's some of the messiest code I've ever written (or at least, posted online). Hoping to clean it up a bit once the bytecode stuff is production-ready.


Yes, there are some cool solutions using laziness that aren't immediately obvious. For example, in 2015 and 2024 there were problems involving circuits of gates that were elegantly solved using the Löb function:

https://github.com/quchen/articles/blob/master/loeb-moeb.md


AoC has been a highlight of the season for me since the beginning in 2015. I experimented with many languages over the years, zeroing in on Haskell, then Miranda as my language of choice. Finally, I decided to write my own language to do AoC, and created Admiran (based upon Miranda and other lazy, pure, functional languages) with its own self-hosted compiler and library of functional data structures that are useful in AoC puzzles:

https://github.com/taolson/Admiran https://github.com/taolson/advent-of-code


Along that line, an over-engineered fizzBuzz using lazy list operations:

https://github.com/taolson/Admiran/blob/main/examples/fizzBu...


Prolog's constraint solving and unification are exactly what is required for solving type-checking constraints in a Hindley-Milner type system.


Yes, absolutely...I just wish the people who wrote FP compilers knew this.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: