Hacker News new | ask | show | jobs
by AnimalMuppet 2308 days ago
I don't know about templating, but... is Haskell's Hindley-Milner type identification system Turing complete? For that matter, Lisp's macros are definitely Turing complete, and they are... a templating system on steroids, maybe?

About mindshare: Lisp has zealots, but they are few, even if they are loud, and they are on HN more than many other places. C++ is perhaps not loved, but in some circles it is very well respected, the way a chef respects a very sharp knife. The value lies precisely in the sharpness.

2 comments

> is Haskell's Hindley-Milner type identification system Turing complete?

I'm out of my depth, but I'm pretty sure HM is not Turing complete by design as otherwise it wouldn't be able to guarantee that inference completes. An HM type system is about as powerful you can get without being Turing complete.

There are extensions to the type systems of languages that use HM making them Turing complete, but when using those extensions inference is not guaranteed or doesn't work at all.

The beauty of Lisp's macros are that they're specifically _not_ expressed in a separate language: They're ordinary Lisp expressions that work directly on the AST.
Even better, they don't need an AST - they work with arbitrary s-expressions and thus in many cases simple list processing operations can be used for code transformations.