adrien 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.02.3 announced http://ocaml.org/releases/4.02.html | Try OCaml in your browser: http://try.ocamlpro.com | Public channel logs at http://irclog.whitequark.org/ocaml
w1gz has quit [Ping timeout: 244 seconds]
boegel has quit [Ping timeout: 250 seconds]
Johann has quit [Ping timeout: 264 seconds]
mehdib has quit [Ping timeout: 244 seconds]
rixed has quit [Ping timeout: 260 seconds]
rixed has joined #ocaml
w1gz has joined #ocaml
mehdib has joined #ocaml
Johann has joined #ocaml
orbifx has quit [Quit: WeeChat 1.4]
boegel has joined #ocaml
<ollehar> test
<ollehar> unbound value Lexing.pp_position
<ollehar> any idea?
silver has quit [Quit: rakede]
<ollehar> hm, has to do with ppx_deriving...
Simn has quit [Quit: Leaving]
pierpa has quit [Ping timeout: 244 seconds]
Vintila has quit [Ping timeout: 248 seconds]
<ollehar> missing module Ppx_deriving_runtime?
<ollehar> when compiling to binary with ppx_deriving.3.3
<ollehar> ach
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
hxegon has quit [Quit: BRB]
hydan has joined #ocaml
hydan has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 244 seconds]
hydan has joined #ocaml
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
noddy has joined #ocaml
bacam_ has joined #ocaml
bacam has quit [Ping timeout: 240 seconds]
ollehar has quit [Quit: ollehar]
tennix has quit [Ping timeout: 260 seconds]
gfixler has quit [Quit: WeeChat 1.0.1]
struk|desk|away is now known as struk|desk
FredF has joined #ocaml
Haudegen has quit [Ping timeout: 246 seconds]
strmpnk has quit [Ping timeout: 240 seconds]
strmpnk has joined #ocaml
struk|desk is now known as struk|desk|away
ygrek has joined #ocaml
Haudegen has joined #ocaml
struk|desk|away is now known as struk|desk
noddy has quit [Ping timeout: 244 seconds]
tennix has joined #ocaml
ygrek has quit [Remote host closed the connection]
noddy has joined #ocaml
struk|desk is now known as struk|desk|away
shinnya has quit [Ping timeout: 268 seconds]
nullcatxxx_ has quit [Quit: bye]
nullcatxxx_ has joined #ocaml
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
larhat has quit [Quit: Leaving.]
nullcatxxx_ has quit [Client Quit]
nullcatxxx_ has joined #ocaml
noddy has quit [Ping timeout: 248 seconds]
Algebr` has joined #ocaml
julien_t has quit [Ping timeout: 264 seconds]
copy` has quit [Quit: Connection closed for inactivity]
GeorgeHahn has joined #ocaml
lokien has joined #ocaml
huza has joined #ocaml
ygrek has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
ygrek has quit [Ping timeout: 268 seconds]
slash^ has joined #ocaml
tennix has quit [Quit: WeeChat 1.4]
julien_t has joined #ocaml
freehck has quit [Ping timeout: 260 seconds]
teknozulu has quit [Ping timeout: 244 seconds]
julien_t has quit [Ping timeout: 240 seconds]
huza has quit [Quit: WeeChat 1.0.1]
GeorgeHahn has quit [Read error: Connection reset by peer]
Vintila has joined #ocaml
seangrove has joined #ocaml
wiredsister has quit [Remote host closed the connection]
julien_t has joined #ocaml
ygrek has joined #ocaml
c-pyon-s is now known as pyon
freehck has joined #ocaml
julien_t has quit [Ping timeout: 248 seconds]
Algebr` has quit [Ping timeout: 240 seconds]
malc_ has joined #ocaml
foocraft has joined #ocaml
larhat has joined #ocaml
Simn has joined #ocaml
hydan has quit [Remote host closed the connection]
hydan has joined #ocaml
schive has joined #ocaml
julien_t has joined #ocaml
julien_t has quit [Ping timeout: 252 seconds]
FredF has quit [Remote host closed the connection]
julien_t has joined #ocaml
lokien_ has joined #ocaml
noddy has joined #ocaml
ontologiae has joined #ocaml
nicholasf has quit [Remote host closed the connection]
nicholasf has joined #ocaml
badon has quit [Ping timeout: 246 seconds]
ygrek has quit [Ping timeout: 244 seconds]
Haudegen has quit [Ping timeout: 244 seconds]
jmbto has joined #ocaml
mettekou has joined #ocaml
mettekou has quit [Ping timeout: 248 seconds]
julien_ has joined #ocaml
ski_ has joined #ocaml
teiresias has quit [Ping timeout: 240 seconds]
julien_t has quit [Ping timeout: 240 seconds]
boegel has quit [Ping timeout: 240 seconds]
_2can has quit [Ping timeout: 240 seconds]
ski has quit [Ping timeout: 240 seconds]
cat5e has quit [Ping timeout: 240 seconds]
cat5e has joined #ocaml
zaquest has quit [Ping timeout: 240 seconds]
zaltekk has quit [Ping timeout: 240 seconds]
Nazral has quit [Ping timeout: 240 seconds]
zaltekk has joined #ocaml
zaquest has joined #ocaml
boegel has joined #ocaml
_2can has joined #ocaml
nicholasf has quit [Remote host closed the connection]
zarul has joined #ocaml
Nazral has joined #ocaml
mal`` has quit [Ping timeout: 246 seconds]
tane has joined #ocaml
rixed has quit [Ping timeout: 240 seconds]
rixed_ has joined #ocaml
mal`` has joined #ocaml
Haudegen has joined #ocaml
silver has joined #ocaml
noddy has quit [Ping timeout: 276 seconds]
badon has joined #ocaml
bacam_ is now known as bacam
pierpa has joined #ocaml
julien_ is now known as picolino
Kakadu has joined #ocaml
butts_butts has joined #ocaml
darkf has quit [Quit: Leaving]
malc_ has quit [Remote host closed the connection]
toolslive has joined #ocaml
noddy has joined #ocaml
tane has quit [Ping timeout: 250 seconds]
seangrove has quit [Ping timeout: 244 seconds]
tane has joined #ocaml
struk|desk|away is now known as struk|desk
demonimin has quit [Ping timeout: 244 seconds]
noddy has quit [Ping timeout: 260 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
orbifx has joined #ocaml
<orbifx> Can I treat type constructors as an enum and get an int from them somehow?
<orbifx> Other than matching and converting to int.
<zozozo> orbifx: well, you probably could using some Obj functions
struk|desk is now known as struk|desk|away
<orbifx> Anything other than Magic and matching :-P
<zozozo> but more seriously there's probably a ppx somewhere that generates the matching and converting function for you
<zozozo> and if it doesn't it would be nice to do it
<orbifx> Ok, nothing part of the basic language?
<Kakadu> Folks, Who is an ocamlbuild expert? https://sympa.inria.fr/sympa/arc/caml-list/2016-03/msg00219.html
<Kakadu> I'm doing something jsoo related, btw...
<orbifx> Just checking I don't mind writing the matching, but it seems verbose when having one to one sequential matching.
<zozozo> orbifx: as Drup said, try the 'enum' plugin of ppx_deriving
<orbifx> Might do if I start getting long lists.
<zozozo> I'd do it for any type with >= 2 constructors, :p
seangrove has joined #ocaml
lokien_ has joined #ocaml
<flux> I would just use an editor macro to format the type definition into the code.
seangrove has quit [Ping timeout: 244 seconds]
picolino has quit [Ping timeout: 264 seconds]
butts_butts has quit [Ping timeout: 268 seconds]
struk|desk|away is now known as struk|desk
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
schive has quit [Quit: Leaving]
ggole has joined #ocaml
nicholasf has joined #ocaml
nicholasf has quit [Remote host closed the connection]
<orbifx> zozozo: thatd a bit of a low threshold :-P
<zozozo> I'm *very* lazy
<zozozo> but then, it actually depends on how often I expect the type to change
nicholasf has joined #ocaml
Vintila has quit [Ping timeout: 260 seconds]
nicholasf has quit [Ping timeout: 248 seconds]
BitPuffin has joined #ocaml
<companion_cube> gah, looks like the `sha` library is not maintained
sfri has quit [Remote host closed the connection]
<toolslive> how do you convince the opam-repository's travis if the distro it's based on (ubuntu 12.04) does not have the c library you need ?
ggole_ has joined #ocaml
ggole has quit [Ping timeout: 260 seconds]
jmbto has quit [Quit: WeeChat 1.3]
seangrove has joined #ocaml
struk|desk is now known as struk|desk|away
seangrove has quit [Ping timeout: 250 seconds]
<zozozo> toolslive: I think opam lets you specify external dependencies
<toolslive> yes, it does: via depext. so I can specify that I need the package. But alas, the distro is so old the library version I get does not have the include headers I need.
<zozozo> hm.. seems like the trick is to have a virtual opam package that only installs correctly if the given C lib is present
<toolslive> my library installs fine on a more recent ubuntu, but it seems that if I can't convince travis it will not be merged in into the opam repo.
<toolslive> the problem is a bit that all this seems totally irrelevant as it only has use if you have the matching hardware (you need a rdma nic to be able to do something with the lib)
MercurialAlchemi has joined #ocaml
<flux> companion_cube, what kind of maintenance would it need? string->bytes?
<companion_cube> I don't know
<companion_cube> there are PRs but they are not merged
<edwin> can you disable part of the functionality when that C lib is not present?
<companion_cube> otoh it seems really nice
ski_ is now known as ski
<mrvn> https://github.com/mrvn/ocaml-qt5 now has a fully playable Tetrix example.
struk|desk|away is now known as struk|desk
hxegon has joined #ocaml
<mrvn> at least my bigarray patch got it
<mrvn> in
<mrvn> I'm trying to write a ppx plugin. I'm trying to add [%external ...] to class methods by matching class_field. But is there a simple way to get hold of the current class that is in?
<mrvn> i.e. the name used in the class_declaration before that
foocraft_ has joined #ocaml
foocraft has quit [Ping timeout: 246 seconds]
seangrove has joined #ocaml
BitPuffin has quit [Read error: Connection reset by peer]
BitPuffin has joined #ocaml
struk|desk is now known as struk|desk|away
teiresias has joined #ocaml
leyyin has joined #ocaml
malc_ has joined #ocaml
malc_ has quit [Client Quit]
MercurialAlchemi has quit [Ping timeout: 244 seconds]
lokien_ has quit [Quit: Connection closed for inactivity]
Algebr` has joined #ocaml
ibor1 has joined #ocaml
ibor has quit [Ping timeout: 252 seconds]
butts_butts has joined #ocaml
copy` has joined #ocaml
NingaLeaf has joined #ocaml
hxegon has quit [Quit: PEACE OUT]
julien_t has joined #ocaml
d0nn1e has quit [Ping timeout: 260 seconds]
d0nn1e has joined #ocaml
rand__ has joined #ocaml
shinnya has joined #ocaml
jgjl has joined #ocaml
schive has joined #ocaml
julien_t has quit [Ping timeout: 244 seconds]
ontologiae has quit [Ping timeout: 244 seconds]
shinnya has quit [Ping timeout: 264 seconds]
foocraft_ has quit [Remote host closed the connection]
larhat has quit [Quit: Leaving.]
idegen has joined #ocaml
sfri has joined #ocaml
NingaLeaf has quit [Quit: Textual IRC Client: www.textualapp.com]
seangrove has quit [Ping timeout: 240 seconds]
FredF has joined #ocaml
hydan has quit [Remote host closed the connection]
anoisz has joined #ocaml
hydan has joined #ocaml
noddy has joined #ocaml
MercurialAlchemi has joined #ocaml
keep_learning has joined #ocaml
jgjl_ has joined #ocaml
jgjl has quit [Ping timeout: 248 seconds]
chindy has joined #ocaml
<keep_learning> Hello every one
<keep_learning> I have written a small function to compute the permutation
<keep_learning> but I am getting Stack overflow during evaluation (looping recursion?).
<keep_learning> Could some one please tell me how to convert the list into Lazy list
<keep_learning> I have tried let thunk = lazy ( (perm [0;1;2;3;4;5;6;7;8;9] 9));;
<keep_learning> but # Lazy.force thunk;;
<keep_learning> Stack overflow during evaluation (looping recursion?).
<keep_learning> So I am looking for function which evaluates the element one by one.
malc_ has joined #ocaml
leyyin is now known as Tobot
Tobot is now known as leyyin
orbifx2 has joined #ocaml
orbifx has quit [Ping timeout: 252 seconds]
<lyxia> you need to define another type for lazy lists
<keep_learning> lyxia, so I have to define the list and all the operations, map, filter for lazy list ?
<lyxia> not filter
butts_butts has quit [Ping timeout: 240 seconds]
<lyxia> It's fine to keep strict lists to represent the permutations themselves
<lyxia> keep_learning: Batteries (and likely other libraries) has lazy lists
rand__ has quit [Quit: leaving]
djellemah_ has joined #ocaml
<keep_learning> lyxia, Thank you
ygrek has joined #ocaml
<lyxia> oh wait you do use filter afterwards
djellemah_ has quit [Client Quit]
<companion_cube> lazy list or iterator
djellemah_ has joined #ocaml
Algebr` has quit [Remote host closed the connection]
noddy has quit [Ping timeout: 252 seconds]
Kakadu has quit [Quit: Page closed]
chindy has quit [Remote host closed the connection]
dwillems has joined #ocaml
aantron has quit [Remote host closed the connection]
larhat has joined #ocaml
djellemah_ has quit [Ping timeout: 268 seconds]
wiredsister has joined #ocaml
aantron has joined #ocaml
FredF has quit [Remote host closed the connection]
anoisz has quit [Read error: Connection reset by peer]
octachron has joined #ocaml
<toolslive> Is there anybody who succeeded in letting lwt play nice with another event loop ? I'm looking for an example of this
jgjl_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
julien_t has joined #ocaml
<edwin> toolslive: there is a glib event loop in lwt itself, which event loop do you want to integrate with?
<smondet> toolslive: years ago, jaked had a blog post using ocamlnet's events with Lwt
julien_t has quit [Ping timeout: 268 seconds]
dwillems has quit [Ping timeout: 260 seconds]
Maelan has quit [Ping timeout: 246 seconds]
tobiasBora has quit [Ping timeout: 240 seconds]
<toolslive> librdmacm's rselect or rpoll
<toolslive> smondet: do you have a link to that blog post?
lokien_ has joined #ocaml
Fistine has quit [Ping timeout: 260 seconds]
Kakadu has joined #ocaml
djellemah_ has joined #ocaml
<edwin> looks like you have to implement that virtual method and you get a new engine
Fistine has joined #ocaml
<toolslive> rselect can handle rsockets but also plain file descriptors, so that might be an option
tobiasBora has joined #ocaml
Haudegen has quit [Ping timeout: 240 seconds]
<toolslive> I fear I have to let both event loops run independently and then I have to translate the events between them, via something like a pipe or eventfd
<edwin> ok I did that once too, the result isn't pretty though
<toolslive> exactly
<edwin> if you can have just 1 engine that'd be better
<edwin> do you need to use Lwt_io and such on your rsockets?
<edwin> cause that is something different than just supporting the event loop
dwillems has joined #ocaml
<toolslive> well, that would be nice too (to have channels) but that's not absolutely necessary. just send/recv on bigarrays is good enough
<toolslive> I have demoware of this where I wrap the calls in Lwt_preemptive.detach. of course that's not what I really want
<toolslive> So, if I have my own Lwt_engine.poll based, all other file descriptor based functionality of lwt gets routed to this engine too ?
keep_learning has quit [Quit: Leaving]
<toolslive> thx!
<smondet> toolslive: also found that code moved there: https://github.com/jaked/orpc
ollehar has joined #ocaml
psnively has joined #ocaml
<ollehar> just a quick check: anyone had this problem with ppx_deriving?
<ollehar> This expression has type Ppx_deriving_runtime.string, expected string
<ollehar> using ocaml 4.02.2, ppx_deriving 2.0 or 3.3
<psnively> Hi everyone! Is there a general incantation for opam to have it install something by statically linking any stubs it has? In particular, it looks like bin_prot relies on C stubs and dynamic linking (at least by default). I’m trying out ocaml-musl-static, so that’s stopping me from using core, hence async_core, cohttp…
dwillems has quit [Ping timeout: 244 seconds]
<edwin> toolslive: if you Lwt_engine.set the new engine, then everything in lwt that deals with file descriptors and timeouts should get router there yes
<toolslive> that's perfect... going to try that after the weekend.
<toolslive> thx for the help
<edwin> http://projects.camlcity.org/projects/dl/ocamlnet-4.1.1/doc/html-main/Equeue_howto.html#lwt also ocamlnet has uq_lwt for replacing lwt's engine with ocamlnet's. I haven't tried that because I actually wanted the opposite (make ocamlnet use Lwt's, but I don't think thats posible)
<edwin> but well if you want examples on how to implement lwt engines you can look
<edwin> psnively: if I want a fully static executable I edit the final linker options, trying to build every library with -static breaks too many things
<edwin> psnively: if you're using _oasis then NativeOpt+: -cclib -static on your executable might do the trick
avsej has joined #ocaml
<psnively> edwin: OK, but let’s say I want to try just ONE library… sorry, but is there a straightforward opam invocation to at least try? :-)
<octachron> ollehar, it may be a compatibility problem, attribute rules changed between 4.02.2 and 4.02.3
<edwin> psnively: opam switch 4.02.3+musl (if you're on Debian or otherwise have a musl-gcc compiler), this just gives you a musl based environment (still dynamic linking)
<psnively> edwin: Yeah. I’ll probably end up doing that in the end, for what I ultimately want to build. It’d just be nice if I could say “please at least try to install this statically.”
<edwin> then opam install your library, and then link your executable with -sttaic
<ollehar> octachron: hmmm, I'll try with 4.02.1.
<avsej> hi guys. I'm trying to build ocaml on openindiana (its is a fork of opensolaris) and have couple of issues. For example here https://github.com/ocaml/ocaml/blob/trunk/configure#L915-L916 it uses assembler and C compiler from GNU, but preprocessor from solaris studio, it does not compile with such setting
<psnively> edwin: Right. I actually switched to ocaml-4.02.3-musl-static, hoping to shortcut all that.
<edwin> yeah I didn't have much luck with ocaml-4.02.3-musl-static, except for very simple ocaml apps with no dependencies
<ollehar> octachron: what is attribute rules?
<ollehar> ppx?
<psnively> edwin: heh.
<edwin> its a problem with those libraries's build systems, not opam itself. They try to build .cmxs and fail
<avsej> but with this patch it feels better https://gist.github.com/avsej/250284cfb80c8eba1b3f, but still not compiles
<edwin> nowadays I prefer to use docker instead of static linking (there are some prebuilt docker images for ocaml/opam for various distros)
<octachron> ollehar, the rules defining how the attributes [@@...] are attached to syntax items
<ollehar> ok
<psnively> edwin: Right. I’m just trying to port a silly orchestration thing that’s in Python, and that would be a good use-case for Go, to OCaml, but I like the standalone-binary idea.
<psnively> edwin: It’s frustrating, because of all of core, the ONLY thing that seems to rely on dynamic linking of stubs is bin_prot.
<octachron> ollehar, as far as I remember, this created some problems for ppx_deriving during the transition from 4.02.2 to 4.02.3
<ollehar> octachron: good to know.
djellemah_ has quit [Ping timeout: 260 seconds]
<Algebr> /#join iphonedev
<Algebr> bah
Haudegen has joined #ocaml
<Algebr> /#join iphonedev
<ollehar> octachron: same problem on 4.02.1...
<Algebr> !!
<ollehar> strange
<octachron> ollehar, and with 4.02.3 ?
<ollehar> will try
<avsej> okay, I managed to build it on solaris, I will make a pull request
<malc_> Algebr: wow
* malc_ higher forces tell you to comment the thing out, think about it
<Algebr> ha
Maelan has joined #ocaml
<ollehar> octachron: same error! :(
<edwin> avsej: someone told me once to use this on OmniOS, don't know if it helps: ./configure -cc "gcc -m64" -as "gas --64" -aspp "gcc -m64 -c" -partialld "ld -r -64"
<avsej> at the moment, I'm building 32bit version
<edwin> with the 32-bit version I think I had some more troubles
<avsej> you mean the runtime or build troubles?
<ollehar> posted an issue about it to whitequark: https://github.com/whitequark/ppx_deriving/issues/90
<octachron> ollehar, sorry wrong hint.
<ollehar> ?
Maelan_ has joined #ocaml
<avsej> edwin, ocaml CLA in .doc format? :(
<edwin> avsej: I don't remember what specific trouble I had with ocaml on 32-bit solaris, but with another application I hit the 256 file descriptor limit: http://www.oracle.com/technetwork/server-storage/solaris/stdio-256-136698.html
<avsej> oh, i suppose build fix does not require it
<edwin> so on the rare ocasion that someone asked me about solaris builds, I always did 64-bit builds since
<edwin> sorry, I'm probably the wrong person to ask about the ocaml CLA, I haven't signed it ...
seangrove has joined #ocaml
<avsej> I'm not sure if it is applicable to illumos at the moment (the file has different comment and renamed field: https://github.com/illumos/illumos-gate/blob/master/usr/src/head/stdio_impl.h#L61), but thanks I will check that
<avsej> this is what I've got for 32bit on OpenIndiana https://github.com/ocaml/ocaml/pull/525
<edwin> looks like the non-i386 solarises already have the right flags
<edwin> don't know about _XOPEN_SOURCE, is the solution to not define, or should it be defined with a higher number instead?
<edwin> that macro has the tendency to work on on some OS and completely break on another
slash^ has quit [Read error: Connection reset by peer]
<edwin> you might try if _XOPEN_SOURCE 600 works, that supposed to work nicely with C99
<avsej> okay. let me try
<avsej> yes, that works too
<avsej> edwin, I've updated PR, but now lets wait for travis-ci, I don't have system to try other unixes
orbifx has joined #ocaml
orbifx2 has quit [Ping timeout: 244 seconds]
<edwin> if something breaks you can ifdef and use the higher number just on solaris
ygrek has quit [Ping timeout: 276 seconds]
<avsej> sure. so far so good with builders
ggole_ has quit []
jgjl has joined #ocaml
jgjl has quit [Client Quit]
<jyc> after updating I'm running into this error when trying to build a project using ctypes: http://pastebin.com/raw/eRipfTSN
<jyc> has anyone seen anything similar?
<jyc> I tried cleaning & re-installing all the dependencies but it doesn't seem to have helped
<Algebr> don't you need to also link ctypes.foreign?
<Algebr> i don't see it there on -package ctypes.foreign just a guess
<jyc> Algebr: just tried adding that, but it doesn't seem to have an effect
<companion_cube> oh no, I've started to use exception patterns, now I'm not going to be able to live without them :)
<jyc> I'm guessing it's pullled in by the dependency that uses ctypes
<jyc> maybe my system packages are out of date... I'll keep trying to update/replace stuff
<jyc> ok... I found this: https://github.com/ocaml/opam-repository/issues/398 and tried switching the build order around randomly
<jyc> and now it works, but I'm very confused as to why
<Algebr> probably because link order matters
<jyc> well it is causing the error, but why does linking some package before another package interfere with the stubs?
<jyc> it looks like lwt.unix is causing the problem: if I put it before lwt.unix, I get the error, if I link it after, it's fine
<Algebr> maybe name collision
<jyc> I see, thanks for the help. will have too look into this more
djellemah has quit [Read error: Connection reset by peer]
iorivur has quit [Remote host closed the connection]
darkf has joined #ocaml
teknozulu has joined #ocaml
BitPuffin has quit [Remote host closed the connection]
<avsej> edwin, so it is green in the end. thanks for guidance
lokien_ has quit [Quit: Connection closed for inactivity]
ygrek has joined #ocaml
psnively has quit [Quit: psnively]
octachron has quit [Quit: Leaving]
schive has quit [Quit: Leaving]
malc_ has quit [Quit: ERC (IRC client for Emacs 25.0.50.2)]
malina has joined #ocaml
leyyin has quit [Quit: So Long, and Thanks for All the Fish]
<orbitz> Is the use of GADTs a performance hack? If so, how?
<fds> Is there any way to say that a file needs e.g. str.cmxa or unix.cmxa from within the file? Rather than passing it as an option to the compiler or using a _tags file?
<mrvn> orbitz: a GADT is just a constructor like any variant type. Except the type system behaves differently.
<Drup> fds: Why don't you want to use the _tags file ?
<mrvn> orbitz: type t = Foo of int | Bar of float is the same speed as type _ t = Foo : int -> int t | Bar : float -> float t
<mrvn> fds: say to whom?
<mrvn> I'm using oasis and ./configure says: "Turn ocaml debug flag on: ............................ true". How to I check that flag in C stubs?
<fds> Drup: Because I'm submitting the solution to a silly programming problem to a website which compiles my solution automatically.
<fds> mrvn: ^
<Drup> No way, then no
<mrvn> fds: just add str.cmxa to the compile argument
<fds> mrvn: I don't have control over the command they run to compile.
<fds> I suppose I should submit a bug report to the site or something.
<mrvn> fds: cut&paste the source for str.ml into your code?
<Drup> :cringe:
<mrvn> what do you need str for?
<smondet> orbitz: (not sure but) I think the performance hack is to make all the cases nullary variants (unboxing + special pattern-match) and passing the Span.t separately while staying well-typed
<fds> I'm actually just using it to split a string. But it's the principle!
<mrvn> smondet: that would be an optimization. ocamlopt doesn't even do that
<Drup> fds: don't use Str to split string, but I agree with you!
<fds> In fact, why is it that only some of the modules require you to pass the cm(x)a to the compiler?
<fds> Drup: What should I use?
<Drup> virtually anything else
<Maelan> fds, maybe a shebang-related hack, or a polyglotte source file?
<mrvn> fds: they all do, except the stdlib cmxa is there implicitly
<mrvn> fds: is it bytecode or native? Do they have findlib?
<Maelan> this is what i do for ocaml scripts that need e·g· unix.cma
<mrvn> #require "package";; to load a package
<Maelan> that would be a serious security hole though
<mrvn> fds: why not convert string to char list and pattern match the list to split?
<orbitz> mrvn: I'm afraid i still don't understand what the optimization is that the comment refers to
<mrvn> Maelan: depends on what modules are available. But if they have unix then *BOOM*
<mrvn> orbitz: Say you have a function buzz that accepts type t = Foo | Bar. Then you can compile a optimized version buzz_Foo that only accept Foo and buzz_Bar that only acepts Bar. Then you don't have to pass the box as argument anymore.
<fds> mrvn: I suppose my question is ``Why doesn't stdlib.cmxa contain all the modules listed in the manual?'' then.
<mrvn> orbitz: in places the compiler knows wether you have a Foo or a Bar as argument it can call the optimized version.
<orbitz> mrvn: ahh ok
<orbitz> thank you
<fds> Maelan: Have you got an example of such a shebang-related hack?
<mrvn> fds: because ocaml for the longest time couldn't link in only the needed parts and all your binaries would become huge.
<fds> mrvn: Ah, I see.
<orbitz> mrvn: is that an implementation detail of how gadts are done in ocaml or something more general?
<mrvn> orbitz: but as said ocaml doesn't even do that so far. I'm not sure if that new flambda thing mentioned on the ml does it.
<orbitz> ah ok
<fds> For now I'll probably just implement the split myself.
<mrvn> orbitz: that is a really general optimization. gcc does it for everything. Certainly not limited to GADT, that's just a special typesystem thing that boils down to simple variant types internally.
<mrvn> orbitz: in gcc if you call foo(1, ...) it will optimize the code for foo for the case that the first argument is 1 (if it cosniders it worth it).
<orbitz> right, I just wasn't curious if this was actually the case in ocaml. The comment is quite unclear :)
<mrvn> orbitz: check out flambda.
<Maelan> fds, after thinking about it for some seconds, i realized that for this to work the submission server must accept and run sh code, and i doubt it is the case
axiles has quit [Quit: Quitte]
<mrvn> Is there something better than using this in _oasis? CCOpt: `pkg-config --cflags Qt5Widgets` -x c++ -std=gnu++11 -Wno-pmf-conversions -O2 -W -Wall -fno-inline `if $debug; then printf -- "-DDEBUG=DEBUG"; fi`
<fds> Maelan: Ah, no problem.
demonimin has joined #ocaml
<Maelan> (the shebang itself would not be useful in this case anyway, only the polyglot aspect, but the same effect (i·e· executing ocaml code) could certainly be achieved by other (less funny) means
<Maelan> )
djellemah has joined #ocaml
<mrvn> I wonder how much software parses ocaml versions as octal and what will break for 4.08
<mrvn> (spit at ., convert each part to int, *BOOM*)
Haudegen has quit [Ping timeout: 264 seconds]
<companion_cube> in OCaml, octal is 0o13, not 013
MercurialAlchemi has quit [Ping timeout: 244 seconds]
<mrvn> companion_cube: didn't say the software doing the scanning needs to be ocaml
<companion_cube> oh :D
butts_butts has joined #ocaml
Haudegen has joined #ocaml
butts_butts has quit [Ping timeout: 252 seconds]
ollehar has quit [Quit: ollehar]
hxegon has joined #ocaml
yegods has joined #ocaml
tane has quit [Quit: Verlassend]
demonimin has quit [Ping timeout: 250 seconds]
pierpa has quit [Ping timeout: 260 seconds]
nicholasf has joined #ocaml