caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: Michal Moskal <malekith@pld-linux.org>
To: Oleg <oleg_inconnu@myrealbox.com>
Cc: caml-list@inria.fr
Subject: Re: [Caml-list] Baby Steps (was: ChartPak - a data visualization library for the web)
Date: Fri, 24 Jan 2003 11:59:19 +0100	[thread overview]
Message-ID: <20030124105919.GB3390@roke.freak> (raw)
In-Reply-To: <200301232319.59207.oleg_inconnu@myrealbox.com>

On Thu, Jan 23, 2003 at 11:19:59PM -0500, Oleg wrote:
> On Monday 20 January 2003 03:37 pm, Brian Hurt wrote:
> > The trend here is that the mainstream only takes baby steps.
> 
> If someone merely added
> - ADTs
> - variant types
> - GC
> - strict[er] typing
> - and perhaps polymorphism
> 
> to C, I wonder if such a language would take off.

Take a look at http://www.research.att.com/projects/cyclone/ and
<advertise> http://gont.pld.org.pl/ </advertise>.

But if you want to know my opinion... I designed such a language, wrote
compiler for it in OCaml, rewrote compiler in this language (getting
it to bootstrap was a lot of fun :-), and finally coded something else
(kind of extended lambda calculus interpreter) in OCaml. And the final
impression was: it's far easier in OCaml. The main difference between
OCaml (the part that I was using) and Gont was syntax.  And OCaml syntax
is better, once you get used to FP. For example:

<'b>list map(*('b ('a)) f, <'a>list l)
{
        switch l {
        case Nil: return Nil;
        case Cons(hd, tl): return Cons(f(hd), map(f, tl));
        }
}

Or version using type inference:

def map2(f, l)
{
        switch l {
        case Nil: return Nil;
        case Cons(hd, tl): return Cons(f(hd), map2(f, tl));
        }
}

And now in OCaml

let rec map f = function
  | [] -> []
  | x :: xs -> f x :: map f xs

-- 
: Michal Moskal ::::: malekith/at/pld-linux.org :  GCS {C,UL}++++$ a? !tv
: PLD Linux ::::::: Wroclaw University, CS Dept :  {E-,w}-- {b++,e}>+++ h
-------------------
To unsubscribe, mail caml-list-request@inria.fr Archives: http://caml.inria.fr
Bug reports: http://caml.inria.fr/bin/caml-bugs FAQ: http://caml.inria.fr/FAQ/
Beginner's list: http://groups.yahoo.com/group/ocaml_beginners


  reply	other threads:[~2003-01-24 12:02 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2003-01-16 10:30 [Caml-list] ANN: ChartPak - a data visualization library for the web Matt Gushee
2003-01-16 12:30 ` Mattias Waldau
2003-01-16 12:45   ` Alessandro Baretta
2003-01-16 12:51   ` Jérôme Marant
2003-01-20 13:55   ` Fabrice Le Fessant
2003-01-20 16:46     ` License wars (was Re: [Caml-list] ANN: ChartPak - a data visualization library for the web) Matt Gushee
2003-01-20 17:22       ` Brian Hurt
2003-01-22 16:57       ` [Caml-list] Re: License wars Michaël Grünewald
2003-01-23 10:43         ` Alessandro Baretta
2003-01-24 15:31           ` John Max Skaller
2003-01-20 19:49     ` [Caml-list] ANN: ChartPak - a data visualization library for the web Mattias Waldau
2003-01-20 20:37       ` Brian Hurt
2003-01-24  4:19         ` [Caml-list] Baby Steps (was: ChartPak - a data visualization library for the web) Oleg
2003-01-24 10:59           ` Michal Moskal [this message]
     [not found]             ` <Pine.LNX.4.33.0301241322390.2036-100000@eagle.ancor.com>
2003-01-24 20:54               ` Michal Moskal
2003-01-24  5:33 ` [Caml-list] Re: License wars Matt Gushee
2003-01-24  8:46   ` Sven Luther
2003-01-24 11:16     ` Dmitry Bely
2003-01-24 11:28       ` Sven Luther
2003-01-24 11:31       ` Alessandro Baretta
2003-01-24 16:16         ` John Max Skaller
2003-01-24 15:49     ` John Max Skaller
2003-01-25  9:54   ` Michaël Grünewald

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20030124105919.GB3390@roke.freak \
    --to=malekith@pld-linux.org \
    --cc=caml-list@inria.fr \
    --cc=oleg_inconnu@myrealbox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).