|
So I've been looking around on this forum and there's not very much on functional languages in general, and lisp is awesome family of functional languages. History and Design Lisp was invented in 1958 by a really cool dude named John McCarthy who was pretty big in AI research and stuff (he actually just died last October). It's currently the second oldest high level programming language still used today (the oldest being Fortran). There's not one implementation or dialect that's been used consistently, so instead of calling lisp a language, it's actually more correct to refer to it as a family of languages (or dialects) which share common features and a common general syntax. Lisp consists entirely of s-expressions. An s-expression is essentially a fully parenthesized list. They can contain either atoms or more lists recursively. An atom is either a constant or a symbol. There is no difference in lisp between a statement and an expression in lisp. Functions application is prefix, and it occurs in parens. A lisp program is written the same way the primary data structure in the language is. This similarity is actually a huge benefit to the language, as it allows the language to use macros extensively. Lisp macros can operate on the actual program just as the program can operate on data. This allows the language to be defined with an extremely small number of fundamental forms. And by extremely small number, I mean that Scheme, one of the major modern dialects, has 12 fundamental forms. Everything else can be implemented in terms of the fundamental forms as macros. Contemporary lisp There are 3 major dialects of lisp in use today. The first two, Scheme and Common Lisp have been around for a while, while the third, Clojure, is pretty new. One other thing to note is that there are two major "types" of lisp: lisp-1 and lisp-2. Lisp-1s use a single namespace for functions and variables, while lisp-2s uses multiple namespaces. Scheme is an extremely minimal dialect of lisp, mostly used for teaching computer science in universities. The canonical book The Structure and Interpretation of Computer Programs was written for the introductory CS course at MIT which used Scheme as it's language of choice due to it's simplicity. The entire language specification is 302 pages in print, including standard libraries and appendices. Scheme is a language defined by a standard, and does not have a single reference implementation. The current version of the standard is R6RS which stands for "the Revised6 Report on the Algorithmic Language Scheme". Scheme is a lisp-1 and features lexical scoping. Scheme also requires proper handling of tail-recursion in it's specification. Popular implementations of Scheme are Racket(formerly called PLT-Scheme) and Gambit. Common Lisp is the other older major dialect of lisp in use today. Common Lisp is basically the opposite of scheme, though the same people that developed scheme chaired the standards committee for CL. Common Lisp is almost the exact opposite of Scheme however. It's standard requires a ton of features, including a system for OOP. CL is a lisp-2, featuring multiple namespaces. It also has lexical scoping. Clojure is the newest dialect of lisp on the scene, and it's generated a resurgence of interest in lisp and functional languages in general. Clojure is a version of lisp which is designed to compile to JVM bytecode. It's designed to work very well with Java programs and therefore has some departure from traditional lisps, such as syntactically different primitives for vectors, maps and sets. It's got a reference implementation and has an alternate compiler for generating javascript. One thing notable about Clojure is that Heroku supports Clojure as one of it's main supported languages (and actually included Clojure support before Java support IIRC). References Wikipedia Other sites referenced are linked inline. Sorry if the end of this post seems odd, I lost my train of thought towards the end
|
# ? Feb 10, 2012 21:52 |
|
|
# ? May 5, 2024 07:59 |
|
Good idea for a thread. The only thing I really have to add is to recommend How To Design Programs (which you can read online), which is a great and accessible introduction to functional programming via Scheme. It's a bit like SICP-lite, and is a book that most any programmer (especially beginner/intermediate level) can benefit from.
|
# ? Feb 11, 2012 18:29 |
|
I'd heartily recommend Conrad Barski's Land of Lisp for someone looking to learn Lisp generally and Common Lisp specifically (although in later chapters it touches on Clojure, Scheme and Arc, the focus is on CL throughout). It's fun throughout, moderately opinionated and only slightly triumphalist. And all the examples are games! There is no better motivator to learning how to handle graphs or whatever in Lisp imo than implementing Grand Theft Wumpus.
|
# ? Feb 11, 2012 20:37 |
|
Here's the obligatory link to the MIT Lectures on LISP. These videos, while older than I am, are very well done and have aged wonderfully. They contain the lectures that go along with the The Structure and Interpretation of Computer Programs book mentioned in the OP.
|
# ? Feb 11, 2012 21:27 |
|
oRenj9 posted:Here's the obligatory link to the MIT Lectures on LISP. These videos, while older than I am, are very well done and have aged wonderfully. They contain the lectures that go along with the The Structure and Interpretation of Computer Programs book mentioned in the OP. Oh here is a youtube link to a video recording of the 1986 SICP course. I think it's actually the full course on video on the MIT youtube channel, in case you don't want to download it. E: It's probably the same videos linked above but on youtube instead of needing downloaded. e2: SCIP -> SICP because I suck at typing. Look Around You fucked around with this message at 21:44 on Feb 11, 2012 |
# ? Feb 11, 2012 21:39 |
|
In case people are interested in books on macros, http://www.bookshelf.jp/texi/onlisp/onlisp.html http://letoverlambda.com/textmode.cl/guest/toc
|
# ? Feb 12, 2012 05:35 |
|
oRenj9 posted:Here's the obligatory link to the MIT Lectures on LISP. These videos, while older than I am, are very well done and have aged wonderfully. They contain the lectures that go along with the The Structure and Interpretation of Computer Programs book mentioned in the OP. This dude owns.
|
# ? Feb 14, 2012 22:56 |
|
duck monster posted:
|
# ? Feb 14, 2012 23:49 |
|
My only, and I mean only, gripe about the videos is that they don't always go in order of the book. So, while you're reading about concurrency, the videos are on stream processing. It's a minor nitpick, otherwise they're fantastic. Since they do blow through some topics pretty fast, I found the Brian Harvey CS 61A lectures from Berkeley great for another view: http://www.youtube.com/watch?v=zmYqShvVDh4&feature=list_related&playnext=1&list=SP6879A8466C44A5D5
|
# ? Feb 15, 2012 15:17 |
|
Dijkstracula posted:No mention of Hal Abelson's awesomeness is complete without the epiphanous "I suggest we look at it for awhile" moment from SICP. Hal Abelson's a really awesome dude but the picture and video are of Gerald Sussman
|
# ? Feb 15, 2012 22:43 |
|
I need to munch some XML, what's the best CL library for this?
|
# ? Feb 17, 2012 06:22 |
|
Otto Skorzeny posted:I need to munch some XML, what's the best CL library for this? All XML libraries are terrible, as you know, but we've been using XMLS. At least it's simple, and without dependencies.
|
# ? Feb 17, 2012 18:27 |
|
I will give it a shot E: Alright, now would be a good time for me to ask you guys to straighten out my understanding of libraries in Lisp. XMLS seems to do a fine job for what I want, parsing the XML and spitting out a nice sexpr. When I'm in the repl, I can just (ql:quickload) the library, but that doesn't work in a script (since the init file doesn't get run). Attempting to (require 'xmls) doesn't seem to work, and I'm wondering if it's because quicklisp keeps software in its dists dir whereas sbcl and clisp look for require'd things in some other dir. Or am I going about things completely wrong? Blotto Skorzany fucked around with this message at 19:20 on Feb 17, 2012 |
# ? Feb 17, 2012 18:28 |
|
Oooooh a Lisp threaaaad. I've been trundling along with Common Lisp for about a year now working on personal projects, and I've written some articles about my travels at http://msnyder.info/. I also work extensively in Emacs Lisp and have a thread kicking about for that, as well. Seconding the recommendation for Land of Lisp, as well as The Little Schemer.
|
# ? Feb 17, 2012 19:20 |
|
Otto Skorzeny posted:I need to munch some XML, what's the best CL library for this? Seeing as how XML is practically the same structure as S-EXPs, parsing XML in Lisp is probably easier than with most languages. This link is about Scheme, so not exactly what you want, but interesting nonetheless. I recommend reading just about everything on that guy's site (http://okmij.org/ftp/Scheme/index.html) because it's all pretty amazing stuff.
|
# ? Feb 18, 2012 02:35 |
|
Kilson posted:Seeing as how XML is practically the same structure as S-EXPs, parsing XML in Lisp is probably easier than with most languages. I wonder if you could make a Lisp interpreter that used XML instead of S-EXPs.
|
# ? Feb 18, 2012 05:41 |
|
You could do so very easily with Racket.
|
# ? Feb 18, 2012 06:03 |
|
Otto Skorzeny posted:XMLS seems to do a fine job for what I want, parsing the XML and spitting out a nice sexpr. When I'm in the repl, I can just (ql:quickload) the library, but that doesn't work in a script (since the init file doesn't get run). Attempting to (require 'xmls) doesn't seem to work, and I'm wondering if it's because quicklisp keeps software in its dists dir whereas sbcl and clisp look for require'd things in some other dir. Or am I going about things completely wrong? REQUIRE rarely does what you want, it's better to rely on ASDF or Quicklisp. Why can't you get it to load your init file in script mode? E; Also, why script mode? If you're using SBCL, why not make a binary? Neslepaks fucked around with this message at 14:50 on Feb 18, 2012 |
# ? Feb 18, 2012 14:47 |
|
Neslepaks posted:REQUIRE rarely does what you want, it's better to rely on ASDF or Quicklisp. Why can't you get it to load your init file in script mode? As for script mode, the program I'm writing is a module for a larger program, and the team generally doesn't want captive interfaces. If I do sb-ext:save-lisp-and-die, when it's run it will bring up the REPL, no?
|
# ? Feb 18, 2012 19:10 |
|
Otto Skorzeny posted:As for script mode, the program I'm writing is a module for a larger program, and the team generally doesn't want captive interfaces. If I do sb-ext:save-lisp-and-die, when it's run it will bring up the REPL, no? No, no. You specify the top-level function with :toplevel #'butt and when that function exits, the program exits, like you'd expect. You can also use --disable-debugger and --disable-ldb when building the image to make sure it never enters any interactive mode. Beware of the order of your options though, SBCL is finicky about it. There are three "groups" of them or some poo poo, read the manpage.
|
# ? Feb 18, 2012 19:18 |
|
Oh, kickass! e: for any future readers, you probably also want to pass :executable t to save-lisp-and-die Blotto Skorzany fucked around with this message at 04:41 on Feb 19, 2012 |
# ? Feb 18, 2012 19:19 |
|
Meganiuma posted:Hal Abelson's a really awesome dude but the picture and video are of Gerald Sussman
|
# ? Feb 19, 2012 00:40 |
|
How do I run Clojure with the numeric-tower library? Using Windows and I'm completely lost as to what to do. None of the official documentation really mentions what to do either.
|
# ? Feb 21, 2012 08:08 |
|
My coding life has improved about 1024x since I installed slimv
|
# ? Feb 21, 2012 08:33 |
|
Otto Skorzeny posted:My coding life has improved about 1024x since I installed slimv Are there any decent 21st century IDEs for LISP/Scheme? MIT-GNU Scheme is nearly as frustrating as Emacs to use. It got to the point where I just didn't want to continue working with Scheme because I didn't have a decent way to work with it. Of course, I guess I could man up and embrace m-x m-e as the original F5.
|
# ? Feb 21, 2012 08:43 |
|
oRenj9 posted:Are there any decent 21st century IDEs for LISP/Scheme? MIT-GNU Scheme is nearly as frustrating as Emacs to use. It got to the point where I just didn't want to continue working with Scheme because I didn't have a decent way to work with it. I don't have enough fingers for emacs, but as I said vim+slimv has treated me real well so far. Outside of that, I'm told LispWorks is nice, and I think they have a free version you could try. If you prefer something scheme-y, I've heard nice things about Racket/PLT Scheme, and they have their own IDE called DrRacket. Blotto Skorzany fucked around with this message at 08:52 on Feb 21, 2012 |
# ? Feb 21, 2012 08:49 |
|
DrRacket is pretty nice, it's got an integrated repl, debugger, macro stepper, etc. If divascheme is still being updated then you can install that and get paredit style structural editing but with vi style modality.
|
# ? Feb 21, 2012 16:23 |
|
DrRacket rocks, thanks guys!
|
# ? Feb 22, 2012 00:00 |
|
Otto Skorzeny posted:My coding life has improved about 1024x since I installed slimv Have you been able to get slimv to work with pathogen? It may be just me having trouble using it with (m)vim on OS X but I wanted to make sure it wasn't a pathogen problem first.
|
# ? Feb 22, 2012 12:26 |
|
Look Around You posted:Have you been able to get slimv to work with pathogen? It may be just me having trouble using it with (m)vim on OS X but I wanted to make sure it wasn't a pathogen problem first. I think your problem is probably because of this: Slimv Tutorial posted:You will also need a Python enabled Vim, and the same Python version installed that is Vim compiled against. This is because the communication part of the plugin is written in Vim's embedded Python (unfortunately there is no embedded Lisp for Vim). I never even bothered to try it with MacVim because of that. I'm sure there are ways around that though.
|
# ? Feb 22, 2012 20:55 |
|
Strong Sauce posted:How do I run Clojure with the numeric-tower library? Using Windows and I'm completely lost as to what to do. None of the official documentation really mentions what to do either. I was about to answer your question, then I found this in the process which pretty much explains exactly what I was going to say better than I could: http://stackoverflow.com/questions/8706655/using-clojure-math-numeric-tower-or-any-library Edit: I love Clojure and I've been waiting for a thread like this to show up. Is there any interest in a big Clojure effortpost here? I'm not really a good programmer or anything but I've banged my head against the wall over problems like Strong Sauce's to the point where I can probably point people in the right direction to get started with it at least. It really is an awesome language. a cat fucked around with this message at 03:01 on Feb 23, 2012 |
# ? Feb 23, 2012 02:56 |
|
jstirrell posted:I was about to answer your question, then I found this in the process which pretty much explains exactly what I was going to say better than I could: Why not post it? This is a lisp thread and Clojure is a lisp v v
|
# ? Feb 23, 2012 03:08 |
|
jstirrell posted:I was about to answer your question, then I found this in the process which pretty much explains exactly what I was going to say better than I could: Unfortunately lein support doesn't work too well on Windows, especially since I didn't want to really install wget/curl. I ended up doing this: java -cp "C:\Program Files (x86)\Clojure\clojure-1.3.0.jar;C:\Program Files (x86)\Clojure\math.numeric-tower-0.0.1.jar" clojure.main then typing in (require '[clojure.math.numeric-tower :as math]) in the REPL edit: even better, just add the jar path to CLASSPATH Strong Sauce fucked around with this message at 04:16 on Feb 23, 2012 |
# ? Feb 23, 2012 04:01 |
|
Lein works fine on windows. You don't even need to "install" wget, just download the binary and put it on your path. It even gives you urls to to it if you run the bat and it can't find it! Though frankly, I don't understand why they made the wrapper a loving bat file. It seems like it would be waaay less trouble to just write it in vbscript or jscript or something. I'm pretty sure WSH has url downloading in it. SavageMessiah fucked around with this message at 04:24 on Feb 23, 2012 |
# ? Feb 23, 2012 04:22 |
|
I got lein loaded after I figured out that having Clojure 1.3.0 required running the latest version of lein, 1.7.1. Anyways, when I finally got that going and tried running `lein deps` it just failed saying it could not find it so I gave up on it. It may work, but it is a pain to install on Windows.
|
# ? Feb 23, 2012 04:27 |
|
I'm reading through Land of Lisp and working on OS X. I had trouble brew install'ing CLISP so I'm running Clozure CL for now. Is this an acceptable implementation? I am sort of unsure of how much variation there is between all the different versions.
|
# ? Mar 3, 2012 05:24 |
|
etcetera08 posted:I'm reading through Land of Lisp and working on OS X. I had trouble brew install'ing CLISP so I'm running Clozure CL for now. Is this an acceptable implementation? I am sort of unsure of how much variation there is between all the different versions. Yes it is. Another good implementation is SBCL. Edit: According to Wikipedia, "Clozure CL is used by ITA Software for the business logic of a new Airline Reservation System for Air Canada[2]." If ITA is using it, you know it's not crap.
|
# ? Mar 3, 2012 05:50 |
|
SBCL is great. As far as I know it has about the best optimizing compiler for CL. Commercial companies like to use Clozure, Allegro CL or Lispworks because they can get fixes overnight or even ask for specific features or platforms. Speaking of CLISP, any news around their JIT? PS. Yay, a Lisp thread! Beef fucked around with this message at 15:56 on Mar 5, 2012 |
# ? Mar 5, 2012 15:54 |
|
etcetera08 posted:I'm reading through Land of Lisp and working on OS X. I had trouble brew install'ing CLISP so I'm running Clozure CL for now. Is this an acceptable implementation? I am sort of unsure of how much variation there is between all the different versions. Clozure's fantastic. I'm going to be publishing an article Real Soon Now that uses it's foreign function interface support extensively.
|
# ? Mar 5, 2012 16:00 |
|
|
# ? May 5, 2024 07:59 |
|
Protip: Use ParEdit mode in emacs to write Lisp. It constantly keeps your parens balanced. Every other editor seems primitive once you have gotten used to it.
|
# ? Mar 5, 2012 18:35 |