tag:blogger.com,1999:blog-5592542.post4945862523670246302..comments2024-03-18T17:28:44.693-07:00Comments on Rondam Ramblings: Yes, code is data, but that's not what makes Lisp coolRonhttp://www.blogger.com/profile/11752242624438232184noreply@blogger.comBlogger15125tag:blogger.com,1999:blog-5592542.post-42082906959928756632018-02-23T08:46:00.428-08:002018-02-23T08:46:00.428-08:00@Ron:
> I'm actually pretty obsessed with ...<a href="#c4367117328212391844" rel="nofollow">@Ron</a>:<br /><br />> I'm actually pretty obsessed with writing readable code. I find it easier to write readable code in Lisp than any other language precisely because the syntax is so malleable. Take a look at <a href="https://github.com/rongarret/tweetnacl/blob/master/ratchet.lisp" rel="nofollow">this</a> for example. I think it's Lukehttps://www.blogger.com/profile/18395549142176242491noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-80746579351605920512018-02-19T01:48:30.413-08:002018-02-19T01:48:30.413-08:00Rondam Ramblings??Rondam Ramblings??Anonymoushttps://www.blogger.com/profile/00529803816625843090noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-68849101615050531172018-02-18T10:48:13.779-08:002018-02-18T10:48:13.779-08:00@Dominic:
> I didn't ask if...
Then you a...@Dominic:<br /><br />> I didn't ask if...<br /><br />Then you are being a pedant. Life is too short for that.<br />Ronhttps://www.blogger.com/profile/11752242624438232184noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-32601332880536493022018-02-18T10:15:40.137-08:002018-02-18T10:15:40.137-08:00I didn't ask if
? (set-macro-character #\) (l...I didn't ask if<br /><br />? (set-macro-character #\) (lambda ... ; Filling this in is left as an exercise<br />...<br />? )<br />") is now a valid Lisp program"<br />? (list 1 2 3) )<br /><br />can be a valid Lisp program.<br /><br />I asked if<br /><br />)<br /><br />can be a valid Lisp program.Dominichttps://www.blogger.com/profile/06141994622234245524noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-73113061788144835412018-02-18T10:02:43.896-08:002018-02-18T10:02:43.896-08:00@Dominic:
> Are you saying that the following ...@Dominic:<br /><br />> Are you saying that the following can be a valid Lisp program?<br /><br />Yes.<br /><br />Welcome to Clozure Common Lisp Version 1.11-r16812M (DarwinX8664)!<br />? (set-macro-character #\) (lambda ... ; Filling this in is left as an exercise<br />...<br />? )<br />") is now a valid Lisp program"<br /><br />Not only does this make close-paren a valid program, Ronhttps://www.blogger.com/profile/11752242624438232184noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-44025295246966532182018-02-18T09:31:37.668-08:002018-02-18T09:31:37.668-08:00> You *can't* know what the rules are beca...> You *can't* know what the rules are because the rules can change at run time.<br /><br />Are you saying that the following can be a valid Lisp program?<br /><br /> )Dominichttps://www.blogger.com/profile/06141994622234245524noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-56664148191627229282018-02-18T07:32:34.973-08:002018-02-18T07:32:34.973-08:00> When you write a Lisp program, you encode byt...> When you write a Lisp program, you encode bytes to a file<br /><br />That's one way to write a Lisp program. It's not the only way.<br /><br />> Is that not what you meant here?:<br /><br />No. I meant what I said. Go back and re-read my words carefully.<br /><br />> You can't parse without a grammar<br /><br />Of course you can. That's manifestly true because Lisp Ronhttps://www.blogger.com/profile/11752242624438232184noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-40895868054150211842018-02-17T22:55:04.305-08:002018-02-17T22:55:04.305-08:00> > Lisp programs are strings
> No, they...> > Lisp programs are strings<br /><br />> No, they really aren't.<br /><br />Yes, they are. When you write a Lisp program, you encode bytes to a file, same as any other programming language.<br /><br />If you're going to claim that "In most programming languages, programs are strings.", then you can't say that Lisp programs aren't also strings.<br /><br />>Dominichttps://www.blogger.com/profile/06141994622234245524noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-55277808582976594072018-02-17T21:07:35.375-08:002018-02-17T21:07:35.375-08:00> > You don't need a grammar
> This ...> > You don't need a grammar<br /><br />> This is a false statement.<br /><br />No, it's a true statement. Take a look at the ANSI Common Lisp spec and try to find the grammar that defines the syntax. There isn't one.<br /><br />> it's wrong to say that no parsing occurs.<br /><br />And I didn't say that no parsing occurs. Obviously it does. But it doesn't Ronhttps://www.blogger.com/profile/11752242624438232184noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-57539870763712013472018-02-17T20:44:29.202-08:002018-02-17T20:44:29.202-08:00> You don't need a grammar
This is a false...> You don't need a grammar<br /><br />This is a false statement. The only language for which there is no grammar is the trivial case: {}. That is the language which contains no strings; the null set.<br /><br />> all I have to do is extract the second element of the list<br /><br />No, you have to parse the string using a parser which is built from a grammar.<br /><br />It may be easyDominichttps://www.blogger.com/profile/06141994622234245524noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-43671173282123918442018-02-17T09:33:40.204-08:002018-02-17T09:33:40.204-08:00@Divye
> Modern programming languages, however...@Divye<br /><br />> Modern programming languages, however, structure code for humans. They introduce syntax rules to increase the density of expression of lines of code at the cost of AST generation<br /><br />Higher density != increased readability. If that were so, APL would be the ultimate programming language. (Also you should read <a href="http://blog.rongarret.info/2008/02/Ronhttps://www.blogger.com/profile/11752242624438232184noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-63373880457377404152018-02-16T21:20:22.656-08:002018-02-16T21:20:22.656-08:00>> Code readability matters
This is usually...>> Code readability matters<br /><br />This is usually thrown around by non Lispers who have hardly written any substantial amount of Lisp code (@Divye Kapoor, while I say this, I am not accusing you of that, in case it comes across like that).<br /><br />And if code readability matters, why is it still hard to read code!!! Millions of lines of monstrous code bases all in the name of Deepak Surtihttps://www.blogger.com/profile/17621415181212724238noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-22939094914311464612018-02-16T18:10:37.831-08:002018-02-16T18:10:37.831-08:00There's a concept in Compiler Theory called an...There's a concept in Compiler Theory called an Abstract Syntax Tree wherein a program's text is broken down into a fundamental tree-like representation (very similar to Lisp's S-Expression structure). <br /><br />When you're claiming that a program in Lisp is actually a List (and that iterating / parsing it is easy), what you're actually claiming is that it's easy to go Divye Kapoorhttps://www.blogger.com/profile/05987327171759168375noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-73354205283229789642018-02-16T14:58:55.156-08:002018-02-16T14:58:55.156-08:00> Prolog is slightly better because its macro l...> Prolog is slightly better because its macro language is the same as the programming language; Lisp macros are a bit different from the programming language.<br /><br />No, that's not true. The macro language for Lisp is Lisp. What makes you think it's any different?<br /><br />Prolog is just Lisp with unification and backtracking search integrated into the language.<br />Ronhttps://www.blogger.com/profile/11752242624438232184noreply@blogger.comtag:blogger.com,1999:blog-5592542.post-77236216289219292342018-02-16T14:20:25.236-08:002018-02-16T14:20:25.236-08:00Prolog is slightly better because its macro langua...Prolog is slightly better because its macro language is the same as the programming language; Lisp macros are a bit different from the programming language. Syntactically, Prolog is what you'd get if LISP wrote <i>foo(a, b)</i> instead of <i>(foo a b)</i> (yes, I know that they're not exactly the same; but they're close enough). Lisp had to invent a syntactic form for macros whereas Peterhttps://www.blogger.com/profile/09181315016585527246noreply@blogger.com