3 ms·
Any source language can be said to be a simple transformation of its target language Not always. There are a number of language features that have non-local im
by raganwald 15y ago
Any source language can be said to be a simple transformation of its target language
Not always. There are a number of language features that have non-local implications, such as pattern matching, lazy evaluation, continuations, or exceptions. If you implement such a feature on top of a language that doesn’t have it, you will have decidedly complex transformations.
I agree that it’s overly simplistic to suggest that it isn’t a full language if it only involves local/simple transformations, but the question of local vs. non-local transformations at least hints at the idea that a new paradigm or way of thinking about programming is involved.
- jerf 15y agoNit: I think pattern matching would be local the way you are using the term; pattern matching is(/would be) implemented right at the site you use it with some form of if/else clauses that would be verbose, but obviously related to the original code. Your other three examples definitely involve large-scale "non-local" source transformation all over the place to implement them. I say this because it took me a moment to figure out how those four things went together.
- chc 15y agoClojure's core.match is implemented as a macro with almost exactly the technique you mention. It spits out a decision tree built out of conds.
- scott_s 15y agothe question of local vs. non-local transformations at least hints at the idea that a new paradigm or way of thinking about programming is involved. Which is an excellent point, and I think the essay would have been better served if you had oriented it that way, and not around the "not a language worth learning" hook.
- raganwald 15y agoI think that essay would be even better than this one. Thanks!
- scott_s 15y agoI took part in a discussion of this idea about a month ago: http://news.ycombinator.com/item?id=3198941 http://news.ycombinator.com/item?id=3198941 There's a paper in there you would want to read as research for that essay.