4 ms·
>What now is called 'embedded domain specific language' was called 'embedded language' in Lisp. Exactly! If you do "Ctrl+F" search on PG's essay, you'll see i
by jasode 9y ago
>What now is called 'embedded domain specific language' was called 'embedded language' in Lisp.
Exactly! If you do "Ctrl+F" search on PG's essay, you'll see it does _not_ have the phrase "embedded language" nor "embedded domain specific language".
What exactly are you nitpicking?
- lispm 9y agoThat he could have used the term 'embedded language', which was used in Lisp decades before he wrote his article. So the article is probably not about embedded DSLs. What he describes is actually extending the language to express the domain - but that does still not mean that the language is 'specific'. It's not necessarily even an embedded language.
- jasode 9y ago>What he describes is actually extending the language to express the domain - but that does still not mean that the language is 'specific'. This appears to be a subjective labeling because "extending the language" is described by some other Lisp programmers as creating a "DSL". Some examples out in the wold: >"Lisp is different, it is a shape shifting creature. It can be made to adapt to any environment [...], one can build a DSL (domain specific language) within Lisp to cater to that domain." From: https://www.quora.com/According-to-Paul-Graham-in-2002-languages-can-be-ranked-in-power-order-and-Lisp-is-the-first-on-that-ranking-Is-this-still-accurate/answer/David-Lin-211 https://www.quora.com/According-to-Paul-Graham-in-2002-langu... >"Extending the syntax the way you're talking about allows you to create domain specific languages." From: https://softwareengineering.stackexchange.com/a/164674 https://softwareengineering.stackexchange.com/a/164674 >", we can extend it in Lisp itself [...] We've just created a very small and limited language for managing to-do lists embedded in Lisp. Such languages are very specific to a particular problem domain and are often referred to as domain specific languages or DSLs." From: http://www.defmacro.org/ramblings/lisp.html http://www.defmacro.org/ramblings/lisp.html What PG is describing may not be a complete and formal DSL according to your definition but others are describing his technique today as writing a <scarequote>DSL</scarequote>.
- lispm 9y ago> "extending the language" is described by some other Lisp programmers as creating a "DSL" Lisp can be extended in many ways without creating a DSL. That's the basic error you make. Paul Graham talks about extending/changing Lisp and you assume that this must be a DSL - while it is just a larger Lisp. Typically bottom-up programming does not mean developing a DSL. Though it can be that one develops one or more DSLs during bottom-up programming. But it's not necessarily so. Remember DSL means 'Domain specific language' - a language (that means syntax/semantics/pragmatics) specific (means offering a set of operations and data structures) to a domain (which has a problem which needs to be solved). A larger Lisp is neither specific to a domain, nor a new language. To give you an example: For some engineering problem (process control of chemical plant) one needs to express fuzzy values and needs to compute with them. PG advocates to implement these fuzzy data structures and operators. One then constructs further parts using these new building blocks. This could be a bunch of classes and functions. Just an extension of the existing Lisp - it would not only work with boolean values, but also with fuzzy values. While using the fuzzy operators, one extends them until all needed operators are available. With the new set of operators large parts of the solution can be written in a shorter way. One can do such bottom-up programming in many languages and now also in many popular languages. One thing that made Lisp attractive early on for this style is the interactive development mode. One creates a new building block and one can immediately try it out - improving it and testing it again was always very fast. Thus one can extend the running program piece by piece and play around with the code in combination with domain data. Something which would not be typical in C, C++ and Java. Still, if one wants, one can do bottom-up programming in those languages too. The result is neither specific to a domain (because all the other functionality is still there), nor would be a 'language' - it's just more vocabulary in an existing language - probably not even new syntax. One could also use the extension points of the language. For example Lisp would use T and NIL as constants for boolean values. One could extend the s-expression reader to add a new syntax for fuzzy values. That would not make a new specific language, but just extend the existing language along the prepared extension points.
- jasode 9y ago>Lisp can be extended in many ways without creating a DSL. That's the basic error you make. Paul Graham talks about extending/changing Lisp and you assume that this must be a DSL - while it is just a larger Lisp. You completely misunderstand my point. We're talking past each other. I absolutely do not assume PG's technique must be a DSL. I tried to be very careful in my wording in the very first comment to avoid claiming such a strong conclusion. Let me try again to clear up the confusion. My perspective is about communication. A lot of people out there already have "DSL" in their head to describe what PG is doing. It's irrelevant whether it is right or wrong. It's the closest mapping people have. Others in this thread tried mapping it to "libraries" or "framework". I argue that "DSL" is much closer to what PG is describing to set off the "aha!" lightbulb moment in readers' minds. Your perspective is about "DSL" being a formalized definition that PG's technique doesn't match and therefore it's not a DSL. I totally understand your point but it's not relevant to what I was explaining. Yes, a "larger Lisp" may not be a DSL in your view but that's what many programmers are calling it when they extend Lisp to more closely match a domain. When PG writes "changing the language to suit the problem", many will naturally rewrite that in their head as "changing the language to suit the domain", and adding an operator is therefore "extending the language to more suit the domain". That's how people out in the wild are describing it even though there's no full-blown embedded Domain Specific Language there with formal semantics and grammar/syntax. Tldr: you're taking "DSL" very literally instead of observing how programmers are using that phrase in the real world.