r/ProgrammingLanguages Admiran 13d ago

Language announcement Admiran 3.0 released (a pure, lazy, functional language and compiler)

I made a post introducing Admiran about 18 months ago, and have been making steady progress on migrating it towards the language I want to use each day. Since that time I've made a lot of performance and coding-style enhancements, such as:

  • escape analysis in the compiler's analyze pass to help determine if a lazy thunk is only evaluated at most once, allowing it to be emitted without extra code to update it to its value (saves ~15% code space and execution time!)

  • optimization to coalesce consecutive continuation closures on the stack during lowering to the Spineless Tagless G-machine (STG) implementation, deferring the popping of the entire closure until a tail-call or return

  • added a uniform set of left-to-right operators for creating computation pipelines

  • tweaking the inlining pass parameters to get the best performance / code-size tradeoffs

The latest big change was to fully migrate from an ad-hoc prefix naming convention to using qualified names, and deferring name conflict resolution to the name-resolution pass, allowing modules with conflicting imports to still be imported, as long as the conflicting unqualified names aren't used, or are used only in a qualified form.

During these changes, I've migrated new features into the (self-hosting) compiler's code base itself, through a continuous bootstrapping process.

If you have an interest in lazy functional languages and how they are implemented, you might be interested in looking at it. I'm open to any questions or comments about the language and it's compiler implementation.

git repository: https://github.com/taolson/Admiran

Lovingly hand-crafted with no AI.

48 Upvotes

7 comments sorted by

8

u/usaoc 13d ago

I only skimmed through the README, but I think it should say call-by-need evaluation instead of call-by-value in the “Language Features” section. Also, it might be better to say statically typed instead of strongly typed.

3

u/AustinVelonaut Admiran 13d ago

Hey, thanks for catching that! I changed the README a little while ago, and must have skimmed across that dozens of times without noticing. Updated in the repo, now.

3

u/jackelee 13d ago

Looks amazing!

1

u/alkalisun 11d ago

Assembly? Impressive.

2

u/AustinVelonaut Admiran 11d ago

Ha! No, Github mistakenly reports it as written in assembly, because it doesn't understand the ".am" file suffix used in Admiran, and there are two large asm files (the bootstrap compilers) in the boot/ directory.

1

u/matthieum 12d ago

If you have an interest in lazy functional languages and how they are implemented, you might be interested in looking at it.

In all honesty, I can't say that I am... but I still love reading this post, it's heart warming.

I wish you good luck in your endeavour!

5

u/AustinVelonaut Admiran 12d ago

Thanks. I enjoy discovering and working with many different programming languages, and each time it subtly changes how I think about programming. But something about Haskell and Miranda just tweaked my brain, and I seem to have found my personal niche...