BitPuffin has quit [Remote host closed the connection]
nomicflux has quit [Quit: nomicflux]
BitPuffin|osx has quit [Remote host closed the connection]
ygrek has quit [Ping timeout: 248 seconds]
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ziyourenxiang has quit [Ping timeout: 248 seconds]
peterpp has quit [Ping timeout: 260 seconds]
jlongster has joined #ocaml
nomicflux has joined #ocaml
nomicflux has quit [Client Quit]
djellemah_ has joined #ocaml
djellemah__ has quit [Ping timeout: 246 seconds]
pierpa has joined #ocaml
sapristi has quit [Ping timeout: 276 seconds]
https_GK1wmSU has joined #ocaml
govg has quit [Ping timeout: 260 seconds]
https_GK1wmSU has left #ocaml [#ocaml]
_berke_` has joined #ocaml
_berke_ has quit [Remote host closed the connection]
niris has joined #ocaml
seangrove has quit [Ping timeout: 260 seconds]
ristos has quit [Quit: Connection closed for inactivity]
<Bluddy[m]>
petepp: List.(...) is like a local open of List. It's useful for bringing in names from a module to a limited context
govg has joined #ocaml
pierpa has quit [Quit: Page closed]
enterprisey has joined #ocaml
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sh0t has quit [Remote host closed the connection]
keep_learning has joined #ocaml
mfp__ has quit [Ping timeout: 248 seconds]
sz0 has quit [Quit: Connection closed for inactivity]
segmond has quit [Quit: l8r]
raphaelss has joined #ocaml
peterpp has joined #ocaml
Orion3k has joined #ocaml
mengu has quit [Remote host closed the connection]
Orion3k has quit [Ping timeout: 260 seconds]
Orion3k has joined #ocaml
kalio has quit [Quit: WeeChat 1.9]
malina has quit [Ping timeout: 260 seconds]
kalio has joined #ocaml
samrat_ has joined #ocaml
al-damiri has quit [Quit: Connection closed for inactivity]
mbuf has joined #ocaml
<mbuf>
OCaml now has parametric polymorphism and multi-core support?
<mbuf>
OCaml does not use the Q Public license anymore?
samrat_ has quit [Ping timeout: 240 seconds]
MercurialAlchemi has joined #ocaml
https___GK1wmSU has joined #ocaml
https__GK1wmSU has joined #ocaml
https___GK1wmSU has left #ocaml [#ocaml]
https__GK1wmSU has left #ocaml [#ocaml]
jnavila has joined #ocaml
<peterpp>
if I have an array of tuples of floats, will it be laid out contiguously in memory?
<peterpp>
will they...
jnavila has quit [Remote host closed the connection]
freusque has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
raphaelss has quit [Quit: Lost terminal]
<companion_cube>
mbuf: Ocaml always had parametric polymorphism
<companion_cube>
peterpp: no
<mbuf>
companion_cube, okay
<companion_cube>
I think it's typically better (in all languages) to use struct-of-arrays, not array-of-structs, for numbers
dakk has joined #ocaml
malc_ has joined #ocaml
mbuf has left #ocaml ["Leaving"]
MercurialAlchemi has joined #ocaml
_berke_` has quit [Remote host closed the connection]
Simn has joined #ocaml
TheLemonMan has joined #ocaml
zpe has joined #ocaml
ome has quit [Ping timeout: 276 seconds]
ome has joined #ocaml
zpe has quit [Remote host closed the connection]
zpe has joined #ocaml
zpe has quit [Ping timeout: 240 seconds]
freusque has quit [Ping timeout: 240 seconds]
freusque has joined #ocaml
enterprisey has quit [Read error: Connection reset by peer]
andreas_ has joined #ocaml
Anarchos has joined #ocaml
mbuf has joined #ocaml
freusque has quit [Ping timeout: 240 seconds]
<Leonidas>
mbuf: yes, the compiler is now LGPL
<mbuf>
Leonidas, thanks!
<Leonidas>
pretty good to see the last user of QPL to stop using it :)
<Leonidas>
mbuf: the stdlib used to be LGPL before already, I think.
<mbuf>
I don't remember the reference, but, I read that type classes (similar to those in Scala) are available in OCaml 4.02?
<Leonidas>
peterpp: for things like Lwt.(foo >>= bar) it might be a useful syntax.
<mbuf>
I was looking for a static, strong, inferred language for multi-core, and came across OCaml
<Leonidas>
mbuf: no. The thing you mean is modular implicits.
<Leonidas>
mbuf: modular implicits are kinda similar to Scala but from what I have seen are sufficiently different from Scala to avoid some of the downsides.
<mbuf>
Leonidas, I shall read on it
<Leonidas>
mbuf: There is no multicore. It is being worked on, though for many things the importance of multicore is overrated anyway
<Leonidas>
(of course, every programmer of language without multicore will say that, so take that with a shovel of salt)
<mbuf>
Leonidas, what about github.com/ocamllabs/ocaml-multicore
<mbuf>
malc_, where Haskell is faster, the difference is not much
<mbuf>
malc_, unlike the case where OCaml is faster
<malc_>
mbuf: fair enough
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
<reynir>
Leonidas: "shovel of salt" :D
freusque has quit [Ping timeout: 240 seconds]
ziyourenxiang has joined #ocaml
malina has joined #ocaml
<peterpp>
there's an example program on lwt's github page and instructions to compile it with ocamlfind
<peterpp>
I'm trying to compile with corebuild, but always get: Error: Extension `lwt' was not translated
mfp__ has joined #ocaml
<def`>
how are you invoking corebuild?
<octachron>
peterpp, corebuild implicit invocation of ppx-jane is probably interfering with lwt.ppx, this should work :"ocamlbuild -use-ocamlfind -package lwt.unix -package lwt.ppx example.native"
<peterpp>
octachron, when I run it I see the same error
<peterpp>
hold on, sorry, it works now
freusque has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
copy_ has joined #ocaml
Muzer has quit [Ping timeout: 258 seconds]
MercurialAlchemi has joined #ocaml
* rwmjones
wonders if anyone has written a "run once" macro/library
<rwmjones>
it should be possible with Lazy I think ..
<malc_>
rwmjones: straightforward lazy () and later Lazy.force_val doesn't suffice?
Mercuria1Alchemi has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 240 seconds]
<Leonidas>
mbuf: you could try them both and see which one you like more? With OCaml and Haskell the differences are more like "which flavour of strawberry milkshake do you like better".
<rwmjones>
where the ‘once’ macro/function is hiding the details
<mbuf>
Leonidas, sure
<reynir>
rwmjones: you want some kind of common subexpression thing?
<mrvn>
rwmjones: how would that work? The result of Str.string_match is not a function that would ever run a second time.
<rwmjones>
ok so in the real code, Str.string_match would be called multiple times, but I only want to compile the regexp once
<rwmjones>
golang has this, so it's not like it's rocket science
<mrvn>
rwmjones: which would give different results depending on str. Do you want memoization?
<def`>
rwmjones: it depends how you want to deal with local values
<malc_>
rwmjones: it looks as if you want lazy + Lazy.force[_val] wrapped into one call..
<rwmjones>
note that once is a macro in that code, it would expand to some compiler magic
<rwmjones>
it can't be done in a function call
Muzer has joined #ocaml
<def`>
to lift the expression to the outer-most scope where all referenced values are bound require some binding analysis
<mrvn>
rwmjones: shouldn't it be: let string_match = Str.string_match [@once]?
<def`>
but you can just replace once by: 1) you allocate a top level option
<rwmjones>
def` has the right idea
<def`>
2) match !toplevel_option with Some x -> x | None -> let result = Str.regexp "blah" in toplevel_option := Some result; result
<rwmjones>
exactly, so I'm looking to see if anyone has implemented a macro doing that
<mrvn>
def`: that would just be common subexpression elimination
<def`>
mrvn: no.
<mrvn>
common on a global scope
<def`>
rwmjones: no, actually there is one thing that cannot be done properly in the language: preventing the toplevel ref to leak in the interface
<rwmjones>
it's not CSE in the ordinary sense because (without the "once" bit) the code is saying to run Str.regexp every time
<mrvn>
rwmjones: I thought you wanted Str.string_match only getting called once. Not just Str.regexp. The later is trivial as def showed.
<def`>
the __magic_unique_name : 'a option will appear in the cmi.
<mrvn>
rwmjones: true, it's a bit more efficient because you only calculate it if you actually need it.
<def`>
(and it cannot be polymorphic, the compiler will complain)
<def`>
but the extending ocaml's open proposal by runhang li and jeremy yallop to appear at ICFP should allow that.
<mrvn>
def`: you could hide it in a functor or sub module or not?
<def`>
no, this require an extension of the language.
<mrvn>
I think you could write once as a functor now.
<mrvn>
and then hide the ugly syntax behind ppx
<mrvn>
Speaking of ppx. Has someone an example of ppx code dealing with classes and methods?
<mrvn>
I want to implement 'external method foo : int = "stub_foo"'
<companion_cube>
hu ho, I thought fail_report was in 0.6, stupid me
<companion_cube>
sam_: I'll try to release soon, it's time
sz0 has joined #ocaml
al-damiri has joined #ocaml
<Leonidas>
hmm, whenever I feel like using jbuilder, it does not support
<Leonidas>
so I tried using ppx_let with jbuilder and it says that %bind is an uninterpreted extension
<rgrinberg>
Usually that's a good sign that the ppx should be avoided. Because it doesn't use omp
<companion_cube>
does ppx_deriving use omp yet, btw?
<rgrinberg>
Somewhere in some branch
<Leonidas>
rgrinberg: I would expect a ppx made my Jane Street to work with the build tool made by Jane Street, but maybe I'm weird.
<rgrinberg>
Maybe you have an old version?
<Leonidas>
yes, that's well possible indeed.
<Leonidas>
but I can't update to a newer, because the newer Core breaks ppx_deriving_yojson
<rgrinberg>
This ppx deriving issue is a good example of this rule btw. See how nobody depending on deriving can use 405
* Leonidas
waves, sadly stuck on 4.04.2
<companion_cube>
rgrinberg: well if jbuilder doesn't support ppx_deriving, then maybe it's a bit too bleeding edge ;)
<Leonidas>
Guess it is back to OMake then.
Soni has joined #ocaml
malina has quit [Ping timeout: 240 seconds]
<rgrinberg>
Leonidas: avoid everything that doesnt use omp. Your downstream users will thank you
<Leonidas>
I would really like to use it, but jbuilder is kinda very unflexible if you don't go the blessed JS way :(
<Leonidas>
rgrinberg: Yes. But lots of code existed before omp
<rgrinberg>
companion_cube: respectfully this is a problem with ppx_deriving (and luckily it's getting fixed)
<rgrinberg>
Leonidas: i don't believe omp is the JS way. At least I wasn't aware it was a JS project.
malina has joined #ocaml
<companion_cube>
this is a problem with most ppx, tbh
<companion_cube>
it was predictable that forward compat would be complicated
<malc_>
omp = ocaml migrate parsestree?
<rgrinberg>
agreed
tane has joined #ocaml
<def`>
I confirm, it is not a JS project
<Leonidas>
rgrinberg: that's not what I said. The blessed JS way can be to also use non-JS stuff. Rarely, though ;)
<hannes>
did anyone do any performance numbers regarding module aliases (I just recently came across https://caml.inria.fr/mantis/view.php?id=7538 and am wondering whether there are other issues in this area)?
<Leonidas>
rgrinberg: why do the older ppx'es don't work? because jbuilder does not use -ppx in the compiler?
<rgrinberg>
Leonidas: exactly
<Leonidas>
wish there was an option to do it anyway. even if it is slower.
<rgrinberg>
it's not that easy, you'd also have to start either calling the compiler with ocamlfind or reading out the ppx option out of META files
dhil has quit [Ping timeout: 240 seconds]
<Leonidas>
yeah, but that's doable and would be helpful until most relevant ppx'es are ported.
<rgrinberg>
time's finite and jbuilder ended up gaining many other useful features
<Leonidas>
(though I suppose that's for the most part ppx_deriving*)
<rgrinberg>
so while it is useful, it should be weighted against other work that can be done
<Leonidas>
rgrinberg: which are all 100% useless if I can't use it to compile my program.
dhil has joined #ocaml
sapristi has joined #ocaml
<Leonidas>
I'm not arguing for anything really weird, like writing stubs in Rust and crosscompiling to armv8
<rgrinberg>
i don't believe that building every kind of ocaml project out there was one of jbuilder's original goals
<rgrinberg>
this limitation is one of many
<Leonidas>
probably not. though that was what made OPAM successful and OASIS-DB not
<rgrinberg>
i never used oasis-db (it was before my time), but I don't think it's an exact analogy
<rgrinberg>
i think that an oasis-db like thing for jbuilder only projects would be very attractive
<rgrinberg>
at least to me.
<companion_cube>
what was oasis-db?
<rgrinberg>
no need to mess around with pins, install steps, dozens of build systems, findlib, etc.
<sam_>
hannes, can i add the pin status to my opam file?
<Leonidas>
rgrinberg: yeah, I can see the appeal. The ability to work with multiple projects in an easier way at the same time is one of the points why I would like to convert my build to jbuilder
<Leonidas>
There is no ppx_json_conv to replace ppx_deriving_yojson so that's a bummer.
<rgrinberg>
you don't like atdgen?
<hannes>
sam_: no.
<sam_>
ah so you cant publish anything that relies on other unpublished packages?
<companion_cube>
does jbuilder support atdgen?
<rgrinberg>
companion_cube: sure does. see the github package for 1 example
Mercuria1Alchemi has quit [Ping timeout: 258 seconds]
<companion_cube>
ah, neat
<rgrinberg>
actually atd/atdgen themselves use jbuilder ^^
<rgrinberg>
and they do have tests :P
<companion_cube>
so I suppose atdgen > ppx_deriving.yojson…
<rks`>
ah?
<rgrinberg>
yeah, i never had good lucky with ppx_deriving_yojson. i always end up needing that little bit of flexibility atdgen provides
<companion_cube>
easier tooling :p
FreeBirdLjj has joined #ocaml
<sam_>
anyone used a lot of angstrom?
<sam_>
i switched to it to be able to define a recursive expression parser using `fix` but the error messages seem much poorer. am I doing something wrong?
<oriba>
I remember there was a new syntax extension that allowed a match or a try-with to match with error-result. I can't find it in the refman.
<oriba>
whats the syntax of it?
<oriba>
And does it work with anypattern matching?
<companion_cube>
match e with … | exception e -> …
<oriba>
ah, "exception", not "error".
<oriba>
thanks, companion_cube !!
<companion_cube>
yeah, they picked an already existing keyword :-)
sapristi has quit [Remote host closed the connection]
sapristi has joined #ocaml
<oriba>
keyword overloading ;-)
malina has quit [Ping timeout: 240 seconds]
enterprisey has joined #ocaml
sapristi has quit [Ping timeout: 240 seconds]
zpe has joined #ocaml
<sam_>
Ok, I have made a bit further progress. How do I turn a `(char, Bigarray.int8_unsigned_elt, Bigarray.c_layout) Bigarray.Array1.t` into a string?
<companion_cube>
by iterating on it, I think
Muzer has quit [Ping timeout: 258 seconds]
<companion_cube>
or using the `bigstring` library or sth similar
<sam_>
ok ill try the bigstring library
<sam_>
File "_none_", line 1:
<sam_>
Error: No implementations provided for the following modules:
<sam_>
EndianBigstring referenced from /Users/sam/.opam/4.04.2/lib/cstruct/cstruct.cmxa(Cstruct)
<companion_cube>
you need to require "bigstring", I think
<companion_cube>
unless you are looking for something in cstruct
<companion_cube>
(if you use cstruct there might be already things to do that in it)
<sam_>
what does it mean to "require" something in OCaml?
<companion_cube>
well that's in utop; otherwise you need to ask your build system to ues the library
<companion_cube>
(and to opam to install it)
<sam_>
I'm using jbuild and opam
<sam_>
Already installed bigstring
<companion_cube>
then you need to add the library in jbuild, with the other libs
<rgrinberg>
sam_: you need ocplib-endian i believe
<sam_>
angstrom's unconsumed Bigarray is what I am trying to convert to string
<rgrinberg>
ocplib-endian.bigstringor so
<rgrinberg>
but this seems like a bug in cstruct.
<rgrinberg>
why doesn't it include this library?
<rgrinberg>
hmm, looks like it does
<sam_>
urk, no bigstring -> string convenience function...
<rgrinberg>
maybe containers has something? ;) i know core/base does
enterprisey has joined #ocaml
<sam_>
angstrom contains something called buffer_of_bigstring. can i use that to get a buffer and then turn that to a string?
<sam_>
or... is there some fancy form of printf that supports bigstrings or buffers?
<rgrinberg>
Format can print to buffers i believe
<sam_>
sprintf
<sam_>
i want to print to string
<sam_>
append a string to a bigstring and get the result as string
<sam_>
frustrating
<sam_>
oh well, its getting too late for me now...
<sam_>
good night
djellemah__ has joined #ocaml
djellemah_ has quit [Ping timeout: 240 seconds]
<sam_>
this ikea programming style of ocaml is a bit annoying sometimes
peterpp has quit [Ping timeout: 260 seconds]
zpe has quit [Remote host closed the connection]
copy_ has quit [Quit: Connection closed for inactivity]
zpe has joined #ocaml
<rgrinberg>
yes, if you insist on not using a good stdlib things can get tedious
<rgrinberg>
Bigstring.{of,to}_string are available in core for example
zpe has quit [Ping timeout: 240 seconds]
sam_ has quit [Ping timeout: 246 seconds]
FreeBirdLjj has quit [Remote host closed the connection]
jnavila has joined #ocaml
dhil has quit [Ping timeout: 240 seconds]
<Leonidas>
rgrinberg: no, deriving it from a type is much nicer and more direct
jnavila has quit [Ping timeout: 258 seconds]
<Leonidas>
it is a bit inflexible though, true.
<Leonidas>
but the concept of deriving is much broader which is quite nice
FreeBirdLjj has joined #ocaml
raphaelss has joined #ocaml
jnavila has joined #ocaml
mars0i[m] has quit [Quit: idle]
kakadu has quit [Quit: Konversation terminated!]
dhil has joined #ocaml
FreeBirdLjj has quit [Remote host closed the connection]
sz0 has quit [Quit: Connection closed for inactivity]
dreadedfrog has joined #ocaml
dejanr has quit []
sam_ has joined #ocaml
dakk_ has quit [Ping timeout: 240 seconds]
dreadedfrog has quit [Ping timeout: 258 seconds]
sam_ has quit [Ping timeout: 260 seconds]
malina has joined #ocaml
dreadedfrog has joined #ocaml
sapristi has joined #ocaml
tane has quit [Quit: Leaving]
kakadu has joined #ocaml
MercurialAlchemi has quit [Ping timeout: 255 seconds]
kakadu_ has joined #ocaml
kakadu has quit [Ping timeout: 255 seconds]
sh0t has quit [Ping timeout: 240 seconds]
sh0t has joined #ocaml
BitPuffin has joined #ocaml
MercurialAlchemi has joined #ocaml
Orion3k has quit [Ping timeout: 246 seconds]
BitPuffin|osx has quit [Ping timeout: 246 seconds]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
jnavila has quit [Ping timeout: 260 seconds]
TheLemonMan has quit [Quit: "It's now safe to turn off your computer."]
Orion3k has joined #ocaml
Orion3k has quit [Ping timeout: 240 seconds]
peterpp has joined #ocaml
Orion3k has joined #ocaml
_andre has quit [Quit: leaving]
sh0t has quit [Ping timeout: 255 seconds]
dakk has joined #ocaml
sepp2k has quit [Ping timeout: 255 seconds]
enterprisey has quit [Remote host closed the connection]
MercurialAlchemi has quit [Ping timeout: 255 seconds]
rossberg_ has quit [Ping timeout: 255 seconds]
sh0t has joined #ocaml
infinity0_ has joined #ocaml
infinity0_ has quit [Changing host]
infinity0_ has joined #ocaml
infinity0_ is now known as infinity0
infinity0 is now known as Guest41311
Guest41311 has quit [Ping timeout: 260 seconds]
rossberg_ has joined #ocaml
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 246 seconds]
dakk has quit [Read error: Connection reset by peer]
ohama has quit [Ping timeout: 246 seconds]
dhil has quit [Ping timeout: 240 seconds]
ohama has joined #ocaml
ygrek has joined #ocaml
kakadu_ has quit [Remote host closed the connection]
maarhart has joined #ocaml
maarhart has quit [Client Quit]
sh0t has quit [Remote host closed the connection]
https_GK1wmSU has joined #ocaml
andreas_ has quit [Quit: Connection closed for inactivity]
https_GK1wmSU has left #ocaml [#ocaml]
bruce_r has joined #ocaml
Simn has quit [Quit: Leaving]
<bruce_r>
Hey guys. I'm trying to setup my library package with "packed modules", but when I tried to use the inner modules in my dependency, I get a "module is dangling" error. I figure that this is due to ocaml 4.02 module aliases, so I changed my code from "module A = A" to "module A = struct include A end" and that worked, but only at the first level... Now my inner inner modules are dangling. Is there a way to tell oasis to not do the modu
average has quit [Ping timeout: 258 seconds]
nightmared has quit [Ping timeout: 246 seconds]
average has joined #ocaml
sh0t has joined #ocaml
sapristi has quit [Ping timeout: 276 seconds]
sam_ has joined #ocaml
sam_ has quit [Ping timeout: 240 seconds]
mengu_ has joined #ocaml
jlongster has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]