OT: Functional Language Recommendation

Sorry for the OT post, but I need some advise from some like-minded
folks who appreciate the finer gems in life :wink:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or
both of them.

Areas I’m interested in:

  • databases access (Mysql, PostgreSQL, Oracle)
  • network access (sockets, HTTP, SMTP, etc.)
  • operating system access (shared mem, etc.)
  • GUI widgets access (Qt, Gtk+, Fox, etc.)
  • web access (Apache module?)
  • object-orientedness

TIA.

···


Wai-Sun “Squidster” Chia
Consulting & Integration
Linux/Unix/Web Developer Dude
"Just Another Ruby Miner"

^^^ you won’t need that in a FP language :slight_smile:

I’d look at scheme (scsh e.g.), too, before you decide for one.

My ocaml programming experience still is limited, am just starting,
though I have to say that it’s quite frustrating sometimes to get
your types right :slight_smile:

-Martin

···

On Wed, Dec 18, 2002 at 12:11:56AM +0900, Wai-Sun Chia wrote:

Sorry for the OT post, but I need some advise from some like-minded
folks who appreciate the finer gems in life :wink:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or
both of them.

Areas I’m interested in:

  • databases access (Mysql, PostgreSQL, Oracle)
  • network access (sockets, HTTP, SMTP, etc.)
  • operating system access (shared mem, etc.)
  • GUI widgets access (Qt, Gtk+, Fox, etc.)
  • web access (Apache module?)
  • object-orientedness

Wai-Sun Chia waisun.chia@hp.com writes:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or
both of them.

Areas I’m interested in:

  • databases access (Mysql, PostgreSQL, Oracle)
  • network access (sockets, HTTP, SMTP, etc.)
  • operating system access (shared mem, etc.)
  • GUI widgets access (Qt, Gtk+, Fox, etc.)
  • web access (Apache module?)
  • object-orientedness

If you are studying a language in order to actually do something
concrete with it (which it seems you are) as opposed to learning more
theoretically about how to express programs in a functional way, I’d
recommend Ocaml. Haskell is really beautiful and elegant but it can
take more effort to write real-world apps because everything must be
expressed purely functionally. Ocaml allows you to write in an
imperative/side-effect style when you need it.

I don’t know which of your interests are specifically supported, but
there are a lot of libraries out there; do a search on ‘caml hump’.

There’s a pretty good book online, DEVELOPING APPLICATIONS WITH
OBJECTIVE CAML, at http://caml.inria.fr/oreilly-book/.

If you decide to learn Haskell instead (or in addition), I highly
recommend Paul Hudak’s THE HASKELL SCHOOL OF EXPRESSION.

Dan

···


http://www.dfan.org

I second the notion of scheme. MzScheme / DrScheme are clean, beautiful,
simple, and have libraries that cover database access, network access, guis,
etc. I believe MzScheme can be compiled to native executables, but i may be
mistaken about that.

Oh, and you can use “The Structure and Interpretation of Computer Programs”
as your scheme text (google it for an online version)… often considered to
be the finest book on the art and science of compter programming bar none.

I write tcl code in a quasi-functional style, but that’s just me.

Jake

“Wai-Sun Chia” waisun.chia@hp.com wrote in message
news:3DFF3E53.1030305@hp.com

···

Sorry for the OT post, but I need some advise from some like-minded
folks who appreciate the finer gems in life :wink:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or
both of them.

Areas I’m interested in:

  • databases access (Mysql, PostgreSQL, Oracle)
  • network access (sockets, HTTP, SMTP, etc.)
  • operating system access (shared mem, etc.)
  • GUI widgets access (Qt, Gtk+, Fox, etc.)
  • web access (Apache module?)
  • object-orientedness

TIA.


Wai-Sun “Squidster” Chia
Consulting & Integration
Linux/Unix/Web Developer Dude
“Just Another Ruby Miner”

“Wai-Sun Chia” waisun.chia@hp.com wrote in message
news:3DFF3E53.1030305@hp.com

Sorry for the OT post, but I need some advise from some like-minded
folks who appreciate the finer gems in life :wink:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or
both of them.

