Templated Monads? Monadic Templates?

So, I finally found some time for a Template Metaranting follow-up post. This time let’s get down to business as this one contains a fair amount of code.

Sadly, I won’t rant as much but instead I’ll try to show how awesome D‘s templates really are. We’ll write a piece of code, based on this Scheme implementation, that is, a simple monad that we’ll use to build a binary tree, with uniquely numbered nodes containing their height, without any global state (therefore purely) entirely at compile time.

Quick Reader, grab my code!
ADVENTURE!

Continue reading

ASM development log 1: OliviaBOT

Hello fellow programmers.
Look at your favourite programming language.
Now back to Lisp.
Now back to your favourite language.
Now back to Lisp.
Sadly, it isn’t Lisp, but if you stopped wasting your time, it could feel like it’s Lisp.
Look down.
Back up.
Where are you?
Reading in OldSpice-guy’s voice as I introduce the ASM programming language.
What’s on your mind?
Back at me.
ASM has it. The expressiveness and brevity augmented by powerful and extensible features.
Look again.
ASM is now usable.
Anything is possible when your programming language is functional and not imperative.
It’s highly munctional.
Continue reading