<Drup>
(next jsoo release is going to be really cool)
lindig has joined #ocaml
<lin>
.quit
<lin>
Sorry
pierpa has quit [Remote host closed the connection]
pierpa has joined #ocaml
lindig has quit [Client Quit]
<flux>
drup, umm, executive summary for us not following js_of_ocaml that closely?-)
<Drup>
you can now compile a .cmo/a to a .js file and use dynlink
<Drup>
and separate compilation
dsheets has joined #ocaml
<Drup>
Previously, you had to compile to an executable then compile that to .js
pyon has quit [Quit: brb guise]
<reynir>
:o that sounds very cool!
<engil>
that remembered by that my previous attempt at writing a reason toplevel with jsoo was a failure
<companion_cube>
soon OCaml on node.js will be more popular than OCaml native
<engil>
mostly because I didn't took the time to understand every bits of it
<engil>
Drup: you think it's doable ?
FreeBirdLjj has quit [Remote host closed the connection]
<engil>
might be the wrong channel…
<Drup>
engil: huum, I don't see what would be the issue
dsheets has quit [Ping timeout: 252 seconds]
<flux>
companion_cube, argh
<engil>
Drup: so the issue is my incompetence, noted.
<engil>
will try again later then
FreeBirdLjj has joined #ocaml
<flux>
not completence but perseverance ;-)
<flux>
-l
<engil>
probably :)
FreeBirdLjj has quit [Remote host closed the connection]
<companion_cube>
flux: I'm not serious, I hope it will not happen
<companion_cube>
but maybe reason will become more popular than vanillocaml
FreeBirdLjj has joined #ocaml
<engil>
well, if you use github stars as a scale, that's already it
<engil>
:-)
<companion_cube>
^^
tane has joined #ocaml
<companion_cube>
stars are fun but they probably are not a valid measure for anything
<companion_cube>
(except 'the number of people clicking on the star button')
<engil>
well, they measure interest, not actual impact
<engil>
nor « real interest », that is, above saying « that's cool »
<companion_cube>
yeah, exactly
<Drup>
engil: I think the simplest way would be to copy the toplevel in js_of_ocaml's sources and add reason -> ocaml translation inside Toplevel.run
<companion_cube>
or "I want to bookmark this"
<engil>
Drup: did that, fought a little bit with translating from camlp4 to ppx, haven't used jsoo in ages
<Drup>
translating from camlP4 to ppx ? What for ?
<flux>
I've starred many projects I haven't even git cloned
pyon has joined #ocaml
<flux>
I'll check them out again.. eventually.. :-)
<engil>
reason won't compile with some camlp4 bits
<Drup>
engil: why does it matter ? You want the jsoo toplevel to take reason as imput, not to translate the code to reason syntax
AlfredENeuman has joined #ocaml
<Drup>
But actually, now that I'm looking at it, don't bother doing that
<Drup>
just change Toploop.parse_topleve_phrase
lindig has joined #ocaml
<Drup>
it's a reference, you can change the content, switch it for a reason parser :]
octachron has joined #ocaml
<engil>
Drup: when I tried to use the reason parser, when using the reason package when compiling, it complained that reason was not compatible with camlp4
<engil>
I probably did something wrong though
<engil>
will try again
<Drup>
that doesn't make sense, it's an ocaml library, once it's compiled, it doesn't matter o_o
<engil>
that what I thought
<Drup>
ping chenglou ^
amnn has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
amnn has joined #ocaml
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<flux>
I realized on the other hand I haven't starred the ocaml project :-)
<engil>
Drup: might be related to this: error(pkg_camlp4) = "reason is incompatible with camlp4"
Sorella has joined #ocaml
lindig has quit [Client Quit]
<Drup>
right, so apparently this error is also propagated to reason.lib, which is wrong
lindig has joined #ocaml
sh0t has joined #ocaml
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lindig has joined #ocaml
steve_gh has joined #ocaml
lindig has quit [Client Quit]
<steve_gh>
can I ask a beginner's question?
gpietro_ has joined #ocaml
<companion_cube>
sure, go on
<steve_gh>
Thxs. I'm a little confused about how I instantiate a date using CalendarLib (for example using utop)
<steve_gh>
If I type
<steve_gh>
let d=Date.make 2016 10 10;;
sh0t has quit [Ping timeout: 260 seconds]
<steve_gh>
I get
<reynir>
Where's CalendarLib from?
<steve_gh>
val d : Date.t = <abstr>
<companion_cube>
from `calendar`?
<companion_cube>
steve_gh: that's just how it's printed, the type is probably opaque
lindig has joined #ocaml
lindig has quit [Client Quit]
<steve_gh>
OK thxs companion_cube. Now if I try applying a getter method to my date d, for example d.days_in_month I get an Error: Unbound value days_in_month.
<companion_cube>
Date.days_in_month d
<steve_gh>
So I'm thinking that I haven't actually specified the type. Am I barking up the wrong tree here?
<companion_cube>
the function belongs to the module, not the values
ygrek has joined #ocaml
<steve_gh>
Duh!!! thank you. I get it now
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
lindig has joined #ocaml
lindig has quit [Client Quit]
FreeBirdLjj has quit [Remote host closed the connection]
FreeBirdLjj has joined #ocaml
wiredsister has joined #ocaml
FreeBird_ has joined #ocaml
<companion_cube>
hmmm, does OCaml support parametrized printing functions nowadays?
<companion_cube>
in utop
<Enjolras_>
you mean like #install_printer ?
<companion_cube>
yeah, it rejects my printing functions
tane has quit [Quit: Verlassend]
<companion_cube>
"wrong type for a printing function"
steve_gh has quit [Ping timeout: 250 seconds]
<companion_cube>
(for (formatter -> 'a -> unit) -> formatter -> 'a t -> unit)
lindig has joined #ocaml
djellemah has quit [Remote host closed the connection]
<aantron>
hum seems i have znc 1.2, from the blessed ubuntu repos
<lin>
1.2 o.O
<lin>
upgrade pls
<aantron>
yeah :p
mistermetaphor has joined #ocaml
<aantron>
thanks
<lin>
Sure lol
lindig has joined #ocaml
ygrek has joined #ocaml
lindig has quit [Client Quit]
mistermetaphor has quit [Remote host closed the connection]
<edwin>
aantron: FWIW I run ZNC 1.6.2-2~bpo8+1, it hasn't crashed since February 20 when I installed that version
<aantron>
edwin: cool, i will try installing znc from the ppa and see how that works
lindig has joined #ocaml
yomimono has joined #ocaml
copy` has joined #ocaml
leyyin has joined #ocaml
kolko has joined #ocaml
ygrek has quit [Ping timeout: 250 seconds]
wiredsister has joined #ocaml
def`_ has joined #ocaml
M-pesterhazy1 has joined #ocaml
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rgrinberg has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0 has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Read error: Connection reset by peer]
Sorella has quit [Quit: Connection closed for inactivity]
AlfredENeuman has joined #ocaml
darius93 has joined #ocaml
Fleurety has joined #ocaml
aphprentice has joined #ocaml
Fleurety has quit [Max SendQ exceeded]
aphprentice has quit [Max SendQ exceeded]
aphprentice has joined #ocaml
lindig has joined #ocaml
infinity0_ has quit [Remote host closed the connection]
rgrinberg has joined #ocaml
infinity0 has joined #ocaml
kushal has quit [Quit: Leaving]
zpe has quit [Ping timeout: 244 seconds]
darius93 has quit [*.net *.split]
AlfredENeuman has quit [*.net *.split]
infinity0 has quit [Remote host closed the connection]
aantron has quit [Quit: Enjoy!]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
infinity0 has joined #ocaml
aantron has joined #ocaml
<frefity>
using lwt, how do I block until a thread has terminated?
Algebr has joined #ocaml
<companion_cube>
you mean,really block? you cannot
<Drup>
frefity: simply use bind/>>=
<companion_cube>
use >>=
<Algebr>
and its friends, I like >|=
Algebr has quit [Remote host closed the connection]
Algebr has joined #ocaml
dsheets has quit [Remote host closed the connection]
<frefity>
thanks
darius93 has joined #ocaml
AlfredENeuman has joined #ocaml
mistermetaphor has joined #ocaml
dsheets has joined #ocaml
Denommus has quit [Ping timeout: 258 seconds]
rgrinberg has quit [Ping timeout: 252 seconds]
zpe has joined #ocaml
<Algebr>
fiddling with fork is annoying, damnit OCaml single threadedness
<companion_cube>
have you tried parmap and the likes?
<Algebr>
parmap is more for computations
<Algebr>
and subdividing work, as I understand it
<Algebr>
I just need to fork n number of times
<companion_cube>
oh
rgrinberg has joined #ocaml
<Algebr>
yea, my hassle is that its messing up sockets from the parents, etc etc. Unix crap
<companion_cube>
ah, yeah, annoying
gpietro_ has quit [Quit: Leaving]
<Algebr>
and tried lwt-parallel but its not actualy forking all the time?
<Algebr>
just hassle of trying to find all the odd unix corner cases
larhat has quit [Quit: Leaving.]
lindig has joined #ocaml
<Algebr>
but the single threadness + Lwt did let me bang something out quite good in a short period of time, for that I love the elegance of Lwt, however heavily underdocumented it is
<Algebr>
Does ocaml farm out the linking of cmos and whatnot to the system linker, or does it have a primitiv inhouse linker
BitPuffin|osx has quit [Remote host closed the connection]
Denommus has joined #ocaml
doecnt has joined #ocaml
doecnt has quit [Remote host closed the connection]
lindig has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lindig has joined #ocaml
shinnya has joined #ocaml
mistermetaphor has quit [Ping timeout: 260 seconds]
mistermetaphor has joined #ocaml
lindig has quit [Read error: Connection reset by peer]
thomasga has joined #ocaml
jwatzman|work has quit [Quit: jwatzman|work]
misterme_ has joined #ocaml
hcarty has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
<Algebr>
python really does have its moments of awesome: if not any([filename.endswith(name) for name in bad_endings]):
<Algebr>
mistermetaphor has quit [Ping timeout: 244 seconds]
<Algebr>
python trivial, the list comprehension is faster than the map(lambda, iterable) since the map will load up the function name/symbol for each call. (Or so I am told)
dsheets has quit [Remote host closed the connection]
dsheets has joined #ocaml
bba has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
zpe has quit [Ping timeout: 240 seconds]
bba has joined #ocaml
dsheets has quit [Ping timeout: 276 seconds]
MightyJoe is now known as cyraxjoe
rand__ has joined #ocaml
octachron has quit [Quit: Page closed]
dsheets has joined #ocaml
wiredsister has quit [Ping timeout: 244 seconds]
<companion_cube>
List.for_all (fun name -> not (File.suffix name filename)) bad_endings <--- sth like this is not too bad either
<Algebr>
yea not bad, but doesn't read to me as easily from left to right
dsheets has quit [Ping timeout: 258 seconds]
<companion_cube>
yeah, yeah, ok
<mfp_>
Algebr: what was the problem with lwt-parallel exactly? IIRC it creates a "zygote" process that will fork as needed to create workers and give the (unix socket) address to the main program so that it can get the result
mfp_ is now known as mfp
unbalancedparen has joined #ocaml
<Algebr>
yea, I don't need it to fork as needed, I need it to fork n number. Otherwise when it forks the children get parents sockets, and I don't need that, also have this race condition where child forks and gets parents server, which gets request and then forks again.
<Algebr>
the main program doesn't get any result, each forked child more like provides a service
<mfp>
Algebr: IIRC the idea is to fork the "zygote" early when the process starts, so that the workers do not inherit random garbage (fds, stuff)
amnn has joined #ocaml
<Algebr>
yea, I take it that's Parallel.init
<companion_cube>
you can also setup FDs so they close on fork, afaik
<companion_cube>
so the child doesn't get them at all
<Algebr>
well, I need child to get the request and parent's handle to close
<Algebr>
bah, its confusing
<companion_cube>
it's on a per-FD basis
<mfp>
the handle is a fd?
yunxing has joined #ocaml
amnn has quit [Client Quit]
<mfp>
you can send the fd via a unix socket to the worker, then forget about it in the main program
<Algebr>
how
<Algebr>
also wat
<Algebr>
you mean like literally just sending the fd's number?
<Algebr>
damnit mulitcore come fix this all.
dwillems has joined #ocaml
<mfp>
nope, the thing to pass unix file descriptors via sendmsg
<rgrinberg>
companion_cube: if you want to officially take over onanomsg you're welcome to
<struk|desk>
if I started a project that needed one of zeromq or nanomsg, not sure which I'd pick
<companion_cube>
ah, yeah
dsheets has quit [Ping timeout: 272 seconds]
<companion_cube>
forgot about that
srcerer_ is now known as srcerer
<rgrinberg>
struk|desk: please pick zeromq. the bindings are in far better shape and zeromq is actually being maintained
<companion_cube>
really? in what way are nanomsg's bindings bad actually?
<struk|desk>
got it! I am trying to using kefka exclusively for anything involving multiple machines anyhow (or tensorflow if it's specific to that domain), but we will see..
<struk|desk>
err, *kafka
tvynr has joined #ocaml
<tvynr>
Does anyone know if it's possible to write a project-specific PPX extension? I'm using OASIS as a build system and I'm trying to come up with a good way to write little domain-specific syntactic sugar without the overhead of creating a separate project.
<mrvn>
rgrinberg: except they sometimes segfault
<mrvn>
tvynr: it is but don't ask me how
<tvynr>
mrvn: Well, that's encouraging, at least. :)
<companion_cube>
tvynr: I suppose you'll have to deal with ocamlbuild directly, but I might be wrong
<rgrinberg>
companion_cube: they don't work with lwt or async yet
<mrvn>
iirc you need to patch myocamlbuild to add the flags and some tags to make it build the ppx first.
<companion_cube>
wait, there is a nanomsg_lwt module?
<tvynr>
companion_cube, mrvn: Thanks; I'll take a look. I'm sort of paranoid I'm going to wind up with something that doesn't play nicely with Merlin. :(
dsheets has joined #ocaml
zpe has joined #ocaml
<hcarty>
mrvn: If they segfault please submit a bug!
dsheets has quit [Ping timeout: 276 seconds]
zpe_ has joined #ocaml
zpe has quit [Ping timeout: 250 seconds]
orbifx has quit [Quit: WeeChat 1.5]
<struk|desk>
does anyone know of a function in Core.Std.Option which provides a default value to the option in a lazy way? eg: Option.value_lazy ~f:(fun () -> "a default") an_optional
dwillems has left #ocaml ["Ex-Chat"]
<companion_cube>
in Core, I don't know
<struk|desk>
I added one as PR to CCOpt :), but core doesn't seeem to have one
octachron has joined #ocaml
<companion_cube>
ahah indeed :D
<companion_cube>
I remembered having one, but not that you were the implementor
shinnya has quit [Ping timeout: 260 seconds]
<octachron>
tvynr, for merlin, you just need to add a line like "FLG -ppx your_ppx_executable" and it should work fine
ggole has quit []
darkf has quit [Quit: Leaving]
<tvynr>
octachron: Ah! I'd forgotten about FLG. Thanks!
<struk|desk>
companion_cube: they are also missing choice, surprisingl..maybe I should PR it, for uniformity's sake
<companion_cube>
:D
<companion_cube>
core, this minimalistic library
<struk|desk>
lol
octachron has quit [Read error: Connection reset by peer]