caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] How to write an efficient interpreter
@ 2011-10-24  9:10 Diego Olivier Fernandez Pons
  2011-10-24  9:58 ` Gabriel Scherer
  2011-10-24 11:28 ` Xavier Leroy
  0 siblings, 2 replies; 12+ messages in thread
From: Diego Olivier Fernandez Pons @ 2011-10-24  9:10 UTC (permalink / raw)
  To: caml-list

[-- Attachment #1: Type: text/plain, Size: 1810 bytes --]

    Caml-list,

I have to write an interpreter for a datatype rich purely applicative
language. I have already written a naive interpreter (like in programming
languages class) and was wondering what where the options for writing
something that would perform better while keeping it maintainable by a
single person < 5% dedicated and preferably only in core-ML (no C code or
fancy ML extensions).

The language could be described as a rich datastructure typed SQL with a
programming language syntax
- first class sets, arrays, dictionaries, lists and their corresponding
comprehensions
- tuples and records merged into a single concept (accessible per position
like in (x, y) = ... or per label like in for t in tupleSet if t.label == 3
then)
- only applicative functions (no lambda operator, no partial application)
- simple types are int, double and string
- only user declared types are tuples-records

It is mainly used for data transformation : take a list of countries,
extract from an database the international airports of those countries,
geolocalize them using city/location table, generate a distance table using
a great-circle distance, assign to each size of plane the legs they can do
based on their maximum fight range, etc.

The language has a JavaScript inline capability

    execute JavaScript {
        //write your javascript code here
    }

that's typically used to define functions, unroll comprehensions to make
them more efficient and to call external libraries (JavaScript has full
visibility on all the language objects and can read/write directly inside,
probably the existing interpreter was written in JavaScript), so I am
considering allowing those features in the core language and only supporting
a very slow JavaScript deprecated compatibility mode.


         Diego Olivier

[-- Attachment #2: Type: text/html, Size: 2082 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2011-11-07  6:46 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-10-24  9:10 [Caml-list] How to write an efficient interpreter Diego Olivier Fernandez Pons
2011-10-24  9:58 ` Gabriel Scherer
2011-10-24 10:57   ` Gerd Stolpmann
2011-10-24 11:28 ` Xavier Leroy
2011-10-24 11:50   ` Diego Olivier Fernandez Pons
2011-10-24 12:33     ` Jérémie Dimino
2011-10-24 12:40     ` Gerd Stolpmann
2011-10-24 12:46       ` oliver
2011-10-24 12:58         ` Gerd Stolpmann
2011-10-24 21:01           ` oliver
2011-10-26  9:27             ` Diego Olivier Fernandez Pons
2011-11-07  6:45               ` Jon Harrop

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).