Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Functional languages

Name: Anonymous 2011-12-25 12:14

I want to learn functional programming. What language should I use?

Common Lisp
bigger community and usage, people like Alan Kay or Dijisktra said it opens your mind to higher levels, macros, Stallman recommends it

Haskell
Strong typing, pure functional, less weird syntax

Name: Anonymous 2011-12-25 12:31

U MENA HASKAL

Name: Anonymous 2011-12-25 12:33

Common Lisp isn't really that functional. If you don't want a purely functional language, you should at least go with Scheme.

If you just want to learn functional programming, I would suggest Haskell. Scheme and CL are great for other reasons.

Name: Anonymous 2011-12-25 13:14

>>3
So, between Common Lisp and Scheme, which one should I pick? I've heard that Scheme is basically Lisp with a reduced standard library.

Name: Anonymous 2011-12-25 13:35

Well, learning functional programming can get a bit involved.

The first two chapters of SICP deal with the basics of functional programming, employing Scheme. It's very bare-bones, using only function definitions, variable binding and anonymous functions. You can use those constructs in almost any modern language (yes, that means that Java isn't modern), though poor language design or excessively imperative standard libraries can hinder your use of them.

In Haskell you get a pattern matching, list comprehensions, a nice type system, built-in and fancy ADTs, though at least the first two you can get as libraries in any Lisp dialect. I can't comment much more, I'm still learning from the official tutorial and Learn you a Haskell.

I'd go with Scheme first, and Haskell second, even if it's just to get a taste of a state-of-the-art language.

Name: Anonymous 2011-12-25 13:40

>>5
Scheme is basically Lisp
Well, that's because Scheme is a Lisp. If you meant CL, no, they're like C and Java: similar syntax, completely different languages.

Scheme is cleaner, Common Lisp is ENTERPRISE-QUALITY.

But if you want pure functional programming, choose Haskell, if you don't care about purity, use an ML (are they still a valid choice, right?).
If you want a Lisp, pick whatever. Scheme encourages functional style.

Name: >>6 2011-12-25 13:40

s/5/4/

Name: Anonymous 2011-12-25 14:07

>>6
>>5
I'll try Scheme and read SICP to see if I like it. Thanks guys!

Name: Anonymous 2011-12-25 14:09

>>8
No, you will use Haskell... you WILL.

Name: Anonymous 2011-12-25 14:21

>>9
NO

Name: Anonymous 2011-12-25 15:37

scheme is called racket nowadays.

spread the word.

Name: Anonymous 2011-12-25 16:13

CL isn't really functional, but you can write functional code in it without problems, it just depends on what style you prefer - CL doesn't force you into any particular style, you're free to choose. Scheme tries much harder to make it more likely you end up writing functional code, but doesn't force you either.

Haskell is purely functional.

less weird syntax
Lisp's syntax is fairly simple compared to Haskell's, but Haskell's syntax looks more 'natural'.

You should probably read SICP (which teaches you programming and uses R5RS Scheme, without macros), and eventually try your hand at CL (read Practial Common Lisp if you want a simple introduction with examples). If you end up prefering Scheme and want to use it for more practical programming, you'll end up using some popular implementation like Racket which provides many extensions/libraries. If you end up prefering CL, you can use the wide majority of implementations (such as SBCL, ClozureCL, ECL, CLISP and so on) as they follow the same standard and libraries tend to work interchangably (except those which are highly unportable, but most of them have compatibility layers which allow them to work with most implementations).

You should also learn ML or Haskell as well as they have their own unique lessons to teach which are not obvious in languages which are not staticly typed.

Name: Anonymous 2011-12-25 16:39

>>12
uses R5RS Scheme
It probably is R4RS Scheme.

Name: Anonymous 2011-12-25 23:49

>>1
It really doesn't matter what language you use, to be fair. However, I'll recommend CL, though it isn't really functional. Don't expect your brain to conform to the CL syntax in a day if it has been molded by the curly-brace way of doing things. Give it a week or two.

Read Practical Common Lisp. Reread it - mostly because the chapter organization is pretty strange for a beginner, IMO. Read ANSI CL. Learn to disregard smug Lisp weenie-ism, unless you're into that kind of thing.

Write, write, write.

Name: Anonymous 2011-12-26 1:36

CL is plebish. Try Clojure.

Name: Anonymous 2011-12-26 3:35

>>15
try a language that can't tail recursion

Name: >>12 2011-12-26 5:33

>>16
To be fair to CL, it doesn't force implementations to implement TCO(tail call optimization) in the standard, while Scheme does(to allow removing a lot of imperative constructs from the standard), however in practice most CL implementations do implement TCO, and it's a matter of which style you prefer (more functional or more imperative).

Name: Anonymous 2011-12-26 7:16

Haskellor Erlang

Name: Anonymous 2011-12-26 7:26

>>16

loop/recur seems good enuff

Name: Anonymous 2011-12-26 9:58

>>19
Good enough is the enemy of the better, which is the enemy of the perfect.
Even so, it is not good enough.

Name: Anonymous 2011-12-26 11:20

OP here. I tried SICP but it's too beginner oriented. Then I looked at Practical Common Lisp and I'm finding it quite enjoyable. I'm going to postpone Haskell for now.

So, New Year's resolutions list:
* Finish Practical Common Lisp.
* Write some application using CL.
* Learn some motherfucking Haskell.

Name: Anonymous 2011-12-26 11:29

SICP is not beginner-oriented, you just didn't read past the first damn chapted. I bet you couldn't solve half the exercises in the second half.

Name: >>22 2011-12-26 11:29

(Chapter. Fuck.)

Name: Anonymous 2011-12-26 11:31

>>22
Yes it is. It's for people that are new to programming. Fuck that, I already graduated.

Name: Anonymous 2011-12-26 12:42

>>24

The reason why MIT says SICP is for people who are new to programming is because the entire student body are technical geniuses.

Name: Anonymous 2011-12-26 12:49

>>24
And no one here gives a shit that you graduated from Devry University.

Name: Anonymous 2011-12-26 12:57

>>24
Fuck that, I already graduated.
And you haven't learned a functional PL? What did they teach you, Enterprise Applications in Oracle®'s Java™?

Name: Anonymous 2011-12-26 13:01

>>27
Hey, they teach us Enterprise Applications in Oracle Java here at San Francisco State University! I wanna let you know they we have an army of small no name firms seeking us CS for IT support jobs.

Name: Anonymous 2011-12-26 13:03

>>28
Being a software engineer at Google or Facebook is nothing compared to the following...

 http://cs.sfsu.edu/jobs/job-bulletin.html

Name: Anonymous 2011-12-26 13:11

>>29

if you work at google you will likely be coding java
if you work at facebook you will likely be coding php

Name: Anonymous 2011-12-26 13:47

LISP is great

Name: Anonymous 2011-12-26 14:07

http://cs.sfsu.edu/jobs/job-bulletin.html
That site seems down, has it been overwhelmed by the mighty /prog/ traffic?

Name: Anonymous 2011-12-26 15:42

>>30

from what I've heard google is seeples seeples seeples seeples, with NO EXCEPTIONS except a little bit of python

Name: Anonymous 2011-12-26 16:46

>>33
and Java
and Go
and JS
and Dart!

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List