Live data from Hacker News

Why Lisp?

blog.rongarret.info

21–30 of 248 posts

Re: Why Lisp?

#21

Earlier quoted context omitted.

Clozure CL is easy to install/run on just about any desktop platform (windows included). On *nix, SBCL is a good choice. I've heard good things about MOCL but haven't tried it myself, and I know getting ECL working on mobile is an uphill battle (but achievable if you have the time). ECL switched maintainers recently, so maybe mobile is something they will focus on in the future.

Seconding the Clozure CL recommendation. It supports threads on Windows, which really expands your options if you want to do web development in Common Lisp. I run Linux on my web servers but develop from a Windows desktop. CCL works great on both.

I have the same workflow. Develop on Windows, push to Linux (including apps that use FFI/threading). Never had a problem with CCL.

Re: Why Lisp?

#22

The article doesn't discuss macros, which is one of the answers to "Why Lisp?" I didn't "get" macros until I read a footnote in the (freely available) book Practical Common Lisp . In chapter 7, it introduces the `dolist` macro. DOLIST loops across the items of a list, executing the loop body with a variable holding the successive items of the list. This is the basic skeleton (leaving out some of the more esoteric opt…

there is two sides.

probably, one evil thing is you have to deal with every other's abstraction and it will make you frustrated when there is a large codebase and a deadline.

Re: Why Lisp?

#23
post #2

> The act of describing what you want the machine to do is interleaved with the machine actually doing what you have described, observing the results, and then changing the description of what you want the machine to do based on those observations. That sounds really powerful and interesting, but wondering how often is that used in practice? I can imagine maintaining and understanding a large self-modifying program l…

Like any powerful technology, Lisp's interactivity and dynamism can be used for good or it can be used for evil. Yes, it takes a little discipline to keep things from spinning wildly out of control. But it's well worth the effort.

Re: Why Lisp?

#24

The article doesn't discuss macros, which is one of the answers to "Why Lisp?" I didn't "get" macros until I read a footnote in the (freely available) book Practical Common Lisp . In chapter 7, it introduces the `dolist` macro. DOLIST loops across the items of a list, executing the loop body with a variable holding the successive items of the list. This is the basic skeleton (leaving out some of the more esoteric opt…

Just to expand on your comment. One can write the equivalent code for a for in python[0] but one can't make python rewrite itself. [0]: https://gist.github.com/PuercoPop/9d192f94f88074d06625

cough I'd love to say it's possible, but with a few modifications.

https://github.com/hylang/hy

http://docs.hylang.org/en/latest/language/api.html?highlight...

Re: Why Lisp?

#25

The article doesn't discuss macros, which is one of the answers to "Why Lisp?" I didn't "get" macros until I read a footnote in the (freely available) book Practical Common Lisp . In chapter 7, it introduces the `dolist` macro. DOLIST loops across the items of a list, executing the loop body with a variable holding the successive items of the list. This is the basic skeleton (leaving out some of the more esoteric opt…

On the other hand, this really hurts readability. When reading other people's code you now effectively have to learn what "language" they use too. I'd say it's probably worth that cost, if used judiciously.

"If used judiciously" is just FUD.

Soviet-era authority figure: "Western-style freedom has its good points---if applied judiciously".

If you're a proper Lisper, you use macros like it's going out of style, and other proper Lispers love your code for it.

All programs have their own dictionary of whatever it is they define, whether it be macros or variables. You can no more understand a function call just by looking at it than a macro call. (Should functional decomposition be introduced "judiciously" into large, monolithic blocks of code that have everything "at a glance" in one place?)

Re: Why Lisp?

#26

The article doesn't discuss macros, which is one of the answers to "Why Lisp?" I didn't "get" macros until I read a footnote in the (freely available) book Practical Common Lisp . In chapter 7, it introduces the `dolist` macro. DOLIST loops across the items of a list, executing the loop body with a variable holding the successive items of the list. This is the basic skeleton (leaving out some of the more esoteric opt…

Could someone please explain the difference between Lisp macros and, say, languages that have first-class functions? I get that a Lisp macro will be expanded into the respective code, while a function's execution is different. However, at the practical (i.e., developer's) level, are there any additional benefits?

Can, say, a Lisp macro be 'partially formed', in the sense that it can expand into some boilerplate that represents an incomplete syntax tree? (Whereas a higher-order-function is necessarily complete.) I can see that being useful, but not inasmuch a it's made out.

Re: Why Lisp?

#27

Which lisp do you use? I've used SBCL and tried using mocl and ECL on mobile platforms, but without any real luck. Too much work getting them set up.

Clozure CL is easy to install/run on just about any desktop platform (windows included). On *nix, SBCL is a good choice. I've heard good things about MOCL but haven't tried it myself, and I know getting ECL working on mobile is an uphill battle (but achievable if you have the time). ECL switched maintainers recently, so maybe mobile is something they will focus on in the future.

The only downside to Clozure CL that I found was the fact that it requires SSE2 instruction support from the processor. There are still some processors around that don't support that -- which can be a bummer if you want to use Clozure CL on one of those machines. Unfortunately, one doesn't always have the option of upgrading the hardware to get around that.

I don't think the developers have worked around that, though I have seen some conversation about it in the past. My limited Google searches on the subject today didn't suggest that anything has changed since the last time I looked at it.

Edit:

Oh, duh, I already said all of this about 4 1/2 years ago:

https://news.ycombinator.com/item?id=1804415

Visiting the system requirements page again suggests the limitation still exists:

http://trac.clozure.com/ccl/wiki/SystemRequirements

Re: Why Lisp?

#28

The article doesn't discuss macros, which is one of the answers to "Why Lisp?" I didn't "get" macros until I read a footnote in the (freely available) book Practical Common Lisp . In chapter 7, it introduces the `dolist` macro. DOLIST loops across the items of a list, executing the loop body with a variable holding the successive items of the list. This is the basic skeleton (leaving out some of the more esoteric opt…

On the other hand, this really hurts readability. When reading other people's code you now effectively have to learn what "language" they use too. I'd say it's probably worth that cost, if used judiciously.

After programming in CL for several years, I can honestly say that when encountering new syntax that people have introduced in an app, it's no harder to follow along with it by reading the macro definition than encountering an unknown function. And when in doubt, you can just macroexpand the syntax and see what it's doing under the hood.

Re: Why Lisp?

#29

The article doesn't discuss macros, which is one of the answers to "Why Lisp?" I didn't "get" macros until I read a footnote in the (freely available) book Practical Common Lisp . In chapter 7, it introduces the `dolist` macro. DOLIST loops across the items of a list, executing the loop body with a variable holding the successive items of the list. This is the basic skeleton (leaving out some of the more esoteric opt…

It would help if I saw a real world problem and how you can solve it Lisp and not in say Python.

Any real world problem solved in Lisp, relative to being solved in Python, eliminates the superfluous problem of Python being involved: a syntactically Fortran-like cumbersome scripting language with somewhat Lispy semantics.

Note that you can program the CL system by expressing yourself in Python:

https://common-lisp.net/project/clpython/

Common Lisp is not only a language, but also a platform (analogous to Mono or JVMs). It has a model of computation: programs expand fully down to a set of special forms, which then compile. You can build languages on top of this.

Re: Why Lisp?

#30

I'm hacking on TXR these days which contains a Lisp dialect called TXR Lisp. Lisp hacking and research is fun, in particular if you have the freedom of your own dialect. The current public release TXR Lisp still has an embarrassingly shoddy implementation of "places": expressions which not only evaluate, but serve as assignable locations. I implemented most of the place-manipulating operators (set, inc, push, ...) as…

> The rlet macro [in the above code] is something I just invented days ago.

This perfectly illustrates both the power and danger of Lisp; also known as “The Lisp Curse”¹

http://www.winestockwebdesign.com/Essays/Lisp_Curse.html

Post reply on HN