Scheme and Common Lisp

Started by
12 comments, last by CoffeeMug 14 years, 3 months ago
Quote:Original post by Daerax
Did I slip?


I never I studied category theory so I'm probably wrong but I read it some where can't remember now. Sorry for making your write all of that, all I know is the generalization of a fold has this fancy name ;)
Advertisement
Aside: "pure" can be used as an adverb, so "pure functional language" is grammatical.

Quote:Original post by snk_kid
I have not read the entire thread but I read your first post a number of times and one thing is clear to me you have conflicting & contradictory goals.

On the one hand you want to learn functional programming, on the other hand you want to write nontrivial programs and you're concerned about libraries even though you said you are worried about libraries being a "crutch" to you. You are also coming off as you are trying to run before learning how to walk.

The best way to learn is to *do*, and that means writing real programs. My concerns about "libraries being crutches" was specifically for the Java and .NET libraries, which were designed and developed with statically, explicitly typed, object oriented languages in mind. The quickest way to learn a new spoken language is to live in the language. I think it's the same way with programming languages.

But writing real programs means using real libraries. I don't want to spend time learning -- for example -- Arc's libraries if nobody gives a shit about Arc.
Quote:
I'm going to give you a virtual wake up slap and say to you get your priorities straight and focus. Your original goal is to learn functional programming and FP is not about libraries. It seems like you haven't quite grasped what (purely**) functional programming actually is about because it has nothing to do with imperative loops.

In purely functional programming there are no imperative loops (no for, while, etc), no mutable variables, there are no (implicit) side-effects. All you have is values & bindings, (anonymous) functions & abstract functions (which are values too but are not procedures/commands/actions), function application & composition, and most importantly recursion and patterns of recursion (or the recursive operators). Every function input always has the same output for every application of the function, this important property of FP here is known as referential transparency, no hidden side-effects when you're looking at an expression and it is much easier to reason about correctness and to apply equational reasoning. Anyways if you do not know what or how to write or the important properties of the abstract function called fold (and the generalization of a fold called catamorphism (meaning a natural transformation)) then you probably do not understand what FP is really about.

As I said before, to learn a language fully, to get to the point of thinking in that language, one has to live in that language. I know what purely functional programming means, I know what the core tenets are about. I haven't lived in FP in order to be able to *think* in FP, and that is the issue.

I know how to teach myself, I've been to this dance before, I don't need "wake up slaps". Telastyn, Sneftel, and elibarzilay told me what I needed to hear.

[Formerly "capn_midnight". See some of my projects. Find me on twitter tumblr G+ Github.]

Honestly, just use Haskell. It's the most widely used, heavily supported purely functional language that exists. It's got a massive user base. It's got library support coming out of its ears. Non-trivial programs are written in it all the time (Most of GHC, the primary haskell compiler, is written in Haskell).
Quote:Original post by cache_hit
Honestly, just use Haskell.

Haskell and Common Lisp are totally different beasts, and IMO both are well worth learning. I don't use either in my daily work anymore, but each one has made me a better programmer, in different ways.

Haskell forces you to learn what functional programming really is about at its core (the whole lambda calculus and typed lambda calculus business, along with currying, higher order functions, and all that good stuff). It also forces you to learn how to deal with state properly, and how to think of code in terms of data and operations on that data (instead of objects).

Common Lisp teaches totally different things. It teaches you how to think of code and data interchangeably, and how to think of and perform compile time programming for really useful things. It teaches you what truly dynamic programs are like (arguably beyond any other language available today). It also teaches you amazing things about software development with the meta-object protocol stuff, and how to think of OOP in terms of multimethods.

I don't have specific advice, just meta-advice. It's really not that hard - it's only hard because it's foreign. Keep at it, and after a while it will become second nature. Remember that if something seems "stupid", it's because of the unfamiliarity. Some really smart people have spent many years to make this stuff happen, so don't just brush it off.

The time investment is well worth it but ultimately these aren't "holy" topics, it's just knowledge. In retrospect I'm not sure if this is a better investment of time than learning, say, statistics, or *really* understanding calculus (as in reading Newton's and Leibniz's original papers), or working your way through The Road To Reality (I still haven't done these three things, they're on my New Year's resolutions list for the next three years). But hey, you gotta start somewhere...

This topic is closed to new replies.

Advertisement