4 ms·
I don't call it this, but maybe: https://en.wikipedia.org/wiki/Language-oriented_programming https://en.wikipedia.org/wiki/Language-oriented_programming i.e.
by chubot 7y ago
I don't call it this, but maybe:
https://en.wikipedia.org/wiki/Language-oriented_programming https://en.wikipedia.org/wiki/Language-oriented_programming
i.e. composing different DSLs to solve a problem. The codebase is separated into parts and each part may be expressed in a different language.
I tend to call it "metaprogramming", which might be vague but is captures the spirit IMO. Metaprogramming how you implement bespoke DSLs. I categorize textual code generation as the most basic form of metaprogramming, i.e. programming where your data is code.
It's one level removed -- rather than talking about the problem, you're talking about the tools/language/construct you're using to solve the problem.
And yes I would say the other downside is that it's easy to go off the deep end :) But I think that certain problems are difficult and you need some leverage to solve them. For example, writing a bash-compatible shell would be extremely repetitive otherwise. It's like a dozen different ways of groveling through backslashes and braces one-by-one.
- breck 7y agoI'm a big fan of Language Oriented Programming and Racket, but I guess here what I am talking about is an "in moderation" flavor of that, where you are not building new languages by addition, but rather by subtraction (sticking to a smaller subset of an existing language). It's certainly the same idea, but this one is more of a pragmatic approach that hopefully helps you avoid falling into unanticipated complexity traps that you encounter when building a new language from the bottom up.
- chubot 7y agoThat's true -- I don't know of a name for it. There should be one! Someday I would like to define the subset of HTML I actually use... HTML is messy with lots of implementation quirks. And plenty of tools operate on it in ad hoc ways. It would be nice to have some notion of correctness for those tools, and defining a subset seems like the best way to do that.
- breck 7y agoAnytime there's a pattern in language design I don't know the name for I turn to my monoid-loving coworker next to me and ask what the horribly complicated term for it is in Haskell. For now how about "Chop" Programming? "Choose Half" Oriented Programming. Or "Super" programming for "Subtract Unwanted Programming Elements Rigorously".
- telotortium 7y agoHTML5 is supposed to be a specification of HTML, with conformance tests and everything.