www.digitalmars.com         C & C++   DMDScript  

D - Re: OCaml

reply Mark Evans <Mark_member pathlink.com> writes:
http://www.venge.net/graydon/talks/mkc/html/index.html

These slides show that a hybrid functional/imperative language can still look
like C and do C-ish things.  There are side-by-side comparisons of C and OCaml
code.  That is the main reason I post it here.

OCaml syntax is pretty bad, but then so is C; we're just more used to it.

OCaml is well known for facilitating parsers and these slides demonstrate that
capability if you're interested.

Mark
Jan 20 2003
next sibling parent reply Ilya Minkov <midiclub 8ung.at> writes:
This example shows exactly the other way around doing it normally in 
OCaml. It's really much simpler. No need to use OCamlP4, AFAIK. A simple 
BASIC interpreter example (actually two of them) in the O'Reily book 
does it with less trouble.

However, it shows how to transform the tree into the C source, which is 
important. Not much of it though.

-i.

Mark Evans wrote:
 http://www.venge.net/graydon/talks/mkc/html/index.html
 
 These slides show that a hybrid functional/imperative language can still look
 like C and do C-ish things.  There are side-by-side comparisons of C and OCaml
 code.  That is the main reason I post it here.
 
 OCaml syntax is pretty bad, but then so is C; we're just more used to it.
 
 OCaml is well known for facilitating parsers and these slides demonstrate that
 capability if you're interested.
 
 Mark
 

Jan 21 2003
parent reply Mark Evans <Mark_member pathlink.com> writes:
Ilya I just wanted all the C folks around here to feel comfortable investigating
OCaml.  Why don't you post an example of the True OCaml Way to let them see the
power they are missing.

Mark

Ilya Minkov says...
This example shows exactly the other way around doing it normally in 
OCaml.

Jan 21 2003
parent Ilya Minkov <midiclub 8ung.at> writes:
Mark Evans wrote:
 Ilya I just wanted all the C folks around here to feel comfortable
investigating
 OCaml.  Why don't you post an example of the True OCaml Way to let them see the
 power they are missing.
 
 Mark

It goes out of the scope of this newsgroup. And i don't have enough time. OCamlP4 is good, when arbitrary code has to be translated into OCaml abstract syntax tree for direct execution. But when arbitrary code has to be translated into C or something else, internal means are quite right. IMO, using them should not differ much, so it doesn't even add anything ineteresting to discuss. I guess i'll keep silent (and busy) for a couple of weeks. I feel like this newsgroup is becoming too crowded. That's probably why Pavel has disappeared, he must have limited time. -i.
Jan 24 2003
prev sibling parent "Steven Shaw" <steven_shaw iprimus.com.au> writes:
 These slides show that a hybrid functional/imperative language can still

 like C and do C-ish things.  There are side-by-side comparisons of C and

 code.

OCaml is nice. I was learning it a while ago (I've moved on since but I will definely get back to it). The trouble with OCaml is that it can't compare with other languages if your application needs threads which take advantage of SMP (the runtime is non-reentrant). Steve.
Feb 06 2003