caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] embedding js_of_ocaml output?
@ 2013-09-29 19:40 Malcolm Matalka
  2013-09-29 19:43 ` Anil Madhavapeddy
  0 siblings, 1 reply; 3+ messages in thread
From: Malcolm Matalka @ 2013-09-29 19:40 UTC (permalink / raw)
  To: caml-list

This might be a really trivial question but perusing the js_of_ocaml
website I didn't see it answered:

Has anyone gone about embedding js_of_ocaml in an ocaml application?
Specifically, I want ship a binary that runs a small embedded webserver
and provides the GUI over that.  The obvious solution is just to add
building the js_of_ocaml output in the build process then make a fake
module that just has a string with the output in it and compile that in.
Hacky but I don't see why it wouldn't work but I'm sure somebody has a
clever idea out there.

Thanks!

/Malcolm

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

* Re: [Caml-list] embedding js_of_ocaml output?
  2013-09-29 19:40 [Caml-list] embedding js_of_ocaml output? Malcolm Matalka
@ 2013-09-29 19:43 ` Anil Madhavapeddy
  2013-09-29 19:51   ` Malcolm Matalka
  0 siblings, 1 reply; 3+ messages in thread
From: Anil Madhavapeddy @ 2013-09-29 19:43 UTC (permalink / raw)
  To: Malcolm Matalka; +Cc: Ocaml Mailing List

On 29 Sep 2013, at 20:40, Malcolm Matalka <mmatalka@gmail.com> wrote:

> This might be a really trivial question but perusing the js_of_ocaml
> website I didn't see it answered:
> 
> Has anyone gone about embedding js_of_ocaml in an ocaml application?
> Specifically, I want ship a binary that runs a small embedded webserver
> and provides the GUI over that.  The obvious solution is just to add
> building the js_of_ocaml output in the build process then make a fake
> module that just has a string with the output in it and compile that in.
> Hacky but I don't see why it wouldn't work but I'm sure somebody has a
> clever idea out there.

'crunch' from OPAM will do what you want:

$ opam search crunch
Available packages for system:
crunch  --  Convert a filesystem into a static OCaml module

(let me know if there's anything in there that's Mirage specific and
I'll fix it).

I believe 'ocamlify' also does the same thing from OASIS, but I've not
used it.

$ opam search ocamlify
Available packages for system:
ocamlify  0.0.1  Include files in OCaml code

-anil

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

* Re: [Caml-list] embedding js_of_ocaml output?
  2013-09-29 19:43 ` Anil Madhavapeddy
@ 2013-09-29 19:51   ` Malcolm Matalka
  0 siblings, 0 replies; 3+ messages in thread
From: Malcolm Matalka @ 2013-09-29 19:51 UTC (permalink / raw)
  To: Anil Madhavapeddy; +Cc: Ocaml Mailing List

Awesome! Thank you!

Anil Madhavapeddy <anil@recoil.org> writes:

> On 29 Sep 2013, at 20:40, Malcolm Matalka <mmatalka@gmail.com> wrote:
>
>> This might be a really trivial question but perusing the js_of_ocaml
>> website I didn't see it answered:
>> 
>> Has anyone gone about embedding js_of_ocaml in an ocaml application?
>> Specifically, I want ship a binary that runs a small embedded webserver
>> and provides the GUI over that.  The obvious solution is just to add
>> building the js_of_ocaml output in the build process then make a fake
>> module that just has a string with the output in it and compile that in.
>> Hacky but I don't see why it wouldn't work but I'm sure somebody has a
>> clever idea out there.
>
> 'crunch' from OPAM will do what you want:
>
> $ opam search crunch
> Available packages for system:
> crunch  --  Convert a filesystem into a static OCaml module
>
> (let me know if there's anything in there that's Mirage specific and
> I'll fix it).
>
> I believe 'ocamlify' also does the same thing from OASIS, but I've not
> used it.
>
> $ opam search ocamlify
> Available packages for system:
> ocamlify  0.0.1  Include files in OCaml code
>
> -anil

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

end of thread, other threads:[~2013-09-29 19:51 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-29 19:40 [Caml-list] embedding js_of_ocaml output? Malcolm Matalka
2013-09-29 19:43 ` Anil Madhavapeddy
2013-09-29 19:51   ` Malcolm Matalka

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