Functional Programming

I'm interested in functional programming.

I'd really like to read a good book on it. It would have practical stuff
in it, but also cover lots of the neat ideas (through practical
examples), and perhaps areas of open research.

It would be aimed at someone who's very interested in programming, and
does it as their day job, but has not really used a functional language
professionally before.

Ideally it'd be written by Dave Thomas, and would be called "Programming
Functionally: The pragmatic programmers guide" :slight_smile:

Any thoughts on this, or other ways to get in to it would be great (good
blogs, wiki, mail groups, etc).

Thanks,
  Benjohn

benjohn@fysh.org wrote:

I'm interested in functional programming.

I'd really like to read a good book on it. It would have practical stuff
in it, but also cover lots of the neat ideas (through practical
examples), and perhaps areas of open research.

It would be aimed at someone who's very interested in programming, and
does it as their day job, but has not really used a functional language
professionally before.

Ideally it'd be written by Dave Thomas, and would be called "Programming
Functionally: The pragmatic programmers guide" :slight_smile:

Any thoughts on this, or other ways to get in to it would be great (good
blogs, wiki, mail groups, etc).

Thanks,
  Benjohn

The closest thing (and highly recommended) would be the recent Pragmatic
book "Programming Erlang". Erlang is a functional programming language,
it features built-in message-passing concurrency, *and* the book is very
well written. It wasn't *written* by Dave Thomas, but I'm sure he helped
*edit* it. Dave??

If you like Ruby, you may also enjoy Lisp since it influenced Ruby.
I'd recommend "Practical Common Lisp" by Peter Seibel. Or "ANSI Common
Lisp" by Paul Graham. Lastly, the classic "Structure and
Interpretation of Computer Programs" by Abelson and Sussman would be
good.

Or you can just skip the books and simply stop assigning to
variables :wink:

Brian Adkins

···

On Aug 23, 1:32 pm, benj...@fysh.org wrote:

I'm interested in functional programming.

I'd really like to read a good book on it.

haskell.org has tons of resources on the haskell language. there are printed
books but they don't have anything you can't gather yourself from the free
tutorials and online books.

···

On 8/23/07, benjohn@fysh.org <benjohn@fysh.org> wrote:

I'm interested in functional programming.

I'd really like to read a good book on it. It would have practical stuff
in it, but also cover lots of the neat ideas (through practical
examples), and perhaps areas of open research.

It would be aimed at someone who's very interested in programming, and
does it as their day job, but has not really used a functional language
professionally before.

Ideally it'd be written by Dave Thomas, and would be called "Programming
Functionally: The pragmatic programmers guide" :slight_smile:

Any thoughts on this, or other ways to get in to it would be great (good
blogs, wiki, mail groups, etc).

Thanks,
  Benjohn

No offense intended, but I am working through that book right now and I would rate it as "good, but not great" writing. The author explains some things very well and is very knowledgeable about the topic, but he leaves out a bit much in places.

For example, I don't feel he ever properly covers printing a message to the screen. You can figure it out from his examples and the man pages he references, but it would be nice not to need these steps.

That said, I do feel I learned a good deal about functional programming from it and I am glad I read it.

James Edward Gray II

···

On Aug 23, 2007, at 1:22 PM, M. Edward (Ed) Borasky wrote:

The closest thing (and highly recommended) would be the recent Pragmatic
book "Programming Erlang". Erlang is a functional programming language,
it features built-in message-passing concurrency, *and* the book is very
well written.

Thanks (everyone) for your suggestions.

*snip*

Or you can just skip the books and simply stop assigning to
variables :wink:

That's very much my programming style. I wonder if it comes from the
small amount of functional programming that I studied :slight_smile:

I guess what I'm intersted in is the techniques or patterns that come up
in functional programs. Program transformation seems to be something
that gets used a lot, for example... I think the ideal for me would be a
reasonably gentle intro to a language (or perhaps a few - there are
quite a lot of those kinds of tutorials on the web though), and then a
series of article like chapters that cover interesting ways of using the
language.

If you like Ruby, you may also enjoy Lisp since it influenced Ruby.
I'd recommend "Practical Common Lisp" by Peter Seibel.

http://www.gigamonkeys.com/book/

Or "ANSI Common Lisp" by Paul Graham.

http://paulgraham.com/onlisptext.html?asdf

