4 ms·
Look, here is the deal with Lisp. It shows you the data structure of your computer program and lets you operate on it and that is neat. But it's not useful for
by 3pt14159 8y ago
Look, here is the deal with Lisp. It shows you the data structure of your computer program and lets you operate on it and that is neat. But it's not useful for actual work because the way you manipulate it makes it hard for you to understand what is happening without knowing all the ways your code is being manipulated. I have to write lisp for my editor (emacs) and I don't hate it, but I don't love it either. The syntax is hard to read quickly because it's cluttered and (usually) nest-y.
If you're willing to trade complete purity away, try Ruby. It's basically everything you want from Lisp without the mess. Give up purity, get comprehensibility.
Blocks are a really great way of doing things. You can even investigate the block source code as a string if you really want to.
Dynamic method definition is well supported and predictable. Data structures are easy to compose and operate on. It's basically all the power but in a more comprehensible way. There's a reason why Rails came out of Ruby. It's naturally powerful.
- aidenn0 8y agoI don't get the whole "macros make your code incomprehensible" thing that is always brought up. A macro is just another way to add abstraction to your program. You might as well say functions are bad because without reading the source code for the function you don't know what the function does. A macro that looks like one thing but does something else is a bad macro. We don't throw away functions just because someone can write a function named "sort" that actually randomizes it's argument rather than sorting
- marcosdumay 8y agoMacros are way more powerful than functions. They can hide way more side effects, can fill a namespace, and can surprise you on many other ways. This wouldn't be a problem if those surprises were rare and clearly marked, but the entire reason for macros to exist is to carry the surprises. As a consequence, having macros as the default (ok, second choice, not much better) tool of your language is bad. It's not that macros are bad by themselves, but they shouldn't be used often. Besides, powerful tools do not get well together with dynamically typed languages.
- aidenn0 8y ago> Macros are way more powerful than functions. They can hide way more side effects, can fill a namespace, and can surprise you on many other ways. Abstractions that surprise you are bad. That doesn't mean the tool used was necessarily bad. > This wouldn't be a problem if those surprises were rare and clearly marked, but the entire reason for macros to exist is to carry the surprises. See above RE: surprised. Also, I can usually identify a macro from indentation, as most macros tend to have lambda lists similar to: ((FOO BAR &key BAZ) &body b) which slime will pickup on and indent appropriately. > It's not that macros are bad by themselves, but they shouldn't be used often. If by "use" you mean "write" I agree. I do write macros far less often than I write functions, and this is common advice for lisp programmers anyways. > Besides, powerful tools do not get well together with dynamically typed languages. Not all lisps are dynamically typed, even common lisp has optional type declarations and typed racket takes this further. Also the GP post suggested Ruby, so that's not a great alternative by this argument.
- vinceguidry 8y agoI upvoted you, as I share your sentiments with regards to Ruby and Lisp, but language evangelism belongs in discussion centered on that language. It's just offtopic otherwise. This is the thread glorifying Lisp. People want to hear what makes Lisp great.