8 ms·
"Is Lisp as hard as people say it is? No. Lisp is actually the simplest programming language, and has no syntactic cruft. While it wasn't designed to be “easy
by mkautzm 12y ago
"Is Lisp as hard as people say it is?
No. Lisp is actually the simplest programming language, and has no syntactic cruft. While it wasn't designed to be “easy to learn” like Swift, Python, Ruby, or Basic, there is less overall to learn and you will be writing real, useful programs in Lisp sooner than you could with other languages."
It's like a never-ending stream of lies, every word being a little more absurd than the last...
- wes-exp 12y agoJust because Lisp looks foreign doesn't mean that it's harder. The syntax is different, but it is also very simple. If this were untrue, Scheme wouldn't have survived as a teaching language all these years.
- sejje 12y ago> The biggest secret to Lisp is that it is actually the simplest programming language ever created—and that, coupled with its expressiveness and elegance, is why it is favored exclusively by the best programmers in the world. But is it?
- nohaxplz 12y agoSounds like you just got told you're not one of the best programmers in the world and are still in shock about it.
- AnimalMuppet 12y agoSounds to me like the GP is in shock about such an over-the-top claim. And it sounds like you're trying to pretend to read his/her statement for something other than what it is.
- nightski 12y agoSimple syntax does not a simple programming language make.
- gre 12y agoSimple syntax "Hello world!" ++++++++[>++++[>++>+++>+++>+<<<<-]>+>+>->>+[<]<-]>>.>---.+++++++..+++.>>.<-.<.+++.------.--------.>>+.>++.
- sejje 12y agoI'm not one of the best programmers in the world, no shock there. I'm learning and enjoying clojure, though!
- bsilvereagle 12y agoAt first I thought the Dr. Scheme (now Dr. Racket) program was crazy to choose a Lisp like language. Then as I learned more languages I realized how much easier it is to think about programming since I started out with Dr. Scheme. How To Design Programs for those interested in picking up Scheme: http://htdp.org/ http://htdp.org/
- mkautzm 12y agoIt's less about it being 'foreign' and more about it being totally unparsable. The thing with imperative programming is that you don't really need to know the language to at least get an idea of what's happening. Lisp is so dense that while you can pack an unbelievable amount of programming into a small chunk, approaching it as a beginner is daunting. There isn't a really good way to 'build' on an algorithm and learning it is significantly harder than learning C# or Java or even better yet, Python. It's like saying, 'Linux is easy to learn! You can do so much in so few characters! It's so powerful! And look, robust manual pages for all!' Yeah, that's true, but handing a user some pipes and greps isn't going to explain what the hell they actually do or better yet, how to leverage that into something useful. It's just going to look like greek to anyone who sees it and a huge effort has to be made to get to the point where you can even begin to understand what's happening. Imperative programming doesn't ask you of much. 'Here is a class. Here is the main method. Write some stuff in here. Here are some basic methods in the default libraries and their expected inputs. It's going to execute line by line. Go nuts.' And that's really the difference here. Lisp asks a lot of the user up front. Python doesn't. C# doesn't. Fuck, Python is so loose that you don't even really need to know what any of the structure is to start writing something that kicks back some output. Yeah, as a group that understands Lisp and Scheme and Haskell and F#, it's really easy to say, 'Lisp isn't THAT hard', but that's bullshit. Lisp IS that hard. Lisp is a very difficult language to pickup when you are starting at square one and it's only marginally easier if your background is purely imperative languages. Misrepresenting that is a bold-faced lie.
- catern 12y agoI don't find your argument to be very compelling. Let me guess: you learned imperative programming first, you're most familiar with it, and you only have limited experience with Lisp, if any? The fact that you find imperative programming easy (because you know it well) and Lisp and functional programming to be hard, is not very informative about which of imperative or Lispy or functional programming is easiest to learn.
- tormeh 12y agoThe only thing that was hard with imperative programming that I can remember was "=". That was absurd, to put it simply. "x = x + 1"? As someone who has seen these symbols in math class and think they know what they mean that notation kind of suck.
- gre 12y agoThe DSL for string formatting certainly doesn't look simple. (format t "~{~@(~A~)~^ ~}, because ~{~A~^ ~} is easier!" llthw (cddr llthw))
- gaigepr 12y agoI am only recently a lisp user but honestly, how is the format function far from: printf("something %s then %d finally %f!", "asd", 1, 1.2) As mentioned, there is a loop built into format. Since lisp also has a (list) function eg: (list 'a 'b 'c 1) I still don't see an argument beyond familiarity with the C style printf syntax for why format is bad/unreadable.
- wglb 12y agoThere is a loop embedded in the lisp version.
- mcosta 12y agoI do not understant it, but with changing ~ with % I can imagine what it does.
- ScottBurson 12y agoIt's complex because it's powerful. ~A is the most common directive; it simply prints an object. '~{...~}' (braces) iterates over a list, applying the directives within it to the list elements. Within that construct, '~^' exits if the last element of the list has been consumed; it's used here to keep the separating space from being printed after the last element. '~@(...~)' (parens) capitalizes words in the output of the directives it contains, downcasing the non-initial character of each word. So there's a lot more power here than in 'printf' control strings. If you find the more exotic notation unintuitive -- and you certainly wouldn't be alone -- you don't have to use it.
- gre 12y agoIt's just disingenuous to say that LISP has extremely simple syntax and then show the DSL for format, which is anything but LISPy or simple.
- rtpg 12y agoSimplicity of syntax does not translate to ease of use. Or else we'd all be programming in one-instruction Turing Tarpit.
- kazinator 12y agoThat's right; Lisp's syntax is not only simple; it is simple while retaining the power to combines together and express any syntax tree. If you put on special Lisp goggles, you can see S-expressions inside the syntaxes of other languages.
- JasonFruit 12y agoCould you enumerate the lies for us? Your comment is arresting but not enlightening without more information.
- kazinator 12y agoI'm an Lisp programmer, so I can. The language ANSI Common Lisp certainly has its fair share of "syntactic cruft". For instance numerous "macro dispatch characters" like #'func #:sym #c(2.0 4.1) #(vec tor). None of the syntactic cruft requires a LR(1) algorithm to work out; most of it is based on recognizing a character or two of prefix material and dispatching a read function. When the dispatch involves two characters, the first one is almost always # (though for programming your own nonstandard read syntax, that is not a fixed rule.) Read syntax is not even considered "real" syntax by Lisp programmers; "real" syntax is the structure of macros. But since macro forms are unambiguously written as nested lists, they already express the phrase structure almost directly; there is no phrase structure that needs to be applied to get a syntax tree. There isn't any syntactic cruft in Lisp that will have you scratching your head as to what goes with what. There are semantic head-scratchers related to syntax, like working out the implied actions of complicated, nested backquotes. There is never a question of syntax, though: nested backquotes are not ambiguous syntactically: they are just nested lists, with some sprinkling of a simple prefix-based notation throughout (splices and unquotes).
- mkautzm 12y agoLisp is the hardly the simplest language. It has way less 'stuff' to learn, but that 'stuff' in imperative languages is generally useful abstractions that you don't to learn, but instead simply know of. By that measurement, x86 Assembly is really the simplest language of them all, but I don't think I need to explain why that's equally absurd. Lisp is a difficult language due to it's density and unreadability. Useful stuff hasn't been built in functional languages until very recently, exception being some AI. Haskell and friends are making functional languages cool and useful (and that's great!) but if you want to build something useful as soon as possible, learn .NET, Java, Python or Ruby.
- noblethrasher 12y ago
- AnimalMuppet 12y agoWell, let's see. Lisp has no syntactic cruft? It has (almost) no syntax, so there's less room for cruft. That said... cons? car? cdr? That's your syntax? That's not cruft? Seriously? There may be less total cruft, but the percentage of cruft might still be higher... There's less overall to learn? If you mean to master the syntax, sure, that's true. You'll be writing real, useful programs in Lisp sooner than you could with other languages? That's a much more arguable point. There's more to being able to effectively program in Lisp than learning the syntax (as there is for every language). Is that "more" easier to learn for Lisp than for other languages? I have no data, but for the web site's claim, I'd at least say "citation needed".
- kazinator 12y agoI believe that Lisp requires years to master. If you're a bright developer, who puts in time eagerly, it will take at least six months before you begin to "get it". At that time you may start itching to evangelize to others, but those who have not put in the time will not get it. It's not realistic to try to make someone see in one or two e-mails or postings what took you a year to see for yourself.
- nmrm 12y agoI think the whole enlightenment thing w.r.t. lisp is overblown.
- kazinator 12y agoFrom what vantage point?
- Blackthorn 12y agoI'm not the above poster but I think the power of macros is way overhyped and not nearly as strong as people claim. I see the claim of "you can write a macro to do it" for any imaginable feature all the time, but it is simply not true. A recent example from personal use is continuations. Scheme has them as a first-class object. Common Lisp does not, but a common claim is that you can write macros to provide continuations. Some people have: there's "cl-cont" available on Quicklisp, which is a macro that will code-walk your functions to turn them into continuation-passing style and thus allow you to use continuations in those functions. So that's great, right? Common Lisp now totally has continuations? Not at all. In order to get this feature, you need to wrap ahead of time (specifically, at compile time) the functions you want to be continuable, and all of their callers, in this macro. You cannot simply use a function that you've been given as part of a continuation, it had to have been compiled under this macro. That's where the power of macros completely falls down and, in my opinion, gets completely overblown. Yes, your language is extendable, but your extensions are limited to computation and source-to-source transformation at compile time. You can't apply any of that power to already-existing artifacts.
- terminus 12y ago> It's like a never-ending stream of lies, every word being a little more absurd than the last... It's been my experience that most things are tractable once you spend long enough staring at them. If you care enough about a subject to have strong sentiments like "never-ending pack of lies" then your time would perhaps be better served by spending time with the "adored" object, rather than these comments.
- nilved 12y agoI think the sentence is poorly put together, but there aren't any lies. Clojure syntax is by far more simple (and thus easier to learn) than C-style languages or Python or Ruby. But the language is harder to jump into because it places particular emphasis on programming principles that are confusing to new programmers, like function purity, recursion and higher-order functions. Keep in mind too that different Lisps have different syntax. The only thing in common between them is Polish notation, S-expressions and a macro system. A Clojure program and a Common Lisp program look and feel very different.
- jfarmer 12y ago"simple" isn't the opposite of "hard," it's the opposite of "complex."