3 ms·
Are you failing to learn it? What have you tried? What's holding you back? I'm offering a free Clojure workshop next Saturday if you're in the Philadelphia regi
by JackMorgan 11y ago
Are you failing to learn it? What have you tried? What's holding you back? I'm offering a free Clojure workshop next Saturday if you're in the Philadelphia region. http://www.meetup.com/Clojadelphia/events/221835485/ http://www.meetup.com/Clojadelphia/events/221835485/
Otherwise, I worked through SICP a couple years back, and I found it invaluable to getting familiar with Lisps and functional programming in general.
I remember sitting down one day (before working through SICP) and saying, "I'm great at PHP, I'll probably just be able to write a Clojure project off the top of my head!" Cue clown music as I beat my head against a language much more expressive than anything I'd encountered to date.
It was a few solid weeks of effort before I could get anywhere, but I remember remarking at the time, "if I can learn this well enough, I'll be a wizard!"
- jokoon 11y agosicp is pretty hardcore I tried reading lisp courses or tutorials, it really did not help. It's either too steep, or it just talks about simple things like adding numbers like (+ 5 9) I'm more into what makes me understand lisp as a better language.
- JackMorgan 11y agoI've heard rave reviews of Joy of Clojure as a good book to "get it". I found I really had to work at the problem from several angles before it "clicked". I started with Land of Lisp, but it felt very arcane to me at the time. I would copy in code from the book, and then look back at just jibberish. I gave up on that a few chapters in. Then I made that site in Clojure, one error at a time, pounding like a monkey until it worked. I then read Clojure Programming twice, followed by working through Let Over Lambda. About halfway through Let Over Lambda, I think it "clicked". I finished with an amazing online course in Programming Languages through Brown University. I finished with SICP chapters 1-3. Nothing worthwhile is ever easy. If you need any help please reach out, you can't waste my time.
- agumonkey 11y agoWhat would you want to learn ? SICP is about fundamental patterns that you will encounter, but sometimes they are too weird to understand without context. Also SICP uses a lot of maths, some people don't like having to deal with 2 difficulties at once. Maybe try HtDP http://www.htdp.org/ http://www.htdp.org/, you'll understand how to think about 'programs' without typing source in a particular language. The pattern of adding numbers is just an instance of a closed set recursion. (F e0 ... en) -> (reduce F (e0 ... en) zero-element) -> (F(...(F(F zero-element e0) e1)...) en) Not just about simple addition, it works with function relating two elements of the same kind to another element of that kind. From 2 arguments to 1, so you can pick another element and relate it to the previous result, so on and so forth until you reduced a list of elements to just one. Of course it's not an application like crafting a website, or rendering GUI, or manipulating sound samples, but these principles are everywhere.
- falcolas 11y agoIf you're really interested in learning and grokking Lisp, you could do worse than trying to implement it yourself. https://github.com/kanaka/mal https://github.com/kanaka/mal Fully working lisp in 10 (easy to not so easy) steps.
- Turing_Machine 11y agoI would recommend: 1) Install Racket (http://racket-lang.org/ http://racket-lang.org/) 2) Read Simply Scheme (https://www.cs.berkeley.edu/~bh/ss-toc2.html https://www.cs.berkeley.edu/~bh/ss-toc2.html) by Brian Harvey and Matthew Wright. It's free. Harvey taught the Scheme classes at UC Berkeley for many years, and is an outstanding (and award-winning) teacher (he also has a series of videos that might be helpful). One of the stated goals of Harvey and Wright's approach is to get the student ready for SICP. It's definitely way above the "add two numbers" level, but is not quite the instant warp factor 10 that you get when you dive into SICP. If you do this, you should also use the Racket Library (https://www.hashcollision.org/simply-scheme/ https://www.hashcollision.org/simply-scheme/) that adds all the extra stuff used in the Harvey and Wright text. Good luck!
- klibertp 11y agoThere's not that much to understand about Lisp and that's why it seems hard. First, you should pick a Lisp-1 because otherwise you'll be hit with "weird" behaviour earlier than necessary. Next, learn the syntax of your Lisp. Pick one that doesn't have many extensions, as they may become a distraction. Ignore any macros your Lisp supports, leave quasiquote and unquote for later (you can use `quote`, but as a shorthand for the `list` function at first). Learning the syntax won't take long, as it becomes pretty minimal if you omit those things. Make sure you use an editor that understands your Lisp and has advanced syntax highlighting and auto indent functionality. The difference between a well formatted and highlighted code and a blob of flat text is huge in Lisps, compare this: (define (plot-lines data) (parameterize ([plot-x-tick-label-anchor 'top-right] [plot-x-tick-label-angle 35]) (let ([out-path (build-path (current-directory) "lines.png")] [data (list (tick-grid) (discrete-histogram data #:y-min 0 #:y-max 100))]) (plot data #:y-label "sloc" #:x-label #f #:out-file out-path)))) with the same code properly highlighted: https://klibert.pl/statics/images/rkt-highlighting.png https://klibert.pl/statics/images/rkt-highlighting.png Similarly, don't ever attempt to balance parens manually, your editor should handle this, along with commands for expanding and shrinking particular expresions (for example, change "(message "%s") something" into "(message "%s" something)" with a single keypress) and other goodies. After the groundwork is done, start with control-flow constructs (forms in Lisp parlance): constructs for assignement (define/defvar/setq (but not! setf)/etc.), for branching (if/cond/etc.), for grouping (begin/progn/etc.), for looping/iteration (loop/for/dotimes/etc.) and error handling (with-handlers/condition-case/etc.). Learn basic data constructors (list/vector/hashmap/etc.). Experiment with these in the REPL or write some simple scripts using them. Learn how to define functions/procedures and refactor your scripts to use them. You're basically done at this point. Not in the sense that you know Lisp, but you're ready to learn all there is to Lisp without much hassle. The last obstacle is learning about defmacro and quasiquote/unquote, but that's easy once you're comfortable with lists and iteration. Everything else in most Lisps is built with macros, and at that point you have all the tools needed to write Lisp code, to investigate your Lisp implementation and finally to build your own extensions into the language. I think that most of the difficulty of learning Lisp stems from learning things in wrong order. Lispers naturally want to show you the most powerful language features to distinguish Lisps from other languages, but they already forgot that these features are built on much simpler things. Or, on the other hand, they drift into lambda calculus and Peano numbers, which smells like a Turing tarpit, where nothing of interest is easy to do. Anyway, try learning things in that order, maybe it'll help. It worked for me, after years of approaching Lisp and quickly retreating I was finally able to grok it thanks to this approach. YMMV of course. [EDIT: formatting]