Another month, another language: pi
Nov. 3rd, 2009 01:44 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
The latest programming language to come to my attention is rather neat: in the pi language, the entire focus is on declaring patterns -- EBNF-style declarations of syntax, and their associated meanings. See the linked page for a little more info and some cool (if simple) examples of how easy it is to define new syntax in this language.
My initial reaction is that it's a bit scary, and almost certainly *much* too easy to completely hang yourself (I'd love to see what you could do with an obfuscated-code contest in this language), but also quite powerful for certain sorts of problems. Probably extremely well-suited to defining DSLs and the like, once it gets more mature...
My initial reaction is that it's a bit scary, and almost certainly *much* too easy to completely hang yourself (I'd love to see what you could do with an obfuscated-code contest in this language), but also quite powerful for certain sorts of problems. Probably extremely well-suited to defining DSLs and the like, once it gets more mature...
(no subject)
Date: 2009-11-03 08:31 pm (UTC)Interesting nest of adverbs there. A mean? I don't think they intend to say that their language is average.
(no subject)
Date: 2009-11-03 11:05 pm (UTC)(no subject)
Date: 2009-11-04 01:10 am (UTC)If C is an implementation of the von Neumann architecture, and Lisp & Scheme are implementations of Alonzo Church's lambda-calculus, these languages can be thought of as implementations of Emil Post's production rules.
(no subject)
Date: 2009-11-04 01:55 am (UTC)(no subject)
Date: 2009-11-04 02:50 am (UTC)Similarly, the Equality pattern is saying that, if the two parameters evaluate to the same value (note the doubled use of e.1), return T; otherwise (I assume that patterns are evaluated in order), they evaluate to different values, so return F.
It seems like pretty conventional stuff nowadays -- I suspect you could write similar examples in most of the popular modern pattern-matching languages. (I'm not an expert in this area, but it looks a lot like examples I've seen in Scala.)