If you are interested in the language as such, there are many choices. If
you are interested in practical applications with multiple OS support, it
narrows down a bit.

LISP and variants are dynamically typed eagerly evaluated languages - not
very portably between Windows / Unix, at least not without paying big bucks.
Clean, Haskell are lazily evaluated statically typed functional languages.
Clean works very well on Windows. Haskell works well on several platforms
and has shown good ability to interoperate, for instance with COM on
windows. However, if for no other reason, I can’t live with a slow huge Perl
startup script as in the GHC compiler - it is officially tagged as research
project.
The ML family are eagerly evaluated statically typed functional languages.
They deduce type info so they are easy to type like LISP and Ruby even with
the type information.

Personally I have chosen OCaml because I need a language that is cross
platform and useful in real life. Few languages come close to this language
in implementation quality. Clean is also interesting, but is effectively
Windows only. I also considered eager versus lazy evaluation. I found the in
real life you mostly don’t need that pretty fancy things you can do with
lazy evaluation - and when you do need it, it is available in OCaml via lazy
streams. Lazy evaluation makes it difficult to predict runtime efficiency
and often especially newcomers have difficulties figuring out why a two-line
program takes 15 minutes to execute and consume all memory. One of the most
useful features of lazy evalutions are combinator parsers - but they are
very difficult to get to perform efficiently, although the can work magic.
Lisp and variants (such as Dylan) are interesting, but you don’t get any
cheap compiler (or, I guess, expensive for that matter) with same qualities
as the OCaml compiler. I would give Dylan a second look though - it may be
the definitive Ruby / Functional bridging language, dynamic and static
language as you desire.

In conclusion, there are really many good choices with good implementations
around - but if you seek a power language to replace C++, I’d say the choice
would be OCaml. With OCaml you can build a 200K standalone executable or a
much smaller cross platform bytecode program that requires a reasonably
sized runtime dll. You can link with .lib, .c and .obj files as you like.

Mikkel

Hello Wai-Sun,

Tuesday, December 17, 2002, 6:11:56 PM, you wrote:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell.

afaik, ocaml is interesting as strong-typed and fast FP language,
Haskell as pure FPL, and Erlang as easy to learn and use FPL

···


Best regards,
Bulat mailto:bulatz@integ.ru

Dan Schmidt dfan@dfan.org writes:

Wai-Sun Chia waisun.chia@hp.com writes:

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d

I’d recommend Ocaml. Haskell is really beautiful and elegant but it
can

Has LISP really been relegated for language archival? :frowning:
Thus, I’d recommend LISP. I know, I know, I’m a dying minority
here. But I couldn’t let such a beatiful language get passed over by
the younger ones. :slight_smile:

YS

Martin Weber Ephaeton@gmx.net wrote in message news:20021217154725.GC5693@phaeton.entropie.net

languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or

I’d look at scheme (scsh e.g.), too, before you decide for one.

I’ve no experience with Ocaml, little with Haskell, and a moderate
amount with Scheme. I’d choose Haskell over Scheme; Haskell’s typing
is sometimes irritating in that it adds an additional level of
complexity and confusion for beginners, but Scheme’s notation, IMHO,
is a heavyweight source of irritation that overrides any other
concerns.

To quote the old joke:

The C programmer is found runnig down the hall waving a stack of
printout saying “I’ll bet you can’t guess what this does!”

The Ada programmer is found in a corner, bent over an Ada manual,
trying to figure out if it is legal to add two Integers.

The Scheme programmer is found hunched 2 inches from his monitor
mumbling: “97, 98, 99… damn, where’s that missing parenthesis??”

(In the original, it was probably a Lisp programmer in place of the
Scheme programmer…)

“Dan Schmidt” dfan@dfan.org wrote in message

Haskell is really beautiful and elegant but it can
take more effort to write real-world apps because everything must be
expressed purely functionally.

For this reason alone (takes more effort to write) , I have always wondered
why Haskell has been endorsed as the language of the year at PragProg. I
would have thought O’Caml would be more “pragmmatic” in that sense.

