caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* New C interfaces
@ 1997-03-11 19:31 Andrew Conway
  1997-03-19 13:20 ` Xavier Leroy
  0 siblings, 1 reply; 2+ messages in thread
From: Andrew Conway @ 1997-03-11 19:31 UTC (permalink / raw)
  To: caml-list


Dear o'caml community,

I have been reading the 1.04 documentation on the C language interface,
and it occured to me that one could get library routined compiled with ocamlopt
to live in harmony with the top level by compiling the library routines
using ocamlopt -output-obj, and then linking them into the toplevel
using -custom. It looks messy but practical. 

Are there any problems with this, apart from the hassle? 
Does this make multiple copies of the garbage collector?

I have a small number of numeric routines that I link into the
top level, and it would be very nice to have them operating more
quickly.

(By the way: there are still many references to caml light in chapter 13.)

[ resume:

Je pense qu'on peut utiliser "ocamlopt -output-obj" et "ocamlmktop -custom"
pour vitesse. Pourquoi pas?

]






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

* Re: New C interfaces
  1997-03-11 19:31 New C interfaces Andrew Conway
@ 1997-03-19 13:20 ` Xavier Leroy
  0 siblings, 0 replies; 2+ messages in thread
From: Xavier Leroy @ 1997-03-19 13:20 UTC (permalink / raw)
  To: Andrew Conway; +Cc: caml-list

> I have been reading the 1.04 documentation on the C language
> interface, and it occured to me that one could get library routined
> compiled with ocamlopt to live in harmony with the top level by
> compiling the library routines using ocamlopt -output-obj, and then
> linking them into the toplevel using -custom. It looks messy but
> practical.

It almost works, but not quite. One problem is that one would need a
runtime library that supports both the bytecode and the native-code
system. In particular, the garbage collector would need to scan both
the interpreter stack and the native stack.

> Does this make multiple copies of the garbage collector?

At any rate, the C linker will not let you do that (duplicate symbols
are an error in C). Also, if you had two GCs, it would be hard to pass
allocated data structures from one world to the other.

- Xavier Leroy





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

end of thread, other threads:[~1997-03-19 17:35 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
1997-03-11 19:31 New C interfaces Andrew Conway
1997-03-19 13:20 ` Xavier Leroy

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