I have tried several times -- and FAILED UTTERLY. It felt like having a fetus shoved up your ass, and then having to shit it out while a big bad nigger is trying to shove it back up with his humongous cock. All while the fetus is growing at a steady pace.
Alright, what I need to know is:
1) How do I indented Lisp.
2) What dialect is "the best".
3) Minor programming project good for a stupid ignorant wapanese newbie.
4) PROTIPs.
>>1 1) How do I indented Lisp.
This is the least of your worries, you'll pick it up as you go along. In general though start a new line for the body of block-style macros, eg defun, or whenever you feel you need to. Closing parens go on the end of the line, they don't get lines all to themselves.
2) What dialect is "the best".
Scheme is simple and elegant, Common Lisp is powerful, has a more complete standard library, has more external libraries (see http://www.cliki.net/index). Use CL for real work, Scheme for a beautiful toy. All other dialects were either killed off by Common Lisp or are special purpose languages.
4) PROTIPs.
Learn emacs. I'm a vim user by preference, but emacs + SLIME will make you a happy lisper.
Get to know this site: http://www.cliki.net/index
If you find yourself starting to doubt that Lisp is REAL Ultimate Power, read some essays from this site: http://www.paulgraham.com/index.html
Compilers: SBCL is the most current, CMUCL and CLISP are fine too. They're all for *nix, as all good things are, but they run fine in cygwin.
Name:
Anonymous2006-04-12 14:51
A better question: why would I want to learn Lisp?
Name:
Anonymous2006-04-12 14:54
>>7
A better question: why would you learn another programming language when ASM can do everything already? Maybe because Lisp is more suited to my needs? Maybe because it's been specifically designed to ease the development of AI applications?
If you're asking such a stupid question, you don't need Lisp to begin with...
Name:
Anonymous2006-04-12 22:34
>>8
Is it really any easier to write "AI applications" in lisp? I mean, it really depends on what kind of AI you're doing... John McCarthy invented lisp, and he was mostly concerned with programs that did logic deduction. That was Good Old Fashioned AI. Most AI systems people are concerned with now like learning systems and planners are probably easier to implement in a more general purpose language like C.
[from ‘LISt Processing language’, but mythically from ‘Lots of Irritating Superfluous Parentheses’] AI's mother tongue, a language based on the ideas of (a) variable-length lists and trees as fundamental data types, and (b) the interpretation of code as data and vice-versa. Invented by John McCarthy at MIT in the late 1950s, it is actually older than any other HLL still in use except FORTRAN. Accordingly, it has undergone considerable adaptive radiation over the years; modern variants are quite different in detail from the original LISP 1.5. The dominant HLL among hackers until the early 1980s, LISP has since shared the throne with C. Its partisans claim it is the only language that is truly beautiful. See languages of choice.
All LISP functions and programs are expressions that return values; this, together with the high memory utilization of LISPs, gave rise to Alan Perlis's famous quip (itself a take on an Oscar Wilde quote) that “LISP programmers know the value of everything and the cost of nothing”.
One significant application for LISP has been as a proof by example that most newer languages, such as COBOL and Ada, are full of unnecessary crocks. When the Right Thing has already been done once, there is no justification for bogosity in newer languages.
Name:
Anonymous2006-04-13 3:43
>>9
Lisp isn't really a special purpose AI language; it just happens to be good at it because it allows amazingly high levels of abstraction and is great at manipulating symbols. The sort of language you're describing is more like Prolog which is only good for a highly restricted set of applications.
>>9
| Most AI systems people are concerned with now like learning systems and planners are probably easier to implement in a more general purpose language like C.
No, it's still easier in Lisp
Name:
Anonymous2006-04-26 2:02
LISP's inherent qualities make it awesome.
LISP's realities -- such as the fact that your program is only guaranteed to be functional as far as the interpreter's own limitations (any computer functionality beyond the interpreter and you probably have to write C code and FFI-call it into LISP which is a PAIN IN THE ASS BECAUSE THERE'S NO FUCKING DOCUMENTATION ANYWHERE AND IT'S DIFFERENT FOR EVERY FUCKING IMPLEMENTATION) -- aren't so nice.
LISP is nice as a scripting language for complicated AI, and for rudimentary prototyping for algorithms. I really wish people who write the interpreters would get their shit together and agree upon some common protocols so writing portal LISP code (even within the same dialect, it's a pain) isn't such a chore. Shit like that really makes it hard for me to convince people that LISP can allow for lower budgets on commercial projects.
Name:
Anonymous2006-04-26 3:08
Blame ANSI. Common Lisp is a political compromise between all the dialects that existed previously. ANSI standardised it with a crummy library that doesn't know about basic things like sockets. Since it lacks these essential things, the implementations have to do it their own, non-standard way.
As long as Common Lisp is the dominant dialect, Lisp will not see any substantial use in the Real World (TM).
Name:
Anonymous2006-04-26 5:50
In the meantime using the CLOCC and UFFI libraries would probably go a fair way to resolving deficiencies in the standard and incompatibilities between flavours.
If there were a more active Lisp community, these, or somthing like these, would probably be de facto standards by now.
Then I whould like to say clisp+Emacs+Slime if this isn't enough ide than gtfo, find reference cards for emacs and slime, and second Cygwin if you don't want to leave your windows boxee (this is my setup now).
Paul Graham http://www.paulgraham.com/ now have an incubator http://ycombinator.com/ for funding startups. One of these startups is http://reddit.com/ which WAS ORIGINALY WRITEN IN LISP and has some good algorithms behind. Recently changed to Python, but there still's the Lisp people reading and posting there. reddit's developers in the early days was like this: someone made a sugestion and in the same day they implemented it's sugestion if it was good.
Learning Common LISP syntax and good practice I've found is easy and fun.
The annoying part is when you -think- that Common LISP doesn't have a built-in function for something, and after Googling with unfortunately-chosen words for unhelpful search results, you set out to code just that. Then like, a month later, you find out Common LISP did indeed have a function/macro built-in to do exactly what you coded.
Huge, huge language. I'm sluggishly downloading Paul Graham's book now, I hope it's more an in-depth reference of Common LISP internals than Peter Seibel's book, because right now I'm still in the "random exploring" phase (and I've been on Common LISP for about 7 months now).
Also I finished downloading that "Common Lisp - The Language" and noticed that it's by Guy Steele, not Paul Graham. I think I'd rather buy the book too, reading a 1000+ page manual on the monitor isn't comfortable or easy to flip through.
>>22, I'll check it out. Although it looks like I'll have to settle for the .pdf for that book -- $234 on Amazon holy shit
>>23 >>24
I misspelled that, sorry, the I was looking for is ANSI Common Lisp, that is the book.
Name:
Anonymous2006-04-28 16:22
I just came across this book, "ANSI Common Lisp Reference", marked as Not Yet Released. Should I wait for it? Looks like it's published by the same company who published Peter Seibel's excellent (but lacking-on-reference) book, and it might be more up-to-date than Graham's "ANSI Common Lisp"?
Disregard that... I noticed it's not coming out until... uh... "February 2008"? uh... I'll go for Paul Graham's book ^_^
Name:
Anonymous2006-04-28 16:53
My friends that didn't like Lisp liked the Paul Graham's book.
Name:
Anonymous2006-04-29 10:48
I'd recommend clisp for the stuff you'll do on the command line, as it uses GNU readline which is really quite nice. Switch to sbcl or cmucl once the performance thingamabobs start getting to you, which won't be any time soon.
As for a programming project, try coming up with a simple MUD engine. Especially given that all of the implementations I suggested support CLOS, which is like the object system to end all object systems.
Name:
Anonymous2006-05-01 23:37
This might be *similar* to the "a celebrity uses it, so it must be good" fallacy, but Paul Graham stated on his website that CLISP is his preferred Common LISP interpreter.
I personally find CLISP easier to use, but CMUCL is the only one that doesn't piss, bitch, and moan when I try to use it as my emacs SLIME interpreter of choice. CMUCL is pretty nice also, in terms of the extensions that come with it (especially for network programming!)
Name:
Anonymous2006-05-02 3:06
I like CLISP's REPL, but in practice you're going to be doing your programming in an editor so that's not a good reason to use it. I've been told that SBCL is the only one that is still actively developed, and it's derived from CMUCL which is/was considered respectable.
CLISP also requires extra work if you want to use it with UFFI. Also the SLIME issues mentioned above.
Name:
Anonymous2006-05-03 23:32
Is there a way to get more specific terminal output going on in Common Lisp?
CLISP has some ext: macros for printing to specific x,y coordinates on a screen, but there seems to be a bug where it only counts once -- have the cursor move to (3,4) and then print a 5-character string, and then have the cursor move to some other remote part of the screen, and it'll just print from (3,9).
Is C code that glues ncurses (or whatever) + UFFI the only way to get reliable terminal output in Common Lisp? It sucks having to write a game when manipulating devices and hardware is a pain like this.
Name:
Anonymous2006-05-04 1:24
Is there a reason no one has said "become gay" yet?
I believe you can, but you'll have to write a wee bit of C code that "bridges" to those API functions, and load that compiled object code as UFFI.
I don't really know how to use UFFI but I'm pretty sure it works just as well in Win32 as it does in Linux, for Common LISP implementations that have official ports to those OSes.
Name:
Anonymous2006-05-04 4:07
be a ninja
Name:
Anonymous2006-05-04 4:28
>>37
You shouldn't even need to do that; you should be able to use def-function to declare foreign functions from, for example, kernel32 or user32. According to the manual* the syntax looks like: (def-function name args &key module returning), so if you wanted to use the win32 sleep() function for example you'd write:
(def-function "sleep"
((milliseconds :long))
"kernel32"
:returning :void)
But I could be way off. I've never actually used UFFI. The next page in the manual describes how to load an entire foreign library, which sounds neat.
This would be a good time to mention (again) that UFFI doesn't directly support CLISP and according to cliki you have to mess around with CFFI to get it working. If you're not trying to use libraries that require UFFI, it might be worth your while not using it at all and just using CFFI directly.
*http://files.b9.com/uffi/uffi-manual-latest.pdf
Name:
Anonymous2006-05-04 17:02
Er, I thought UFFI was the "standardized" method of loading foreign functions and now there's this CFFI thing I've never heard about?
Guh...
This sort of stuff really is the Achilles' Heel of LISP. Just because something is academic, doesn't mean it should be designed to be hard to use...
Name:
Anonymous2006-05-04 17:43
UFFI is standard across all flavours except for CLisp. CLisp is inferior.
By a quick google search (web and usenet) and things people said in those results, it seems it's more like "UFFI doesn't support CLISP", not "CLISP doesn't support UFFI".
Name:
Anonymous2006-05-07 11:05
>>40
Whoa, LISP, academic? What decade are you living in?
Name:
Anonymous2006-05-07 19:40
>>43
Everything that required more intelligence than a java developer is academic, didn't you know?
Well find me a corporation I can work for that'll hire me for my LISP skills, that isn't merely a government subcontractor or research arm of some university, and I'll suck your dick, slappy.
Name:
Anonymous2006-05-08 6:48 (sage)
>>45
Googl.......oh wait, they got taken over by lolololenterprisescalablebestpractises managers
>>47
Internally, google has been in a downward spiral since about 2003 or so
Name:
Anonymous2006-05-08 17:25
Shit. So, what happened to one of the best places to work ever? Don't tell me they managed to hire some retarded businessmen full of enterprise and scalability with his industry magazines and business conferences. I wonder how didn't Google collapse, it must've been really good to withstand two years of professional management. Damn. What'd be the model company now? One that's not ruled by business ruin-it-all idiots?
I swear these Java loving enterprise managers are like King Midas, only instead of Midas they are Mierdas, and turn to shit everything they touch.
>>49 That's the direction EVERY company goes to eventually. Which is one reason why I personally avoid working in the industry (the other reason being that I suck. >.>)
Name:
Anonymous2006-05-09 3:19
>>46
They also hired Guido van Rossum to continue to make Python even worse than it already is. I think they're hoping it will evolve into Java so they can use it for Scalable Enterprise Best Practice Solution Paradigms or something.
Name:
Anonymous2006-05-10 20:12
2007 will be remembered as the year that google turns Pythonic. I will laugh at them.
Name:
Anonymous2006-05-10 22:18
2007 will be remembered as the year that google becomes self-aware. I will fear it.
Name:
Anonymous2006-05-11 3:33 (sage)
2007 will be remembered as the year that google buys 4chan. moot will love it.
Name:
Anonymous2006-05-11 3:34
While I don't agree with everything that's going on with Python 3000 (and I don't know if lambda will finally be there or not, if not then boo, and the functional functions can always be moved to a module so they're not a problem), I have to say it's unfair to say it's enterprise.
It would take GvR a hundred years to turn Python into the kind of shit Java is, and I'd always prefer Python over Java without even stopping to think for a second.
>>53
Google is already Pythonic, there's nothing to do in this department.
>>54
If parts of Google are written in Python, it'll become self-aware. All Python methods are self-aware: def method(self, params):
self.property = ...
etcSee? self-awareness.
Name:
Anonymous2006-05-11 7:20
Lisp = Lost in superflous parenthesis
Lips = Lost in pornographic sensation
i know....it's not funny, but i have to do it
Name:
Anonymous2006-05-11 13:52
LISP: Lame Illustrated Sickness Putty
LISP: Lame Invisible Security Polish
LISP: Language Incognito Sudden Perfect
LISP: Language Institute Super Putty
LISP: League Ipod Scumlog Protocol
LISP: Leftist Imperforated Shocking Platform
LISP: Left-wing Incognito Simple Plop
LISP: Liberation Incognito Super Putty
LISP: Liberation Internet Soft Protection
LISP: Licking Imperforated Software Pissing
LISP: Licking Imperforated Supple Plop
LISP: Light Institute Steaming Puntme
LISP: Light Italian Simple Php
LISP: Likes Illustrated Seventh Programmer
LISP: Likes Information Slick Preprocessor
LISP: Limited Imperforated Shocking Php
LISP: Limited Incorporated Sex Perfect
LISP: Limited Incorporated Slick Php
LISP: Linux Incognito Skinny Pope
LISP: Liquor Incorporated Sexy Pissing
LISP: Liquor Infant Sucking Protocol
LISP: Little Institute Scissors Perfect
LISP: Love Incognito Soviet Prostitute
LISP: Love Incorporated Security Php
LISP: Love Inspection Stallman Powerbook
LISP: Love Institute Software Polish
LISP: Love Invisible Sudden Purr
LISP: Lovely Incorporated Sixth Pipebomb
LISP: Lovely Incorporated Skinny Purr
LISP: Lowtax Illness Stallman Peckers
I just realized that there's a Lisp thread, and it's already tl;dr.
For learning Lisp (CL), I very highly recommend the classic "Common Lisp - A Gentle Introduction to Symbolic Computation" by David S. Touretzky. It's out of print and available as a free ebook from http://www.cs.cmu.edu/~dst/LispBook/index.html
Name:
Anonymous2006-07-28 14:20
scheme is superior.
Name:
Anonymous2006-07-28 15:17
>>60
Great book that. I hardly ever see it recommended, but it's what rehabilitated me after 3 years of doing Java at uni.
>>62
Scheme is better than Common Lisp which is really bloated. For one, CL's functions and variables have different namespaces which really irritates me.
Name:
Anonymous2006-07-29 14:40
>>63
Scheme and Common Lisp are both Lisp dialects.
Now that I've got my semantic pedantery out of the way; I agree with you in that I prefer Scheme's simplicity and single namespace; having to #' my symbols just to pass functions around is ugly ugly ugly. I wouldn't claim that makes Scheme better than CL though, I just prefer it. CL fans have their reasons for preferring CL.
Name:
Anonymous2006-07-29 16:55
>>64
Having to do (funcall something-thats-bound-to-a-function-value p1 p2 p3 p4 ...) instead of the kind without "funcall" is more explicit. The function variables in Scheme tend, in my experience, to get lost in the noise.
Though, letrec is kind of hard to beat in terms of being generic; CL has the labels form though so it's not all bad... but you still can't, to my knowledge, declare variables and functions in the same labels form.
Ohh by the way, anyone notice that we're discussing LISP on 4chan's discussion boards? Of all places? Hooray for blowing off steam on /b/!
Name:
Anonymous2006-07-30 4:19
damn i need to finish learning scheme. anyone know haskell?
i am just getting into learning haskell. why can't i do anything remotely useful with it? (the only thing i know that is built with haskell is pugs)
Name:
Anonymous2006-08-03 19:12
>>71
From various comments I'm getting the idea Haskell is for theoretical fappage, but not to do any real work with.
Name:
Anonymous2006-08-03 19:49
>>72
The problem is most people's head asplode when they try to learn functional programming. Because they're stupid.
Name:
Anonymous2006-08-03 23:48
>>73
no. i'd say it's haskell's insistence on having no side effects at all.
Name:
Anonymous2006-08-04 0:18
main = getLine >>= putLine >> main
I just wrote 'cat'. No side effects you say?
Name:
Anonymous2006-08-04 7:07
>>75
Side effects? In *MY* PROGRAM????? GRRRRRRRRRRRRRRRRRRRRRRRRRRRRRR
Name:
Anonymous2006-08-04 11:35
Lisp sucks sure there're pure functions in Lisp but it's not purely functional, it's multiparadigm, and it allows SIDE EFFECTS, whitch means that it is a PROCEDURAL language
The problem with Lisp is that anything interesting you might be able to do with it, has already been done with it--and done better.
Wait. I just summed up programming languages in general OH SHI-
Name:
Anonymous2006-08-05 8:59
I guess that's it then, guys. Let's just pack up and go home. We're finished here.
Name:
Anonymous2006-08-05 16:58
Lisp sucks sure there're pure functions in Lisp but it's not purely functional, it's multiparadigm, and it allows SIDE EFFECTS, whitch means that it is a PROCEDURAL language
Name:
Anonymous2006-08-05 18:34
I like haskell now. I tried ocaml and with floats you have to do x+.y = z. floats having different arithmetic functions? DIEEEEEEEEEEEEEEEEEEEEEEE.
Name:
Anonymous2006-08-05 18:53
>>82
Agreed. It's like programming in Forth or something where floats and ints have different stacks. Where's my motherfucking abstraction?
Name:
Anonymous2006-08-05 19:56
Where's my motherfucking abstraction?
In a non-strongly and statically-typed language.
Name:
Anonymous2006-08-05 20:18
I've really wanted to learn Lisp/Scheme once I heard about them. However, I kept getting lost with the endless libraries, and the foreign operators (#' anyone?). The community has already implemented so many shortcuts, it's impossible to distinguish the language from the hacks (kinda reminds me of the MFC). If I haddn't run across newLisp (http://www.newlisp.org/) I would have already given up on all of it. If you want a very gentle, well documented, out-of-the-box introduction to Lisp-like syntax and thinking, take a look at newLisp. From there, you may want to move on to CLisp or PLT Scheme.
Name:
Anonymous2006-08-06 14:31
Lisp sucks sure there're pure functions in Lisp but it's not purely functional, it's multiparadigm, and it allows SIDE EFFECTS, whitch means that it is a PROCEDURAL language
Name:
Anonymous2006-08-06 20:57
Languages without side effects can't do anything ;p
Name:
Anonymous2006-08-07 4:11
>>87
So the program (+ 2 2) doesn't do anything? Admittedly, it's much harder to do certain things, but you can certainly get stuff done in lisp without using things with side effects.
>>86
No one cares. If I really cared about something being purely functional, I'd be programming in lambda calculus or some shit. As it stands, I'm more concerned about getting things done in an efficient (and hopefully elegant) manner than planing the "pure" OOP/functional/whateverthefuck wankfest.
Sure, (+ 2 2) does something, but you don't know the answer. :D
Output is a side-effect.
Monads suck.
Name:
Anonymous2006-08-08 6:07
>>90 Sure, (+ 2 2) does something, but you don't know the answer. :D
It does nothing if you optimize the program. Any program that has no side-effects can be optimized to (). That's the main selling point of Lisp I think.
Name:
Anonymous2006-08-08 15:27
Any program that has no side-effects can be optimized to (). That's the main selling point of Lisp I think.
It's fast if it does nothing!
>>92
Yeah! I wonder who came up with this brilliant idea of programming without using side-effects and doing that optimization... why didn't he patent it... would it be patentable?
Speaking of monads, does anyone have a good explaination of wtf they are without me having to climb into bed with Haskell? All I know is they are some kind of syntax sugar to allow for side-effects in a purely functional language. How do they work? What would you have to do if you didn't have the handy syntax?
Name:
Anonymous2006-08-09 9:54
>>97
I believe the theory is that they are uncertain values. Or something like that.
If you didn't have monads, you'd simply put side-effect statements in your code :)
Name:
Anonymous2006-08-09 16:08
Haskell has syntax sugar for monads specifically but monads itself is not syntax sugar. It's a way to abstract a certain type of computation.
>>96
Dude, SICP is a book first and foremost. Google for it if you'd like to read it -- it's available on the netz0rs without dipping into ebooks or anything. Plain HTML with a few images for the equations and so forth.