* [Caml-list] Sexplib and js_of_ocaml
[not found] ` <CAOOOohTVReOVEvPB+oD3iW_b20piQA93YCQLzD-5zhhtJa5XNg@mail.gmail.com>
@ 2017-07-26 8:38 ` Philippe Veber
2017-07-26 9:17 ` Jeremie Dimino
0 siblings, 1 reply; 3+ messages in thread
From: Philippe Veber @ 2017-07-26 8:38 UTC (permalink / raw)
To: caml users
[-- Attachment #1: Type: text/plain, Size: 534 bytes --]
Dear all,
I recently noticed that sexplib parser fails with a "Too much recursion"
exception when run in the browser on a very moderately sized string
representation of an S-exp. I understand this is due to the absence of tail
call optimization (although js_of_ocaml performs it in the case of a single
recursive function). With this idea in mind, I suppose there is no simple
workaround, so I wanted to ask if anyone knew a convenient replacement for
serialization/deserialization that would work in the browser.
Cheers,
Philippe.
[-- Attachment #2: Type: text/html, Size: 684 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Sexplib and js_of_ocaml
2017-07-26 8:38 ` [Caml-list] Sexplib and js_of_ocaml Philippe Veber
@ 2017-07-26 9:17 ` Jeremie Dimino
2017-07-26 9:29 ` Philippe Veber
0 siblings, 1 reply; 3+ messages in thread
From: Jeremie Dimino @ 2017-07-26 9:17 UTC (permalink / raw)
To: Philippe Veber; +Cc: caml users
You can use parsexp [1], which implements the same parser as sexplib
and works well in javascript.
[1] https://github.com/janestreet/parsexp
On Wed, Jul 26, 2017 at 9:38 AM, Philippe Veber
<philippe.veber@gmail.com> wrote:
> Dear all,
>
> I recently noticed that sexplib parser fails with a "Too much recursion"
> exception when run in the browser on a very moderately sized string
> representation of an S-exp. I understand this is due to the absence of tail
> call optimization (although js_of_ocaml performs it in the case of a single
> recursive function). With this idea in mind, I suppose there is no simple
> workaround, so I wanted to ask if anyone knew a convenient replacement for
> serialization/deserialization that would work in the browser.
>
> Cheers,
> Philippe.
--
Jeremie
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [Caml-list] Sexplib and js_of_ocaml
2017-07-26 9:17 ` Jeremie Dimino
@ 2017-07-26 9:29 ` Philippe Veber
0 siblings, 0 replies; 3+ messages in thread
From: Philippe Veber @ 2017-07-26 9:29 UTC (permalink / raw)
To: Jeremie Dimino; +Cc: caml users
[-- Attachment #1: Type: text/plain, Size: 938 bytes --]
Great, thanks a lot !
2017-07-26 11:17 GMT+02:00 Jeremie Dimino <jdimino@janestreet.com>:
> You can use parsexp [1], which implements the same parser as sexplib
> and works well in javascript.
>
> [1] https://github.com/janestreet/parsexp
>
> On Wed, Jul 26, 2017 at 9:38 AM, Philippe Veber
> <philippe.veber@gmail.com> wrote:
> > Dear all,
> >
> > I recently noticed that sexplib parser fails with a "Too much recursion"
> > exception when run in the browser on a very moderately sized string
> > representation of an S-exp. I understand this is due to the absence of
> tail
> > call optimization (although js_of_ocaml performs it in the case of a
> single
> > recursive function). With this idea in mind, I suppose there is no simple
> > workaround, so I wanted to ask if anyone knew a convenient replacement
> for
> > serialization/deserialization that would work in the browser.
> >
> > Cheers,
> > Philippe.
>
>
>
> --
> Jeremie
>
[-- Attachment #2: Type: text/html, Size: 1601 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2017-07-26 9:29 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
[not found] <CAOOOohQYCKAEUXgDtvi_VLfU1qJgNjMKZfjcnTyMJ-ge-6Oo_A@mail.gmail.com>
[not found] ` <CAOOOohQU1cJ89iZridtT1Jp1irLodSo-DUT_q6T+q27PJtrmgA@mail.gmail.com>
[not found] ` <CAOOOohRi+axyz5kwbdEaTCN0=MfXx8pOHk0Ah6YgYy0ZEYT2Xg@mail.gmail.com>
[not found] ` <CAOOOohTbbpt3eARSPSAuafTd_SRt=S769KJLPZ93-R8u0KG-dw@mail.gmail.com>
[not found] ` <CAOOOohRvc4vSqMC1SeHH0k5RZzKd8S2Ek1YweKNFi5CH0uhEDw@mail.gmail.com>
[not found] ` <CAOOOohSgpraamwc720MAdoPgydvzhZfmOBA05zrBBGuonLNf0g@mail.gmail.com>
[not found] ` <CAOOOohQ4=T24Te0W4uQAAD9A8dd+AaxE8ahHzjU+j8ckPvOJOg@mail.gmail.com>
[not found] ` <CAOOOohT_nJ5=evDwRdDOGwb0ORL0egRO1jRCzB=2rdX7-0Jgbw@mail.gmail.com>
[not found] ` <CAOOOohT2XDNZRVS9CMfsBCvHeqeo58rFYTpiERm_gxL37ACmyA@mail.gmail.com>
[not found] ` <CAOOOohTpSwKhbJz3-Tb+aERMBe7tT+9YP9eJhPkSVJviByB_Qw@mail.gmail.com>
[not found] ` <CAOOOohRYhqLnQMrUMbbEGa5AUGsk=s05128bhUT6Jhkdx27X0g@mail.gmail.com>
[not found] ` <CAOOOohRHoC96DiNiLTkEoeNBnjNbjwMk7RBwOWozH1ho5GN8Zg@mail.gmail.com>
[not found] ` <CAOOOohTVReOVEvPB+oD3iW_b20piQA93YCQLzD-5zhhtJa5XNg@mail.gmail.com>
2017-07-26 8:38 ` [Caml-list] Sexplib and js_of_ocaml Philippe Veber
2017-07-26 9:17 ` Jeremie Dimino
2017-07-26 9:29 ` Philippe Veber
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox