caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] In-memory assembly
@ 2018-01-10 10:20 Christoph Höger
  2018-01-10 10:41 ` Gabriel Scherer
  2018-01-10 16:46 ` Basile Starynkevitch
  0 siblings, 2 replies; 4+ messages in thread
From: Christoph Höger @ 2018-01-10 10:20 UTC (permalink / raw)
  To: OCaml Mailing List

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

Dear all,

I want to trigger OCaml compilation programmatically from a C++ application
and avoid the usage of subprocesses. It is fairly straightforward to
generate an OCaml AST, but I cannot compile it.

1. The relevant modules/libraries do not load

  utop # #require "compiler-libs.optcomp";;
  Error: Reference to undefined global `Location'

  X86_masm.generate_asm stdout [] ;;


2. The relevant modules seem to insist on file i/o for communication (i.e.,
they use out_channel objects)


Does anyone know a simple way around these issues?

a) Can I load the optcomp library without modifying the compiler (or with
some simple modifications)

b) Is there a way to create an out_channel  from a memory buffer?

thanks,

Christoph

ps: If the answer to both questions is "no", I would be willing to work
with the community and enhance the compiler if I could get some advice on
how to do it best and if such a modification is wanted.

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

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

end of thread, other threads:[~2018-01-10 16:46 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-01-10 10:20 [Caml-list] In-memory assembly Christoph Höger
2018-01-10 10:41 ` Gabriel Scherer
2018-01-10 15:42   ` Evgeny Roubinchtein
2018-01-10 16:46 ` Basile Starynkevitch

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