Live data from Hacker News

Ooh Ooh My Turn Why Lisp? (2008)

smuglispweeny.blogspot.com

31–40 of 160 posts

Re: Ooh Ooh My Turn Why Lisp? (2008)

#31
post #21
post #19

Earlier quoted context omitted.

I'm biased, but there's a big difference between "learning lisp" (well enough to transliterate that python program) and really getting the code as data concept. I'd say that learning X really well is always a positive because whenever you learn something in depth you can then apply the concepts elsewhere. And there are still lisp-only concepts, so learning lisp is positive. ML is good too. Also spending time with a w…

With Lisp I get the data thing but with ML you learn almost everything is a language. I can't really explain it but the whole variant/ADT pattern matching really forces to make you think of your problem domain as a specification or language (e.g. DSL). It is one of the reason why I think so many compilers are written in ML (that and the toolset is awesome for it).

That description of ML reminds me what I really like about REBOL and RED as well.

Re: Ooh Ooh My Turn Why Lisp? (2008)

#32
post #20
post #18

"The question is where will we be in five years, the answer is using Common Lisp, because of language features" says the author in the comments. This was 8 years ago. Kind of rude of me to take that potshot, but it's there. I've been reading these "Why Lisp?" Arguments for years and yet it still remains pretty niche. The longer this goes on the more I am unable tell Lisp advocates apart from Perl advocates. They both…

I'm developing a language that's a superset of Lua and Lisp. It's still in its infancy, but here's an example of a Lisp/Lua function in a module that can be imported as a (+...) macro that expands into Lua `a + b + c + ...` expression. https://github.com/meric/l2l/blob/rewrite/l2l/macro/arithmet... The idea is programmers will write in Lua whenever readability is prioritised, and when homoiconicity is required, for e…

You know about metalua, right? http://metalua.luaforge.net/

Re: Ooh Ooh My Turn Why Lisp? (2008)

#33
post #32
post #20

Earlier quoted context omitted.

I'm developing a language that's a superset of Lua and Lisp. It's still in its infancy, but here's an example of a Lisp/Lua function in a module that can be imported as a (+...) macro that expands into Lua `a + b + c + ...` expression. https://github.com/meric/l2l/blob/rewrite/l2l/macro/arithmet... The idea is programmers will write in Lua whenever readability is prioritised, and when homoiconicity is required, for e…

You know about metalua, right? http://metalua.luaforge.net/

Yes, I wanted a version of Lua with Macro's that reused familiar syntax (for lispers), that can run on LuaJIT, and is implemented in Lua completely.

Re: Ooh Ooh My Turn Why Lisp? (2008)

#34
post #21
post #19

Earlier quoted context omitted.

I'm biased, but there's a big difference between "learning lisp" (well enough to transliterate that python program) and really getting the code as data concept. I'd say that learning X really well is always a positive because whenever you learn something in depth you can then apply the concepts elsewhere. And there are still lisp-only concepts, so learning lisp is positive. ML is good too. Also spending time with a w…

With Lisp I get the data thing but with ML you learn almost everything is a language. I can't really explain it but the whole variant/ADT pattern matching really forces to make you think of your problem domain as a specification or language (e.g. DSL). It is one of the reason why I think so many compilers are written in ML (that and the toolset is awesome for it).

Another important feature of ML is abstract data types (opaque signature ascription), which forces abstraction clients not to rely on implementation details. It's Dijkstra's “separation of concerns”, integrated into the type checking process! See: https://existentialtype.wordpress.com/2011/04/16/modules-mat...

Re: Ooh Ooh My Turn Why Lisp? (2008)

#35

Okay, I've spent a lot of time writing Common Lisp and even more time reading about Common Lisp, and to be honest, I'm just a little tired of the cult around it. People who know it well gloat about how great Common Lisp is, which just so happens to make them look great too. And people who don't know Common Lisp all talk about the little Common Lisp they know, because they don't want to seem like they aren't in on it,…

>Let's talk about this fabled exchange between Norvig and McCarthy, where McCarthy asks if Python can gracefully manipulate code as data, and Norvig said no, and supposedly a thousand words were said in the ensuing silence.

Python has this: https://docs.python.org/2/library/ast.html so it is possible to manipulate code as data. It just happens that it's not homoiconic, but so what?

Re: Ooh Ooh My Turn Why Lisp? (2008)

#36
post #21

Earlier quoted context omitted.

With Lisp I get the data thing but with ML you learn almost everything is a language. I can't really explain it but the whole variant/ADT pattern matching really forces to make you think of your problem domain as a specification or language (e.g. DSL). It is one of the reason why I think so many compilers are written in ML (that and the toolset is awesome for it).

That description of ML reminds me what I really like about REBOL and RED as well.

With the “slight” difference that ML actually enforces that your program is consistent with your description of the problem domain.

Re: Ooh Ooh My Turn Why Lisp? (2008)

#37
post #22
post #18

"The question is where will we be in five years, the answer is using Common Lisp, because of language features" says the author in the comments. This was 8 years ago. Kind of rude of me to take that potshot, but it's there. I've been reading these "Why Lisp?" Arguments for years and yet it still remains pretty niche. The longer this goes on the more I am unable tell Lisp advocates apart from Perl advocates. They both…