Unless, of course, O’Caml has already been covered in the past.

Hi.

I’m planning to study a functional language in the comming year (new
year’s resolution, as I have zero experience/knowledge on functional
languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or
both of them.

I like the HUGS system, which is a nice way to learn Haskell. I agree
with Martin that if you want to go the pragmatic route, then OCaml
would be better.

My own experience is that both are “under-cooked” when it comes to some
of the items you mentioned, certainly compared to Ruby. In my case I
was looking for a telnet client and multi-database access (Oracle and
MSSQL) so I ended up with ruby :wink:

If you wish to explore functional languages, then one that I have just
found is called Joy.

     http://www.latrobe.edu.au/philosophy/phimvt/joy.html

Imagine a purely-functional FORTH and you get the idea.

-mark.

···

At 12:47 AM 12/18/2002 +0900, Martin wrote:

On Wed, Dec 18, 2002 at 12:11:56AM +0900, Wai-Sun Chia wrote:

Or he just hits ‘%’ in vi or the moral equivalent in his editor. Editors
are there to help you, remember ? I think the lisp syntax is the most
easy and plain there is out there (maybe aside from forth ? :slight_smile: There
is one rule with some exceptions, one preference rule, that’s it,
period. It can’t get any easier. It’s much harder to remember preference
tables a la C (wait, = before or after || ?) than to remember the whole
lisp syntax rules.

But well, it’s on Sean to choose.

-Martin

···

On Wed, Dec 18, 2002 at 05:46:56AM +0900, Sean Russell wrote:

Martin Weber Ephaeton@gmx.net wrote in message news:20021217154725.GC5693@phaeton.entropie.net

languages) and have narrowed it down to either Ocaml and Haskell. It’d
be great if any of you could share your experiences with either one or

I’d look at scheme (scsh e.g.), too, before you decide for one.

I’ve no experience with Ocaml, little with Haskell, and a moderate
amount with Scheme. I’d choose Haskell over Scheme; Haskell’s typing
is sometimes irritating in that it adds an additional level of
complexity and confusion for beginners, but Scheme’s notation, IMHO,
is a heavyweight source of irritation that overrides any other
concerns.

To quote the old joke:

The C programmer is found runnig down the hall waving a stack of
printout saying “I’ll bet you can’t guess what this does!”

The Ada programmer is found in a corner, bent over an Ada manual,
trying to figure out if it is legal to add two Integers.

The Scheme programmer is found hunched 2 inches from his monitor
mumbling: “97, 98, 99… damn, where’s that missing parenthesis??”

ser@germane-software.com (Sean Russell) writes:

[…]

…but Scheme’s notation, IMHO, is a heavyweight source of
irritation that overrides any other concerns.

With the exception of emacs users, where the editor helps out quite a
lot. (there are some nice emacs modes for Ocaml too, where the
indentation the mode produces can sometimes be a helpful clue about
syntax errors).

[…]

The Scheme programmer is found hunched 2 inches from his monitor
mumbling: “97, 98, 99… damn, where’s that missing parenthesis??”

That’s just

Meta-<
Meta-Ctrl-f

until you don’t end up on a (define…).

Hi –

“Dan Schmidt” dfan@dfan.org wrote in message

Haskell is really beautiful and elegant but it can
take more effort to write real-world apps because everything must be
expressed purely functionally.

For this reason alone (takes more effort to write) , I have always wondered
why Haskell has been endorsed as the language of the year at PragProg. I
would have thought O’Caml would be more “pragmmatic” in that sense.

It’s not exactly an endorsement; “Language of the Year” isn’t an award
or anything like that, it’s just a language-learning initiative. The
reason Haskell was chosen is that the people who started up the
“Language of the Year” project (me and Chad Fowler) wanted to learn
Haskell :slight_smile: The whole thing is based on an idea by the PragProgs, who
also offered to host the project.

David

···

On Wed, 18 Dec 2002, Shashank Date wrote:


David Alan Black
home: dblack@candle.superlink.net
work: blackdav@shu.edu
Web: http://pirate.shu.edu/~blackdav

Hello Yohanes,

Tuesday, December 17, 2002, 8:43:49 PM, you wrote:

Has LISP really been relegated for language archival? :frowning:
Thus, I’d recommend LISP. I know, I know, I’m a dying minority
here. But I couldn’t let such a beatiful language get passed over by
the younger ones. :slight_smile:

languages like womens - small is beatiful :slight_smile:

···


Best regards,
Bulat mailto:bulatz@integ.ru

Shashank Date wrote:

“Dan Schmidt” dfan@dfan.org wrote in message

Haskell is really beautiful and elegant but it can
take more effort to write real-world apps because everything must be
expressed purely functionally.

For this reason alone (takes more effort to write) , I have always
wondered why Haskell has been endorsed as the language of the year at
PragProg. I would have thought O’Caml would be more “pragmmatic” in
that sense.

If I’m not mistaken, the point of choosing Haskell as the LotY was
exactly that it is a purely functional language.

If the choice of language had to be pragmatic in itself, we’d probably
end up with Perl/Python/Ruby/Java/C++ all the time. It can be,
pragmatic, though, to learn languages that aren’t themselves very
practical/pragmatic for the time being.

Unless, of course, O’Caml has already been covered in the past.

Nope. This year’s Haskell-LotY was the first one.

Michael

···


Michael Schuerig If at first you don’t succeed…
mailto:schuerig@acm.org try, try again.
Michael Schürig | Sentenced to making sense --Jerome Morrow, “Gattaca”

“Bulat Ziganshin” bulatz@integ.ru writes:

Hello Yohanes,

Tuesday, December 17, 2002, 8:43:49 PM, you wrote:

Has LISP really been relegated for language archival? :frowning:
Thus, I’d recommend LISP. I know, I know, I’m a dying minority
here. But I couldn’t let such a beatiful language get passed over by
the younger ones. :slight_smile:

languages like womens - small is beatiful :slight_smile:

I find your antirubenesque attitude insulting to me.

YS.

dblack@candle.superlink.net wrote in message

It’s not exactly an endorsement; “Language of the Year” isn’t an award
or anything like that, it’s just a language-learning initiative.

Ok, may be “endorse” is not the right term to use. I meant to say
“suggested”, “recommended” or something to that effect. But, yes, I was
assuming a little more that just “hosting the project” :wink:

The reason Haskell was chosen is that the people who started up the
“Language of the Year” project (me and Chad Fowler) wanted to learn
Haskell :slight_smile:

So again, why Haskell ? What was (is??) the lure ? Even Matz seemed to
endo…, sorry, like (?) the idea.(ruby-talk: 47758). Or was he just
referring to your project on PragProg ?

Also, are you guys thinking of LOTY for 2003 ? Just curious …

– shanko

It’s much harder to remember preference tables a la C (wait, = before or
after || ?)

Bruce Eckel, (Thinking in Java):
"Upon hearing me complain about the complexity of remembering operator
precedence during one of my seminars, a student suggested a mnemonic that is
simultaneously a commentary: “Ulcer Addicts Really Like C A lot.”

Ulcer = Unary
Addicts = Arithmetic (and shift)
Really = Relational
Like = Logical (and bitwise)
C = Conditional (ternary)
A Lot = Assignment

Hello Michael,

Wednesday, December 18, 2002, 12:29:44 PM, you wrote:

If the choice of language had to be pragmatic in itself, we’d probably
end up with Perl/Python/Ruby/Java/C++ all the time.

but winner will be Visual Basic :slight_smile: one time i compared popularity
of languages by seeing at page like
http://directory.google.com/Top/Computers/Programming/Languages/

···


Best regards,
Bulat mailto:bulatz@integ.ru

“Michael Schuerig” schuerig@acm.org wrote in message

It can be, pragmatic, though, to learn languages that
aren’t themselves very
practical/pragmatic for the time being.

Oh, absolutely !

Unless, of course, O’Caml has already been covered in the past.

Nope. This year’s Haskell-LotY was the first one.

Good to know …missed it this year :frowning:
But will be eager to participate with what happens in 2003.