Home > Archive > Functional > June 2007 > What language would you use for teaching functional programming?
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
What language would you use for teaching functional programming?
|
|
| arcadiorubiogarcia@gmail.com 2007-05-26, 10:06 pm |
| Hi,
I am about to teach a functional programming course. I would like to
hear your opinions about which language would you use.
In particular I am interested in finding a language that allows my
students to develop a real-world project in the second part of the
course. Therefore, things such as documentation, library availability,
tools, etc. have its importance.
I'm already inclined towards OCaml, but don't let it bias your
answers.
Thanks,
A. Rubio
| |
| Pascal Costanza 2007-05-26, 10:06 pm |
| arcadiorubiogarcia@gmail.com wrote:
> Hi,
>
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
For Common Lisp, the following two books are recommended:
- http://www.gigamonkeys.com/book/
- http://www.norvig.com/paip.html
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
| |
| arcadiorubiogarcia@gmail.com 2007-05-26, 10:06 pm |
| > For Common Lisp, the following two books are recommended:
>
> -http://www.gigamonkeys.com/book/
> -http://www.norvig.com/paip.html
>
> Pascal
>
Yes, I own both of them. They are superb. I would add to the list:
- http://www.cs.cmu.edu/afs/cs.cmu.ed...Book/index.html
- http://www.paulgraham.com/onlisptext.html
However, what drives me out of Common Lisp are the somehow poor IDEs
available, the overwhelming size of the standard libraries and the
complexity of CLOS.
| |
| Chris Smith 2007-05-26, 10:06 pm |
| <arcadiorubiogarcia@gmail.com> wrote:
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
Teaching to whom?
Teaching for what reasons?
Teaching for how long and what expected workload?
If you're trying to get people up to speed in a particular environment,
then you should look at what that environment is doing. If your goal is
more general education about programming language ideas and concepts,
I'd start by considering intended scope and effort/time by students.
If that value is low, you're looking for a simple language to get across
the core functional programming ideas quickly; and it'll be hard to beat
Scheme. If that value is very high, then it'd be hard to beat Haskell,
which really intersects practically all interesting programming language
design issues and makes them clearly visible. For something in the
middle -- not insanely hard to learn, but still not punting on all the
significant modern language design issues -- something in the ML family
may be nice.
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
So depending on your definition of "real-world", this impact the
decision in various ways. If you mean that students will deal with
significant complexity in the problem itself, then this saps your time
for teaching language ideas, so you'd probably avoid the high end of the
effort/scope scale, then. At the same time, if you have the time, many
of the more interesting language concepts would be better expressed in
the context of a larger, more complex project.
Yes, that is a poor answer. I'm of the opinion that given the
information you've provided, it would be hard to be more specific.
--
Chris Smith
| |
| Pascal Costanza 2007-05-26, 10:06 pm |
| arcadiorubiogarcia@gmail.com wrote:
>
> Yes, I own both of them. They are superb. I would add to the list:
>
> - http://www.cs.cmu.edu/afs/cs.cmu.ed...Book/index.html
> - http://www.paulgraham.com/onlisptext.html
>
> However, what drives me out of Common Lisp are the somehow poor IDEs
> available, the overwhelming size of the standard libraries and the
> complexity of CLOS.
For IDEs, you should definitely check out the commercial offerings. The
IDEs for Allegro Common Lisp, Corman Lisp, Macintosh Common Lisp, and
especially LispWorks are excellent. Emacs + SLIME is also pretty widely
used, and people seem to be quite happy with that combination
(especially Aquamacs is an adaptation of Emacs that pretty much makes it
work like a regular Mac OS X application).
The overwhelming size of the standard libraries is a pretty subjective
thing. Some find them too small. ;) Most importantly, you can ignore
many of them, especially in a teaching setting.
Same goes for CLOS: Although CLOS seems pretty much overweight from a
superficial point of view, it's pretty straightforward to use, because
you typically only use third, or so, of the features in practice. The
rest is special-case functionality that's only useful in marginal cases
(but when they occur, these features are extremely valuable).
A good strategy is probably to start with a subset. ISLISP is (more or
less) a subset of Common Lisp - what you learn in the former can be used
mostly unchanged in the latter. The specification of ISLISP is about 130
pages (that's less than R6RS Scheme ;).
For more information about ISLISP, see http://islisp.info/ and for an
implementation of ISLISP, see http://www.eligis.com/
I hope this helps.
Cheers,
Pascal
--
My website: http://p-cos.net
Common Lisp Document Repository: http://cdr.eurolisp.org
Closer to MOP & ContextL: http://common-lisp.net/project/closer/
| |
| Jon Harrop 2007-05-26, 10:06 pm |
| arcadiorubiogarcia@gmail.com wrote:
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
Provided your real-world project doesn't require concurrency or a GUI, OCaml
should be fine.
--
Dr Jon D Harrop, Flying Frog Consultancy
The F#.NET Journal
http://www.ffconsultancy.com/produc...journal/?usenet
| |
| Griff 2007-05-26, 10:06 pm |
| Scheme. Use the PLT distribution as it includes plenty of libraries.
Also go here:
http://www.teach-scheme.org/Overview/
for a great book and a great IDE.
On May 26, 11:35 am, arcadiorubiogar...@gmail.com wrote:
> Hi,
>
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
>
> I'm already inclined towards OCaml, but don't let it bias your
> answers.
>
> Thanks,
>
> A. Rubio
| |
| Arved Sandstrom 2007-05-26, 10:06 pm |
| <arcadiorubiogarcia@gmail.com> wrote in message
news:1180197322.769430.58950@h2g2000hsg.googlegroups.com...
> Hi,
>
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
>
> I'm already inclined towards OCaml, but don't let it bias your
> answers.
>
> Thanks,
>
> A. Rubio
Speaking as a student, because I am one - I am self-teaching functional
languages - I think I would like to see Haskell, F# or OCaml, and Scheme.
Teach the one primarily, but introduce the other two.
AHS
| |
| Simon Richard Clarkstone 2007-05-26, 10:06 pm |
| Arved Sandstrom wrote:
> <arcadiorubiogarcia@gmail.com> wrote in message
> news:1180197322.769430.58950@h2g2000hsg.googlegroups.com...
>
>
> Speaking as a student, because I am one - I am self-teaching functional
> languages - I think I would like to see Haskell, F# or OCaml, and Scheme.
>
> Teach the one primarily, but introduce the other two.
(The second person in this piece refers to the original poster.)
Note that I do not know much about OCaml and F#; I have read online
tutorials but not actually programmed anything in them. My opinions
will be biased by this.
IMO Haskell would make the best *contrast* to Scheme (within functional
languages) being the most fiercely pure and of the three and the most
unusual. Concepts like laziness, typeclasses, *full* type inference,
kinds, monads, purity, etc are (IMO) probably more natural to use in
Haskell than F# or OCaml, because they are built in.
In Haskell (unlike the others) you don't get much idea of how
(especially) laziness works, because it is built in. OTOH, you can use
analogous arguments for teaching OO in C or ASM rather than Java or
Smalltalk (and presumably some places *do*).
I was taught a little Haskell, and the main project we were given was
the modification of a provided engine that read a newsgroup, analysed
it, and emitted a webpage; we had to add more forms of analysis. This
is the sort of thing that Haskell is good at:
* Its networking libraries are quite ample for the task
* Algebraic datatypes and Haskell syntax are suited to generating
webpages (using the module Text.Html)
* A circular definition was the core of part of the analysis: turning
a collection of newsgroup posts into an explicit tree
I would suggest choosing a task suited to Haskell: a data-analysis
program might be good, as above, or anything else that does some simple
inputting, lots of complicated processing, then some simple output, such
as a compiler or interpreter. (To avoid having to teach the language
being compiled/interpreted as well, you could make it a Scheme
compiler/interpreter; that also removes some bits like parsing and
lexing, which you may want.)
--
Simon Richard Clarkstone:
s.r.cl?rkst?n?@durham.ac.uk/s?m?n.cl?rkst?n?@hotmail.com
"August 9 - I just made my signature file. Its only 6 pages long.
I will have to work on it some more." -- _Diary of an AOL User_
| |
|
| On May 26, 10:16 am, arcadiorubiogar...@gmail.com wrote:
> However, what drives me out of Common Lisp are the somehow poor IDEs
> available, the overwhelming size of the standard libraries and the
> complexity of CLOS.
There's some value in making it possible for your students to do the
whole thing in plain ol' emacs on a school account over ssh. There's
no telling what they'll have on their home computers -- if the
projects are kept on a school server, then students can work from an
on-campus computer lab or from home, and there's less concern about
getting set up with a new programming environment. Just ensure your
students have accounts on the school system, and you'll eliminate a
lot of potential excuses for why a project wasn't submitted on time.
OCaml isn't a bad idea, but if this is an introductory class, why not
some variant of Scheme? You'll spend less time teaching the syntax of
the language, and motivated students will eventually find OCaml and
Haskell on their own or in later courses.
| |
| Christopher Diggins 2007-05-27, 10:13 pm |
| On May 26, 9:35 am, arcadiorubiogar...@gmail.com wrote:
> Hi,
>
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
>
> I'm already inclined towards OCaml, but don't let it bias your
> answers.
>
> Thanks,
>
> A. Rubio
If you don't mind me suggesting my own language, I designed the Cat
programming language (http://www.cat-language.com) with the hope that
it would be useful for teaching functional programming concepts. It is
a new language however, so tool support is limited, but you would have
an enthusiastic developer at your disposal. :-)
Christopher Diggins
| |
| Torben Ęgidius Mogensen 2007-05-29, 4:17 am |
| arcadiorubiogarcia@gmail.com writes:
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
>
> I'm already inclined towards OCaml, but don't let it bias your
> answers.
If the course is "introductory programming using a functional
language", i.e., for people who have never programmed before, either
Scheme or SML would be good choices. Both have a selection of
compilers available and there are good introduction-level textbooks
for both.
Both scale well to serious applications, so that should be no
hindrance.
If you want to teach functional programming to people who already know
programming i languages like C or Java, choose Haskell. It is a
somewhat steep step for beginners, but for showing programmers how
things can be done differently and more elegantly than they are used
to, it is hard to beat. That doesn't mean I say Haskell is superior
to SML or Scheme -- I like the module system of SML and the simplicity
of both (compared to SML or Scheme, Haskell is HUGE).
Torben
| |
|
| On May 26, 9:35 am, arcadiorubiogar...@gmail.com wrote:
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
>
For teaching a functional programming course with a real-world project
component you might want to try CAL.
CAL is a lazy, strongly-typed functional language targeting the JVM
and available at: http://labs.businessobjects.com/cal/
CAL was open sourced in 2007 under the BSD license. It is a mature
system, in use internally at Business Object and under development
since 2000.
In terms of creating interesting real-world projects: using CAL one
can easily access any Java class, method, field etc. Thus, it is
possible to create cross-platform projects that incorporate polished
UI, make use of mature Java libraries, etc. The results can be
distributed to others as a set of JARs.
There is quite a lot of language documentation, both for the beginner
and the intermediate CAL programmer. There are introductory videos for
those who like that sort of thing. The libraries included with CAL are
generally fairly well documented with CALDoc (similar to Javadoc).
Here is some sample CAL syntax: http://resources.businessobjects.com/labs/cal/sql.html
The features are similar to Haskell and so students can learn about
laziness, type inference, parametric polymorphism, type classes,
algebraic data types etc. If you need a textbook, you can use
something like Simon Thompson's The Craft of Functional Programming.
We've used this book a lot at Business Objects internally and it is
easy for people to learn to convert this sort of Haskell code to CAL
on inspection, even from the beginning.
For editing the language in an IDE there is an Eclipse plug-in with
various features like syntax highlighting, navigation, tooltips, error
reporting, refactoring support etc.
There is also the Gem Cutter, a visual programming tool that generates
CAL functions. It is a handy way for students to learn functional
concepts (such as type inference, specialization, using higher order
functions etc) without being bogged down by syntax.
Bo
| |
|
| On May 29, 2:34 am, torb...@app-1.diku.dk (Torben =C6gidius Mogensen)
wrote:
> arcadiorubiogar...@gmail.com writes:
>
>
>
> If the course is "introductory programming using a functional
> language", i.e., for people who have never programmed before, either
> Scheme or SML would be good choices. Both have a selection of
> compilers available and there are good introduction-level textbooks
> for both.
>
> Both scale well to serious applications, so that should be no
> hindrance.
>
> If you want to teach functional programming to people who already know
> programming i languages like C or Java, choose Haskell. It is a
> somewhat steep step for beginners, but for showing programmers how
> things can be done differently and more elegantly than they are used
> to, it is hard to beat. That doesn't mean I say Haskell is superior
> to SML or Scheme -- I like the module system of SML and the simplicity
> of both (compared to SML or Scheme, Haskell is HUGE).
>
> Torben
I started with Scheme because it is small, compared to Common Lisp at
least.
If it turns out that you like Scheme and want to start using it for
implementing "things",
you find that there are plenty of libraries, tools, and resources
available to Scheme that
quickly turn it into a "big" language.
| |
| Martin Bishop 2007-06-13, 10:05 pm |
| The choices for Scheme should be obvious: SICP and/or HTDP, along with
DrScheme if you need a good IDE.
arcadiorubiogarcia@gmail.com wrote:
> Hi,
>
> I am about to teach a functional programming course. I would like to
> hear your opinions about which language would you use.
>
> In particular I am interested in finding a language that allows my
> students to develop a real-world project in the second part of the
> course. Therefore, things such as documentation, library availability,
> tools, etc. have its importance.
>
> I'm already inclined towards OCaml, but don't let it bias your
> answers.
>
>
> Thanks,
>
> A. Rubio
>
|
|
|
|
|