Heh, yeah. Lisp has powerful features, I'm sure, but something that's always stumped me is, if that power mattered for delivering better code, would we have to strain so hard to find examples of why it's better? Paul Graham's viaweb story, well, that's great, but why wasn't there a whole cohort of super-powered startups winning the day with lisp in the original dot com boom? Why are there so few big wins with lisp? T…

You confuse powerful with popular. Many startups don't need powerful tools, other than a CRUD framework and JQuery. Also, existence and abundance of libraries is a factor, and Lisp didn't get much love from the OSS web folks til recently.

Re: Ooh Ooh My Turn Why Lisp? (2008)

#38

> he simply asked if Python could gracefully manipulate Python code as data Have there been any big LISP macro code injection vulnerabilities in the wild?

What do you mean with "macro code injection vulnerabilities"? Macros are expanded before the code is compiled; by the time someone is running the program there are no macros. Well, technically, someone could call `EVAL` in a production app, but that's strongly discouraged.

Re: Ooh Ooh My Turn Why Lisp? (2008)

#39

Is there any advantage in using a functional language when programming non-mathematically related code? I see how it can help write Neural Networks, AI, financial code, etc. But if you know Python,Ruby,PHP,Java and Lisp (well), why would you choose to write a blog, webstore, webmail client or social media* app (which probably is about 90% of what people actually do) in Lisp over the four three? I'll tell you why I wo…

Yes. Functional programming (although it isn't necessarily a trait of Lisp) has, in fact, little relation to math (despite what many people believe). It's also very far removed from the field of AI right now (not for any particular reason, but there's no more specific reason to switch to Lisp for AI than there is for desktop or web apps). The reason you'd use Lisp is quite simple -- it saves time and makes programming easier. Macros are the biggest time saver in the world, and you don't realize how much time you waste writing repetitive code until you get to use them.

As for your 3 reasons in favor of the other languages, I think the first means almost nothing at all. Lisp is much easier (once you grasp it) than many other languages, so I think the fact that you'll get less answers on StackOverflow is irrelevant. As for the second reason, as long as you have one library that works for what you want -- say some library for writing web servers -- it doesn't really matter after that. There's rarely any reason to reinvent the wheel here, and there's always someone that attempted such a common task before you. Just because you don't have 3,000 different choices like in Java, doesn't mean that you won't find high-quality code for what you need to do (in fact, I'd argue that Lisp code has a much higer quality on average than Java code). As for hiring, I think Paul Graham has already given the best comments on this. Simply put, a good programmer can be taught to write good Lisp, even if they don't know it by the time you hire them.

Re: Ooh Ooh My Turn Why Lisp? (2008)

#40

Okay, I've spent a lot of time writing Common Lisp and even more time reading about Common Lisp, and to be honest, I'm just a little tired of the cult around it. People who know it well gloat about how great Common Lisp is, which just so happens to make them look great too. And people who don't know Common Lisp all talk about the little Common Lisp they know, because they don't want to seem like they aren't in on it,…

> So the very first thing you do with your macro powers, and pretty much the only useful thing you can do, is break s-expressions. Once the first macro is written you can no longer assume that inputs to macros will be s-expressions with the function at the beginning and arguments following. Every future macro must account for every previous macro. The more you use the capability to manipulate code as data gracefully,…

> You should check out Racket's macro system. It's a lot more sophisticated than Common Lisp's. Common Lisp macros are to C (e.g., gensym is a macro-level malloc, you need to manually destructure S-expressions, etc.) as Racket macros are to ML and Haskell (syntax objects are aware of which variables are in scope, so automatic fresh name generation is possible; user-defined syntax classes and patterns let you process arbitrarily complicated structures in a sane way, etc.).

Agreed. I did play around with this part of Racket quite a bit and I'm convinced that it's the best system if I wanted to create a domain-specific language. But it still runs into the problem where you're defining a new language with new syntax, which forces you to define even more new language with more syntax in order to make that language useful. It's the best way to build a DSL

But given we already have a pretty good multi-purpose language with a lot of work put into it (Racket) the number of situations where it's worthwhile to create an equally-well-thought-out DSL is pretty low. Racket makes it easier, but it's still not easy. Add to this the fact that other people are going to write half-assed DSLs in my code, the net tradeoff is still usually negative, even with Rackets clearly superior macro system.

> Furthermore, “code as data” itself is only true with a caveat: the full version is ”code in an object language is data in the metalanguage”, which is obvious to anyone who has written a compiler.

Uh, I've written a compiler and that's not obvious.

If you want to disagree with me on what "code as data" means, you're welcome to do so. As long as you understood what I said I don't care which words got me there.

> Common Lisp is a ridiculously powerful language, but it isn't a functional language. It fails to meet the zeroth nonnegotiable requirement in a practical functional language, namely, a notion of compound value: https://news.ycombinator.com/item?id=12199981

How about we assume when I said "functional programming" I'm using the Wikipedia definition[1].

[1] https://en.wikipedia.org/wiki/Functional_programming

Post reply on HN