<kaustuv>
How difficult would it be to write a utility that uses ocamldep -modules to figure out what Batteries modules a given program is using, and then link it against just those modules instead of the full battereies.cmxa?
<thelema>
I think ocaml automatically does that if you don't 'open Batteries', but instead use individual modules directly
<kaustuv>
Yes for top level modules. But, say I use BatSet somewhere. Now I've pulled in stuff about ropes, etc., that I may not actually use.
<thelema>
yes, oops on that part of the design
<thelema>
but there's no way to use anything in batset without pulling in all its deps
<thelema>
no matter how you link
<kaustuv>
If for 2.0 we can reorganize the Batteries module layout a bit, I suggest we move the standard sets and maps to BatSets and BatMaps, and also give BatNames for these instances.
<thelema>
agreed - standard sets and maps shouldn't be in BatSet or BatMap
<kaustuv>
(At the cost of some additional bloat on the API modules index page)
<thelema>
could be in rope, string, etc.
<kaustuv>
That's risky. It might introduce dependency cycles, eg. with the BatIO-based printers.
<thelema>
okay, maybe some could be moved out. We'd find out quickly if this was impossible
dgfitch has quit [Quit: Lost terminal]
dgfitch has joined #ocaml
<kaustuv>
What would be awesome is to have real dead code elimination in ocamlopt -nodynlink
<thelema>
yes, that's the real solution.
<kaustuv>
But that's probably a lot of work and the OCaml devs have enough on their plate already
<thelema>
it shouldn't be that bad - it'd just need creating new modules that are the needed subset of the required modules.
<thelema>
computing this would be straightforward, I expect
<thelema>
With PIC, the repackaging should be straightforward
arubin has joined #ocaml
joewilliams_away is now known as joewilliams
kaustuv has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
zirhc has quit [Remote host closed the connection]
eye-scuzzy has quit [Remote host closed the connection]
eye-scuzzy has joined #ocaml
strlen has joined #ocaml
mnabil has quit [Remote host closed the connection]
cyanure has joined #ocaml
benthos has quit [Quit: Lost terminal]
Snark has joined #ocaml
hcube has joined #ocaml
myu2 has quit [Remote host closed the connection]
hcube has quit [Read error: Connection reset by peer]
hcube has joined #ocaml
Yoric has joined #ocaml
hcube_ has joined #ocaml
hcube has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
ttamttam has joined #ocaml
Yoric has quit [Quit: Yoric]
ikaros has joined #ocaml
hcube_ has quit [Ping timeout: 240 seconds]
edwin has joined #ocaml
<gildor>
adrien: we briefly talk about this with Jacques at ICFP 2010, but I'll wait oasis 0.3.0 and the support for pkg-config before attempting to use oasis with lablgtk
myu2 has joined #ocaml
myu2 has quit [Client Quit]
bzzbzz has quit [Ping timeout: 276 seconds]
Yoric has joined #ocaml
ygrek has quit [Remote host closed the connection]
bzzbzz has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Yoric_ has joined #ocaml
hcube has joined #ocaml
hcube has quit [Client Quit]
_andre has joined #ocaml
Yoric_ has quit [Quit: Yoric_]
avsm has joined #ocaml
ikaros has quit [Quit: Leave the magic to Houdini]
ygrek has joined #ocaml
boscop has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 255 seconds]
ftrvxmtrx has joined #ocaml
sepp2k has quit [Quit: Leaving.]
lopex has joined #ocaml
oriba has joined #ocaml
cyanure has quit [Remote host closed the connection]
oriba has quit [Quit: Verlassend]
ygrek has quit [Remote host closed the connection]
smerz has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
ikaros has joined #ocaml
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 255 seconds]
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 255 seconds]
seafood has joined #ocaml
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 240 seconds]
drunK has joined #ocaml
mlh has quit [*.net *.split]
cyanure has joined #ocaml
jsk has joined #ocaml
seafood has quit [Quit: seafood]
oriba has joined #ocaml
myu2 has joined #ocaml
gmarik has joined #ocaml
_y_ has joined #ocaml
<_y_>
hi folks -- I have two somewhat complicated questions
<thelema>
_y_: just ask
<_y_>
so I've embedded an OCaml interpreter into a C++ application, and I am using it interactively; there exists scenarios in which I create an OCaml object in the interpreter, and then pass the object into C++, at which point the object "is alive", even though there may not be any more references to it from the OCaml code... for instance, I create a graph object in OCaml, and pass it through to the graph viewer, which is goverened by C++, and that ob
<thelema>
register_root?
<_y_>
I just grepped the 3.12.0 source tree for register_root and found nothing...?
<_y_>
google also finds nothing
<thelema>
ocaml_register_global_root
<_y_>
ok, so you're suggesting that I call ocaml_register_global_root when I create the object, and ocaml_remove_global_root when the user closes the window (for instance)
<_y_>
er, when I create the window (in the C++ code)
<thelema>
to keep the ocaml GC from collecting a value that's no longer reachable from the ocaml side, you should use register_global_root (or maybe generational_root)
<thelema>
There's a cost to registering lots of roots, so try to minimize this.
<_y_>
sounds reasonable, akin to what I actually did (stuff the value in a hash table when I create the graph viewer, remove it from the hash table via a callback when I close the window), but more, uh, conformant
<_y_>
the second question is harder to ask because I'm not entirely sure what's going on
<_y_>
as an example of a symptom of the issue that I'm facing ... the C++ application includes a debugger, and I have wrapped the C++ debugger interface in such a way that I cause it to call back into my OCaml code when events occur
<_y_>
so I set the debugger to trace, and my OCaml code gets called back into upon every instruction that the debugger traces
<_y_>
I have my OCaml code print the address of the currently-executing instruction, and I give it a well-defined stop condition
sepp2k has joined #ocaml
<_y_>
it will work as expected for a variable number of execution steps, after which point it will just stop tracing
<_y_>
before the stop condition fires, it just stops
<_y_>
then if I attempt to restart the execution, the program throws an exception
<thelema>
stack overflow?
<_y_>
similar, and similarly hard to pin down, things happen inside of the graph viewer
<_y_>
I don't think so re: stack overflow
<thelema>
what exception?
<_y_>
not consistent
<_y_>
different exceptions at different locations during different trials
<_y_>
and I should note that the environment is single-threaded
<thelema>
I don't know.
eye-scuzzy has quit [Quit: leaving]
<_y_>
yeah, I apologize for the vagueness here
<_y_>
I'll try to narrow it down more precisely and come back with a better question
eye-scuzzy has joined #ocaml
accel has joined #ocaml
<accel>
in haskell, I can look at the type of a function and know whether it's pure or not; in ocaml, is there a way in ocaml to ahve the compiler guarantee me that a piece of function is "pure" ?
<thelema>
accel: no
<accel>
thelema: for code review processes; what is the closest I can come to this?
<thelema>
look for :=, <- and any *.set functions (i.e. Array.set/unsafe_set)
<accel>
so is ti correct to say, ocaml's type system for functions
<thelema>
but it's possible for any of these to be hidden within functions called by the given code.
<accel>
only makes statements about the input/output types
<accel>
but makes no guarantee whatsoever about side effects
<thelema>
correct.
<thelema>
no guarantee on termination either
<accel>
i don't think haskell's type system guarantess termination either
lopex has quit []
<thelema>
it's possible, but impractical. the ocaml devs decided that side effect / pure was not worth it as well
<orbitz>
Of all the times i've tried to learn Haskell i've come to the conclusion that Purity is the turing tarpit of our age
<_y_>
for what it's worth, thelema, after I applied your suggestion regarding object lifetimes across the C++/OCaml boundary, I no longer experience the random, phantom segfaults, so I'm guessing it had something to do with the GC moving the object out from underneath my C++ code
<_y_>
thank you very much
<_y_>
two birds with one stone
tony_ has joined #ocaml
Yoric has joined #ocaml
<thelema>
_y_: you're welcome
ccasin has joined #ocaml
jlenormand has joined #ocaml
<jlenormand>
erm
<jlenormand>
is "lazy let" part of ocaml?
<thelema>
jlenormand: no, I think it's someone's camlp4...
<thelema>
jane street? no,
<thelema>
the french financial prog company
<jlenormand>
lexifi
ftrvxmtrx has quit [Read error: Operation timed out]
<thelema>
yes, them
<adrien>
gildor: ok, thanks, I'm trying to add something to lablgtk2 and it's not a lot of fun (it depends on react, the build system doesn't seem to enjoy that)
<adrien>
and while I'm reading that, you get something better with FRP for GUIs than with lazyness I believe
edwin has quit [Remote host closed the connection]
bohanlon has quit [Ping timeout: 246 seconds]
bohanlon_ is now known as bohanlon
lopex has joined #ocaml
edwin has joined #ocaml
<hcarty>
adrien: I agree. A proper FRP GUI API seems tricky to implement properly, but allows for some very nice end-user code
mlh has joined #ocaml
ftrvxmtrx has joined #ocaml
myu2 has quit [Remote host closed the connection]
<adrien>
well, coming soon near you: lablgtk.git/adrien/react :P
avsm has quit [Quit: Leaving.]
myu2 has joined #ocaml
drunK has quit [Remote host closed the connection]
bohanlon_ has joined #ocaml
Yoric has quit [Ping timeout: 276 seconds]
bohanlon has quit [Ping timeout: 246 seconds]
bohanlon_ is now known as bohanlon
Yoric has joined #ocaml
myu2 has quit [Remote host closed the connection]
jonathandav has quit [Remote host closed the connection]
<hcarty>
adrien: Sounds very exciting :-)
Yoric has quit [Quit: Yoric]
onigiri__ has joined #ocaml
onigiri__ has left #ocaml []
<adrien>
once I manage to get it integrated into the build system :P
<adrien>
(it should provide a method #react to use in place of #connect)
kaustuv has joined #ocaml
bohanlon has quit [Ping timeout: 260 seconds]
mnabil has joined #ocaml
trigen has quit [Read error: error:1408F10B:SSL routines:SSL3_GET_RECORD:wrong version number]
ttamttam has left #ocaml []
trigen has joined #ocaml
mnabil has quit [Ping timeout: 255 seconds]
ymasory_ has joined #ocaml
mnabil has joined #ocaml
ulfdoz has joined #ocaml
Yoric has joined #ocaml
tony_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 265 seconds]
_andre has quit [Quit: leaving]
yezariaely has joined #ocaml
_y_ has quit [Ping timeout: 265 seconds]
ftrvxmtrx has joined #ocaml
ftrvxmtrx_ has quit [Ping timeout: 240 seconds]
Yoric has quit [Ping timeout: 245 seconds]
yezariaely has left #ocaml []
arubin has joined #ocaml
tony_ has joined #ocaml
tony_ has quit [Quit: Leaving]
tony_ has joined #ocaml
tony_ has quit [Quit: Leaving]
Associat0r has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
krktz has joined #ocaml
krktz has quit [Client Quit]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 255 seconds]
orbitz has quit [Ping timeout: 240 seconds]
orbitz has joined #ocaml
avsm has joined #ocaml
oriba has joined #ocaml
<ski>
hm, i was wondering .. when referring to `ML', should that mean only the common ancestor of O'Caml and SML, or could it be used ambiguously for any language in the family ?
<thelema>
I use it either for the original ML or the name of the family - I don't refer to either OCaml or SML as 'ML"
<ski>
yeah, i was thinking so too
<ski>
"Mercury's type system is based on many-sorted logic with parametric polymorphism, very similar to the type systems of modern functional languages such as ML and Haskell."
<ski>
i suggested changing `ML' to `the MLs'
<cyanure>
Hi guy, i was wondering, in Arg, is there a way to specify the anon_func to get any number of arguments? a list or smtg ?
<thelema>
cyanure: (fun x -> anon_args := x :: !anon_args)
<cyanure>
ok
<cyanure>
thx thelema
<thelema>
ski: "the MLs" doesn't sound right either
<ski>
oh ?
<thelema>
even in that context, just "ML" seems okay to me
<thelema>
No specific "ML" is appropriately called "ML", but somehow all of them together can be called ML
<ski>
mhm .. to me that sounded as suggesting that `ML' (as of today) was a single language
Edward has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
avsm has quit [Quit: Leaving.]
ikaros has quit [Quit: Leave the magic to Houdini]
ftrvxmtrx_ has quit [Ping timeout: 240 seconds]
ftrvxmtrx has joined #ocaml
ccasin has quit [Quit: Leaving]
tony_ has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 276 seconds]
seafood has joined #ocaml
oriba has quit [Quit: Verlassend]
spicey has quit [Remote host closed the connection]
cyanure has quit [Remote host closed the connection]
Associat0r has quit [Ping timeout: 240 seconds]
seafood has quit [Quit: seafood]
ftrvxmtrx_ has quit [Read error: Operation timed out]
edwin has quit [Remote host closed the connection]
ftrvxmtrx_ has joined #ocaml
BiDOrD has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
gmarik has quit [Quit: Leaving.]
Edward has quit [Ping timeout: 240 seconds]
tony_ has quit [Quit: Ex-Chat]
Edward has joined #ocaml
coucou747 has joined #ocaml
mnabil has quit [Remote host closed the connection]
sepp2k has quit [Quit: Leaving.]
arubin has quit []
Edward has quit []
ymasory_ has quit [Remote host closed the connection]