News for hackers. Stuff that matters.
Re:Lisp Quickstart by acalderaro on Friday March 24, 2017 @02:20PM (#13951006)
I've always wondered why LISP was such a hot-topic of discussion for CS people. I'm not technical myself, but the idea of different computing languages being more/less efficient in certain tasks is interesting.

I don't know how valid this is, since I've only spoken with a handful of Lispers, but it seems that they appreciate the freedom and lack of boundaries/rules/limits that Lisp provides. They talk about it like a language that can do anything, because it has no rules on what it can or cannot do.

But at the same time, my friends also remind me that the lack of limits means that they are more accountable for every line of code, and that as a beginner, it'd be best for me to use something more structured (they always say Python) until I'm comfortable taking off the training wheels.

Can anyone share their thoughts?

Re:Lisp Quickstart by TeMPOraL on Friday March 24, 2017 @05:23PM (#13952334)
The 'freedom' of Lisp that you're describing comes from a different relationship between the language and the programmer than you have in other languages. In almost all non-lisp languages (including all the popular languages you've heard about), you're a user of the language. There's a set of syntactic and semantic rules provided by the language designers, and you're supposed to use them to express your programs. There's a strong separation between the language designers and the users of that language.

On the other hand, Lisp languages (affectionately called "programmable programming languages"), remove that separation almost completely. As a programmer using a Lisp, you're provided with enough tools to build new syntax and semantic rules, so that the language better matches your problem domain. This is a very powerful technique, but obviously also dangerous.

As a simple example, say you wanted to do OOP in Python, but for some reason Python didn't provide the "class" keyword. At this point, you'd be totally out of luck. Your best bet would be to send a request to language designers, and in the meantime try to program OOP-style in structural code. On the other hand, if someone took away the "defclass" macro from Common Lisp, you could quickly reimplement it yourself and thus introduce OOP facilities that look and work as if they were a part of the language from the start (in fact, building your own simple OOP is pretty much a textbook exercise for lispers).

That much of power can obviously confuse people who didn't do much programming before. It's good to start with a simpler language first - be it something like Python, or even subset of Scheme that's used in SICP, which sacrifices some of the Lisp power for making it suitable as an introduction to programming.

Re:Lisp Quickstart by kazinator on Friday March 24, 2017 @03:26PM (#13951529)
> I've always wondered why LISP was such a hot-topic of discussion for CS people.

Because in a discussion with five CS people, only one has actual real Lisp programming experience, one has some freshman experience in some professor's one-weekend Lisp-like dialect where a run-time type error segfaults, and the other three have different misconceptions about what Lisp is.

Re:Lisp Quickstart by aidenn0 on Friday March 24, 2017 @10:45PM (#13953824)
The number of times I've mentioned common lisp and gotten "Oh yeah, that's the language with no loops, just recursion, right?" does sadden me a bit.

To clear it up for anyone reading this:

Scheme has tail-call elimination as a requirement of the language; common lisp does not, and even includes an (overly?) sophisticated DSL for iteration in the standard library.

Also 95% of what you learned about lisp in your "Survey of programing languages" course was wrong.

Re:Lisp Quickstart by taeric on Saturday March 25, 2017 @11:44AM (#13956153)
The loop macro may be described as overly sophisticated. However, I can't help but get a chuckle with how much all of the new "stream" based mechanisms in java[1] mimic it. Ironically, with what appears to be more parens.

[1] https://docs.oracle.com/javase/8/docs/api/java/util/stream/C...

Re:Lisp Quickstart by aidenn0 on Saturday March 25, 2017 @03:44PM (#13957217)
python's list comprehensions and generator expressions can get pretty complex too.
Re:Lisp Quickstart by taeric on Saturday March 25, 2017 @06:21PM (#13957829)
To be fair, the LOOP facilities are ridiculously complex. Similarly so are the FORMAT facilities.

I regret not knowing more about them as a younger programmer. Most of the "power" of lisp is always shown in the ability to compose programs out of forms. It is amazing how much code you can avoid writing by just using either loop or format. Or both.

Re:Lisp Quickstart by nocman on Friday March 24, 2017 @04:47PM (#13952094)
I'd be interested to see some data on what the real ratio is.

I suspect that 1 in 5 might actually be high, which IMHO is sad -- not because I think less of those without any kind of Lisp experience, but because I think they are seriously missing out.

For any CS folks (or just developers in general) who have thought about learning a Lisp of some sort, but for some reason have never gotten it done, I would encourage you to do so -- it really is worth the effort.

Re:Lisp Quickstart by kazinator on Friday March 24, 2017 @05:05PM (#13952211)
I know; if any random sample of five CS people could be expected to have 0.9 to 1.1 Lispers in it with a 19/20 confidence, that would be a different world, ha!
Re:Lisp Quickstart by TeMPOraL on Friday March 24, 2017 @05:06PM (#13952213)
Universities sometimes do their fair share to screw this up even further. In my Alma Mater, there is this famous PhD who managed to discourage a generation of students from Lisp by the sole virtue of how she did the classes. :/.
Re:Lisp Quickstart by kazinator on Saturday March 25, 2017 @12:42PM (#13956409)
Some examples/anecdotes would be interesting. with-genyms to protect the guilty.
Re:Lisp Quickstart by aidenn0 on Friday March 24, 2017 @02:41PM (#13951167)
Some languages are absolutely more efficient for certain tasks.

Here are some probably not very contentions examples:

If you pick Brainfuck for your language it will probably take you longer to write your program than Java.

You will probably be able to write a network server in Go faster than you will be able to write it in assembly.

Those may seem contrived, but if you start to compare things that could be actual business decisions it becomes much harder for everybody to remain objective.

You also get to the point for which there may be no universal answer for each programmer. This is at least partly because many programming tasks are quite mundane, and so wouldn't be any faster/slower in general between, for example, Javascript and Lisp. You give them to me and I'll do it much faster in Lisp, while a javscript developer will do it much faster in javascript just because the task is simple enough that individual proficiency with the tools trumps any minor differences for such tasks.

Re:Lisp Quickstart by dreamcompiler on Saturday March 25, 2017 @03:18AM (#13954471)
It's common for Lisp newbies to think they can just hack a Lisp program until it works because it's so forgiving. Wrong. Lisp does provide an enormous amount of freedom, and knowing your integers and your buffers cannot overflow, taking the sqrt of -1 just works, and having infinite precision fractions are all pretty great. But you still have to know about algorithms, data structures, and software engineering if you're going to succeed at Lisp.