Tagged DSL

"Kajtek, you incredibly handsome stallion, what have you been doing these past few months?" - you might ask, concerned about the lack of ASM dev logs recently...

Well, I've mostly been studying various PL design quirks and prototyping neat features such as vau calculus flavoured fexprs or the following piece of what I consider art.

As mentioned before, I was working on an extensible reader that would support user-defined reader macros for easy DSL programming. It took me quite some time, effort and researching but eventually I came up with an awesome solution. It's worthy to mention here, that it's in no way a new solution. I prefer to figure stuff out myself and often times it turns out that similar concept already existed a few years before mine. Bummer u_u.

Continue reading

One of the most distinctive features of Common Lisp and Lisp in general, are its code-generation and code-manipulation capabilities.

Probably the best example is the LOOP macro - a Swiss Army knife of iteration that can do pretty much anything. The following snippet iterates a list of random numbers collecting some statistics of its contents and does that while being very concise and readable:

(let ((random (loop with max = 500
                    for i from 0 to max
                    collect (random max))))
  (loop for i in random
          counting (evenp i) into evens
          counting (oddp i) into odds
          summing i into total
          maximizing i into max
          minimizing i into min
        finally (format t "Stats: ~A"
                          (list min max total evens odds))))
Stats: (0 499 120808 261 240)

Continue reading


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.

asm3

Continue reading