As for me, I'm still sort of trying Lisp. I'm mustn't be old enough cause I just can't acquire a taste for emacs. I find it completely impenetrable and the 'reward' of learning Lisp isn't sufficient for me to endure it. Every now and then, though, I give it another shot.

Erlang though? Two thumbs up.

Cheers,
Dave

Brian Adkins wrote:

If you like Ruby, you may also enjoy Lisp since it influenced Ruby.
I'd recommend "Practical Common Lisp" by Peter Seibel. Or "ANSI Common
Lisp" by Paul Graham. Lastly, the classic "Structure and
Interpretation of Computer Programs" by Abelson and Sussman would be
good.

Or you can just skip the books and simply stop assigning to
variables :wink:

The graveyards are littered with the bones of programmers who thought
they'd never have to use an imperative language again. And there are
dozens -- maybe even hundreds -- of dead functional, single-assignment,
dataflow, block-diagram, and other "nifty" little magic bullet languages.

Functional programming is harder than imperative programming. Recursion
is harder to understand than iteration. Denotational and axiomatic
semantics of programming languages are harder than operational
semantics. And so on.

Anybody here remember SISAL? ID (Irvine Dataflow)? At least Matz
remembered CLU. :slight_smile: I personally think Erlang is the last best hope for
functional programming.

I had that same goal, only I already had chosen Haskell.

After reading a few online tutorials I bought "Programming in Haskell" and I think it is an excellent book. It teaches the basics, to the point, idiomatic Haskell and functional style. I am just learning Haskell so I don't have enough perspective, but my impression so far is that this book is a must-read to learn, you'll be quickly on the right track.

-- fxn

···

On Aug 24, 2007, at 11:01 AM, benjohn@fysh.org wrote:

That's very much my programming style. I wonder if it comes from the
small amount of functional programming that I studied :slight_smile:

I guess what I'm intersted in is the techniques or patterns that come up
in functional programs. Program transformation seems to be something
that gets used a lot, for example... I think the ideal for me would be a
reasonably gentle intro to a language (or perhaps a few - there are
quite a lot of those kinds of tutorials on the web though), and then a
series of article like chapters that cover interesting ways of using the
language.

Well I feel that "Programming Erlang" really is what you are looking,
for. I am not finished with it, but the "gentle introduction" seems to
fit perfectly.
I tried OCaml, Haskell first but I did not find anything like
"Programming Erlang" to walk me into the concepts...

Robert

···

On 8/24/07, benjohn@fysh.org <benjohn@fysh.org> wrote:

Thanks (everyone) for your suggestions.

*snip*

> Or you can just skip the books and simply stop assigning to
> variables :wink:

That's very much my programming style. I wonder if it comes from the
small amount of functional programming that I studied :slight_smile:

I guess what I'm intersted in is the techniques or patterns that come up
in functional programs. Program transformation seems to be something
that gets used a lot, for example... I think the ideal for me would be a
reasonably gentle intro to a language (or perhaps a few - there are
quite a lot of those kinds of tutorials on the web though), and then a
series of article like chapters that cover interesting ways of using the
language.

--
I'm an atheist and that's it. I believe there's nothing we can know
except that we should be kind to each other and do what we can for
other people.
-- Katharine Hepburn

Emacs may have some advantages for Lisp, but it's not required. I use
vim (as does Graham IIRC). Thanks for the pointers to the free books -
I should've mentioned that.

···

On Aug 24, 7:55 am, Sharon Phillips <phillip...@yahoo.co.uk> wrote:

As for me, I'm still sort of trying Lisp. I'm mustn't be old enough
cause I just can't acquire a taste for emacs. I find it completely
impenetrable and the 'reward' of learning Lisp isn't sufficient for
me to endure it. Every now and then, though, I give it another shot.

Cheers,
Dave

Sharon Phillips wrote:

As for me, I'm still sort of trying Lisp. I'm mustn't be old enough
cause I just can't acquire a taste for emacs. I find it completely
impenetrable and the 'reward' of learning Lisp isn't sufficient for me
to endure it. Every now and then, though, I give it another shot.

Yeah, you're right. Lisp and Forth are great old languages, but they
were a lot more fun when they (and we) were younger. :slight_smile: If I hadn't
learned Lisp 1.5 in the 1970s I probably wouldn't attempt it now.

Forth, on the other hand, is something I'd probably learn now if I
didn't already know it. It's an amazing set of concepts that look really
weird until you stare at them long enough. At some point in the process,
you go, "Oh My God -- that's *brilliant*,", at which point you are a
Forth addict. :slight_smile:

