flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://www.ocaml.org | OCaml MOOC http://1149.fr/ocaml-mooc | OCaml 4.03.0 announced http://ocaml.org/releases/4.03.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
jstolarek has joined #ocaml
zpe has joined #ocaml
jeffmo has quit [Quit: jeffmo]
jeffmo has joined #ocaml
jeffmo has quit [Client Quit]
seangrove has quit [Ping timeout: 250 seconds]
zpe has quit [Ping timeout: 250 seconds]
octachron has quit [Quit: Leaving]
silver has quit [Quit: rakede]
jstolarek has quit [Ping timeout: 264 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest79172
Guest79172 has quit [Ping timeout: 258 seconds]
sh0t has quit [Ping timeout: 260 seconds]
wtetzner has joined #ocaml
sh0t has joined #ocaml
zpe has joined #ocaml
nicoo has quit [Ping timeout: 244 seconds]
zpe has quit [Ping timeout: 260 seconds]
malc_ has quit [Remote host closed the connection]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
thizanne has quit [Ping timeout: 265 seconds]
wtetzner has quit [Remote host closed the connection]
nicoo has joined #ocaml
phase_ has quit [Ping timeout: 252 seconds]
<Algebr`> any opam peeps around
<Drup> Algebr`: depends, what's the question
wtetzner has joined #ocaml
wtetzner has quit [Ping timeout: 260 seconds]
<Algebr`> I wanted a package merged
<Algebr`> heh
zpe has joined #ocaml
phase_ has joined #ocaml
zpe has quit [Ping timeout: 276 seconds]
infinity0 has quit [Remote host closed the connection]
infinity0 has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest56624
<gasche> Algebr` send a pull-request against opam-repository
<gasche> (and then wait, but check the CI results and, if they fail, either fix it or explain why it is a benign failure)
<Algebr`> I did, still have it open
<gasche> well
<gasche> that was 5 hours ago, and now people in Europe are sleeping
<Algebr`> just a matter of waiting i guess.
<Algebr`> there is no one with opam-repo access in north america?
Guest56624 has quit [Ping timeout: 260 seconds]
<gasche> I don't know
<gasche> most of my interactions are with Jeremy Yallop
darkf has joined #ocaml
sh0t has quit [Ping timeout: 276 seconds]
zpe has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
phase_ has quit [Ping timeout: 276 seconds]
zpe has quit [Ping timeout: 276 seconds]
copy` has quit [Quit: Connection closed for inactivity]
sh0t has joined #ocaml
tmtwd has joined #ocaml
wtetzner has joined #ocaml
kushal has joined #ocaml
phase_ has joined #ocaml
wtetzner has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 265 seconds]
MercurialAlchemi has joined #ocaml
tobiasBora has quit [Ping timeout: 244 seconds]
_y has quit [Ping timeout: 276 seconds]
pierpa has quit [Ping timeout: 258 seconds]
fluter has quit [Ping timeout: 250 seconds]
fluter has joined #ocaml
johnelse has joined #ocaml
johnelse is now known as Guest27490
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Algebr` has joined #ocaml
Guest27490 has quit [Ping timeout: 250 seconds]
phase_ has quit [Remote host closed the connection]
travula has joined #ocaml
sh0t has quit [Remote host closed the connection]
Simn has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe has quit [Ping timeout: 264 seconds]
Mercuria1Alchemi has joined #ocaml
_y has joined #ocaml
_y has quit [Ping timeout: 244 seconds]
jeffmo has joined #ocaml
tmtwd has quit [Ping timeout: 244 seconds]
cdidd has quit [Ping timeout: 250 seconds]
MercurialAlchemi has quit [Ping timeout: 260 seconds]
kitf has joined #ocaml
cdidd has joined #ocaml
johnelse has joined #ocaml
johnelse is now known as Guest71939
Guest71939 has quit [Ping timeout: 260 seconds]
MercurialAlchemi has joined #ocaml
kitf has quit [Quit: Page closed]
travula has quit [Ping timeout: 276 seconds]
travula has joined #ocaml
bigs has quit [Ping timeout: 250 seconds]
pootler_ has quit [Ping timeout: 250 seconds]
<Algebr`> Drup: how can I get the ocaml code generated by a ppx?
Sorella has quit [Ping timeout: 250 seconds]
MorTal1ty has quit [Ping timeout: 250 seconds]
<Algebr`> for example I want to pass js_of_ocaml.ppx on my .ml, have it be desugared and dump another .ml
msch has quit [Ping timeout: 240 seconds]
pootler_ has joined #ocaml
msch has joined #ocaml
bigs has joined #ocaml
MorTal1ty has joined #ocaml
Sorella has joined #ocaml
kushal has quit [Quit: Leaving]
orbifx1 has joined #ocaml
AltGr has joined #ocaml
silver has joined #ocaml
kushal has joined #ocaml
larhat has joined #ocaml
tristero has quit [Ping timeout: 250 seconds]
trystero has joined #ocaml
tobiasBora has joined #ocaml
_y has joined #ocaml
orbifx has joined #ocaml
dexterph has joined #ocaml
travula has quit [Ping timeout: 258 seconds]
ontologiae_ has joined #ocaml
johnf has joined #ocaml
teiresias has quit [Remote host closed the connection]
teiresias has joined #ocaml
<jun> seems ppx_tools/rewriter does exactly that
gustav___ has quit [Ping timeout: 276 seconds]
gustav___ has joined #ocaml
<Algebr`> yea was trying to get it to work but failing
<Algebr`> but what do I provide for the rewriter,
<Algebr`> not sure if jsoo provides?
<Leonidas> oh great, patdiff created dependency conflicts. gnaaaah, core
<Leonidas> Algebr`: you're asking at 4am :p
<Algebr`> okay, its 1:30 am for me too
<Algebr`> lol
<Algebr`> actually nvm, will figure it out later.
nickapos has quit [Ping timeout: 276 seconds]
travula has joined #ocaml
ontologiae_ has quit [Ping timeout: 240 seconds]
johnelse has joined #ocaml
johnelse is now known as Guest51323
jstolarek has joined #ocaml
Algebr` has quit [Ping timeout: 250 seconds]
orbifx has quit [Ping timeout: 276 seconds]
jwatzman|work has joined #ocaml
tane has joined #ocaml
ggole has joined #ocaml
Guest51323 is now known as johnelse
rand__ has joined #ocaml
zpe has joined #ocaml
dhil has joined #ocaml
toolslive has joined #ocaml
yomimono has joined #ocaml
johnelse has quit [Quit: leaving]
johnelse has joined #ocaml
johnelse has quit [Client Quit]
johnelse has joined #ocaml
johnelse has quit [Quit: leaving]
johnelse has joined #ocaml
alpen has quit [Ping timeout: 244 seconds]
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
dave24 has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
larhat1 has joined #ocaml
larhat has quit [Read error: Connection reset by peer]
alpen has joined #ocaml
<dave24> how can I pass a string that is not null terminated from C to an ocaml function?
<dave24> In the manual I can only find caml_copy_string, but that requires the string to be null terminated
<dave24> also, how do I deallocate 'value's?
zpe has quit [Remote host closed the connection]
sdothum has joined #ocaml
zpe has joined #ocaml
redpoppies has joined #ocaml
redpoppies has quit [Remote host closed the connection]
zpe has quit [Ping timeout: 258 seconds]
<toolslive> it might an idea to look at the non-null terminated string as a bigarray (or Lwt_bytes.t)
<dave24> toolslive: it needs to be a normal string on the ocaml side, I want to create one in the C code from a char* and a length to pass to caml_callbackN
<toolslive> I think you will have to copy as ocaml strings have some weird encoding at the end.
<toolslive> hence the caml_alloc_string
<dave24> so I can caml_alloc_string and then memcpy into it?
<toolslive> so: caml_alloc_string(len); memcpy(....)
<dave24> :D
<toolslive> yes
<dave24> thanks
<dave24> do I need to deallocate those?
<toolslive> if you want to avoid the copy, consider bigarray
<toolslive> "those" ?
<dave24> the string i get from caml_alloc_string
<toolslive> ocaml_str = caml_alloc_string(.....);memcpy(....); return ocaml_str;
<toolslive> or in your case, use that to call your function. no deallocation as you don't know if the ocaml side keeps it in a data structure or not...
<toolslive> it's the gc's responsibility
<dave24> right
<dave24> so what about values i get from an ocaml function?
<dave24> how does it know when I'm done with them?
<toolslive> you create the value on the C side, and hand it to an ocaml function, right ? then you're done with them as soon as you hand it over.
<toolslive> it might even be that the buffer itself is already moved by the gc during the time it's in use on the ocaml side. You're not in charge of the value anymore.
<dave24> right, but if the function gives me back another different `value`... I need to free that somehow right?
<dave24> or do I have to copy it right away?
<toolslive> so you get a different value back ? and you want to use it on the C side ?
<dave24> yes, to pass to another ocaml function
<toolslive> then you need to register it as a local value in the C code otherwise, the gc on the ocaml side might move it while you're looking at it from the C side.
<toolslive> there are macros for that.
<toolslive> CAMLlocal....
<toolslive> hold on. see if I can find a link for you
<toolslive> there's a section on "exchanging raw data"
<toolslive> you might want to read the whole guide before you start coding again ;)
<dave24> I read the manual
<toolslive> also: calling C from ocaml is more comfortable via ctypes
<dave24> but CAMLlocal and CAMLreturn confused me because they seem to be for use in functions not for general gc control
<toolslive> the manual is a bit short on detail....
<dave24> i see
<dave24> thanks a lot, I'll have read of that then
<toolslive> have fun ;)
tane has quit [Quit: Verlassend]
pierpa has joined #ocaml
picolino has left #ocaml ["Quitte"]
picolino has joined #ocaml
rand__ has quit [Ping timeout: 252 seconds]
<dave24> this says the GC will set the `closure_f` to NULL... how is that possible? http://www.linux-nantes.org/~fmonnier/OCaml/ocaml-wrapping-c.html#ref_mlfromc
<dave24> toolslive: to me it seems ocaml only has access to `*closure_f`
<toolslive> and to the parameters you give it (in this case Val_unit) and in your case probably the allocated ocaml string
<dave24> yes
<dave24> but that guide says ocaml will set closure_f to NULL, but I never pass it that
nicholasf has quit [Remote host closed the connection]
<dave24> nowhere does it say `caml_something(&closure_f);`
<toolslive> caml_callback(*closure_f, Val_unit);
<dave24> yes, that passes the value pointed by closure_f. But never its address
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
<toolslive> it's a static value that you want to keep across calls, but you want to initialize it on first usage. I don't think the gc will touch that value.
<toolslive> (I might be wrong)
<dave24> thats what I think as well
<dave24> but the guide says this: "But you still have to test if it is equal to NULL in case the caml garbage collector has freed it"
<mrvn> if you register it as root then it won't free it.
<mrvn> and if you don't register it then it is totaly undefined.
phasip has joined #ocaml
thizanne has joined #ocaml
<phasip> I am looking at some code that does Format.printf "... @[%a@]@. " what does the @ characters do here? to me it seems like the output is as if "... %a" as used.
<mrvn> dave24: that guide looks sketchy. better follow the manual.
<Drup> phasip: I encourage you to look in the Format documentation, it's explained at lenght
<phasip> Oh, thanks Drup apparently I opened the Printf manual that said that @ outputs @
<phasip> Printf.printf != Format.printf
<companion_cube> phasip: @ stuff is for formatting, that is, manage linebreaks and indentation
<companion_cube> (and yeah, look at Format's manual)
<dave24> mrvn: is there an equivalent of CAMLlocal/CAMLreturn that works for non-local variables? I need to pass a reference to a value around in a pointer. That pointer is passed as userdata to places I can't control.
<dave24> is that was register as root does?
<mrvn> dave24: caml_register_global_root
<mrvn> You need to malloc a value, register its address and then pass the address of the value around.
<dave24> so, if its a value I get from an ocaml function, do I need to copy that?
<mrvn> if you want to keep it past the function exiting then yes
tane has joined #ocaml
<dave24> ok, thanks a lot!
<mrvn> just assign it to your malloced value*
<dave24> assign? but thats not a copy then?
<mrvn> it's a shallow copy
<dave24> so its like this?: v = ocaml_callback(..) -> value my_ref = v -> caml_register_generational_global_root(&my_ref) -> i have my_ref until i call remove register
<mrvn> no, that would make my_ref a stack variable and when the function exits its becomes invalied and the GC gets total garbage.
<mrvn> Anything on the stack must always be CAMLparam/local
MercurialAlchemi has quit [Ping timeout: 260 seconds]
<mrvn> unless you ment: value my_ref; void init() { caml_register_generational_global_root(&my_ref); }
<mrvn> my_ref being a global variable.
<dave24> hm, i think i understand now. I was confused because i keep thinking of `value` as a reference, but its an actual value i need to copy
<dave24> i duplicate the value onto the heap, and pass the duplicates address to the register function.
<dave24> i think....
<mrvn> dave24: "value" can be a value like 1,2,3 or Foo | Bar or []. Or it can be a pointer to int64, Blub of int, { x:int; }, class foo, or other more complex types.
<mrvn> dave24: you can use *my_ref = ocaml_callback(..)
<dave24> ok thanks again!
travula has quit [Ping timeout: 244 seconds]
zpe has joined #ocaml
nicholasf has quit [Remote host closed the connection]
aggelos_ has quit [Quit: leaving]
aggelos_ has joined #ocaml
zpe has quit [Read error: Connection reset by peer]
nicholasf has joined #ocaml
rgrinberg has joined #ocaml
pyon has joined #ocaml
lol-icon is now known as Guest2645
Guest2645 has quit [Killed (weber.freenode.net (Nickname regained by services))]
pyon is now known as lol-icon
tane has quit [Remote host closed the connection]
<beginner_> Small optimization question. In this example is f A actually performed twice or only once? https://gist.github.com/anonymous/9e578c66390322a55b06b461737c2dc4
zpe has joined #ocaml
<ggole> Is this a question about optimisation or semantics? In OCaml, calling a function twice is distinguishable from only calling it once.
<mrvn> if you write it twice it happens twice
<beginner_> ggole: I was just wondering if the compiler can store the result from the first evaluation and uses it directly instead of evaluating it twice
<mrvn> beginner_: it could if the function is pure. Does flamba do anything towards that?
<phasip> So, whats the name of this operator ">>|" ? (Or what does it do / where can I read about it?)
<beginner_> mrvn: I don't know, but it would be really nice if that gets optimized
<ggole> I wouldn't expect it.
<mrvn> beginner_: usualy I just write better code
tane has joined #ocaml
<mrvn> in your example: A -> f A
<beginner_> mrvn: i was just something that came up recently and i was curious whether or not i gets removed. I guess the only way to tell would be to look into the assembly code?
<mrvn> beginner_: till flambda ocaml never optimized anything but inline functions.
<mrvn> made it verry clear what happens when you write something.
<beginner_> mrvn: the example was just the quickest thing i could write to express the question
<mrvn> beginner_: try it with "let f = let t = ref true in function A -> t := lnot !t; !t
<beginner_> mrvn: that was not a real world example, just a minimal example for my question.
<beginner_> mrvn: but i really appreciate this input
shinnya has joined #ocaml
dhil has quit [Ping timeout: 244 seconds]
<gasche> beginner_: it does not get removed
<gasche> as a rule of thumb, you should assume that OCaml executes the code as it is written
iorivur has joined #ocaml
<gasche> (this is not always true, but it's a better base assumption than expecting magical things to happen)
<beginner_> so what are companies like jane street do? do they look at the resulting assembly code and look for the most efficient ways or just by benchmarking?
<companion_cube> ggole: what? in OCaml, calling a function twice calls it twice
<companion_cube> because of possible side effects
<beginner_> companion_cube: there are no exceptions to that rule?
<gasche> companion_cube: ggole wrote "distinguishable"
<gasche> beginner_: programmers write reasonable, readable code, and then they profile and optimize what needs be
orbifx1 has quit [Quit: WeeChat 1.5]
<gasche> you don't need to be constantly looking at assembly code whenever you learn a new programming language
<gasche> (this is a bad habit that some C programmers have, along with the inability to think of language semantics other than through compilation to assembly)
<companion_cube> oh sorry ggole, misread :(
zpe has quit [Remote host closed the connection]
<beginner_> gasche: it was just this special case, were i was wondering if there is potential optimization
<pierpa> as everyone has already said to you, that would not be an optimization, it would be a miscompilation
<ggole> Looking at assembly is usually more about cost model than semantics if you ask me
<ggole> (Unless you are working on an implementation at that level.)
<ggole> Dumping stuff at a higher level is also useful for that, though.
<Drup> phasip: iirc, "fmap"
<Drup> (or just "map")
dhil has joined #ocaml
<beginner_> thanks for all the information
johnelse has quit [Ping timeout: 264 seconds]
johnelse has joined #ocaml
SpiceGuid has joined #ocaml
nicholasf has quit [Remote host closed the connection]
StatelessCat has quit [Quit: WeeChat 1.5]
fraggle-boate has joined #ocaml
<Bluddy[m]> companion_cube: have you seen my -safe-syntax PR?
<companion_cube> oh yeah, saw the message
<companion_cube> 32 comments already!?
fraggle-boate has quit [Remote host closed the connection]
<Bluddy[m]> Yeah. What do you think of my backwards-compatibility solution?
<Bluddy[m]> Does it make sense?
octachron has joined #ocaml
silver_ has joined #ocaml
fraggle-boate has joined #ocaml
<Drup> Bluddy[m]: if you need to do sed (or cppo) magic, it's precisely *not* backward compatible.
<companion_cube> I don't know
<Bluddy[m]> Drup: of course it's not directly backwards compatible -- I'm changing the syntax. What I'm saying is that given the fact that the changes are precise and minimal, a simple sed command is all that's needed to get -safe-syntax compiling on -unsafe-syntax (ie. old) compilers
<companion_cube> I think it's better to migrate old code bases
<companion_cube> I think the good way of doing it is by parsing the old syntax, and printing the new one
<companion_cube> (maybe building on ocp-indent, which knows how to parse without removing comments)
silver has quit [Ping timeout: 244 seconds]
<companion_cube> if there is a tool to easily migrate, I'd really switch
<Bluddy[m]> Yeah that will happen companion_cube. I'm trying to address the issue people brought up of LTS releases with old OCaml compilers
<Drup> Bluddy[m]: also, you assume that most matches/if are wrapped in begin/end, which is not the case
<Drup> migrating would be more work
<Drup> and regardless, the existence of a translation tool (which is more or less certain) doesn't change the fact that it breaks compat
<Bluddy[m]> Drup: This is an instant migration from new -safe-syntax code to old -unsafe-syntax code. Any compiler can compile -safe-syntax code easily. That's what I'm saying.
<Bluddy[m]> Of course the migration to -safe-syntax should be manual/requires better tooling.
<Bluddy[m]> Maybe I should clarify that in the PR.
copy` has joined #ocaml
<companion_cube> Drup: depends on the style
<companion_cube> if you have lots of nested matches, well, begin…end everywhere
<Drup> Bluddy[m]: except that you are mistaken about what backward compatibility is about
<Bluddy[m]> Drup: I understand I'm breaking backwards compatibility. That's not what I'm addressing here.
<Drup> your answer is simply "well, it doesn't matter to be backward compatible, we just have to provide something to ease transition", which is not really an answer
ocaml242 has joined #ocaml
silver_ is now known as silver
ocaml242 has quit [Client Quit]
orbifx has joined #ocaml
ChristopheT has joined #ocaml
ChristopheT has quit [Client Quit]
<companion_cube> Drup: on the other hand a switch -unsafe-syntax could be provided, same as -safe-string
<companion_cube> (which is already a large breaking change)
<Bluddy[m]> Drup: If every build tool can detect the OCaml version, and convert files on the fly using a simple sed command (or the simple OCaml alternative) is it a big problem?
shinnya has quit [Ping timeout: 244 seconds]
ChristopheT has joined #ocaml
<Bluddy[m]> You don't need any fancy tooling to convert safe-syntax to unsafe-syntax. That's my point. It's a trivial change, and this means that even if every project today converts to safe-syntax, they'll still be buildable with old OCaml versions stuck in LTS releases and such.
phasip has quit [Quit: Page closed]
Mercuria1Alchemi has quit [Ping timeout: 252 seconds]
<companion_cube> you'd have to modify the build process though
<companion_cube> which might be annoying
<pierpa> "The thing is that experienced users won't see the benefits of the new syntax and will actually suffer from it"
<pierpa> sigh
<pierpa> :)
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
<pierpa> there's no hope. Just realize this.
<companion_cube> I don't know, do experienced users here think this has no benefit?
<sspi> Drup: you here? I saw your comment on my Reason JSX PR :)
<sspi> I was wondering if you had advice for me on how not to mess things up, besides using PPX instead
<Drup> I'm always here.
<sspi> (I know :P)
* Drup haunts the IRC channel.
* pierpa thinks drup actually is 4 twin brothers
<Drup> sspi: I didn't know you were SanderSpies.
<Drup> Frankly, my advice at this point would just be to improve tyxml's ppx instead :/
<Bluddy[m]> So typical of yallop to burst my bubble :)
<Drup> sspi: regardless if you want to use tyxml underneath, you probably want to use something like markup and adopt a similar quoting mecanism as the one we did for tyxml
<companion_cube> well, the compatibility tool from unsafe to safe, could also do safe to unsafe
<companion_cube> it would "just" have to embed both parsers :D
noddy has joined #ocaml
seangrove has joined #ocaml
<gasche> we can use the ppx or camlp4 machinery to process newer-ocaml-syntax code and output a binary AST that an older compiler understands (with correct location information etc.)
<gasche> this requires plumbing (downgrading functions from new parsetree to old parsetrees) but it's a generic tool
tane has quit [Quit: Verlassend]
lol-icon has quit [Read error: Connection reset by peer]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
pyon has joined #ocaml
Denommus has joined #ocaml
pyon is now known as lol-icon
ChristopheT has quit [Ping timeout: 258 seconds]
dexterph has quit [Ping timeout: 250 seconds]
SpiceGuid has joined #ocaml
<sspi> Drup: tyxml looks nice and could probably also be changed to fit our purpose, however I believe the JSX syntax a certain appeal that I like to keep :-) (and yes, I'm biased here)
<sspi> it's also not clear to me how to pass attributes from tyxml to plain OCaml code (eg. I can do <Foo bar=true /> with JSX which translates to Foo.createElement ~bar:true [])
Denommus has quit [Quit: going away]
pierpa has quit [Ping timeout: 276 seconds]
groovy2shoes has quit [Remote host closed the connection]
MercurialAlchemi has joined #ocaml
dexterph has joined #ocaml
slash^ has joined #ocaml
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
larhat1 has quit [Quit: Leaving.]
shinnya has joined #ocaml
struk|desk has quit [Read error: Connection reset by peer]
<dave24> does caml_startup behave different in a shared object? Or does it do exactly the same things?
sepp2k has joined #ocaml
<seangrove> I can't quite figure out how to call window.setTimeout in jsoo. Anyone have an example?
jeffmo has quit [Quit: jeffmo]
gasche has quit [Remote host closed the connection]
shinnya has quit [Ping timeout: 244 seconds]
jwatzman|work has quit [Quit: jwatzman|work]
zpe has joined #ocaml
noddy has quit [Ping timeout: 244 seconds]
yomimono has quit [Ping timeout: 250 seconds]
<seangrove> Nevermind, got it: `Dom_html.window##setTimeout (Js.wrap_callback (fun () -> do_some_stuff ())) 500.`
toolslive has quit [Ping timeout: 264 seconds]
groovy2shoes has joined #ocaml
Algebr` has joined #ocaml
zaquest has quit [Quit: Leaving]
toolslive has joined #ocaml
dhil has quit [Ping timeout: 250 seconds]
<dave24> can I create multiple ocaml runtime environments from c? one for each thread, so they don't have to wait for each other?
<Algebr`> so start your code in C, then do a caml_main on each pthread? Or perhaps fork?
<Algebr`> idea
<dave24> i cant fork, can I run caml_startup(in my case) multiple times... i dident knwo that
<dave24> how do I clean it up again
<dave24> there does not seem to be a caml_shutdown or something like that
octachron has quit [Quit: Page closed]
<Algebr`> yes, there was a big PR I remember about deinit the ocaml runtime
orbifx has quit [Ping timeout: 240 seconds]
ygrek has joined #ocaml
jeffmo has joined #ocaml
seangrove has quit [Ping timeout: 265 seconds]
noddy has joined #ocaml
shinnya has joined #ocaml
rgrinberg has quit [Ping timeout: 260 seconds]
johnelse has quit [Ping timeout: 244 seconds]
ontologiae_ has joined #ocaml
hcarty has joined #ocaml
dave24 has quit [Quit: leaving]
zpe has quit [Read error: Connection reset by peer]
hcarty has quit [Quit: WeeChat 1.5]
<Drup> sspi: attributes like that works in tyxml too
<Drup> (with pretty much the same syntax)
rgrinberg has joined #ocaml
<Algebr`> sean posted this awesome video of a todomvc using the reactjs bindings, https://www.dropbox.com/s/um29z2793ta7s9l/todomvc_state_replay.mp4?dl=0
<Algebr`> much more real world thing
nickapos has joined #ocaml
<Algebr`> also how did it happen that there is OCamlbuild AND Ocamlbuild modules
jeffmo has quit [Read error: Connection reset by peer]
jeffmo has joined #ocaml
toolslive has quit [Ping timeout: 264 seconds]
toolslive has joined #ocaml
zpe has joined #ocaml
seangrove has joined #ocaml
zpe has quit [Remote host closed the connection]
<Drup> sspi: which purpose are you refering to ? I would realy like a set of concrete things you want to do that are not possible currently
noddy has quit [Quit: "it's a bit backwards around here"]
rgrinberg has quit [Quit: WeeChat 1.5]
AltGr has left #ocaml [#ocaml]
rgrinberg has joined #ocaml
zpe has joined #ocaml
rand__ has joined #ocaml
<sspi> Drup: it's basically connecting React with Reason, JSX is a logical step in this process
<Drup> why would you want to connect a javascript rendering library with an alternative ocaml syntax ?
<Algebr`> because it makes using the libray concise and easy
<Drup> Algebr`: if there are other ways, which doesn't compromise separation of concern, it would probably better to use them
<Drup> I know it's a bit tendancy lately to add billions of special purpose syntaxes in languages (let's put xml literals, then sql strings, then, then)
<Algebr`> actually I was looking at ripping out tyxml's ppx
<Drup> Ah, that would be fine by me
<Algebr`> but replacing the markup usages with function calls to reactjs bindings
<Algebr`> but where anntron
<Algebr`> aantron
<Algebr`> that I think would be easiest and fastest, in a way.
<Drup> I still think we should have a tyxml thing for your reactjs binding, but I really don't have time to look at it now
<Algebr`> that's what I'm saying
<Drup> hum, is it ?
<Algebr`> most of the effort i think is there and well done, just replace using markup.ml with function calls to reactjs bindings
<Drup> markup.ml is the parser, you need it ... to parse
<Algebr`> I mean more about identifiying [%html [<div id="123"]]
<Algebr`> html and div id
<Algebr`> those things I need a handle on
<Drup> yes, that's markup's job
<Algebr`> right but couldn't they also be %div %id
<Algebr`> instead of something to be parsed
<Drup> I'm not sure I understand what you are trying to say
<Algebr`> hmm, nvm, maybe i don't either. jumping through all these languages/syntaxes hurt my brain
<Drup> yeah, that's why I like the simple solution
<Drup> normal ocaml/reason + html quotations with ppx
<Drup> you put html in the quotations, nothing special here
<Drup> and then it emits function calls (to Tyxml combinators)
<Drup> you can then obtain tyxml combinators for any structure, given you can implement the right module signature
<Drup> it's flexible, extensible and concerns are separated
<Algebr`> it won't work
<Algebr`> because the tyxml_ppx won't let me put arbitrary expressions in the syntax
<Drup> you can, with antiquotations.
<Algebr`> show
<Drup> let my_paragraphs =
<Drup> [%html "<p>"[my_span]"</p><p>more content</p>"]
<Drup> "my_span" is an ocaml expression
<Drup> (it's just a variable here, but you can put any ocaml expression)
<Drup> or do you mean being able to put non-html tags, such as <Foo ...> directly in the html ?
<Algebr`> yes too
<Drup> that second thing, we considered did, and decided it to not do it at first
<Algebr`> what about [<div onClick=(fun _ -> 123)]
<Drup> considered it*
<Drup> yeah, that works too
<Algebr`> hmmmm
<Drup> the non-html tags, it's something we were planning to revisit for subsequent versions
darkf has quit [Quit: Leaving]
octachron has joined #ocaml
wtetzner has joined #ocaml
ggole has quit [Ping timeout: 260 seconds]
<Algebr`> in myocamlbuild.ml, you can do, there's flag ["c"; "compile"] for compiling and that invokes ocamlc, which ones invokes ocamlopt? its at the linking stage, is that like flag ["l"; "link"]?
trystero is now known as tristero
unbalancedparen has joined #ocaml
SpiceGuid has joined #ocaml
toolslive has quit [Ping timeout: 264 seconds]
wtetzner has quit [Remote host closed the connection]
johnelse has joined #ocaml
<octachron> Algebr`, I think ocamlopt is chosen through the "native" tag (?)
<Algebr`> well I mean I can do what oasis does with CCOpt with flag ["c"; "compile"]
<Algebr`> what is the equivalent for CClib
johnelse has quit [Ping timeout: 240 seconds]
strykerkkd has joined #ocaml
toolslive has joined #ocaml
jeffmo has quit [Quit: jeffmo]
ollehar has joined #ocaml
<ollehar> anyone knows about an llvm lib for ocaml where llvm ir represented as adt get compiled?
<ollehar> in my compiler I went from typed ast immediately to using the llvm api by whiteshark. I think a middle layer between those two would be good. :P
slash^ has quit [Read error: Connection reset by peer]
<ollehar> not maintained any more.
rgrinberg has quit [Ping timeout: 244 seconds]
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
SpiceGuid has joined #ocaml
rgrinberg has joined #ocaml
Simn has quit [Read error: Connection reset by peer]
johnkeates has joined #ocaml
<johnkeates> I'm trying to compile something written in ocaml, but it seems to be unable to find threads, but it's available
<johnkeates> where do I look to find out why it can't find it?
<ollehar> johnkeates: paste your error messages?
<ollehar> or compile with some thread argument
<ollehar> -threads
<ollehar> ?
<mrvn> -thread Generate code that supports the system threads library
<johnkeates> ill grab the error line, just a sec
<johnkeates> ocamlfind: Package `threads' not found
<johnkeates> context: I'm using xenserver-buildroot on Debian Jessie to compile Xen as it's a dependency for yet another Xen project, the Xen-API (XAPI) which is also written in OCaml
<johnkeates> the part that it breaks on is when building libre-ocaml-1.2.2
<johnkeates> it configures fine, but then fails when checking for threads availability
<ollehar> package?
<ollehar> did you google the error message?
<johnkeates> yes
<johnkeates> it's generic, but I'm not familiar enough with ocaml to know where to start checking on why it might not find threads
<johnkeates> now, I know ocamlfind is used to figure out what ocaml components are where
<johnkeates> but what i don't know is why it's not finding threads while it's installed
wolfcore has quit [Ping timeout: 264 seconds]
<ollehar> I didn't think thread was a package. :P
<ollehar> which ocaml version?
<ollehar> big program, big makefile?
<johnkeates> yes
<ollehar> can you paste the compilation line that fails?
<johnkeates> let me pastebin, just a sec
<johnkeates> basically, it's a huge project, with a ton of spec files, it's using shell scripts, and omake via pbuilder inside cowbuilder
<johnkeates> the thing i'm doing is not hugely supported, which is also why i'm doing it, XenServer as a distribution is CentOS/RHEL based, but there is support for Debian in the built root, it's just not kept up-to-date, so that's why i started hacking on it
wolfcore has joined #ocaml
luzie has quit [Quit: WeeChat 1.5-rc1]
<ollehar> johnkeates: do `locate thread.cmx`
<ollehar> but thread != threads
<ollehar> maybe you should report an issue to the project owner?
<johnkeates> well, i don't think citrix wants to have a chat
<johnkeates> unless $$$
<ollehar> why?
<ollehar> no support?
<ollehar> what does grep threads give?
<ollehar> in the src
orbifx has joined #ocaml
<johnkeates> i'm not sure yet, the src is 190MB
<johnkeates> the sources are from Xen, which is now a Linux Foundation project, but commercially supported by Citrix, which used to have the closed source XenServer which is now open source
<mrvn> have you tried building it on centos?
<johnkeates> yes, that works
<johnkeates> but i'm porting build root to debian
<mrvn> johnkeates: so do they have a threads.cmx?
<johnkeates> yes
<johnkeates> well, it's /usr/lib/ocaml/process/threads.cmxa and /usr/lib/ocaml/threads/threads.cmxa and there is a cothreads version too
<mrvn> /usr/lib/ocaml/threads/META?
<mrvn> mrvn@frosties:~% cat /usr/lib/ocaml/threads/META
<mrvn> # Specifications for the "threads" library:
<mrvn> version = "[distributed with Ocaml]"
<johnkeates> /usr/lib/ocaml/threads/ contains no META
<mrvn> That's on Debian
<johnkeates> hmm
<johnkeates> /usr/lib/ocaml/threads/ is full of thread files, but no META file
<mrvn> libfindlib-ocaml: /usr/lib/ocaml/threads/META
<johnkeates> there is a ./METAS/META.threads
sh0t has joined #ocaml
<johnkeates> libfindlib-ocaml is installed
<mrvn> what version?
<johnkeates> 1.4.4 from the system
<mrvn> johnkeates: why aren't you developing under unstable?
<johnkeates> Xen has a 1.5.5 version too, which builds fine and is available in the source directory
<johnkeates> because it's not stable, and because it has been supported on Ubuntu 14.04 which is Jessie in Debian slang
<johnkeates> the docs on github suggest that xenserver-buildroot (that's the repo name) is tested on CentOS and Ubuntu 14.04
<johnkeates> not, since that was written, a lot of changes were made and Ubuntu (or Debian) wasn't tested in the meantime
<mrvn> % ocamlfind list | grep threads
<johnkeates> i've already patched a number of things
<mrvn> threads (version: [distributed with Ocaml])
<johnkeates> yeah, i get the same output
jeffmo has joined #ocaml
<mrvn> how does it test for threads? Maybe the test is just wrong?
<johnkeates> according to the configure output, the build system is using the same ocamlfind as I use on the commandline
<johnkeates> yeah, I thought that could be an issue, but I'm also not sure how it tests for threads
<johnkeates> the first error listed is "ocamlfind: Package `threads' not found"
<johnkeates> but when I use ocamlfind it finds it
<johnkeates> an error below it reports a different command: '/usr/bin/ocamlbuild' lib/re.cma lib/re.cmxa lib/re.a lib/re_emacs.cma lib/re_emacs.cmxa lib/re_emacs.a lib/re_str.cma lib/re_str.cmxa lib/re_str.a lib/re_posix.cma lib/re_posix.cmxa lib/re_posix.a lib/re_glob.cma lib/re_glob.cmxa lib/re_glob.a lib/re_perl.cma lib/re_perl.cmxa lib/re_perl.a lib/re_pcre.cma lib/re_pcre.cmxa lib/re_pcre.a -tag debug'
<johnkeates> which doesn't even contain threads in the arguments list
<johnkeates> but it's possible ocamlbuild uses ocamlfind internally I suppose, but does it?
<octachron> ocamlbuild should use ocamlfind only when passed the -use-ocamlfind flag
<johnkeates> I guess it must be a non-reported command they use for testing the existence of 'threads'
<johnkeates> Does ocaml use SPEC files? or is the OMakefile the norm
<Algebr`> hmm, ocamlfind list | grep thread
<Algebr`> threads (version: [distributed with Ocaml])
<Algebr`> threads.posix (version: [internal])
<Algebr`> threads.vm (version: [internal])
<johnkeates> yep, i have the posix and vm versions too
copy` has quit [Quit: Connection closed for inactivity]
<johnkeates> as well as the cothreads one which contains a few versions as well
<ygrek> just pass '-tag thread' to ocamlbuild and/or -package threads to ocamlfind
MercurialAlchemi has quit [Ping timeout: 264 seconds]
larhat has joined #ocaml
butts_butts has joined #ocaml
larhat has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 258 seconds]
butts_butts has quit [Remote host closed the connection]
wtetzner has joined #ocaml
wtetzner_ has joined #ocaml
jeffmo has quit [Read error: Connection reset by peer]
silver has quit [Quit: rakede]
wtetzner has quit [Read error: Connection reset by peer]
zpe has quit [Remote host closed the connection]
kakadu has joined #ocaml
kushal has quit [Ping timeout: 258 seconds]
Algebr` has quit [Ping timeout: 250 seconds]
johnelse has joined #ocaml
nicholasf has joined #ocaml
jbrown has quit [Quit: Leaving]
johnelse has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Ping timeout: 244 seconds]
iorivur has quit [Ping timeout: 258 seconds]
ollehar has quit [Quit: ollehar]
StatelessCat has joined #ocaml
iorivur has joined #ocaml
iorivur has quit [Remote host closed the connection]
strykerkkd has quit [Quit: Leaving]
zpe has joined #ocaml
johnkeates has quit [Quit: Leaving]
jbrown has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
ygrek has joined #ocaml
Algebr` has joined #ocaml
jbrown has quit [Remote host closed the connection]
pierpa has joined #ocaml
orbifx1 has joined #ocaml
orbifx has quit [Ping timeout: 276 seconds]
jbrown has joined #ocaml
nicholasf has quit [Remote host closed the connection]
copy` has joined #ocaml
nicholasf has joined #ocaml
SpiceGuid has quit [Quit: ChatZilla 0.9.92 [SeaMonkey 2.40/20160120202951]]
wtetzner_ has quit [Remote host closed the connection]
nicholasf has quit [Ping timeout: 244 seconds]
ontologiae_ has quit [Ping timeout: 244 seconds]
orbifx1 has quit [Ping timeout: 240 seconds]
dexterph has quit [Ping timeout: 244 seconds]
seangrove has quit [Read error: Connection reset by peer]
seangrove has joined #ocaml
kakadu has quit [Remote host closed the connection]
unbalancedparen has quit [Quit: WeeChat 1.5]
zpe has joined #ocaml
nicholasf has joined #ocaml
sillyotter has joined #ocaml
zpe has quit [Ping timeout: 252 seconds]
unbalancedparen has joined #ocaml
unbalancedparen has quit [Client Quit]
sillyotter has quit [Quit: WeeChat 1.5]
nicholasf has quit [Ping timeout: 250 seconds]
octachron has quit [Quit: Leaving]
Algebr` has quit [Ping timeout: 250 seconds]