4 ms·
Any procedure you write becomes a part of the programming language– your procedures are indistinguishable from the built-in ones. You don’t write Lisp code so m
by DanielBMarkham 16y ago
Any procedure you write becomes a part of the programming language– your procedures are indistinguishable from the built-in ones. You don’t write Lisp code so much as you extend the Lisp language until it becomes a custom language for whatever it is you’re trying to do. Its a subtle difference, but a significant one.
Yes, and you can do the same thing when you extend the type system in C++, or C#. The ability to extend the type system to allow the eventual DSL created to integrate is a key consideration, and LISP is a leader in this area, but the important thing to realize is that you should work at the level of DSL, you should become a Language-Oriented Programmer.
- rbanffy 16y agoYou can, but you can't change the meaning of if or #define. In Lisp (like Forth, where I learned it) it's not like "first class procedures" but "all names are created equal". At least until you take the red pill and grok macros, but that's a story for another day. When you extend types you don't create a DSL - you create a domain-specific object hierarchy that fits within a given language.
- DanielBMarkham 16y agoYou're arguing a technical detail. I agree with you, but in my opinion it's not important, so I'm not going to chase down every little language option here out there. It would turn our discussion quickly into a weird kind of trivia contest. The point is that understanding DSLs is a key concept for a programmer. Wrapping that up into your toolbox gives you a huge advantage. From there you can appreciate (or not) these other things.
- rbanffy 16y agoI see what you mean, but creating a DSL on top of a grammar like C's is more like creating a jargon than a language. Like when you catch two astronauts talking, you can't make out any of the nouns, some of the verbs, but the structure is still familiar - it's English (or Chinese, or Russian) with a new set of nouns and verbs. You don't have a domain-specific language - you just have domain-specific words. Languages such as Lisp are uniquely well suited for that because you can redefine almost anything, including language parts that other languages consider reserved words. With it, you can create other language that's free to create not only its own verbs and nouns, but its own grammar rules.