I do want to sit down some day with a good Scheme and learn the
internals, though. Speaking of which, a couple of weeks ago, Amazon.ca
accidentally posted a price of $4 (CDN, IIRC) for "Lisp in Small
Pieces". A bunch of folks from some other mailing lists jumped on it,
and of course, Amazon cancelled their orders, although they felt guilty
enough to give the losers a $10 gift certificate. But I ended up getting
a copy at list price and it was well worth it.

Erlang though? Two thumbs up.

Definitely!!

Robert Dober wrote:

Well I feel that "Programming Erlang" really is what you are looking,
for. I am not finished with it, but the "gentle introduction" seems to
fit perfectly.
I tried OCaml, Haskell first but I did not find anything like
"Programming Erlang" to walk me into the concepts...

There is also the problem with Haskell (and OCaml, Prolog, Eiffel, etc.
for that matter) that they are very much academic constructs, rather
than languages honed by real programmers who get paid to write working
software. Erlang is very much a language for real programmers who get
paid to write working software.

I do want to learn a concatenative at some point - any opinions as to
whether I should start with Forth or jump straight to Joy or Factor?

martin

···

On 8/25/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

Forth, on the other hand, is something I'd probably learn now if I
didn't already know it. It's an amazing set of concepts that look really
weird until you stare at them long enough. At some point in the process,
you go, "Oh My God -- that's *brilliant*,", at which point you are a
Forth addict. :slight_smile:

I know it is OT but do you share my POV that from all that old
languages the only one that is still ahead of its time is Smalltalk?
And to come back to the issue, How old is Erlang BTW (I did not find a
historical chapter in my book)?
Cheers
Robert

···

On 8/25/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

Sharon Phillips wrote:
>
> As for me, I'm still sort of trying Lisp. I'm mustn't be old enough
> cause I just can't acquire a taste for emacs. I find it completely
> impenetrable and the 'reward' of learning Lisp isn't sufficient for me
> to endure it. Every now and then, though, I give it another shot.

Yeah, you're right. Lisp and Forth are great old languages, but they
were a lot more fun when they (and we) were younger. :slight_smile: If I hadn't
learned Lisp 1.5 in the 1970s I probably wouldn't attempt it now.

Forth, on the other hand, is something I'd probably learn now if I
didn't already know it. It's an amazing set of concepts that look really
weird until you stare at them long enough. At some point in the process,
you go, "Oh My God -- that's *brilliant*,", at which point you are a
Forth addict. :slight_smile:

I do want to sit down some day with a good Scheme and learn the
internals, though. Speaking of which, a couple of weeks ago, Amazon.ca
accidentally posted a price of $4 (CDN, IIRC) for "Lisp in Small
Pieces". A bunch of folks from some other mailing lists jumped on it,
and of course, Amazon cancelled their orders, although they felt guilty
enough to give the losers a $10 gift certificate. But I ended up getting
a copy at list price and it was well worth it.

> Erlang though? Two thumbs up.

Definitely!!

--
I'm an atheist and that's it. I believe there's nothing we can know
except that we should be kind to each other and do what we can for
other people.
-- Katharine Hepburn

Martin DeMello wrote:

Forth, on the other hand, is something I'd probably learn now if I
didn't already know it. It's an amazing set of concepts that look really
weird until you stare at them long enough. At some point in the process,
you go, "Oh My God -- that's *brilliant*,", at which point you are a
Forth addict. :slight_smile:

I do want to learn a concatenative at some point - any opinions as to
whether I should start with Forth or jump straight to Joy or Factor?

martin

I guess it depends on what you want to do with it. I only briefly looked
at Joy and haven't even heard of Factor until just now. Joy struck me as
an "academicized" Forth, which I think is a "bad" thing. Forth itself
has a current ANS standard and a working committee building a new
standard, at least two commercial vendors and dozens of open-source
implementations. People actually get paid to write Forth.

I would start with GNU Forth (gforth). It's available in most Linux
distros and should run anywhere GCC runs. It does have a GCC dependency,
which might be an issue on Macs or Solaris. I don't have either so I
can't answer that -- it runs very well on Linux and Windows.

···

On 8/25/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote:

Robert Dober wrote:

I know it is OT but do you share my POV that from all that old
languages the only one that is still ahead of its time is Smalltalk?

