---------- Forwarded message ----------
From: wm <wmle...@gmail.com>
Date: Jan 9, 12:26 pm
Subject: January meeting
To: WestsideProggers
> /me adds Wm to TO: of message in hopes of getting his attention
Attention gotten.
Have added some new examples to Bertrand, plus updated the
documentation.
I'm really looking for someone(s) who want to do some real work with
Bertrand, like adding array/streams/iterators to it. Or adding a
graphical user interface.
--wm
---------- Forwarded message ----------
From: "Phil Tomson" <philtom...@gmail.com>
Date: Jan 9, 12:34 pm
Subject: January meeting
To: WestsideProggers
On Fri, Jan 9, 2009 at 12:26 PM, wm <wmle...@gmail.com> wrote:
>> /me adds Wm to TO: of message in hopes of getting his attention
> Attention gotten.
> Have added some new examples to Bertrand, plus updated the
> documentation.
> I'm really looking for someone(s) who want to do some real work with
> Bertrand, like adding array/streams/iterators to it. Or adding a
> graphical user interface.
> --wm
What about Bertrand as an embedded DSL within another language like
OCaml or Haskell? then you'd get those things pretty much for free.
You can add syntax to OCaml, for example, using campl4 (Caml's
pre-processor that lets you manipulate the AST for a program and add
syntax). That might be an interesting way to go.
Phil
---------- Forwarded message ----------
From: "Phil Tomson" <philtom...@gmail.com>
Date: Jan 9, 4:37 pm
Subject: January meeting
To: WestsideProggers
I've been looking for an excuse to play with camlp4. Let me look at
Bertrand a bit more (I just took a quick glance at it a month or so
ago when Igal posted the code) and see what it would take. From what
you said in the Nov meeting there isn't much syntax to Bertrand.
Phil
On Fri, Jan 9, 2009 at 4:29 PM, wm <wmle...@gmail.com> wrote:
> I would certainly be involved, if others will jump in too.
---------- Forwarded message ----------
From: Wm Leler <wmle...@gmail.com>
Date: Jan 9, 4:56 pm
Subject: January meeting
To: WestsideProggers
There is almost no syntax to Bertrand, just rules, types, and
operators.
Only seven reserved characters in Bertrand, which are { } . # " ' `
Extremely simple semantics, too.
I don't know camlp4. Do you have a pointer to a good quick
introduction?
It would be very good to embed Bertrand in some other language, but it
would need to be the right language.
--wm
---------- Forwarded message ----------
From: "Phil Tomson" <philtom...@gmail.com>
Date: Jan 9, 5:22 pm
Subject: January meeting
To: WestsideProggers
On Fri, Jan 9, 2009 at 4:56 PM, Wm Leler <wmle...@gmail.com> wrote:
> There is almost no syntax to Bertrand, just rules, types, and operators.
> Only seven reserved characters in Bertrand, which are { } . # " ' `
> Extremely simple semantics, too.
> I don't know camlp4. Do you have a pointer to a good quick introduction?
There's a wiki here:http://brion.inria.fr/gallium/index.php/Camlp4
There's a new blog about it here:http://
ambassadortothecomputers.blogspot.com/
Here's an example where they wrote a camlp4 syntax extension that
generates converters between OCaml and JSON:http://
martin.jambon.free.fr/json-static.html
> It would be very good to embed Bertrand in some other language, but it
> would need to be the right language.
What do you think would be the characteristics of the 'right'
language?
Phil
---------- Forwarded message ----------
From: Wm Leler <wmle...@gmail.com>
Date: Jan 9, 5:38 pm
Subject: January meeting
To: WestsideProggers
>> It would be very good to embed Bertrand in some other language, but
>> it
>> would need to be the right language.
> What do you think would be the characteristics of the 'right'
> language?
> Phil
Off the top of my head:
1) It should be very good at manipulating tree structures efficiently.
Most of what Bertrand does is match a pattern expression against a
subject expression, and replace it with a body expression. Over and
over again.
2) It should be able to define new functions at run-time and evaluate
them.
3) It would be nice if it could deal with infix notation expressions.
4) It should have some built-in graphics.
5) It should run on lots of platforms, and be widely available.
I'm sure there are other things too.
--wm
---------- Forwarded message ----------
From: "Phil Tomson" <philtom...@gmail.com>
Date: Jan 9, 6:21 pm
Subject: January meeting
To: WestsideProggers
On Fri, Jan 9, 2009 at 5:38 PM, Wm Leler <wmle...@gmail.com> wrote:
>> What do you think would be the characteristics of the 'right'
>> language?
>> Phil
> Off the top of my head:
> 1) It should be very good at manipulating tree structures efficiently.
> Most of what Bertrand does is match a pattern expression against a
> subject expression, and replace it with a body expression. Over and
> over again.
Both Haskell and OCaml are great for tree manipulation.
> 2) It should be able to define new functions at run-time and evaluate
> them.
...that's a bit tougher. Neither is a very dynamic language. Could
you generate expression trees that then get evaluated within a
context?
> 3) It would be nice if it could deal with infix notation expressions.
Should work.
> 4) It should have some built-in graphics.
They've each got bindings to graphics libs.
> 5) It should run on lots of platforms, and be widely available.
All the important platforms are covered (not sure about Windows,
though ;-)
Phil
I also see that ghc (popular Haskell compiler) now has something they
call "compiler plugins" which use template haskell (like camlp4, but
for Haskell), you can read an article about compiler plugins for ghc
in issue 12 of the Monad Reader:
http://www.haskell.org/haskellwiki/The_Monad.Reader
The article is entitled:
Compiler Development Made Easy
Phil
If Curry uses ghc, then maybe that's how they do it? (via ghc plugins?)
Phil