gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
sepp2k has quit [Remote host closed the connection]
<_habnabit> so why is there BatList.{sum,fsum}, but only BatEnum.sum
<thelema> _habnabit: someone created two for list and one for enum
<_habnabit> so, it was just arbitrary?
<thelema> yes.
<_habnabit> okay
<thelema> If you really want Enum.fsum, I guess we can have it, but I'm not convinced we shouldn't just remove the lot and make people .reduce (+)
<_habnabit> well, fsum is more useful than sum, if it's actually properly calculating float error when doing sums
<_habnabit> (I never checked, but I hoped it was.)
<thelema> I doubt it - it's probably just .reduce (+.)
<thelema> If you want to implement a version that's more correct, that'd be a reason to keep it.
<_habnabit> okay.
dnolen has joined #ocaml
<thelema> _habnabit: this algorithm is what you were thinking: http://en.wikipedia.org/wiki/Kahan_summation_algorithm
<_habnabit> yes.
<thelema> that doesn't look too difficult to implement
<thelema> hmm, apparently divide-and-conquer summation gives O(log n) error vs. O(n) error for incremental summation
<thelema> except that'd be hard to implement for a stream.
<thelema> first priority is to fix odb.
<thelema> yay, easy fix
<thelema> ok, now for float adding
<thelema> _habnabit: should the error be returned as well?
<_habnabit> IIRC you just add the error back in at the end.
<thelema> no, it looks like it gets added back in at each step
<_habnabit> er, maybe I'm thinking of another algorithm after all
<_habnabit> I'm kinda distracted right now
<thelema> no problem
ikaros has quit [Quit: Ex-Chat]
destrius has quit [Ping timeout: 240 seconds]
destrius has joined #ocaml
destrius has quit [Ping timeout: 240 seconds]
EmmanuelOga has joined #ocaml
everyonemines has joined #ocaml
oriba has quit [Quit: oriba]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
_habnabit has quit [Quit: ZNC - http://znc.sourceforge.net]
_habnabit has joined #ocaml
_habnabit has quit [Excess Flood]
_habnabit has joined #ocaml
_habnabit has quit [Client Quit]
_habnabit has joined #ocaml
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
dnolen has quit [Quit: dnolen]
dnolen has joined #ocaml
ulfdoz has joined #ocaml
dnolen has quit [Ping timeout: 248 seconds]
destrius has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
sebz has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
BiDOrD_ has quit [Ping timeout: 252 seconds]
BiDOrD has joined #ocaml
ulfdoz has quit [Ping timeout: 255 seconds]
<Drakken> Is there a core module for Batteries to replace Pervasives?
<_habnabit> BatPervasives ?
<Drakken> what is wrong with me
<Drakken> I must have seen BatPMap and assumed that would be after BatPe*, ignoring case/ascii ordering.
sebz has quit [Quit: Computer has gone to sleep.]
ftrvxmtrx has joined #ocaml
waern has quit [Ping timeout: 268 seconds]
yezariaely has joined #ocaml
thomasga has joined #ocaml
ocp has joined #ocaml
larhat has joined #ocaml
trhodes has joined #ocaml
milosn has quit [Ping timeout: 276 seconds]
edwin has joined #ocaml
avsm has joined #ocaml
musically_ut has quit [Read error: Operation timed out]
ikaros has joined #ocaml
destrius has quit [Quit: Leaving.]
eikke has quit [Ping timeout: 248 seconds]
sebz has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
fridim_ has joined #ocaml
everyonemines has quit [Quit: Leaving.]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
eikke has joined #ocaml
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
linshuai_irc has joined #ocaml
fridim_ has quit [Ping timeout: 268 seconds]
linshuai_irc has left #ocaml []
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
dobroerlanger has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
chambart has quit [Ping timeout: 252 seconds]
sebz has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Client Quit]
EmmanuelOga has joined #ocaml
<thelema> avsm: thanks for the bug report in odb - it was just recently broken (by me) and is now fixed re: dep handling
<adrien> has anyone been doing the following: instead of (`Add (e, pos, title)), use (`Add (`Element e, `Position pos, `Title title))
<thelema> adrien: use a record
<adrien> it's mostly so that it makes more sense when pattern-matching the values
<adrien> thelema: I want to avoid having to declare the types
<adrien> there are going to be quite a lot of them
<adrien> and they will be used only in two locations: sending and receiving
<thelema> There's a runtime cost for excess PVs
<thelema> but other than that, it seems like it'll work fairly
<thelema> the types will get ugly, as they always do with PVs
<adrien> ok, thanks
<adrien> I think I abuse PVs currently already
<adrien> but I'm not sure I can do much better: I use them to communicate between separate modules
<adrien> iirc, regular variants were quite heavy to work with already
<thelema> if there's a dependency between modules, express it properly, don't just induce it with PVs
<Drakken> would it be too much work to put the type(s) in a separate module?
<adrien> thelema: they were needed, at least at some point; the codebase_s_ are more mature now and will benefit from some proof-reading
<adrien> but it's not sure it's going to be handy to remove PVs
<adrien> ah, I remember
<adrien> I have two types and they share some fields
<Drakken> It's too bad record types aren't namespaces.
<adrien> meaning: type action_common = [ `A | `B ];; type action_functional = [ action_common | `FC ];; type action_ui = [ action_ui | `UD ];;
<avsm> thelema: thanks for fixing it! love odb so far
sebz has quit [Quit: Computer has gone to sleep.]
<thelema> avsm: glad it's helpful. It's set on --stable by default now, but there's more software/newer versions (not all working) in --testing and --unstable. the master list is here: http://oasis.ocamlcore.org/dev/odb/
emmanuelux has joined #ocaml
sebz has joined #ocaml
pilki has joined #ocaml
sebz has quit [Client Quit]
yezariaely has quit [Quit: Leaving.]
sebz has joined #ocaml
avsm has quit [Quit: Leaving.]
sebz has quit [Quit: Computer has gone to sleep.]
<hcarty> thelema: I have a "v1.0beta" version of a getting started guide for OCaml + findlib + odb + oasis, from source, on Linux.
<hcarty> thelema: I'll push it to my odb fork for now for you to take a look at
<hcarty> It can go wherever it will be most helpful after that
<hcarty> https://github.com/hcarty/odb/blob/master/getting-started.md -- If anyone wants to take a look. It is a (hopefully) simple/minimal outline of the steps required to build a usable OCaml toolchain from source.
<thelema> hcarty: looking now
<thelema> hcarty: maybe should use block code instead of lists of code
chambart has joined #ocaml
Boscop has joined #ocaml
<hcarty> thelema: I was debating the same thing while writing it. I left it in list form to make it easier to add comments, but # comments in block code should be fine
<hcarty> All of the steps were tested exactly as they are written on a 64bit Ubuntu 11.04 system. System-level dependencies for a few different distributions would be a nice thing to add eventually.
<thelema> hcarty: yes, deps would be a good idea, but I think it's pretty minimal - mainly a C compiler.
<thelema> I'm not so sure about the "setup the environment for odb" steps - I agree that a bashrc is useful for people wanting to do anything fancy with odb, but for this kind of guide, it seems unnecessary
<thelema> my intent for odb was "configuration free"
<hcarty> thelema: The odb configuration is primarily to get CAML_LD_LIBRARY_PATH and friends set
<thelema> I kind of like the configuration being just environment variables
<thelema> oh yeah, that part. Didn't you already set that in your "configure findlib" step?
<thelema> and the destdir isn't needed, as this is a local install.
<thelema> ODB needs to auto-detect permissions to the default destdir
<thelema> But first, better feedback with versions.
Boscop has left #ocaml []
<hcarty> I tried to leave it so that odb was installing to its default ~/.odb location
<thelema> it doesn't need any config for that.
<hcarty> That would allow re-use of the odb section and on for any OCaml installation, source, Debian, Fedora, etc.
<hcarty> It does for packages with C bindings
<thelema> ah, yes...
<thelema> because that's not taken care of in the findlib config...
<thelema> well, I'm not sure that ~/.odb is the right thing for a local install.
<thelema> rather, I suggest that it's not.
<thelema> and the install path shouldn't matter.
<hcarty> I'd like to split this up eventually
<hcarty> Think perlbrew vs cpanm
<hcarty> Or, perhaps, local::lib
* thelema doesn't know the difference
<hcarty> perlbrew - build any version of Perl from source
<thelema> ok. That's definitely not handled by odb
<hcarty> cpanm + local::lib - install CPAN modules to custom locations
<thelema> with an ocaml-brew, it'd be even more important to not install to ~/.odb
<hcarty> I'm not entirely convinced that local source-based OCaml installations should have odb packages installed under the install tree
<thelema> what else is the default findlib dir for?
<thelema> `ocaml -where`/site-libs
<thelema> *ocamlc
<hcarty> Out-of-tree package installs allow for options like local stable, testing, unstable sets of libraries
<thelema> hmm, that's an idea - install *all* packages from oasis-db at once.
<hcarty> With odb.ml + a few environment variable changes, one OCaml version could be used with several sets of libraries (ex. Batteries 1.x in stable, 2.x in testing)
<thelema> I was thinking about how to determine whether there was any problems in the testing set of packages before promoting to stable
<hcarty> thelema: "--install-everything" could be a nice testing tool
<thelema> since there's an apparent problem in testing for oasis
<hcarty> And useful for local or custom oasis-db repositories
<thelema> and I don't immediately see its cause
<thelema> --install-everything can't last, can it?
<hcarty> It's the type-conv version
<hcarty> There was something on one of the mailing lists about this, and I think that there is a patch somewhere to fix oasis building against the newer type-conv
<thelema> hcarty: ah, thanks.
<hcarty> IIRC a function was removed from the API
* thelema rolls the dice and promotes a new stable
<hcarty> thelema: There is a patch on the caml-list for odn from May 30
<hcarty> I have the message saved in my account. I'll see if I can find the original message in the archives.
<thelema> hcarty: I'll wait for a new release... hopefully not too long.
<thelema> There's already a bunch of -oasis* versions in oasis-db, I need to upstream the _oasis files
ftrvxmtrx has quit [Quit: Leaving]
<hcarty> thelema: https://sympa-roc.inria.fr/wws/arc/caml-list/2011-05/msg00180.html -- hopefully gildor will release a new version which works with the newer type-conv
<hcarty> thelema: re: --install-everything - I don't think this would be a commonly used option, primarily used for the purpose you mentioned
<hcarty> But if there is eventually a local version of oasis-db, having an --install-everything option could be handy when setting up a new system with local libraries.
<thelema> added comment on odn's oasis-db page with link to the patches
<thelema> I dunno if anyone cares about the comments on those pages, but it's sometimes a good place to put notes about package x not working under odb
<thelema> hcarty: true - with custom package trees, --install-everything would be useful
<hcarty> thelema: I'm off for a while. Email or leave comments here if you have anything further on the getting started summaryu
<thelema> what's the easiest way to get the output of a shell command into a string?
<hcarty> summary
<thelema> hcarty: thanks for your writeup
<hcarty> thelema: You're welcome, and thank you for the comments.
bipedman has joined #ocaml
avsm has joined #ocaml
<avsm> thelema: i've just been playing with Ruby Version Manager, and it's awesome. Adding support to odb to have multiple ocaml versions in the same style would solve every problem I've ever had with ocaml installations
<thelema> avsm: that's a different program, to install and manage multiple ocaml installations.
<avsm> thelema: i.e. just install a full ocaml+findlib into ~/.odb/<version>/ and 'odb —default 3.12.1' or 'odb —default head' to select the version via a symlink
<avsm> i've just been reading the (deliciously short) odb.ml, and it seems to be a good place to put the same functionality
<thelema> that part of the functionality, yes
<avsm> i wanted to try the new 'let.foo syntax' in ocaml-trunk, and doing an 'odb reinstall head' with a bunch of libraries would make it so much easier
<thelema> I have no problem with setting a build dir
<thelema> but reinstalling ocaml+findlib seems out of scope
<avsm> think so? it's just a ./configure && make
<avsm> with almost no dependencies
<avsm> yeah exactly. the thing that RVM does thats so good is just you up and running with everything in one go, via 'gemsets'
<avsm> i just want to try 'lwt with ocaml-trunk'
<avsm> those ocaml installation instructions are pretty much the same on every platform i work on (*BSD, Linux, MacOS X), so sticking them into odb (optionally) doesn't seem too out of scope
<avsm> especially as the system installation is just a symlink out of ~/.odb/system, or something similar
Drakken has left #ocaml []
<avsm> thing is; the need for a quick whole-world recompile of compiler+libraries is even more important with ocaml, due to the obvious recompilation issues
<thelema> avsm: Take as much code as you like out of odb, maybe it can even go into the same project as odb, but I don't think I want to put it into odb.ml itself.
<avsm> split up the file, and you lose much of the benefit i suspect
<avsm> anyway, i'll take a shot at it over the vacation
<thelema> agreed. And I have a bit more work on odb to make upgrades/world reinstallations...
<thelema> avsm: if you build something compelling, we can probably integrate it back into odb. I just imagine the biggest difficulty is managing the environment variables and findlib configurations for multiple ocaml installs
maufred has quit [Quit: leaving]
maufred has joined #ocaml
<avsm> avsm: yeah, i think all the variables already exist, so it shouldn't be too invasive
maufred has quit [Client Quit]
<thelema> wow, a ton of code is going into ocaml trunk in the last two days
maufred has joined #ocaml
avsm1 has joined #ocaml
avsm has quit [Ping timeout: 240 seconds]
<thelema> wow, dbm has been shed from ocaml trunk
ikaros has joined #ocaml
<thelema> and a bunch of obselete native-code generators (Alpha, HPPA, IA64, ...)
ocp has quit [Read error: Operation timed out]
<f[x]> thelema, funny that you ellipse'd the one codegen that would be missed :)
<f[x]> i.e. MIPS
<thelema> github ellipsed it first, but yes. I agree MIPS isn't dead.
<pilki> thelema : it's holydays :)
<thelema> pilki: yes, everyone is free to work on ocaml. good times.
<pilki> is your "ocaml-community" just a copy of the svn repo, or something else too ?
<pilki> thelema : and how often do you update it ?
<avsm1> who owns github.com/ocaml?
<thelema> pilki: it's got some old patches, but not updated at all. There's a cron job that pulls from svn every 5 minutes or so.
eikke has quit [Ping timeout: 240 seconds]
<thelema> avsm1: a good question
<pilki> no idea
bipedman has quit []
sebz has joined #ocaml
avsm1 has quit [Quit: Leaving.]
ulfdoz has joined #ocaml
maufred_ has joined #ocaml
Anarchos has joined #ocaml
maufred_ has quit [Quit: leaving]
larhat has quit [Quit: Leaving.]
eikke has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
<hcarty> thelema: The last time I checked OCaml's trunk was just after the toplevel additions. This new flood of activity and features is impressive.
<hcarty> What is the goal of the let.foo syntax?
<thelema> hcarty: I guess to accomodate lwt
<thelema> I'm not really sure how I'd use it.
<pilki> hcarty : it is an equivalent for the do notation of haskell
<pilki> and not only for lwt
<pilki> for any monadic stuff
<thelema> I guess that's just the haskell people being off the deep end of purity?
<hcarty> I lookf forward to mind-bendingly useful examples of let.foo and GADTs in OCaml :-)
<hcarty> s/lookf/look/
<thelema> I just look forward to polymorphic printing and comparison
<thelema> if someone can do that in ocaml, that's worth it to me.
<thelema> (and don't mention dump)
<pilki> thelema : have you seen the proposal of alain Frisch ?
<pilki> with dynamic types ?
<thelema> pilki: runtime types, you mean?
<pilki> yes
<pilki> this allows printing and comparison
<thelema> yes, that's an 80% solution I can understand and get behind (especially if the dispatch can be done at compiletime)
<hcarty> thelema: avsm's comments are part of why I wrote getting-started.md the way I did. But it may be useful to have a purely vanilla version (no extraneous configuration) and a custom version (easy support for multiple OCamls and multiple library trees)
<thelema> hcarty: yes, I was expecting something targeting a total beginner, with minimal complexity.
<hcarty> thelema: The Ruby tool avsm mentioned sounds a lot like perlbrew
<hcarty> thelema: That's what I was shooting for, with the hope that the result would be flexible enough to grow from.
<thelema> hcarty: I now see the usefulness of perlbrew, and will work to make odb friendly with this. odb already auto-detects GODI and configures for its install dir
<hcarty> thelema: And that ~/.odb could be blown away, leaving OCaml itself intact.
<thelema> I blow away ~/.odb all the time.
<thelema> I have yet to be convinced that perlbrew belongs in odb.ml
<bitbckt> perlbrew is the perl equiv. of rvm?
<hcarty> bitbckt: Or the other way around - I don't know which came first
<hcarty> thelema: I agree. I think 'ocamlbrew' and odb.ml should be separate tools
<hcarty> They could merge eventually if it seems logical, but initial work should probably be separate
<bitbckt> thelema: the reason I commented on the odb issue related to this was merely because conversation _happens_ around odb.
<bitbckt> not that odb needs to have this feature.
<hcarty> bitbckt: A tool complimentary to odb is definitely a good idea
<hcarty> I want to make a .sh equivalent to that getting-started document. That could be a v0 ocamlbrew.
<bitbckt> rvm used to be (maybe still is) a 3k+ line bash script... I'd prefer not to have another of those hanging about.
<thelema> hcarty: while proofreading, I was thinking about whether the document shouldn't just be a documented .sh file
<bitbckt> but it makes a good proof-of-concept.
<hcarty> thelema: I wanted to get it out in prose first, but a .sh is my goal
sepp2k has joined #ocaml
waern has joined #ocaml
<bitbckt> I'd still like to see findlib support multiple installed versions of a library, selectable at compile time.
<thelema> bitbckt: findlib supports multiple ocaml installations surprisingly well, but you're right, it doesn't handle multiple versions of the same library
<bitbckt> thelema: yes, it does. I'd have no hair if it didn't have the support it currently has.
<thelema> bitbckt: there's definitely room for findlib to be ... replaced, if you're looking for a project
<bitbckt> hehe
<bitbckt> I may have some time in the near future.
<hcarty> Are there other findlib-like systems which support multiple versions of the same library installed side by side?
<bitbckt> pkg-config
<bitbckt> also, I suppose, rubygems and pip.
<bitbckt> but non-compiled languages have slightly different needs.
<_habnabit> no, there's no support for it in python really
<bitbckt> virtualenvs + pip packages don't get you there?
<_habnabit> well, yes, I was about to say virtualenv
<_habnabit> but that's not 'side by side'
<bitbckt> that's more like rvm, I guess...
<_habnabit> they're all isolated
<bitbckt> ivy is the Java equivilant
<bitbckt> jeebus...equivalent.
<bitbckt> English is hard.
pango__ has quit [Ping timeout: 240 seconds]
pango has joined #ocaml
edwin has quit [Ping timeout: 252 seconds]
fridim_ has joined #ocaml
<_habnabit> any reason there's BatList.{find,find_map} but only BatEnum.find ?
<thelema> _habnabit: probably no good reason - want to spend a minute contributing Enum.find_map?
<_habnabit> sure.
<_habnabit> how do you run the qtests?
<thelema> make qtest-native
<_habnabit> ah, thanks
<thelema> if you want to run just one file: TESTABLE=src/batFoo.ml make qtest-native
<_habnabit> hmm, I don't see any such target. this is on the v2 branch.
<thelema> _habnabit: update to master - v2 is merged in and development continues there
<_habnabit> ah okay.
<gildor> hcarty: I think the latest version of odn is type-conv compatible
<thelema> gildor: 0.0.6?
<hcarty> gildor: With 3.0.3?
<hcarty> gildor: With type-conv 3.0.3 that is?
<gildor> let me check
<gildor> odn 0.0.6 with type-conv 3.0.4 (as found on debian)
<_habnabit> hmm, is there documentation on quickcheck for ocaml anywhere?
<_habnabit> wondering if there's an easier way to see if something raises an exception than an inline try-with
<_habnabit> ah
<adrien> I've seen that in the recent changes:
<adrien> +- New syntax "let.e0 p = e1 in e2" where e0 is a simple expression,
<adrien> + expanded to "e0 e1 (fun p -> e2).
<thelema> _habnabit: not complete docs, just quick ones I wrote up...
<adrien> is it only because I'm not used to it (yet) or is it actually hard to read?
<thelema> _habnabit: you may have to use the source for details
<hcarty> adrien: It looks hard to read to me, but without concrete examples it's kind of hard to tell.
<adrien> hcarty: agreed
<_habnabit> yeah, that seems pretty useless to me
<adrien> I wonder if it could be used instead of pa_lwt
<thelema> _habnabit: qtest/quickcheck.ml
<_habnabit> thelema, thanks.
<hcarty> adrien: Noise about IRC seems to indicate that is (part of?) its purpose
<thelema> _habnabit: it doesn't look like there's an easier way in this quickcheck, but it's certainly fixable.
<thelema> hcarty: that's just my best guess for its purpose.
<hcarty> gildor: "Error: Unbound value Gen.idp" using odn 0.0.6 and type-conv 3.0.3. We'll have to put 3.0.4 in odb.
<adrien> hcarty: "Noise about IRC"? what do you mean?
<thelema> adrien: I think he means my speculation.
<hcarty> thelema, adrien: Yes, and I think someone else mentioned it earlier too...
<adrien> ah, ok; I also think someone did but on the ML iirc
<hcarty> thelema: Yes, you and pilki were talking about it earlier
<hcarty> thelema: Sorry, I didn't remember who had initiated that topic.
<thelema> hcarty: no worries.
<hcarty> gildor: Where is type-conv 3.0.4 available?
<thelema> adrien: ML? It was committed 11 hours ago
<gildor> hcarty: wait a second
<hcarty> gildor: I'd like to upload it on oasis-db so that oasis is buildable across stable/testing/unstable
<hcarty> thelema: Cool, thanks
<hcarty> gildor: Thank you as well :-)
<thelema> gildor: I bet there's a patch involved in the debian packages
<thelema> 3.0.4's changelog only says "Improved package dependency resolution
<adrien> thelema: I can't remember well and gmail's webmail search is pure crap
<gildor> thelema: I am checking that, no patches on odn
<adrien> (I want regexp search! or at least search with a max distance of *1* !)
<pilki> mmh, hl?
<gildor> no patch on type-conv and odn in debian
<hcarty> gildor: I get that error from using OCaml 3.12.1 with type-conv 3.0.4 and odn 0.0.6 from oasis-db's unstable packages
<_habnabit> thelema, pull request submitted
<thelema> _habnabit: tests!
<thelema> _habnabit: merged, thanks.
<_habnabit> no problem.
<_habnabit> oh, haha, looks like I cleaned off a bunch of trailing whitespace too
<thelema> For summing an array of 10K floats,
<thelema> for loop (87.10 us) is 63.3% faster than
<thelema> Array.fold (237.07 us) which is 56.0% faster than
<thelema> Enum.reduce (539.23 us) which is 19.9% faster than
<thelema> Enum.fsum (Kahan) (673.39 us)
<_habnabit> hah
<thelema> _habnabit: no worries - my next commit would have cleaned the whitespace anyway. I finally got around to adding that option in my emacs save hook
<_habnabit> yes, it's my favorite hook
<thelema> _habnabit: is there a tab-fixer to put in there?
<_habnabit> you mean, like untabify?
<thelema> well, I'd like to make sure there's no spaces before tabs
<_habnabit> ahh
<_habnabit> yeah, I just untabify everything
<thelema> but untabify might suffice.
<thelema> _habnabit: oops, one thing forgotten - the @since 2.0 in the docs.
<_habnabit> oh, I see
* Anarchos discovered Funnelweb and thinks of most use with ocaml
fridim_ has quit [Ping timeout: 268 seconds]
<thelema> Anarchos: "Using FunnelWeb, it is quite possible to write programs like novels --- to be read from cover to cover. Sometimes the story is very exciting, with data structures making dashing triumphs and optimized code bringing the story to a satisfying conclusion. " lol
ocp has joined #ocaml
<adrien> is Array.get impacted by -unsafe or not?
<thelema> adrien: yes
spearalot has joined #ocaml
<adrien> ok, I'll simply shout on anyone using -unsafe and asking for "safety" :p
<hcarty> adrien: What brings that up? :-)
<thelema> a.(x) is just syntax sugar for Array.get a x
<Anarchos> thelema it is just a literate programming tool :)
<thelema> if you redefine Array.get, a.(x) will use the different get
<adrien> hcarty: I got a bit lazy while coding in the train and used the out-of-bound exception instead of checking that the array index was in-bounds
<thelema> adrien: my recommendation is that -unsafe is the wrong way to go and one should replace .get with .unsafe_get in the few hotspots that need it.
<adrien> thelema: that's not the goal: the code relies on not-unsafe
<adrien> but I'll change that
<hcarty> With 3.12.x, Unsafe.(...) would be nice for localizing unsafe accesses
<thelema> adrien: I'd leave it as is - if someone is foolish enough to use -unsafe, they get what they deserve
<hcarty> Locally make Array, String and Bigarray accesses use the *.unsafe_* functions
<thelema> hmm... odd...
<thelema> For summing an array of 10K floats,
<thelema> unsafe for loop (86.15 us) is probably (alpha=9.52%) same speed as
<thelema> for loop (87.12 us) which is 62.1% faster than
<hcarty> thelema: xleroy commented on that on the list a while ago...
<hcarty> thelema: Along the lines of modern processors are smart enough to negate the benefits of "-unsafe" in many cases
<hcarty> gildor++
<hcarty> gildor: Woo-hoo! :-) It works
<hcarty> gildor: Thank you for pushing out the update
<thelema> hcarty: yes, modern processors have gotten *damn* good at array bounds checks
<hcarty> It looks like "./odb.ml --unstable oasis" works now
<adrien> is there a way to see the changelog of odn from that page,
<hcarty> thelema: That's good. I like having the comfort of bounds checking and performance.
<hcarty> thelema: That's quite a varied set of quotes.
<adrien> woah, these quotes badly need context
<adrien> plus the quotation page is baaad
<adrien> s/page/title/
edwin has joined #ocaml
* Anarchos dreams to see the concurrent GC of Damien Doligez coming back into scene
<adrien> I think he doesn't exactly have "happy" dreams about it however
<thelema> Anarchos: it was dropped because it was just too complex to maintain.
<Anarchos> thelema but i read it was formally proved in TLA+ formalism in his thesis :)
spearalot has quit [Quit: Computer has gone to sleep]
<adrien> not sure who said he had proven his program correct but not working
<adrien> Dij
<adrien> bah
<adrien> Dijkstra or Knut; maybe Knut
<adrien> h
<thelema> Knuth, iirc
<adrien> "Beware of bugs in the above code; I have only proved it correct, not tried it."
<adrien> and Knuth
<Anarchos> adrien Knuth
<thelema> "Walking on water and developing software from a specification are easy if both are frozen." - Edward V Berard
<adrien> "Adrien Knuth"? nah, "Knuth" is not my last name ;-)
<adrien> thelema: I think that's one of my favourite quotes
<pilki> I'm playing with the GADTs
<pilki> wow my friends, the error messages are a mess :)
<thelema> pilki: I can believe that.
<adrien> pilki: if you have experiences to share later on... =)
thomasga has quit [Quit: Leaving.]
<pilki> adrien ?
<adrien> pilki: I'll be happy to hear from you about GADTs
<Anarchos> adrien but in the reign of multicore, the concurrent GC can be really interesting !
EmmanuelOga has quit [Ping timeout: 244 seconds]
<adrien> unless you can partition your tasks
<adrien> have you seen the recent stuff in ocamlnet?
<adrien> it creates several ocaml runtimes in the same process so you can run several of them at once and have shared memory
<hcarty> adrien: What part of ocamlnet is that?
<bitbckt> netmulticore?
<adrien> probably netmulticore, yes
<Anarchos> adrien no i was not aware
<Anarchos> adrien in fact, when you interface ocaml with a C multithreaded api, and you want your C threads being able to call back ocaml, you are not free to partition your tasks or whatsoever
<hcarty> adrien: That's pretty cool. I didn't know that was how it works.
<hcarty> Anarchos: Unless you use multiple processes, one partition per process
<adrien> hcarty: that's iirc, there are the details in one article on the website
<adrien> Anarchos: why not?
<Anarchos> hcarty not sure what you say, but the lib uses multiple processes
Xizor has joined #ocaml
<pilki> adrien : right now, my main goal is to break the typechecker :)
<pilki> which I did a couple of times, but Jacques fixed everything
<pilki> (except the error messages)
<adrien> ah, ok, I thought you were beginning with GADTs
<pilki> oh, I am :)
<hcarty> Anarchos: If you use multiple processes, each process can independently call to/from C. It doesn't help with multiple C threads calling back into a single process though.
<Anarchos> hcarty i have lightweight processes having shared memory
<Anarchos> hcarty so each callback can triggers the gc on the same ocaml heap...
thomasga has joined #ocaml
thomasga has quit [Client Quit]
<adrien> bah, uncaught exception and even with backtraces I don't understand where it's from
<thelema> backtraces are too often wrong in native code - can you reproduce in bytecode?
<adrien> they have been working well for me most of the time
<adrien> and I need to fix cowboy/glib and therefore lablwebkit before I can use bytecode there
<adrien> or at least, I need to fix the package
<adrien> and I'm using Obj in this code so I can only blame myself
<adrien> ah, I hadn't seen a .(i) in the line
<adrien> was inside a "for i = 0 to len (* not -1 *) do"
fridim_ has joined #ocaml
<Anarchos> adrien lol
fridim_ has quit [Ping timeout: 268 seconds]
<adrien> ah crap; trying to compare an variant to its "name" (from the type declaration); not going to work easily =/
ulfdoz has quit [Ping timeout: 252 seconds]
fridim_ has joined #ocaml
Xizor has quit []
ocp has quit [Ping timeout: 244 seconds]
edwin has quit [Remote host closed the connection]
struktured has quit [Ping timeout: 240 seconds]
<thelema> wtf: Sys_error "Bad file descriptor" raised at pervasives.ml:22 `let failwith s = raise(Failure s)`
<adrien> closed stdout?
<adrien> and strace could help here
<thelema> ah, bad backtrace because of re-raise
<thelema> really raised at ... Pervasives.input_scan_line
<_habnabit> whoops I hung tuareg-mode by hitting M-q when I had a comment open with no close
<_habnabit> now emacs is pegging a core
<bitbckt> think of it as hugging a core.
<bitbckt> emacs is friendly that way.
Morphous_ has quit [Ping timeout: 240 seconds]
<thelema> ctrl-g
<_habnabit> yeah, I already spammed C-g
<_habnabit> no effect
<_habnabit> tried sending it SIGHUP and emacs cored, hahah
<thelema> wow.
<bitbckt> :)
raichoo has joined #ocaml
Morphous_ has joined #ocaml
milosn has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
pilki has quit [Quit: This computer has gone to sleep]
ikaros has quit [Quit: Ex-Chat]
fridim_ has quit [Ping timeout: 268 seconds]
<_habnabit> there's Unix.error_message, but is there a way of going from a Unix.error to a string with the error name? i.e. EPERM
<thelema> TODO add batUnix.error_to_string
<_habnabit> heh
<thelema> short version, no. We'd have to write a function to do the conversion.
<_habnabit> dang.
<thelema> Code generation is often useful for this (pa_do, etc)
<thelema> but afaik, hasn't been done.
<_habnabit> it's just irritating when someone sends me an error report with `Unix.Unix_error(23, ...)` and I have to walk them through the steps of figuring out what that is on their OS
<thelema> ocaml/otherlibs/unix/unixsupport.c has error_table[] with an ordered list of the error ids
<thelema> but it's just their int values
sebz has joined #ocaml
destrius has joined #ocaml
<thelema> are you sure that Unix_error(23,...) doesn't always refer to the 24th entry in the Unix.error variant?
<_habnabit> oh, hmm.
<_habnabit> maybe it does
<_habnabit> is that what the ordinal value of a variant type normally is?
<_habnabit> i.e. via Obj.magic or whatever
<thelema> yes
<thelema> variants are represented as a tag plus a tuple - all variants without arguments get tags 0--n, and variants with arguments get tags 0--n again (but are distinguishable because of their length)
<_habnabit> ah
raichoo has quit [Quit: leaving]
sebz has quit [Quit: Computer has gone to sleep.]
sebz has joined #ocaml
struktured has joined #ocaml
<smango> I'm trying to compile an ocaml program so I can run it on a machine that doesn't have ocaml installed. I've done it before but I can't remember how
<_habnabit> ocamlbuild x.native
<_habnabit> done
<smango> ah, ocamlbuild, thanks
<_habnabit> well, you don't need ocamlbuild
<_habnabit> but it's an easy way to accomplish that