gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
cdidd has quit [Remote host closed the connection]
Framedragger has quit [Quit: Leaving.]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
ulfdoz has quit [Ping timeout: 240 seconds]
ulfdoz has joined #ocaml
Progster has joined #ocaml
sepp2k1 has quit [Remote host closed the connection]
mjonsson has joined #ocaml
Sablier has quit [Quit: Kat]
avsm has quit [Quit: Leaving.]
bobry has quit [Remote host closed the connection]
lopex has quit [Remote host closed the connection]
joewilliams has quit [Remote host closed the connection]
mjonsson has quit [Read error: Connection reset by peer]
Progster has quit [Ping timeout: 260 seconds]
emmanuelux has quit [Ping timeout: 264 seconds]
pango has quit [Ping timeout: 252 seconds]
ssbr__ has quit [Ping timeout: 252 seconds]
pango has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 244 seconds]
impomatic has quit [Read error: Connection reset by peer]
Progster has joined #ocaml
BiDOrD_ has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
BiDOrD has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
Hussaind has joined #ocaml
BiDOrD has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
Hussaind has left #ocaml []
Progster has quit [Ping timeout: 240 seconds]
BiDOrD has quit [Remote host closed the connection]
BiDOrD has joined #ocaml
hcarty has quit [Ping timeout: 252 seconds]
hcarty has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
Hodapp has quit [Read error: Operation timed out]
Hodapp has joined #ocaml
lamawithonel has joined #ocaml
lamawithonel has quit []
lamawithonel has joined #ocaml
lamawithonel has quit [Ping timeout: 244 seconds]
jonafan has quit [Ping timeout: 252 seconds]
jonafan has joined #ocaml
eni has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
fantasticsid has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
fantasticsid has joined #ocaml
BiDOrD has quit [Read error: Connection reset by peer]
BiDOrD has joined #ocaml
Snark has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
ftrvxmtrx has quit [Quit: Leaving]
eni has quit [Ping timeout: 244 seconds]
pango is now known as pangoafk
edwin has joined #ocaml
dwmw2_gone has quit [Read error: Connection reset by peer]
dwmw2_gone has joined #ocaml
dwmw2_gone has quit [Excess Flood]
dwmw2_gone has joined #ocaml
C_Tux is now known as adrien___
cdidd has joined #ocaml
djcoin has joined #ocaml
adrien___ is now known as adrien
Sablier has joined #ocaml
Sablier has quit [Read error: Connection reset by peer]
Sablier has joined #ocaml
silver has joined #ocaml
ftrvxmtrx has joined #ocaml
fantasticsid has joined #ocaml
Tobu has quit [Remote host closed the connection]
Tobu has joined #ocaml
avsm has joined #ocaml
avsm has quit [Quit: Leaving.]
ankit9 has joined #ocaml
emmanuelux has joined #ocaml
impomatic has joined #ocaml
Yoric has joined #ocaml
impomatic is now known as john_metcalf
joewilliams has joined #ocaml
ankit9 has quit [Quit: Leaving]
avsm has joined #ocaml
ankit9 has joined #ocaml
Tobu has quit [Ping timeout: 248 seconds]
john_metcalf has quit [Quit: http://RetroProgramming.com]
Yoric has quit [Quit: Instantbird 1.2a1pre -- http://www.instantbird.com]
Yoric has joined #ocaml
phao has joined #ocaml
fantasticsid has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
joewilliams has quit [Remote host closed the connection]
joewilliams has joined #ocaml
thomasga has joined #ocaml
Submarine has quit [Quit: Leaving]
avsm has quit [Quit: Leaving.]
tmaedaZ has quit [Ping timeout: 260 seconds]
ankit9 has quit [Ping timeout: 244 seconds]
tmaedaZ has joined #ocaml
john_metcalf has joined #ocaml
ankit9 has joined #ocaml
avsm has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
f[x] has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
dsheets has joined #ocaml
ftrvxmtrx has joined #ocaml
ankit9 has quit [Ping timeout: 248 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
dsheets has quit [Ping timeout: 244 seconds]
bobry has joined #ocaml
ankit9 has joined #ocaml
osa1 has joined #ocaml
<avsm> is there any reason that %.d.cmx doesnt exist as an ocamlbuild target? %.d.cma and %.p.cmx exist...
lopex has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
lamawithonel has joined #ocaml
diml has quit [Ping timeout: 244 seconds]
munga has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
_andre has joined #ocaml
lamawithonel has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
Yoric has joined #ocaml
Progster has joined #ocaml
xaimus has quit [Ping timeout: 252 seconds]
xaimus has joined #ocaml
diml has joined #ocaml
f[x] has quit [Remote host closed the connection]
Framedragger has joined #ocaml
<hcarty> avsm: Oversight?
<hcarty> avsm: I expect it was missed somewhere. It took a long while for ocamlfind integration to support all of the options it should, so this may be a similarly missed feature.
sepp2k has joined #ocaml
<hcarty> We have camlp4-less syntax extensions/AST transformations in trunk... nifty
f[x] has joined #ocaml
<avsm> hcarty: %.p.cmx is pretty broken at first glance
<avsm> the issue seems to be that dependent cmx files arent detected as present (since %.cmx is looked for)
<flux> hcarty, hmm, the one based on attributes or something?
<avsm> this breaks inter-module inlining, but also totally fails if you use for-pack
<avsm> hrm
<hcarty> flux: I'm not sure - there is an example in the source tree but I haven't gone into it too much yet.
<hcarty> flux: I think it's similar though, if not the same.
<flux> An example of a simple AST -> AST rewriter
<flux> maybe it's just me, but it doesn't seem very simple :P
<hcarty> flux: That was my reaction, which is part of why I haven't spent much time looking at it :-)
tac-tics has joined #ocaml
<hcarty> flux: I think line 135 and on are the interesting bits. The rest seems like boilerplate which could hopefully be eliminated/limited before an official release.
edwin has left #ocaml []
gnuvince has quit [Ping timeout: 245 seconds]
ankit9 has quit [Quit: Leaving]
ankit9 has joined #ocaml
<f[x]> that generic parts will be in stdlib or whatever I guess
ankit9 has quit [Quit: Leaving]
john_metcalf has quit [Quit: john_metcalf]
smondet has joined #ocaml
<_andre> does anyone have an example of creating a value of a variant type with arguments from C?
<hcarty> _andre: Starting on line 113: https://forge.ocamlcore.org/plugins/scmgit/cgi-bin/gitweb.cgi?p=ocaml-hdf/ocaml-hdf.git;a=blob;f=src/hdf_impl.c;h=588e4d343d3d1de83fa142d60d3556f5a198064e;hb=HEAD
<hcarty> _andre: Sorry, line 107
<hcarty> That covers variant and polymorphic variant values
<hcarty> And after reading your question again it looks like you want the linux-nantes page
gnuvince has joined #ocaml
<_andre> hcarty: thanks
tac-tics is now known as tac-tics[home]
Yoric has quit [Ping timeout: 244 seconds]
tac-tics has joined #ocaml
diego_diego has joined #ocaml
Submarine has quit [Quit: Leaving]
tmaedaZ has quit [Ping timeout: 252 seconds]
tmaedaZ has joined #ocaml
Sablier has quit [Read error: Connection reset by peer]
Yoric has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
silver has quit [Read error: Connection reset by peer]
fraggle_ has quit [Remote host closed the connection]
<gnuvince> I have a quick question about ocamllex + ocamlyacc; if I declare %token FOO in parser.mly, can I associate line/column information in the lexer, or would that need to be %token <Lexing.position> FOO?
djcoin has quit [Quit: WeeChat 0.3.2]
Yoric has joined #ocaml
fraggle_ has joined #ocaml
eni has joined #ocaml
<thelema> gnuvince: when parsing, you have access to position information in the lexer through global variables
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<gnuvince> thelema: ah, great, thanks!
<thelema> | error { printf "ERROR(line %d): couldn't parse rule\n%!" ($startpos.pos_lnum); exit 1 }
avsm has quit [Quit: Leaving.]
<thelema> I have this, although the "$startpos" looks weird to me now
<pippijn> I think that's menhir
Kakadu has joined #ocaml
emmanuelux has quit [Ping timeout: 264 seconds]
<thelema> ah, yes
avsm has joined #ocaml
Anarchos has joined #ocaml
pangoafk is now known as pango
tac-tics_ has joined #ocaml
tac-tics has quit [Ping timeout: 245 seconds]
tac-tics[home] has quit [Ping timeout: 245 seconds]
avsm has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: Leaving]
thomasga has quit [Ping timeout: 240 seconds]
Tobu has joined #ocaml
Sablier has joined #ocaml
Tobu has quit [Client Quit]
Tobu has joined #ocaml
osa1 has joined #ocaml
fraggle_ has quit [Remote host closed the connection]
<ssbr> I am reading terrible business on how to wrap C to be used from OCaml: http://www.linux-nantes.org/~fmonnier/ocaml/ocaml-wrapping-c.php
<ssbr> with regards to creating arrays from C, it says that it's the same as tuples, "except that you have to make sure that all the elements of the array have the same type."
<ssbr> Literally? Like I change nothing except everything has the same type, and ocaml figures out whether it's a tuple or an array by magic?
<Anarchos> ssbr arf :)
<Hodapp> Anarfos?
<Anarchos> Hodapp i know the house where stand linux-nantes :)
<ssbr> If you've got better/clearer docs I'd be happy.
<Anarchos> ssbr maybe looking the code directly ?
<ssbr> What code?
<Anarchos> ssbr the code of the wrapping !
<ssbr> I'm writing the wrapper.
<ssbr> I need to know how to do what I need to do.
<Anarchos> ssbr the ocaml official manual is pretty clear if i remember (section "interfacing with C")
Xizor has joined #ocaml
<ssbr> oh, derp, of course, it doesn't magically infer it's a tuple/array, it knows because of a separate type declaration
<Qrntz> it wouldn't be able to, since tuples can be homogenous
<ssbr> Right.
<ssbr> It hit me when I saw that booleans are just ints of value 0/1 :p
* ssbr is not really writing a new wrapper as much as extending an old one
<ssbr> and the current wrapper is an inscrutable combination of macros and such that hide how it really works <_<
<adrien> ssbr: arrays and tuples are stored the same way basically
<adrien> the exception is when floats/doublaes are invovled
<ssbr> Right, when they are stored unboxed
<ssbr> also records get unboxed into the same thing sometimes.
<ssbr> Woo, the power of static typing :p
<mrvn> isn't a float tuple also stored unboxed?
<ssbr> mrvn: doesn't look like it
<ssbr> the mention of representing floats as Double_array_tag arrays is restricted to when they talk about records and arrays
<mrvn> I guess that would make problems with a function taking a (float * 'a) tuple.
<Anarchos> double_array_tag is just to speed up scientific programs
<mrvn> and saves a but lot of memory
<ssbr> One thing I wanted to know, that's tangentially related: is it possible / at all reasonable to make libraries in OCaml that are meant to be used from C (and languages with C FFIs)?
<Anarchos> a (float *'a) tuple would be store as any tuple, but would take much more memory
<mrvn> Anarchos: point was that a (float * int) tuple would be boxed and if a (float * float) tuple is not then a function expecting a (float * 'a) doesn't know if it is boxed or not.
<Anarchos> mrvn i am not skilled enough anyway to know that
<ssbr> mrvn: C++ has a solution for this... ;)
<mrvn> ssbr: c++ doesn't even have boxing
<ssbr> mrvn: Depends what you mean. Anyway, it has generics that can accept things with wildly different interfaces
<mrvn> ssbr: nope. it has templates that are like functors.
<ssbr> it solves this sort of problem by compiling the function with different implementations -- so in this example, we have one compiled version that takes boxed tuples, and one that takes unboxed tuples. And then presumably you know at the call-site statically which you want?
<ssbr> welp, it compiles, and doesn't segfault. On the other hand, it doesn't seem to exist, so of course it doesn't segfault.
<ssbr> `external fdd_vars : int -> int array = "wrapper_fdd_vars"` should be enough to make ocaml aware of a function called fdd_vars , right?
<mrvn> ssbr: yes
<mrvn> s/fdd_vars/wrapper_fdd_vars/ though
<mrvn> It binds the function wrapper_fdd_vars to the ocaml value fdd_vars
<ssbr> I want ocaml code to be aware of a function called fdd_vars, which is implemented in the C function called wrapper_fdd_vars
<ssbr> so that I can call it like (fdd_vars x) for some int x
ftrvxmtrx has joined #ocaml
<ssbr> Oh, there is a .mli file too
<ssbr> do I only need to put it in one of those?
<ssbr> the code here has the same declarations in the .ml and .mli files...
<mrvn> you can
<ssbr> I can leave them in just the .mli file?
<mrvn> no, you can put a abstract entry in the mli if you want
<ssbr> mrvn: "abstract entry"?
<mrvn> val fdd_vars : int -> int array
<ssbr> Ah, nice
<mrvn> you don't have to expose that it is C code.
<ssbr> man, I broke the linker
<ssbr> /usr/bin/ld: cannot find -lzbdd
<ssbr> linking used to work, definitely.
<ssbr> Any idea how to debug this?
avsm has joined #ocaml
<mrvn> undo what you did to break it
<orbitz> ssbr: find libzbdd and prove ld is looking for it in the righ tplace, perhaps via strace
<ssbr> humm
<ssbr> there's more below, bleh, I should've noticed that
<ssbr> the error is: http://codepad.org/yzEpKWak
<ssbr> anyway, I don't know how to find libzbdd
<ssbr> I can't believe that ld can't find it now, if it could find it before. All I changed were C and OCaml source files.\
avsm has quit [Quit: Leaving.]
<Kakadu> ssbr: it is your code or not?
<ssbr> Kakadu: it is code that I am working on, but I didn't write most of it. Nor did I write the build script thing.
<Kakadu> what command is executed before thies error?
<Kakadu> this*
tac-tics_ is now known as tac-tics
<wmeyer> ssbr: maybe you have some code generator that depends on lzbdd and changing a file you triggered this dependency to built
<ssbr> I've changed that file before, though.
<ssbr> Every file that I have changed today, I changed previously with no ill effects
<ssbr> can a link error not be caused by incorrect code?
<Kakadu> ssbr: hm, do you know where libzbdd is?
phao_ has joined #ocaml
<ssbr> Kakadu: I have never heard of it
<Kakadu> use find or locate
phao has quit [Disconnected by services]
phao_ is now known as phao
<ssbr> locate lists it in all my checkouts of this project
<ssbr> (~/datalogX/Buddy/libzbdd.so )
<Kakadu> good
<ssbr> (where X is the empty string, 1, or 2)
<Kakadu> try to add options below to the mentioned ocamlopt command
<gnuvince> Does ocamlyacc allow things like: production: TOKEN* ; ?
<Kakadu> -ccopt -L~/datalog/Buddy -ccopt -lzbdd
<Kakadu> ssbr ^^
<wmeyer> gnuvince: yes list(TOKEN)
<ssbr> Kakadu: ok, I'll figure out how to do this :p
<ssbr> thank you
<wmeyer> gnuvince: it's not PEG but allows to repeat elements, it's unrolled to recursive rule
<tac-tics> What kind of a bytecode format does Ocaml use?
<tac-tics> Is it a stack machine compilation? Or a low-level lambda lifted lambda calculus?
<gnuvince> wmeyer: is there somewhere these are listed?
<wmeyer> gnuvince: yes, in the manual
<wmeyer> tac-tics: both
<tac-tics> wmeyer: Does the manual also specify the bytecode format? Or is that more of a "read the source code" topic?
<gnuvince> wmeyer: can't find it in here: http://caml.inria.fr/pub/docs/manual-ocaml/manual026.html
<wmeyer> tac-tics: I think it's more like - read source
<wmeyer> tac-tics: you can always use compiler-libs/ to reuse some of the code
<tac-tics> wmeyer: okay.
<wmeyer> there are trace options, and -dinstr option
avsm has joined #ocaml
<tac-tics> I'm looking for inspiration for a new toy functional language I'd like to write.
<tac-tics> One of my requirements is to have it compile to Javascript and at least one other target (probably JVM), and I know from other projects there are some quirks with doing that naively.
<wmeyer> gnuvince: I meant Menhir - sorry
<wmeyer> ocamlyacc is minimalistic
<wmeyer> tac-tics: you could take a look at js_of_ocaml
<wmeyer> (if you haven't)
<tac-tics> wmeyer: Thanks.
<tac-tics> And no, I haven't. I have never really worked with Ocaml at all. I'm coming from a Haskell background. But I don't really think lazy evaluation makes a good default.
<tac-tics> So for my own language design, I'm looking into the alternatives in FP :)
<orbitz> tac-tics: Looked at Roy?
<orbitz> Adding a JVM backend to Roy would be neat
cyphase has joined #ocaml
<tac-tics> orbitz: Nope. Never heard of him.
<orbitz> it's not a Him, it's a language
<tac-tics> I know :) I'm reading up on it now.
avsm has quit [Quit: Leaving.]
<orbitz> tac-tics: i think it's a cute language. Complicated enough to be fun.
<wmeyer> orbitz: so it's not bootstrapping itself
<tac-tics> orbitz: I'll definitely look over it.
<orbitz> wmeyer: Currently it' simplemented in JS AFAIK
<wmeyer> orbitz: yes I can see :-) it should be really implemented first time only in JS
<orbitz> wmeyer: Indeed :)
<orbitz> hoefully they'll do that
john_metcalf has joined #ocaml
john_metcalf has left #ocaml []
Snark has quit [Quit: Quitte]
adrien is now known as adrien_
adrien_ is now known as adrien
Tobu has quit [Remote host closed the connection]
gnuvince has quit [Ping timeout: 252 seconds]
Tobu has joined #ocaml
Submarine has quit [Ping timeout: 244 seconds]
BiDOrD has quit [Ping timeout: 265 seconds]
eni is now known as albacker
albacker has quit [Changing host]
albacker has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
<ssbr> OK, so, I'm suffering from a linker error: shell session is here: http://bpaste.net/show/xfx0qkIp5mXVIgqU8LiW/
<ssbr> I followed advice given here earlier (to make it run ocamlopt ... -ccopt -L~/datalog/Buddy -ccopt -lzbdd ...) , but that doesn't appear to have changed anything
<Kakadu> ssbr: show output of my command plz
<mrvn> does it call ld with -L ...?
<ssbr> Kakadu: that is the output...
<Kakadu> ssbr: I don't see --copt...
<ssbr> Kakadu: -ccopt
<Kakadu> aah
<Kakadu> I see
sepp2k1 has joined #ocaml
<smondet> ssbr: I think in that case ld looks for libzbdd.a (not .so)
<ssbr> mrvn: I don't know what ocamlopt does with its arguments :(
<ssbr> smondet: I see. Although I don't know how to resolve this.
sepp2k has quit [Ping timeout: 246 seconds]
<Kakadu> what files are in Buddy/ ?
<Kakadu> maybe you can add .a somewhere in command above?
<ssbr> Kakadu: http://bpaste.net/show/MmtJ3D43tOG8PEfKVmwN/ <-- files in Buddy
<Kakadu> hm
<Kakadu> I can't see Buddy/libzbdd.so
<ssbr> Neither can I. It is not there.
<Kakadu> but locate says....
<ssbr> yes, one of the paths given by locate is /home/daj/datalog3/Buddy/libzbdd.so
<Kakadu> locate sux
<ssbr> None of the other paths contain a libzbdd.so either
<Kakadu> use find to find a *zbdd*
<ssbr> er, wait, yes they do
<ssbr> $ find ~ | grep .*zbdd.*
<ssbr> /home/daj/datalog2/Buddy/libzbdd.so
<ssbr> /home/daj/datalog/Buddy/libzbdd.so
<ssbr> I guess that one time I ran "make clean" got rid of it? but make didn't put it back? guh
* ssbr reads the makefile
<Kakadu> I think u can copy backup version :D
<ssbr> Kakadu: I changed the buddy bindings, so I want something newer...
gnuvince has joined #ocaml
albacker has quit [Quit: Leaving]
_andre has quit [Quit: leaving]
iZsh has quit [Ping timeout: 260 seconds]
Progster has quit [Ping timeout: 244 seconds]
<Kakadu> What is mad in my C function? http://bpaste.net/show/WmAQHNa0n4AAraaB6oye/
iZsh has joined #ocaml
<mrvn> Kakadu: the CAMLreturn
<ssbr> oooookay, so running "make clean" definitely deletes that .so and running make does not regenerate it. Ever.
<ssbr> Must be a buggy makefile, and that must've been a downloaded constant thing.
<wmeyer> ssbr: additionally, maybe it's a virus that replicates on your hard drive :-)
<mrvn> Kakadu: and you should cache caml_named_value
<Kakadu> mrvn: CAMLreturnT(int,Int_val(ans)) ?
<mrvn> Kakadu: the sprintf are bad too
<Kakadu> mrvn: I van caml_named_value using static.
<mrvn> Kakadu: not sure. I just think the CAMLparam0() must be matched by a CAMLreturn thingy
<Kakadu> s/van/cache/
<mrvn> Kakadu: just like the docs say
<mrvn> Kakadu: and don't you have to check the return of caml_callback with some makro?
<mrvn> check for an exception
<Kakadu> I think caml_callback is OK
<Kakadu> caml_incr is let f x = x+1
<mrvn> Kakadu: I'm assuming this is some simple testcase.
<thelema> if an exception is returned, bad things will happen, but no problem otherwise with not checking.
<mrvn> ans can also never be 0
<ssbr> some C code I'm wrapping aborts the program. How do I debug to find out where this happens?
<mrvn> ssbr: gdb
<ssbr> As I understand it, the debugger cannot be run on compiled ocaml code
<thelema> ssbr: it can.
<mrvn> sure it can
<ssbr> Oh. Well, then, how do I run the debugger?
<thelema> Kakadu: also, why are you treating your input and return type as int? It should be value.
<mrvn> ssbr: how much time do you have?
<ssbr> I don't want to use gdb until I find out which C function is failing, then I'll debug that C function.
<mrvn> thelema: I'm asuming this is for C code that calls ocaml.
<ssbr> mrvn: how should that change the answer? I need to solve my problem as fast as is reasonable, and will take as much time is necessary to solve it
<Kakadu> thelema: why value?
<ssbr> mrvn: no, it's ocaml code that calls C
<mrvn> ssbr: because learning how to use gdb is a bigger project
<thelema> Kakadu: because that's the type of ocaml values, thus Int_val and Val_int
<ssbr> mrvn: I have programmed in C before, and know how to use gdb and gdb-like debuggers
<mrvn> ssbr: then what is your question. just use it
<ssbr> mrvn: However I don't know how to use gdb on ocaml code, and would rather I use an ocaml debugger for navigating ocaml code
<thelema> mrvn: oh, c code just calling ocaml?
<ssbr> I do not want to debug C code until I have isolated the problem to C code
<thelema> mrvn: I assumed this was a full circle loop.
<mrvn> ssbr: you said the C code aborts. so an ocaml debugger won't help
<Kakadu> thelema: arggh, Int_val doesn't extract normal int from OCaml int value?
<thelema> mrvn: that's probably my bad assumption
<ssbr> mrvn: It will let me step through the ocaml code until it calls the relevant C code.
<thelema> Kakadu: it should.
<thelema> Kakadu: or maybe the reverse.
<ssbr> then it'll magically abort, and I'll know what to call gdb on. Or is this not an effective strategy?
<mrvn> ssbr: just call gdb and see where it aborts.
<thelema> Kakadu: yes, int_val converts an ocaml value to an int.
<ssbr> how is that easier? :(
<tac-tics> I heard it was possible to walk backwards in pure code in the Ocaml debugger. Is that true?
<Kakadu> thelema: so it is OK that my function returns int?
<mrvn> Kakadu: that is something you have to know. is it suppsoed to return int?
<thelema> Kakadu: what is your function being called by? other C code?
<ssbr> mrvn: all that tells me is this:
<ssbr> -strategy polar -main_program src/datalog/test/smallTests/ex009/ex009.datalog
<ssbr> errrrrr
<ssbr> Program received signal SIGABRT, Aborted.
<ssbr> 0xb7fdd424 in __kernel_vsyscall ()
<wmeyer> bt
<mrvn> ssbr: and the backtrace?
<_habnabit> ssbr, that's the only thing on the stack?
<thelema> tac-tics: yes, ocaml's debugger can time travel (to an extent)
<Kakadu> thelema: yeah, other C code
<ssbr> The next line is "(gdb)"
<_habnabit> bt
<tac-tics> thelema: neat!
<ssbr> Ah, okay
<thelema> Kakadu: then you don't need any of the CAML* macros
<tac-tics> Do tail calls generally cause issues when debugging, since they throw away part of your stack?
<thelema> tac-tics: no more than for loops cause issues
<mrvn> Kakadu: you are allso missing the acquire/release_runtime makros.
<ssbr> I know which ocaml function now, but not which C function
<_habnabit> ssbr, bdd_default_errhandler isn't a C function?
<ssbr> _habnabit: not one I called directly, no.
<Kakadu> mrvn: caml_main(argv)?
<ssbr> I called a few other different functions directly, which I guess called bdd_default_errhandler
<_habnabit> ssbr, _something_ is calling it, though
<_habnabit> ssbr, it looks like it's set as a callback by something
<ssbr> _habnabit: well yes.
<mrvn> Kakadu: your C code doesn't hold the caml runtime lock, right? Then you need to acquire it before the callback
phao has left #ocaml []
<tac-tics> Is the Ocaml runtime GIL'ed?
<_habnabit> ssbr, especially with 'default' in the name
<ssbr> _habnabit: yes
<mrvn> ssbr: start adding printf.
<ssbr> mrvn: the prints don't show up.
<ssbr> is there some buffering I can turn off somewhere?
<mrvn> ssbr: don't forget to flush_all ()
<_habnabit> ssbr, might search to see what it's being used as a callback for
<ssbr> I'm including newlines
<_habnabit> ssbr, add %! to the end of your format string
<ssbr> _habnabit: that's all the way in the BuDDY codebase, which I have no idea how to navigate as I've never touched it
<_habnabit> fun
<ssbr> the error is definitely in one of the wrapper functions I added, not in the codebase itself
<Kakadu> hmmm
<mrvn> ssbr: and try to compile with -g
<Kakadu> I've understanded the problem
<wmeyer> -gdb3
<mrvn> Kakadu: understood
<Kakadu> mrvn: understood
<Kakadu> code above works on x86_64 but crashes on ARM
<mrvn> Kakadu: pure luck
* Kakadu hates crosscompilation
<ssbr> woo, so the problem is in my fdd_vars function, and not (so far) in bdd_ithvar. Fun times.
<Kakadu> mrvn: What kind of locks do you mean? Where is it in http://caml.inria.fr/pub/docs/manual-ocaml/manual032.html ?
<ssbr> mrvn, _habnabit, et al: thanks.
<mrvn> 18.10.2 Parallel execution of long-running C code
<mrvn> and you might need 18.10.1 Registering threads created from C
<mrvn> and 18.7.4 Main program in C
<Kakadu> I don't think I have parallel execution at all
BiDOrD has joined #ocaml
<mrvn> The docs don't say but the caml_main() probably returns with the runtime lock held so you probably don't have to care about it.
<Kakadu> Java executes C code which executes OCaml code... It is Android hell
<mrvn> Unless your ocaml code creates threads and you want them to run in parallel.
<mrvn> java is full of threads ...
<Kakadu> Java is DSL for generating multithreaded stacktraces
<mrvn> Kakadu: have you used CAMLreturnT in your code yet?
<Kakadu> yes
<Kakadu> it still crash
<mrvn> and it still fails?
<Kakadu> still
<Kakadu> In my country people says that 'morning is wiser than evening'
<mrvn> we say sleep on it.
<adrien> code drunk, debug sober
<mrvn> if stuck send to ML
Progster has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
<Ptival> we say that night gives advice
<Anarchos> who knows about olmar ?
<adrien> C++ parser, mozilla?
<Anarchos> adrien yes
<adrien> that's all I know \o/
<adrien> =P
<Anarchos> i ported it to HaikuOS(beos clone)
<Anarchos> and mozilla will soon get into trouble :)
<Anarchos> anyway i am looking for a parser of C++ able to translate to ocaml
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
<Ptival> lol
<Ptival> I imagine C++ as a not-so-white wizard, standing still, yelling "NONE SHALL PARSE!"
sgnb has quit [Read error: Connection reset by peer]
<adrien> Anarchos: translate or offer an AST which can be read from ocaml?
sgnb has joined #ocaml
<Anarchos> Ptival lol
<Anarchos> adrien just offer an ast, i can cope with that
<adrien> Anarchos: yacfe?
<adrien> C++ support is not complete but there's already something
<adrien> something substantial
Tobu has quit [Quit: No Ping reply in 180 seconds.]
<Qrntz> adrien, sober debugging can get one back into drinking!
<Anarchos> adrien i want to translate C++ API of Haiku to ocaml in an automatic fashion
<adrien> Qrntz: that's how I'm feeling currently at work
<adrien> Anarchos: imho, yacfe is your best bet
peddie has joined #ocaml
Tobu has joined #ocaml
<adrien> but be warned that miracles don't happen that often
<adrien> so it might take some work in the haikyu ssources too
eni has joined #ocaml
<Anarchos> adrien i was getting olmar working except on some obscure regression tests
sgnb has quit [Read error: Connection reset by peer]
sgnb has joined #ocaml
gnuvince_ has joined #ocaml
gnuvince has quit [Ping timeout: 245 seconds]
Tobu has quit [Quit: No Ping reply in 180 seconds.]
Tobu has joined #ocaml
Xizor has quit [Ping timeout: 260 seconds]
<wmeyer> ocamlgraph is wonderful
Yoric has quit [Ping timeout: 252 seconds]
eni has quit [Ping timeout: 244 seconds]
<thelema> wmeyer: what's up with the circles on the edges?
gnuvince_ has quit [Ping timeout: 245 seconds]
<wmeyer> thelema: No idea - but this is CFG of imperative factorial function
<wmeyer> I did some massive refactoring of the project
<wmeyer> still plenty of cleanups todo :(
<adrien> rqq
emmanuelux has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
munga has quit [Ping timeout: 240 seconds]
thomasga has joined #ocaml
ski has quit [Ping timeout: 244 seconds]
ski has joined #ocaml
thomasga has quit [Client Quit]
Sablier has quit [Read error: Connection reset by peer]
<Drakken> Why won't ocamlc let me include a directory in ..?
smondet has quit [Quit: Bye]
<thelema> Drakken: ocamlc should have no problem doing that
<thelema> ocamlbuild, no
tactics_ has joined #ocaml
gnuvince_ has joined #ocaml
hcarty has quit [Ping timeout: 244 seconds]
hcarty has joined #ocaml