HackerTrans
TopNewTrendsCommentsPastAskShowJobs

taolson

no profile record

Submissions

Show HN: Admiran: a pure, lazy functional language and self-hosting compiler

github.com
2 points·by taolson·4 месяца назад·0 comments

comments

taolson
·в прошлом месяце·discuss
We actually did this in my freshman dorm room, as the paint color almost exactly matched the original Crest "green".
taolson
·2 месяца назад·discuss
I remember a visit by Gasseé and a team of BeBox engineers to the PowerPC design center in Austin, where they demo'ed the yet-to-be released early version of the BeBox and OS. We were all duly impressed by the speed and responsiveness of the system. At one point they were demoing that it really was running multiple processors by opening a control panel that showed the processor activity, and clicking a button to disable one of the processors, which instantly doubled the load on the other processor. Someone in the crowd asked "What if you disable the other processor, too?", and they said "I don't know -- let's see." The system promptly crashed ;-)
taolson
·3 месяца назад·discuss
Sorry, I meant "Haskell / Miranda style syntax" -- e.g. curried functions, concise syntax with little boilerplate, etc. The word type is too overloaded ;-)
taolson
·3 месяца назад·discuss
Nice to see another language with Haskell / Miranda type syntax, but the vibe-coded implementation sure shows: e.g. src/Compiler/Infer.sky isUpperStart:

    isUpperStart : String -> Bool
    isUpperStart name =
        case String.slice 0 1 name of
            
            "A" ->
                True
            
            "B" ->
                True
            
            "C" ->
                True
        ... for 23 more cases.
And the corresponding go code in the bootstrap compiler is even worse.
taolson
·4 месяца назад·discuss
An example where this is useful is to help inline otherwise recursive functions, by writing the function to take some useful parameters first, then return a recursive function which takes the remaining parameters. This allows the function to be partially in-lined, resulting in better performance due to the specialization on the first parameters. For example, foldr:

foldr f z = go

  where

    go [] = z

    go (x : xs) = f x (go xs)
when called with (+) and 0 can be inlined to

go xs = case xs of

    [] -> 0

    (x : xs) = x + go xs
which doesn't have to create a closure to pass around the function and zero value, and can subsequently inline (+), etc.
taolson
·5 месяцев назад·discuss
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
taolson
·5 месяцев назад·discuss
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
taolson
·5 месяцев назад·discuss
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!
taolson
·5 месяцев назад·discuss
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
taolson
·5 месяцев назад·discuss
Also this one, which originally came from Usenet days:

https://old.reddit.com/r/talesfromtechsupport/comments/cp48t...
taolson
·6 месяцев назад·discuss
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...
taolson
·7 месяцев назад·discuss
>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?
taolson
·7 месяцев назад·discuss
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
taolson
·7 месяцев назад·discuss
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
taolson
·8 месяцев назад·discuss
Along that line, an over-engineered fizzBuzz using lazy list operations:

https://github.com/taolson/Admiran/blob/main/examples/fizzBu...
taolson
·8 месяцев назад·discuss
Prolog's constraint solving and unification are exactly what is required for solving type-checking constraints in a Hindley-Milner type system.
taolson
·8 месяцев назад·discuss
>something AMD noted IIRC in the original K5 with its AMD29050-derived core

Just a small nitpick: I've seen the K5/29050 connection mentioned in a number of places, but the K5 was actually based upon an un-released superscalar 29K project called "Jaguar", not the 29050, which was a single-issue, in-order design.
taolson
·9 месяцев назад·discuss
What about Miranda, Haskell, OCaml and F#?
taolson
·9 месяцев назад·discuss
> Indeed Smalltalk - a pure OOP language - had `Block` objects fifty years ago.

Although in the original Smalltalk-80, blocks were not full closures, so it didn't support all the things you would expect to be able to do with a lambda.
taolson
·9 месяцев назад·discuss
Miranda should still be readable for those with some Haskell background (it was a major influence on developing the Haskell language). I also have a more modern update to Miranda called Admiran: https://github.com/taolson/Admiran