<olegfink>
well, min-caml is 20 times the size of minml, and I absolutely don't care (for now) about the expressiveness of the language the compiler understand, I need something with simple AST and understandable code generator
rwmjones_lptp has joined #ocaml
rwmjones_lptp is now known as rwmjones
Associat0r has joined #ocaml
Associat0r has quit [Client Quit]
munga has joined #ocaml
<olegfink>
if anyone cares, here's a version of miniml modified to work with modern llvm: http://vpaste.net/BDuaq?
fx___ has joined #ocaml
fx_ has quit [Read error: 60 (Operation timed out)]
Yoric has joined #ocaml
caligula_ has joined #ocaml
[df] has joined #ocaml
pimmhogeling has quit ["Ik ga weg"]
pimmhogeling has joined #ocaml
avsm has joined #ocaml
caligula__ has quit [Read error: 110 (Connection timed out)]
<mrvn>
fx___: scheme?
<fx___>
?
<mrvn>
You can't get much simpler than scheme
ikaros has joined #ocaml
Submarine has joined #ocaml
_andre has joined #ocaml
fx___ has quit [Read error: 110 (Connection timed out)]
fx_ has joined #ocaml
maskd has joined #ocaml
peper has quit ["leaving"]
peper has joined #ocaml
munga has quit ["Ex-Chat"]
avsm has quit ["Leaving."]
ikaros has quit ["Leave the magic to Houdini"]
Yoric has quit []
<olegfink>
hm, where should caml_copy_string be defined?
<mrvn>
/usr/include/caml/alloc.h:CAMLextern value caml_copy_string (char const *);
<olegfink>
well, I meant to ask how should I use it from a binding (when I try to compile some ocaml code with a binding that uses it, I get "undefined reference")
<olegfink>
I compile it with $ ocamlc -cc g++ -ccopt -D__STDC_LIMIT_MACROS -ccopt -D__STDC_CONSTANT_MACROS -c modstr.c
<olegfink>
and then $ ocamlc -cclib -lstdc++ llvm.cma modstr.o modstr.ml -o modstr which says "undefined reference to `caml_copy_string(char const*)'"
<fx_>
put `extern "C"` around includes
<fx_>
* around caml includes
<olegfink>
thanks, it did it
<olegfink>
for some reason I assumed every C header in the universe comes with extern "C" wrapper already
<fx_>
not the french ones
<olegfink>
yay, now we have string representation of llvm modules!
<olegfink>
too bad it can't be done with llvm c api, so it won't make it to the official bindings
Spiwack has joined #ocaml
Submarine has quit [Read error: 110 (Connection timed out)]
ski_ has joined #ocaml
avsm has joined #ocaml
avsm has quit ["Leaving."]
<olegfink>
hm, would you recommend going ocamlbuild route to handle all those ocamlc invocation or should I better use a good old Makefile? The code's pretty much standalone, doesn't have to be integrated anywhere.
<julm>
ocamlbuild works well out of the box
<olegfink>
for llvm?
<julm>
and makefile forces you to improve your understanding of the compilation process
<julm>
euh
<julm>
dunno for llvm
<julm>
actually I don't even know what is llvm
<julm>
some other dude around will tell you for sure
<olegfink>
here's the command line my makefile produces: ocamlc -pp camlp4oof -cclib -lstdc++ -I +camlp4 dynlink.cma camlp4lib.cma llvm.cma llvm_bitwriter.cma llvm_bitreader.cma modstr.o minml.ml -o minml
<olegfink>
can I get the same without myocamlbuild.ml?
<julm>
does one of the .cma have the -cclib -lstdc++ in its embedded flags?
<[df]>
I want to experiment with a multi-module project in the top-level - do I need to build each module to a .cmo and then #load it?
<olegfink>
probably not, because it doesn't get picked if I omit it from the ocamlc invocation
<julm>
olegfink: then I don't know, wait for the answer of somebody familiar with ocamlbuild
zhijie has quit ["Leaving."]
zhijie has joined #ocaml
<julm>
[df]: you could create a module in the toplevel as in a file with the [module] keyword
<fx_>
It it is the llvm_*.cma modules that need -lstdc++ - then it would be better to embed this option inside that cma
<[df]>
julm: you mean put them all in the same module?
<fx_>
and then ocambuild without plugin would do
<[df]>
I want to leave them in different modules for when I build to an executable
derdon has joined #ocaml
<fx_>
otherwise you need a plugin to drive it
<julm>
[df]: then use several [module] keywords
<julm>
module A = struct end;;
<julm>
module B = struct end;;
<julm>
whatever you want
<[df]>
I'm not sure I follow
<[df]>
I'd put that at the top of each file?
<julm>
what do you want?
pimmhogeling has quit [Read error: 110 (Connection timed out)]
<[df]>
I've got this project which currently builds to an executable
<[df]>
but I want to easily test it from the toplevel
<fx_>
[df], you can load a .cma
<[df]>
what I'm doing currently is using a separate Makefile rule to build the .cmo files, and then a script to load them all into the toplevel
<julm>
especially when there is a alloc_small in the middle
<olegfink>
that'd explain why it corrupts things.
<julm>
maybe :)
<olegfink>
(it corrupts ModuleID)
<julm>
that said, maybe llvm brings/deletes something special that makes this CAML* useless
tmaeda is now known as tmaedaZ
<olegfink>
it seems strange, LLVMModuleRef is opaque, ocaml has no idea about what it is
<Camarade_Tux>
doubtful and probably not worth it, and it should be easy to test it anyway ;-)
<olegfink>
then somewhere in it there is a pointer to ocaml string
<olegfink>
and then ocaml gc's the string...
<olegfink>
well, llvm takes about an hour to build
<julm>
ctux: ^ and on your phantom?
<Camarade_Tux>
olegfink: I have a machine that should build it pretty quickly but I don't have much time, so if you can give me what I need to download and what I need to do, I can do it ;-)
<Camarade_Tux>
(no need to go into too many details though ;-) )
<Camarade_Tux>
btw, I'll put up a machine meant for compiling and testing across various OS and architectures (qemu though, but quad-core) at least for the mingw-w64. And for ocaml too unless everyone tell me noone will use it: if you want to save me _some_ time, tell it now ;-)
<Camarade_Tux>
btw, this machine compiles gcc in 5 minutes :-)
<julm>
go go go ctux !
<olegfink>
Camarade_Tux: which distro is it running?
<julm>
slack I guess
<Camarade_Tux>
olegfink: I use slackware64 but I'll put various virtual machines (I'm currently even downloading a ppc32 distrib to see how fast [or slow] it is)
<thelema>
ah, much better. a Not_found being raised at a totally different location
<Camarade_Tux>
thelema: would it be possible you have a mix of modules? like ocaml picking the bad one? or different versions?
pad` has joined #ocaml
<thelema>
It's probably related to me updating my local batQueue module...
<thelema>
although I would expect that to raise an error
<thelema>
maybe the signature didn't change.
<Camarade_Tux>
olegfink:
<Camarade_Tux>
; ModuleID = 'p�'
<olegfink>
cool, now the course of action is probably to add CAMLprim/CAMLreturn to llvm_create_module in llvm/bindings/ocaml/llvm/llvm_ocaml.c
<Camarade_Tux>
(the second character enclosed in single quotes is unreadable)
<Camarade_Tux>
okay, trying
<olegfink>
(ModuleID should be what I gave it, e.g. "name")
<olegfink>
s/e.g./i.e./
<Camarade_Tux>
ok
ccasin has quit [Remote closed the connection]
<olegfink>
maybe adding printf("%s\n", String_val(ModuleID)) in llvm_create_module would help
<Camarade_Tux>
who wrote the bindings?
<Camarade_Tux>
I'm not a pro of C bridges but this one looks really weird: it's not returning something of type "value"
<olegfink>
not me!
<Camarade_Tux>
^^
<olegfink>
you know, some of its arguments aren't of type value either
<julm>
|* Note that these functions intentionally take liberties with the CAMLparamX *|
<julm>
|* macros, since most of the parameters are not GC heap objects. *|
<Camarade_Tux>
well spotted
<Camarade_Tux>
doesn't cost much to try
<olegfink>
by the way I tried the other way 'round
<olegfink>
wrote a wrapper around C++ function to set the module id
<olegfink>
even without CAML* and Gc.compact() between setting and printing everything looks fine
hyperboreean has quit [Read error: 110 (Connection timed out)]
ccasin has joined #ocaml
<Camarade_Tux>
julm: regarding the comment you pasted, that works for params but not for return values, right?
alexyk has quit []
<julm>
euh
<Camarade_Tux>
casting to value didn't help, I get the same output
<Camarade_Tux>
unfortunately I really can't spend more time on that today and I have to go =/
<Camarade_Tux>
(will be free tomorrow)
alexyk has joined #ocaml
* julm
reads caml/memory.h
<olegfink>
Camarade_Tux: thanks, have fun
ccasin has quit [Remote closed the connection]
Yoric has quit []
alexyk has quit []
demitar has joined #ocaml
demitar has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
_andre has quit ["*puff*"]
alexyk has quit []
Submarine has quit [Read error: 110 (Connection timed out)]
alexyk has joined #ocaml
ttamttam has joined #ocaml
itewsh has joined #ocaml
gilsonm has joined #ocaml
ttamttam has quit ["Leaving."]
alexyk has quit []
ygrek has joined #ocaml
kotrin has joined #ocaml
kotrin has left #ocaml []
ulfdoz has quit [Read error: 110 (Connection timed out)]
itewsh has quit [Client Quit]
otswim has joined #ocaml
<otswim>
hello, has someone even used the implementation of fibheap for ocaml? i implemented dijkstra, but sometimes i get "Fatal error: exception FibHeap.Make(Ord).Empty" when doing fibheap_extract_min_data heap whereas fibheap_size heap outputs a lot more than 0; has anyone ever had this problem?
alexyk has joined #ocaml
CcSsNET has quit [K-lined]
jcaose has joined #ocaml
anders^^ has quit [Read error: 60 (Operation timed out)]
derdon has quit []
ygrek has quit [Remote closed the connection]
<otswim>
i'm beginning to think that's because i'm not compiling fiblib correctly, what is the good way to do that? to 'make' the src and then?
Submarine has joined #ocaml
<otswim>
what should i do with the cma and cmxa? just use them within ocamlopt?
jcaose has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux>
cma with ocamlc and cmxa with ocamlopt
<Camarade_Tux>
maybe more a problem in the fib-heap implementation but I don't know, I never used it
<olegfink>
bleh, ocaml is a beatiful language, but a terrible toolkit
ski_ has quit ["Lost terminal"]
travisbrady has joined #ocaml
<olegfink>
is now too late to just redo the whole system? :-)
<olegfink>
(before godi and batteries get more widespread)
<olegfink>
Camarade_Tux: you have automated gtk+ wrapper generator, right?
<thelema>
olegfink: batteries isn't sufficient - an improved ocamlbuild might be
<Camarade_Tux>
olegfink: not complete and not perfect though
<Camarade_Tux>
right now, it does webkit-gtk really well but I know others which don't completely work
<olegfink>
well, with all my love to unix, I believe such an adanced language must have a different compilation model, probably more like java's (though it's very weird at certain points)
<travisbrady>
is anyone aware of an sql parser for ocaml? I have an svn repo with a few thousand sql queries in it and I'm hoping to find duplicates and near duplicates
<olegfink>
Camarade_Tux: I'm just fed up with current llvm ocaml bindings and feel advanterous enough to try something from scratch
<travisbrady>
I googled but just found this YACAMLQT which is a C# project
<olegfink>
or maybe I should just screw llvm
ikaros has joined #ocaml
<thelema>
travisbrady: I don't know of one - you've checked the ocaml hump?
<thelema>
olegfink: It seems everyone is doing llvm now
<travisbrady>
thelema: i have, but i always have difficulty navigating around there so maybe i missed it
<travisbrady>
thelema: btw, nice work on batteries, i spent some time this weekend investigating it
<thelema>
travisbrady: fair enough. I don't know of one, but expect a large subset easy to parse
<olegfink>
it's a bit like webkit -- a millions times betters than gecko but still a huuge pile of c..p
<thelema>
travisbrady: thanks.
<travisbrady>
would it be reasonable to attempt to build one using BatParserCo?
<olegfink>
doesn't pgocaml come with some camlp4-based parser?
<travisbrady>
ahh, i'll have a look at that. thanks olegfink
<Camarade_Tux>
olegfink: there are two things: 1- ocaml-gir relies on some "glib" "conventions" (rather, conventions followed by glib-based libraries) but it should be possible to overcome that problem, 2- gobject-introspection is a horrible POS, I wouldn't mind dumping it now even though I've solved the problem i had with it
hyperboreean has joined #ocaml
<Camarade_Tux>
just needs a good C (C++ ?) parser
<otswim>
Camarade_Tux: i can't do open FibHeap if i compile with ocamlopt fiblib.cmxa etc.
<olegfink>
nice joke, Camarade_Tux :-)
<Camarade_Tux>
;-)
<Camarade_Tux>
olegfink: and remember that you can't bind "int*" without annotations ;-)
<otswim>
http://pastebin.com/f7176a5b8: maybe do i need some other files that just fiblib.cmxa in order to compile? for instance some of the fibheap.*?
<olegfink>
just why people _start_ writing stuff in C++? (like llvm)
<Camarade_Tux>
so that you have a harder time writing binding to it ;-)
fremo_ has quit [lindbohm.freenode.net irc.freenode.net]
ertai_ has quit [lindbohm.freenode.net irc.freenode.net]
TaXules has quit [lindbohm.freenode.net irc.freenode.net]
companion_cube has quit [lindbohm.freenode.net irc.freenode.net]
noj has quit [lindbohm.freenode.net irc.freenode.net]
ertai has joined #ocaml
TaXules has joined #ocaml
fremo_ has joined #ocaml
companion_cube has joined #ocaml
alexyk has quit []
Submarine has quit [Read error: 113 (No route to host)]
<otswim>
has someone ever heard of the exception: FibHeap.Option.No_value; i'm getting it but this exception is document nowhere, i've looked the doc of fiblib and didn't find this exception in it (it has been raised by fibheap_decrease_key) and google has 0 result for it