4 ms·
>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
by 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.
- kazinator 9y agoWhether DSL or not, Paul Graham does emphasize the use of macros, in more than one of of his essays. Not just the stock of macros that you get from an implementation, but the program's own. For instance, I read something of his some fifteen years ago where he claimed that it was typical for a Lisp program to be about 25% macros. lispm is right that a bunch of macros don't necessarily make a domain-specific language. If I use PG's anaphoric if macro, or "with-gensyms", I'm not in a different domain; I just have some shorthand for what I'm already doing.
- jasode 9y ago>I'm not in a different domain; The "domain" doesn't have to necessarily mean different disciplines such as "game programming" is one domain and "online shopping" is another domain. Thanks to montrose's reminder, I cite PG's "On Lisp" page 5 (which appears immediately after the "Programming Bottom-Up" section): >We transform our software from a mere program into a _programming language_, and advanced users can build upon it the extra features that they need. [...] The simplest bottom-up programs consist of two layers: language and program. Complex programs may be written as a series of layers, each one acting as a programming language for the one above. If this philosophy is carried all the way up to the topmost layer, that layer becomes a programming language for the user. Also in section "1.4 Extending Lisp" page 7: >Lisp is an excellent language for writing compilers and interpreters, but it offers another way of defining a new language which is often more elegant and certainly much less work: to define the new language as a modification of Lisp. Then the parts of Lisp which can appear unchanged in the new language (e.g. arithmetic or I/O) can be used as is, and you only have to implement the parts which are different (e.g. control structure). A language implemented in this way is called an _embedded language_. Embedded languages are a natural outgrowth of bottom-up programming. Yes, the 1993 time period predates today's "DSL" meme but now that "DSL" has permeated into widespread programmers' awareness, is there a better label to describe those PG paragraphs? I argue that today, people would rewrite PGs technique in their mind as "layering DSLs".
- grimgrin 9y agoYou have not taken criticism very well at all I too thought you were saying pg was suggesting a DSL You argued the idea anyways, and “his point” > I argue that instead of those 3, the most applicable terminology to map to pg's idea would be a "DSL" ("Domain Specific Language".)[1] The "DSL" terminology seemed to have gained currency around 2008 so this old 1993 essay wasn't able to use it. In any case, his point is to program Lisp in such a way as to build a "DSL" inside of Lisp and you then program your higher level concepts on that DSL.
- jasode 9y ago>You have not taken criticism very well at all I accept lispm's criticism and have acknowledged his idea of DSL is correct. I don't accept his mischaracterization of what I wrote and tried to clarify the confusion I caused. I accepted lispm's threshold for what constitutes a DSL. He did not seem to accept my DSL-as-a-meme. >I too thought you were saying pg was suggesting a DSL I acknowledge that you and lispm thought I claimed PG was recommending a _DSL_. What I tried to convey is that PG was talking about a concept that many programmers would loosely call a "DSL". <formal>DSL</formal> != <scarequote>DSL</scarequote>. <formal>DSL</formal> != <meme>DSL</meme>. >You argued the idea anyways, and “his point” Yes... and I carefully wrote, "I argue that instead of those 3, the most applicable terminology to _map_ to pg's idea would be a "DSL": I was hoping the word "map" was a sufficiently loose qualification to turn off the literal computer science definition of DSL. Instead of claiming PG's technique _is_ a DSL, I'm saying programmers out there have this informal usage of "DSL" (quotes) as a _meme_ and that is the closest terminology they would use. (See my 3 links showing examples of "DSL" being thrown around when Lisp syntax is extended.) Of the candidate phrases such as "library", "framework, "DSL", and PG metaphors such as "border between two warring states" -- the "DSL" meme is the closest _mapping_ even if PG himself might disagree and say that adding custom operators to better suit the program is not a _DSL_. It's the same meme-vs-formal situation with C++. Some programmers would describe the design of classes as creating a "DSL"(quotes) within the C++ source code, but others would look at it and insist that they see no formal _DSL_ at all because there's no separate domain language that was explicitly defined and there's no separate text artifact that is parsed. (E.g. "Writing C++ classes isn't creating a DSL! That's just regular C++ programming!")