3 ms·
There's a thought I've had in the back of my mind for quite some time but it seems so obvious that I think there must be a glaring flaw I'm not seeing otherwise
by Hexstream 19y ago
There's a thought I've had in the back of my mind for quite some time but it seems so obvious that I think there must be a glaring flaw I'm not seeing otherwise it would already have been done extensively:
Whenever a language has a burdensome and rigid syntax, isn't there almost necessarily a way to make a good s-expression syntax to substitute it? You'd get macros free!
- gruseom 19y agoIf by "good s-expression syntax" you mean a representation suitable for embedding into a Lisp, then yes: it's obvious, there's no glaring flaw, you get macros for free, and it is done extensively. There's an s-expression representation (or several) for pretty much anything you'd want to integrate with a Lisp program. Examples of common ones are HTML, SQL, and Javascript. Where you don't see this done much is with general-purpose programming languages. This is probably because people who find s-expressions useful are already using Lisp as their general-purpose language. So it's mostly done for interoperability with other, pre-existing systems, like web browsers or C libraries. (You can see an example of the latter on slides 15 and 16 of http://www.xach.com/lisp/lispvan-2008-02-28.pdf http://www.xach.com/lisp/lispvan-2008-02-28.pdf.) Erlang is a fascinating intermediate case. The distinctive value of Erlang is arguably not in the language, but in its runtime and libraries (including Mnesia). For this reason, the "general-purpose" caveat doesn't apply, and it's easy to see why someone might want to build a Lisp program on top of the Erlang runtime via embedded s-expressions. I seem to recall that there was a game company already doing this. If anyone knows about that or other examples, please post them here.
- lg 19y agorobert virding (of "hello, robert" erlang movie fame) released "lisp-flavoured erlang" recently. Haven't played with it yet... http://groups.google.com/group/erlang-questions/browse_thread/thread/adfe375287d4bef4/4a9127e701f5e2db http://groups.google.com/group/erlang-questions/browse_threa...
- eru 19y agoHello, Dave.
- yters 19y agoAren't all languages sexps at the parse tree level? Lisp is basically a language without the syntactic top layer.
- deleted 19y ago[deleted]
- obdurak 19y agoYou could go further and say that all languages are lists of characters and wish for a language without the lexical top layer.