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>
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>
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
<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
<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
<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>
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?