From: Alain Frisch <alain@frisch.fr>
To: Gour <gour@atmarama.net>, caml-list@inria.fr
Subject: Re: [Caml-list] OCaml vs Ada and/or GUI options
Date: Thu, 19 Sep 2013 10:11:51 +0200 [thread overview]
Message-ID: <523AB1C7.1050509@frisch.fr> (raw)
In-Reply-To: <20130918134229.37a0df52@atmarama.noip.me>
We have done some experiments running LexiFi's core libraries (symbolic
manipulations of terms representing financial contracts) in the browser,
using js_of_ocaml. We also played with dynamic GUI generation directly
in the browser, based on our runtime type extension (which works fine
with js_of_ocaml).
Overall, we were impressed by the easiness to integrate js_of_ocaml (no
need to patch the compiler or do big changes to the build system) and
its faithfulness to the semantics of OCaml. Really no big bad
surprises, and it was amazing to see a complex piece of software running
in the browser. js_of_ocaml opens many interesting doors for using
OCaml in web development!
(((Some points which required some special care:
- Support for C primitives. Each primitive called by the bytecode
needs to have a Javascript implementation. Since LexiFi's version of
OCaml is most often synchronized with OCaml's trunk than with a stable
release, we had to implement the new primitives. This raises the
general point that js_of_ocaml will need some active maintenance, even
if the OCaml bytecode itself is very stable across versions.
- A tiny semantic difference: in OCaml, the expression
"String.unsafe_get s (String.length s)" returns '\000', which gives an
efficient way to iterate over a string without checking for the
end-of-string condition explicitly. This hack (which is also used in
the stdlib module, btw) does not work with the way strings are
represented in js_of_ocaml. That said, we were quite happy to see that
other low-level hacks we do with the runtime representation of values
worked well (setting a block tag to Object_tag to force generic
comparison and hashing to use the second field; or playing with the
representation of method tables to memoize method calls).
- The lack of weak hash tables, which we use quite a lot. I wonder if
Firefox's experimental WeakMap could be used to simulate them (and if
other browsers will get similar features).
- Reliance on Camlp4 for interacting with Javascript. Getting rid of
this dependency was our first internal use of -ppx!
)))
Alain
On 09/18/2013 01:42 PM, Gour wrote:
> On Wed, 11 Sep 2013 13:42:49 +0200
> Gerd Stolpmann <info@gerd-stolpmann.de> wrote:
>
>> We would need an HTML5 binding so the programmer wouldn't see the
>> Javascript part.
>
> In my search for adequate GUI bindings I've found out about OCaml
> bindings (https://github.com/astrada/ocaml-extjs) for ExtJS
> (http://www.sencha.com/products/extjs/) so wonder what is your
> experience with js_of_ocaml in generall and/or ExtJS?
>
>
> Sincerely,
> Gour
>
next prev parent reply other threads:[~2013-09-19 8:11 UTC|newest]
Thread overview: 80+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-09-10 21:09 Gour
2013-09-10 21:38 ` Paolo Donadeo
2013-09-11 5:24 ` Adrien Nader
2013-09-11 7:21 ` Kakadu
2013-09-11 8:21 ` [Caml-list] " Gour
2013-09-11 8:14 ` Gour
2013-09-11 18:17 ` Adrien Nader
2013-09-11 19:31 ` Gour
2013-09-11 19:53 ` Adrien Nader
2013-09-11 20:41 ` Gour
2013-09-11 21:01 ` Adrien Nader
2013-09-12 5:44 ` Gour
2013-09-12 6:31 ` Adrien Nader
2013-09-12 5:36 ` Gour
2013-09-12 6:48 ` Adrien Nader
2013-09-12 7:26 ` Gour
2013-09-11 20:06 ` Jon Harrop
2013-09-11 20:48 ` Anthony Tavener
2013-09-11 21:04 ` Adrien Nader
2013-09-12 14:40 ` [Caml-list] " Jon Harrop
2013-09-12 14:51 ` Alain Frisch
2013-09-12 14:57 ` Lukasz Stafiniak
2013-09-12 15:04 ` Alain Frisch
2013-09-14 3:05 ` Jon Harrop
2013-09-14 7:10 ` Kakadu
2013-09-14 11:37 ` Jon Harrop
2013-09-15 8:32 ` Kakadu
2013-09-14 23:51 ` Francois¡¡Charles Matthieu¡¡Berenger
2013-09-11 22:17 ` [Caml-list] " Richard W.M. Jones
2013-09-12 13:49 ` [Caml-list] " Jon Harrop
2013-09-12 13:58 ` Richard W.M. Jones
2013-09-11 9:49 ` David MENTRE
2013-09-11 10:14 ` Kakadu
2013-09-11 15:21 ` David MENTRE
2013-09-12 1:31 ` Francois Berenger
2013-09-11 18:43 ` Adrien Nader
2013-09-11 18:36 ` Adrien Nader
2013-09-11 19:34 ` [Caml-list] " Gour
2013-09-11 19:45 ` Adrien Nader
2013-09-11 22:06 ` [Caml-list] " Jacques Garrigue
2013-09-12 3:25 ` Ivan Gotovchits
2013-09-12 6:41 ` Adrien Nader
2013-09-12 11:49 ` Gerd Stolpmann
2013-09-11 19:17 ` [Caml-list] " Gour
2013-09-11 22:03 ` [Caml-list] " Jacques Garrigue
2013-09-12 8:16 ` Alain Frisch
2013-09-11 12:26 ` Jon Harrop
2013-09-11 18:48 ` Adrien Nader
2013-09-11 13:22 ` Paolo Donadeo
2013-09-11 13:33 ` Kakadu
2013-09-11 14:09 ` Paolo Donadeo
2013-09-11 19:36 ` Jon Harrop
2013-09-11 19:45 ` [Caml-list] " Gour
2013-09-12 12:55 ` [Caml-list] " Jon Harrop
2013-09-11 18:57 ` Adrien Nader
2013-09-11 19:01 ` Rudi Grinberg
2013-09-11 19:15 ` Adrien Nader
2013-09-11 8:10 ` [Caml-list] " Gour
2013-09-11 1:00 ` [Caml-list] " Francois Berenger
2013-09-11 5:07 ` rixed
2013-09-11 8:26 ` [Caml-list] " Gour
2013-09-11 9:23 ` rixed
2013-09-11 12:54 ` Leo White
2013-09-11 12:59 ` Gour
2013-09-11 19:06 ` Adrien Nader
2013-09-11 8:16 ` Gour
2013-09-11 9:00 ` Francois Berenger
2013-09-11 19:19 ` Gour
2013-11-17 20:12 ` [Caml-list] " Gour
2013-09-11 7:38 ` Gabriel Kerneis
2013-09-11 8:20 ` [Caml-list] " Gour
2013-09-11 11:42 ` Gerd Stolpmann
2013-09-18 11:42 ` [Caml-list] " Gour
2013-09-18 12:24 ` Gerd Stolpmann
2013-09-20 4:47 ` Gour
2013-09-19 8:11 ` Alain Frisch [this message]
2013-09-19 8:30 ` Daniel Bünzli
2013-09-19 8:47 ` Andreas Rossberg
2013-09-20 4:51 ` Gour
2013-09-20 12:04 ` Gerd Stolpmann
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=523AB1C7.1050509@frisch.fr \
--to=alain@frisch.fr \
--cc=caml-list@inria.fr \
--cc=gour@atmarama.net \
/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