flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
travisbrady has joined #ocaml
ulfdoz has quit [Ping timeout: 245 seconds]
eikke has quit [Ping timeout: 260 seconds]
darkf has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Neros_ has quit [Ping timeout: 246 seconds]
ben_zen has quit [Ping timeout: 246 seconds]
ben_zen has joined #ocaml
travisbrady has joined #ocaml
ben_zen_ has joined #ocaml
ben_zen_ has quit [Client Quit]
zpe has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
stevej has quit [Quit: ["Textual IRC Client: www.textualapp.com"]]
rgrinberg has joined #ocaml
madroach has quit [Ping timeout: 248 seconds]
madroach has joined #ocaml
tianon has quit [Quit: "I'm a very important man. I've got a tower!"]
ggole has joined #ocaml
leoncamel has quit [Ping timeout: 245 seconds]
leoncamel has joined #ocaml
cdidd has quit [Remote host closed the connection]
rolloTomasi has joined #ocaml
groovy2shoes has quit [Quit: groovy2shoes]
zpe has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
travisbrady has quit [Quit: travisbrady]
tianon has joined #ocaml
rgrinberg has quit [Read error: Operation timed out]
tianon has quit [Quit: "I'm a very important man. I've got a tower!"]
tianon has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
nalaginrut has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
yacks has joined #ocaml
rudi has joined #ocaml
rudi is now known as rgrinberg
gnuvince has quit [Ping timeout: 245 seconds]
ttamttam has joined #ocaml
Watcher7 is now known as Watcher7|off
lopex has quit [Read error: Operation timed out]
lopex has joined #ocaml
lusory has quit [Quit: leaving]
zpe has joined #ocaml
lusory has joined #ocaml
hkBst has joined #ocaml
hkBst has quit [Changing host]
hkBst has joined #ocaml
zpe has quit [Remote host closed the connection]
djcoin has joined #ocaml
awm22 has quit [Quit: Leaving.]
raichoo has joined #ocaml
awm22 has joined #ocaml
awm22 has quit [Quit: Leaving.]
awm22 has joined #ocaml
yacks has quit [Ping timeout: 268 seconds]
yacks has joined #ocaml
zpe has joined #ocaml
rgrinberg has quit [Ping timeout: 256 seconds]
ttamttam has quit [Quit: ttamttam]
mcclurmc has joined #ocaml
awm22 has quit [Quit: Leaving.]
jsvgoncalves has joined #ocaml
jbrown__ has joined #ocaml
yacks has quit [Ping timeout: 260 seconds]
gustav__ has joined #ocaml
gustav__ has quit [Client Quit]
q66 has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
eikke has joined #ocaml
gustav has quit [Remote host closed the connection]
Anarchos has joined #ocaml
Tobu has joined #ocaml
awm22 has joined #ocaml
hkBst has quit [Ping timeout: 245 seconds]
hkBst_ has joined #ocaml
hkBst_ has quit [Changing host]
hkBst_ has joined #ocaml
Fullma has joined #ocaml
UncleVasya has joined #ocaml
hkBst_ has quit [Ping timeout: 256 seconds]
gustav has joined #ocaml
Nahra has quit [Remote host closed the connection]
RagingDave has joined #ocaml
yacks has joined #ocaml
beckerb has joined #ocaml
hkBst_ has joined #ocaml
mcclurmc has joined #ocaml
cthuluh has quit [Ping timeout: 245 seconds]
cthuluh has joined #ocaml
eikke has quit [Remote host closed the connection]
cthuluh has quit [Ping timeout: 245 seconds]
ontologiae has joined #ocaml
ttamttam has joined #ocaml
eikke has joined #ocaml
Drup has joined #ocaml
bitbckt has quit [Quit: out]
ontologiae has quit [Ping timeout: 252 seconds]
bitbckt has joined #ocaml
<hcarty> Is it reasonable to use Lwt_pool as a way of limiting the number of threads used for a particular purpose in Lwt?
<orbitz> i think so
<hcarty> orbitz: Thanks. I haven't used that module before, but a unit Lwt_pool.t seems like it would serve my needs well (limit the number of external processes run at once with Lwt_process)
<Drup> It's almost the purpose of Lwt_pool, so yes, it's reasonable.
<hcarty> Drup: The 'almost' part concerned me :-) But it shouldn't hurt to try.
<hcarty> Thank you both
<Drup> At least, I use it like that :D
awm22 has quit [Ping timeout: 264 seconds]
ontologiae has joined #ocaml
cdidd has joined #ocaml
_andre has joined #ocaml
nalaginrut_ has joined #ocaml
nalaginrut has quit [Ping timeout: 240 seconds]
Drup has quit [Ping timeout: 246 seconds]
Yoric has joined #ocaml
sepp2k has joined #ocaml
Yoric has quit [Read error: Connection reset by peer]
Leonidas has quit [Ping timeout: 264 seconds]
Leonidas has joined #ocaml
Yoric has joined #ocaml
smerz_ has quit [Ping timeout: 245 seconds]
sepp2k_ has joined #ocaml
sepp2k has quit [Ping timeout: 264 seconds]
sepp2k_ has quit [Remote host closed the connection]
Yoric has quit [Read error: Connection reset by peer]
cthuluh has joined #ocaml
dwmw2_gone is now known as dwmw2
Yoric has joined #ocaml
adrien_o1w has joined #ocaml
adrien_oww has quit [Ping timeout: 268 seconds]
Drup has joined #ocaml
jsvgoncalves has quit [Ping timeout: 256 seconds]
breakds has joined #ocaml
logicgeezer_ has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
Neros has joined #ocaml
Kakadu has joined #ocaml
groovy2shoes has joined #ocaml
wwilly has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
csmrfx has left #ocaml []
zpe has joined #ocaml
raichoo_ has joined #ocaml
raichoo has quit [Ping timeout: 256 seconds]
yacks has quit [Ping timeout: 245 seconds]
zpe has quit [Read error: No route to host]
zpe has joined #ocaml
yacks has joined #ocaml
groovy2shoes has quit [Quit: groovy2shoes]
rgrinberg has joined #ocaml
smondet has joined #ocaml
zpe has quit [Ping timeout: 260 seconds]
oriba has joined #ocaml
awm22 has joined #ocaml
talzeus_ has joined #ocaml
travisbrady has joined #ocaml
weie_ has joined #ocaml
weie has quit [Ping timeout: 252 seconds]
sgnb has quit [Read error: Connection reset by peer]
rolloTomasi has left #ocaml []
Fullma has quit [Ping timeout: 245 seconds]
raichoo_ has quit [Ping timeout: 252 seconds]
Fullma has joined #ocaml
raichoo has joined #ocaml
Anarchos has quit [Ping timeout: 245 seconds]
zpe has joined #ocaml
talzeus_ has quit [Remote host closed the connection]
<gasche> new reddit/ocaml post!
<gasche> (I was looking for a context switch to avoid working on a tedious proof)
talzeus_ has joined #ocaml
zpe has quit [Ping timeout: 256 seconds]
nalaginrut_ is now known as nalaginrut
bitbckt has quit [Quit: out]
raichoo has quit [Quit: leaving]
bitbckt has joined #ocaml
zpe has joined #ocaml
troydm has quit [Read error: Operation timed out]
weie_ has quit [Read error: Connection reset by peer]
weie has joined #ocaml
adahlberg has joined #ocaml
Anarchos has joined #ocaml
raichoo has joined #ocaml
talzeus_ has quit [Remote host closed the connection]
awm22 has quit [Read error: Operation timed out]
Nahra has joined #ocaml
mcsquiggedy has joined #ocaml
awm22 has joined #ocaml
hkBst__ has joined #ocaml
hkBst_ has quit [Ping timeout: 245 seconds]
beckerb has quit [Ping timeout: 245 seconds]
darkf has quit [Quit: Leaving]
zpe has quit [Remote host closed the connection]
beckerb has joined #ocaml
jsvgoncalves has joined #ocaml
<mcsquiggedy> If there are any Menhir savants present: my generated parser inexplicably has "# filename.mly [lineno]" lines interspersed throughout it, and ocamlc throws a parse error. Any idea what could cause either of these things?
beckerb has quit [Ping timeout: 245 seconds]
<gasche> mcsquiggedy: those are lexer directives meant to give you the correct error locations
<gasche> the OCaml lexer will recognize those directives and update its internal location information, so that error messages from later stages give you the locations in the .mly files rather than the generated .ml file that you really don't want to look at
<mcsquiggedy> Okay, that makes sense. Which leaves the parse error: "Parse error: [fun_def] expected after "fun" (in [expr])", which is thrown for the function representing the start rule.
<gasche> my guess would be that you borked something in your code
<mcsquiggedy> That would be very difficult, considering that the code is generated by Menhir from a correct .mly file.
<gasche> how do you know that it is correct?
<The_third_man> are you sure the mly file is correct ?
<gasche> are you switching from ocamlyacc to menhir?
<mcsquiggedy> s/correct/accepted by Menhir/;
<gasche> I'm not sure menhir looks inside the grammar productions
<gasche> can you upload the .mly somewhere?
<gasche> hum
<mcsquiggedy> ocaml.nopaste.dk/p42926
<gasche> works on my computer
wagle has quit [Read error: Operation timed out]
<gasche> (eg. fails with a type error for unbound module Synext)
<gasche> (the resulting file is even parsed fine by camlp4o)
<gasche> I need to go soon
<mcsquiggedy> okay
<gasche> I'd bet on something wrong in your compilation pipeline, or installed versions
<mcsquiggedy> thanks for taking a look
<gasche> besides, maybe you could try
<gasche> menhir --infer foo.mly
<gasche> which will call ocamlc to type-check the production rules
<gasche> it should work
<gasche> bye
Arsenik has joined #ocaml
Kakadu has quit [Quit: Page closed]
hkBst__ has quit [Quit: Konversation terminated!]
jsvgoncalves has quit [Ping timeout: 264 seconds]
wagle has joined #ocaml
gnuvince has joined #ocaml
eikke has quit [Ping timeout: 256 seconds]
mcsquiggedy has quit [Ping timeout: 246 seconds]
chrisdotcode has joined #ocaml
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
rgrinberg has quit [Ping timeout: 256 seconds]
travisbrady has quit [Quit: travisbrady]
<Anarchos> how to keep track of an ocaml value within C side ?
oriba has quit [Quit: oriba]
<ggole> Keep track of?
<thelema> Anarchos: you mean track where the value is moved to?
<thelema> Anarchos: I think you can register a c pointer as a GC root, and then the GC will modify it on compaction
<ggole> If you have any ocaml values that are maintained by C code, you have to use the declaration macros so they are visible to the GC.
travisbrady has joined #ocaml
chrisdotcode has quit [Ping timeout: 256 seconds]
<Anarchos> thelema i have a C++ class and and OCaml class whcich communicate with each others. so i need to keep the value of the ocaml class as an attribute in the C++ class
<thelema> Anarchos: I think you can register the member variable as a GC root, and thenn the GC will handle it.
ttamttam has left #ocaml []
<Anarchos> yes but caml_register_root will be called too often....
<ggole> Oh, caml values on the C heap? That's asking for trouble.
<ggole> Try to arrange not to have to do that.
<thelema> how many roots are we talking, and is there a way to cut down on the quantity?
mcclurmc has quit [Ping timeout: 245 seconds]
Kakadu has joined #ocaml
<Anarchos> ggole not if you call caml_register_global_root ;)
troydm has joined #ocaml
<Anarchos> thelema one value per C++ object created in my application....
<wmeyer> you can collate your values to single block and then register it
<thelema> Anarchos: all the same ocaml object?
<Anarchos> thelema no.
<wmeyer> anyway hi
<thelema> each to a distinct ocaml object?
<Anarchos> i think i will keep a hashtable in the ocaml side, keeping track within the ocaml and the C++ objects, since the c++ pointers won't change.
<thelema> Anarchos: if you can do that, great
<ggole> Anarchos: I didn't mean that the gc wouldn't work. If you pinpoint all the pointers it will work fine, it's just error prone (and might be slow? not sure).
<Anarchos> thelema ok thanks for the help
<Anarchos> ggole i will try ...
<thelema> Anarchos: it may also be an option to just turn off compaction
<ggole> If you realloc or use vectors, say, you'll have to make sure to update the gc info. It's easy to forget.
<Anarchos> ggole yes i keep that in mind while coding :)
<ggole> Great. Well, good luck.
breakds has quit [Quit: Konversation terminated!]
<Anarchos> ggole thanks
Drup has quit [Quit: Leaving.]
nalaginrut has quit [Ping timeout: 245 seconds]
tane has joined #ocaml
ulfdoz has joined #ocaml
<ousado> oh I didn't know ocaml had a moving gc
<thelema> ousado: yes, ocaml's GC compacts the major heap
<thelema> it's also generational, which means objects move from minor heap to major heap
yacks has quit [Ping timeout: 246 seconds]
<ousado> ah yes, reading about it here: http://ocaml.org/tutorials/garbage_collection.html - hehe "Unlike the Java GC, which gives GCs a bad name ..."
<thelema> the java gc has gotten lots better over the years
<ousado> the upcoming haxe target is faster than all others, mostly due to the GC
<ousado> err java haxe target
<ousado> programs simply make use of like 3 cores and become much faster
<ousado> 2 cores just for the gc
<thelema> lol
<ousado> (this is for micro-benchmarks that do lots of small allocations, of course)
awm22 has quit [Quit: Leaving.]
<ousado> but it's somewhat impressive
ggole has quit []
emmanuelux has joined #ocaml
<ousado> btw. is ocaml.org running on that new eliom-based thing wmeyer started some time ago?
<ousado> hm.. the server is github.com so I guess not
<ousado> (the http server header, I mean)
rgrinberg has joined #ocaml
<ousado> but it's that/a new design at least IIRC
smondet has quit [Remote host closed the connection]
mcsquiggedy has joined #ocaml
adahlberg has quit [Remote host closed the connection]
<wmeyer> ousado: nope
<wmeyer> it's a static generated page
<ousado> wmeyer: is it an ongoing project?
rgrinberg has quit [Ping timeout: 252 seconds]
Arsenik has quit [Ping timeout: 272 seconds]
rgrinberg has joined #ocaml
Arsenik has joined #ocaml
walter|r has joined #ocaml
studybot_ has joined #ocaml
pippijn_ has joined #ocaml
pippijn has quit [Disconnected by services]
pippijn_ is now known as pippijn
talzeus has quit [Ping timeout: 268 seconds]
othiym23 has quit [Ping timeout: 268 seconds]
walter has quit [Ping timeout: 268 seconds]
othiym23 has joined #ocaml
Arsenik has quit [Ping timeout: 260 seconds]
asmanur has quit [Ping timeout: 256 seconds]
<Anarchos> thelema i can't use objects as values in a map : the infamous "<..> escape its scope" arise
<thelema> Oo.id
<thelema> err, hmm.
<thelema> they don't all have the same type, I'm guessing
<thelema> is my guess correct?
<Anarchos> thelema they all inherits from be_interne, but they can have different types
<thelema> can you upcast to be_interne?
<thelema> i.e. do you need anything in their interface that's not in be_interne?
<Anarchos> yes i need to recover the exact object, to call methods
asmanur has joined #ocaml
<thelema> then the map won't work for you, as you can only get one type of value out of a map...
<thelema> Unless you want to make a giant variant to tag the different types
<thelema> otherwise the compiler can't be sure that the object you pull out will have the method you want to use.
Arsenik has joined #ocaml
<thelema> type obj_types = A of #a | B of #b | ...
<thelema> another alternative is to put stub methods in your base class
<thelema> so that all objects have all methods, and you can just cast to the base class to put into map
* ousado checks the name of the channel
<thelema> ousado: "Object"ive Caml.
<ousado> :)
ttamttam has joined #ocaml
gustav has quit [Ping timeout: 256 seconds]
gustav has joined #ocaml
<ousado> ah.. wrapping a C++ library .. of course
* ousado is no longer confused
<Anarchos> thelema my previous solution was more clean, but buggy due to values moved by gc...
ontologiae has quit [Ping timeout: 245 seconds]
<thelema> it may be possible to force your ocaml objects to be created on the major heap and never moved, although this is an abuse of the GC
<Anarchos> thelema with a call to caml_register_global_root(object ) ?
<thelema> no, by tweaking other parameters of gc
redfire has joined #ocaml
<Anarchos> thelema the context is : i want to mimic a native C++ multithread API in ocaml
milosn has joined #ocaml
Neros has quit [Ping timeout: 245 seconds]
milosn_ has quit [Ping timeout: 264 seconds]
Neros has joined #ocaml
yacks has joined #ocaml
ttamttam has left #ocaml []
awm22 has joined #ocaml
<Anarchos> thelema and what about playing with Obj.magic
<thelema> Anarchos: eww.
<thelema> I wouldn't recommend it.
<thelema> you have a giant heirarchy of classes that you want to mirror in ocaml?
<Anarchos> thelema yes
<thelema> maybe get inspiration from lablgtk2
<wmeyer> Anarchos: my advise is to look at what lablgtk2 doe
<wmeyer> oh thelema exactly
<wmeyer> it's not trivial!
<Anarchos> thelema wmeyer, thanks i forgot lablgtk2...
<wmeyer> you can also look what Kakadu has done with Qml
<wmeyer> he's generated the bindings
jsvgoncalves has joined #ocaml
<Kakadu> I'm here if somebody wants we
<thelema> Kakadu: how to make good C++ bindings?
<thelema> :) easy question.
manu49 has joined #ocaml
<Kakadu> thelema: Bind to the subset which is easy to bind
Arsenik has quit [Ping timeout: 272 seconds]
smondet has joined #ocaml
jsvgoncalves has quit [Ping timeout: 245 seconds]
<wmeyer> Kakadu: :D
<wmeyer> I like this answer
jsvgoncalves has joined #ocaml
jsvgoncalves has quit [Remote host closed the connection]
djcoin has quit [Quit: WeeChat 0.3.9.2]
ulfdoz has quit [Read error: Operation timed out]
_andre has quit [Quit: leaving]
Watcher7|off is now known as Watcher7
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
smondet has quit [Remote host closed the connection]
mcclurmc has joined #ocaml
zpe has quit [Remote host closed the connection]
<Anarchos> thelema lablgtk2 is not easy to understand...
<thelema> Anarchos: yup.
ttamttam has joined #ocaml
ttamttam has quit [Remote host closed the connection]
Neros has quit [Ping timeout: 252 seconds]
Neros has joined #ocaml
ulfdoz has joined #ocaml
jsvgoncalves has joined #ocaml
mcsquiggedy has quit [Ping timeout: 248 seconds]
Kakadu has quit []
rgrinberg has quit [Ping timeout: 245 seconds]
tobiasBora has joined #ocaml
<tobiasBora> Hello !
<tobiasBora> I'd like to create an associative array with all global variables to access them easily. However, I would like to be able to use several types in this array so I don't know which type could I use...
<tobiasBora> Which structure would you advise me ?
<tobiasBora> *recommend
<thelema> tobiasBora: ocaml is strongly typed, so when you get a value out of a data structure or one is returned from a function, it will have a single type.
<thelema> You can use a variant type to tag several types, such as type x = I of int | F of float | ...
<thelema> If you have a fixed collection of global variables, maybe a record will help: type globals = { x : int; y : float; z : int array; ...}
<tobiasBora> it will be a bit long to use... I think that put it in an array is not a good idea...
<thelema> is your collection of global variables going to be fixed from run to run?
<tobiasBora> And in the last structure, is it possible to add elements ?
<thelema> no, you can't add elements to a record; it has a fixed set of fields.
<tobiasBora> I think i may want to create global variables in functions...
<tobiasBora> Is it possible to create a global variable in a function ?
<wmeyer> tobiasBora: no such thing as static variable inside a function
<wmeyer> but in practice it's not a problem
<Armael> what do you mean by global variable ?
<wmeyer> Armael: he probably means in a global static storage
<wmeyer> let's say he wants: void foo() { static int bar = 0; return; }
<thelema> static implies fixed to me.
<Armael> i see
<tobiasBora> Armael: When we declare a variable outside any function, it is a global function. Is it possible to define the same types of variables inside a function .
<wmeyer> tobiasBora: firstly you have to answer the question why do you need it, and then you can define easily this via. closure
<wmeyer> like this
<wmeyer> let foo = let bar = ref 0 in fun () -> ();;
<wmeyer> you see bar is accesible from the inner closure
<wmeyer> so you get the behavior you want tobiasBora
<tobiasBora> wmeyer: and the whole program must be run inside foo ?
<thelema> tobiasBora: foo can be used elsewhere without bar being accessible outside foo
<tobiasBora> I tried this : http://paste.ubuntu.com/5620574/ but I've "unbound value bar"
<thelema> tobiasBora: exactly; bar is not accessible outside foo.
<thelema> but bar is shared across all instances of foo.
<thelema> s/instances of/calls to/
<SuperNoeMan> anybody in here familiar with Godel's incompleteness theorem?
<thelema> tobiasBora: why do you want a bunch of global variables?
<tobiasBora> I don't really understand how does it work...
<tobiasBora> I think that I'll need to create a lot of global variables in my program (because a lot of parameters are inply)
<thelema> tobiasBora: parameters are great. use them. in ocaml, you don't have to enter their types, so they're very easy.
<tobiasBora> and maybe I'll need to create new variable during the program. But I think that I'll use a hashtable
<tobiasBora> thelema: yes, but give 60 parameters to all function is a bit redundant ^^
<tobiasBora> *giving
<tobiasBora> *functions
<tobiasBora> *redondant
<thelema> tobiasBora: if your function takes 60 parameters, you should break it into smaller functions, or define it in a scope where those parameters are just available.
<thelema> and if it's the same 60 parameters, use some data structure to hold them all.
<thelema> a record would work very well.
<tobiasBora> thelema: in fact it is a simulation. So of course I will use parameters when I call small function, but lots of parameters must be modified and it's really hard to do it with argument
eni has joined #ocaml
<tobiasBora> Yes, records will be nice to do it when it stay in a function. I'll try and if I've some problems I'll come back ;-) Thanks a lot !
<thelema> n/p; good luck
manu49 has left #ocaml []
zpe has joined #ocaml
mcclurmc has quit [Ping timeout: 245 seconds]
zpe has quit [Ping timeout: 264 seconds]
Arsenik has joined #ocaml
redfire has quit [Quit: WeeChat 0.3.8]
awm22 has quit [Quit: Leaving.]
RagingDave has quit [Remote host closed the connection]
<Anarchos> thelema i fear to have to download lablgtk, instead of browsing source code on the internet....
<Anarchos> thelema ref_and_sink and unsafe_create..... Makes me fear those very angry names !!
ontologiae has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
travisbrady has quit [Quit: travisbrady]
tobiasBora has quit [Quit: Konversation terminated!]
jsvgoncalves has quit [Read error: Connection reset by peer]
raichoo has quit [Quit: leaving]
<wmeyer> hi
smerz_ has joined #ocaml
Neros has quit [Ping timeout: 248 seconds]
Neros has joined #ocaml
Drup has joined #ocaml
UncleVasya has quit [Quit: UncleVasya]
<bernardofpc> SuperNoeM> anybody in here familiar with Godel's incompleteness theorem? -> how much familiarity do you need (or better but, ask, don't ask to ask ;-))
<bernardofpc> tobiasBor> in fact it is a simulation. -> I'd be interested to know why you chose OCaml for simulation
<Ptival> yeah, some very shallow familiarity here too
eikke has joined #ocaml
darkf has joined #ocaml
chrisdotcode has joined #ocaml