Lisp is always ahead of its time, because it is always being reinvented.

···

--
       vjoel : Joel VanderWerf : path berkeley edu : 510 665 3407

Robert Dober wrote:
> I know it is OT but do you share my POV that from all that old

languages the only one that is still ahead of its time is Smalltalk?
And to come back to the issue, How old is Erlang BTW (I did not find a
historical chapter in my book)?
Cheers
Robert

Well, I think the Lispniks would claim that Smalltalk is a dialect of
Lisp. :slight_smile: But seriously, Smalltalk is certainly not as "old" as Fortran,
Lisp, or C. Nor is it the first "object-oriented" language -- that honor
probably belongs to Simula, a dialect of Algol.

Smalltalk represents a convergence of a number of concepts, including
"everything is an object", model-view-controller architectures, actors,
graphical user interfaces, and many others. But I don't think Smalltalk
was ever "ahead of its time."

I don't really think the concept of "ahead of its time" has any meaning
where programming languages are concerned. Programming languages are in
a very real sense living creatures -- they are born, they evolve, they
cross-breed, and sometimes die.

But I can only think of a few languages that have actually died, in the
sense that they haven't evolved into something in use today. SLIP and
the IPL family of languages, with a "target market" similar to that of
Lisp, died out. COMIT and SNOBOL, string processing languages, more or
less died out, although their successor, regular expressions, is about
as vital as anything can be.

And a fair number of Algol dialects -- JOVIAL, NELIAC, Algol 68 -- were
dead-end paths off the main Algol line, today represented by C/C++/C#
and Java. Just off the top of my head, I can't think of any others that
literally disappeared from the face of the Earth.

The primary compiler for Macs is gcc.

James Edward Gray II

···

On Aug 25, 2007, at 2:06 PM, M. Edward (Ed) Borasky wrote:

It does have a GCC dependency,
which might be an issue on Macs or Solaris. I don't have either so I
can't answer that -- it runs very well on Linux and Windows.

Martin DeMello wrote:

Forth, on the other hand, is something I'd probably learn now if I
didn't already know it. It's an amazing set of concepts that look really
weird until you stare at them long enough. At some point in the process,
you go, "Oh My God -- that's *brilliant*,", at which point you are a
Forth addict. :slight_smile:

I do want to learn a concatenative at some point - any opinions as to
whether I should start with Forth or jump straight to Joy or Factor?

I guess it depends on what you want to do with it. I only briefly looked
at Joy and haven't even heard of Factor until just now. Joy struck me as
an "academicized" Forth, which I think is a "bad" thing. Forth itself
has a current ANS standard and a working committee building a new
standard, at least two commercial vendors and dozens of open-source
implementations. People actually get paid to write Forth.

Yay! I used to get paid to write Forth. :smiley: It was my favorite
language for many years.

This looks like a pretty nice explanation of how Forth works:
http://dec.bournemouth.ac.uk/forth/forth.html

I wrote a for-fun Forth interpreter in Perl a few years back:
http://tastyspleen.net/~billk/pforth/

Just stumbled on this link--kind of interesting, Forth code to
add object oriented defining methods to Forth: (classes with
inheritance... although the numbers used to link message names
to corresponding methods seems kinda clunky...)
http://www-personal.umich.edu/~williams/archive/forth/peters/ooPocketForth.txt

I've thought on occasion it might be neat to submit a ruby quiz
sometime, where the goal is to write, in ruby, the core of a Forth interpreter/compiler, such that the rest of the language
(provided with the quiz) can bootstrap itself.

I think it's kind of one of those potential "ah ha!" moments
when one realizes how simple a Forth interpreter/compiler loop
can actually be.

I'd probably get back into Forth if I were doing small embedded systems programming. But Forth doesn't go out of
its way to do complex things behind the scenes to help the
programmer the way Ruby does. (Fixnum -> Bignum automatic
conversion being one example... Dynamic memory allocation
with garbage collection being another...)

Ultimately I ended up feeling that while Forth's simplicity
is one of its key strengths in a context like embedded
systems, its simplicity ends up being more of a liability
when programing large applications.

But when you need to get an interpreter, compiler,
I/O subsystem, and editor in a few Kbytes of memory--Forth
is truly amazing.

Regards,

Bill

···

From: "M. Edward (Ed) Borasky" <znmeb@cesmail.net>

On 8/25/07, M. Edward (Ed) Borasky <znmeb@cesmail.net> wrote: