caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] JavaScript interpreter in OCaml
@ 2012-07-25 13:38 Diego Olivier Fernandez Pons
  2012-07-25 15:22 ` Pierre-Alexandre Voye
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Diego Olivier Fernandez Pons @ 2012-07-25 13:38 UTC (permalink / raw)
  To: caml-list

    Caml-list,

Does anyone have a JavaScript interpreter in OCaml ? Doesn't need to
be 100% compliant, the user can always rewritte some parts of the
JavaScript. And we discourage using weird / complex JavaScript
constructions anyway. Alternatively, a JavaScript -> OCaml source to
source translator could be good as well.

        Diego Olivier

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

* Re: [Caml-list] JavaScript interpreter in OCaml
  2012-07-25 13:38 [Caml-list] JavaScript interpreter in OCaml Diego Olivier Fernandez Pons
@ 2012-07-25 15:22 ` Pierre-Alexandre Voye
  2012-07-25 15:40 ` David Allsopp
  2012-07-25 18:32 ` Stéphane Glondu
  2 siblings, 0 replies; 5+ messages in thread
From: Pierre-Alexandre Voye @ 2012-07-25 15:22 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

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

I searched for it one day and didn't found anything.
But there's Pffff which contains a JavasScript parser and a beginning of
AST analyser :

https://github.com/facebook/pfff/tree/master/lang_js

2012/7/25 Diego Olivier Fernandez Pons <dofp.ocaml@gmail.com>

>     Caml-list,
>
> Does anyone have a JavaScript interpreter in OCaml ? Doesn't need to
> be 100% compliant, the user can always rewritte some parts of the
> JavaScript. And we discourage using weird / complex JavaScript
> constructions anyway. Alternatively, a JavaScript -> OCaml source to
> source translator could be good as well.
>
>         Diego Olivier
>
> --
> Caml-list mailing list.  Subscription management and archives:
> https://sympa-roc.inria.fr/wws/info/caml-list
> Beginner's list: http://groups.yahoo.com/group/ocaml_beginners
> Bug reports: http://caml.inria.fr/bin/caml-bugs
>
>


-- 
---------------------
https://twitter.com/#!/ontologiae/
http://linuxfr.org/users/montaigne

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

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

* Re: [Caml-list] JavaScript interpreter in OCaml
  2012-07-25 13:38 [Caml-list] JavaScript interpreter in OCaml Diego Olivier Fernandez Pons
  2012-07-25 15:22 ` Pierre-Alexandre Voye
@ 2012-07-25 15:40 ` David Allsopp
  2012-07-25 18:32 ` Stéphane Glondu
  2 siblings, 0 replies; 5+ messages in thread
From: David Allsopp @ 2012-07-25 15:40 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

On 25 Jul 2012, at 14:38, "Diego Olivier Fernandez Pons" <dofp.ocaml@gmail.com> wrote:

> Does anyone have a JavaScript interpreter in OCaml ? Doesn't need to
> be 100% compliant, the user can always rewritte some parts of the
> JavaScript. And we discourage using weird / complex JavaScript
> constructions anyway. Alternatively, a JavaScript -> OCaml source to
> source translator could be good as well.

I don't know whether you mean written in pure OCaml or just usable from OCaml. For the latter, I've used Alain Frisch's SpiderCaml: http://alain.frisch.fr/soft.html#spider

Personally, I'd say that linking to a well-maintained interpreter is a better solution than yet another implementation of JavaScript with all the warts that go with doing that.

HTH,


David

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

* Re: [Caml-list] JavaScript interpreter in OCaml
  2012-07-25 13:38 [Caml-list] JavaScript interpreter in OCaml Diego Olivier Fernandez Pons
  2012-07-25 15:22 ` Pierre-Alexandre Voye
  2012-07-25 15:40 ` David Allsopp
@ 2012-07-25 18:32 ` Stéphane Glondu
  2012-07-25 20:21   ` Alan Schmitt
  2 siblings, 1 reply; 5+ messages in thread
From: Stéphane Glondu @ 2012-07-25 18:32 UTC (permalink / raw)
  To: Diego Olivier Fernandez Pons; +Cc: caml-list

On 25/07/2012 15:38, Diego Olivier Fernandez Pons wrote:
> Does anyone have a JavaScript interpreter in OCaml ? Doesn't need to
> be 100% compliant, the user can always rewritte some parts of the
> JavaScript. And we discourage using weird / complex JavaScript
> constructions anyway. Alternatively, a JavaScript ->  OCaml source to
> source translator could be good as well.

I've never tried it, but there is:

   http://jscert.org/code.html


Cheers,

-- 
Stéphane


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

* Re: [Caml-list] JavaScript interpreter in OCaml
  2012-07-25 18:32 ` Stéphane Glondu
@ 2012-07-25 20:21   ` Alan Schmitt
  0 siblings, 0 replies; 5+ messages in thread
From: Alan Schmitt @ 2012-07-25 20:21 UTC (permalink / raw)
  To: Stéphane Glondu; +Cc: Diego Olivier Fernandez Pons, caml-list

Stéphane Glondu <steph@glondu.net> writes:

> On 25/07/2012 15:38, Diego Olivier Fernandez Pons wrote:
>> Does anyone have a JavaScript interpreter in OCaml ? Doesn't need to
>> be 100% compliant, the user can always rewritte some parts of the
>> JavaScript. And we discourage using weird / complex JavaScript
>> constructions anyway. Alternatively, a JavaScript ->  OCaml source to
>> source translator could be good as well.
>
> I've never tried it, but there is:
>
>   http://jscert.org/code.html

We'd love to have people play with this, but beware it's an interpreter
extracted from a Coq development (correctness trumps efficiency), and
many parts of the language are still missing. We're working on extending
it, but I don't think it's ready for prime time yet.

Best,

Alan

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

end of thread, other threads:[~2012-07-25 20:22 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-07-25 13:38 [Caml-list] JavaScript interpreter in OCaml Diego Olivier Fernandez Pons
2012-07-25 15:22 ` Pierre-Alexandre Voye
2012-07-25 15:40 ` David Allsopp
2012-07-25 18:32 ` Stéphane Glondu
2012-07-25 20:21   ` Alan Schmitt

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