flux changed the topic of #ocaml to: Yes, inria.fr is back up! | Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0beta1 available from http://caml.inria.fr/pub/distrib/ocaml-3.11/ | Or grab OCaml 3.10.2 from http://caml.inria.fr/ocaml/release.html
ulfdoz has quit ["deprecated"]
vixey has quit [Network is unreachable]
struktured_ has joined #ocaml
alexyk_ has joined #ocaml
alexyk has quit [Read error: 104 (Connection reset by peer)]
alexyk_ has quit [Read error: 104 (Connection reset by peer)]
alexyk has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
mishok13 has joined #ocaml
velco has quit ["Ex-Chat"]
ofaurax has quit ["Leaving"]
Kerris0 has quit ["Leaving."]
alexyk has quit []
alexyk has joined #ocaml
tomh has quit ["http://www.mibbit.com ajax IRC Client"]
alexyk has quit [Read error: 110 (Connection timed out)]
struktured_ is now known as struktured
Axle has joined #ocaml
threeve has quit []
seafood has quit []
kig has left #ocaml []
threeve has joined #ocaml
threeve has quit []
seafood has joined #ocaml
sporkmonger has quit []
seafood has quit []
seafood has joined #ocaml
jeddhaberstro has quit []
seafood has quit []
Mr_Awesome has joined #ocaml
seafood has joined #ocaml
apples` has quit ["Leaving"]
ygrek has joined #ocaml
johnnowak has joined #ocaml
Camarade_Tux has joined #ocaml
filp has joined #ocaml
Snark has joined #ocaml
johnnowak has quit []
snhmib has quit ["Good riddance!"]
johnnowak has joined #ocaml
love-pingoo has joined #ocaml
Gionne has joined #ocaml
ulfdoz has joined #ocaml
<Gionne> hello
pierre_m has joined #ocaml
_zack has joined #ocaml
<Gionne> what's wrong? http://pastebin.ca/1248659
<pierre_m> nothing :p, the toplevel is right
<gildor> Gionne: you are missing every variant
<pierre_m> try let pr1 = Prodset([....])
<gildor> Prod (Term "A", ([Term "Bcd"; Term "d"])///
<gildor> ...
<tsuyoshi> mfp: "A taste of OCaml Batteries Included" is on the first page of reddit for me
<Gionne> mmm
<Gionne> son i cannot use a "general" type prodset?
<gildor> Gionne: don't see what you mean, this is already a general type prodset
<gildor> you just write it this way
<Gionne> i even don't know what i mean ;D
<Gionne> thanks for now
<gildor> how do you want the compiler make the difference between Term and NTerm ?
<Gionne> with the lexer
<Gionne> uhm
<gildor> but you don't give the least information about it
<gildor> NTerm of string | Term of string
<Gionne> i am a bit confused
<gildor> both are string...
<gildor> I really don't see how the lexer can make any difference
<gildor> (BTW, i think you are talkin about the parser which is a better place to make this kind of difference)
<Gionne> the term should be a lowercase, nterm a uppercase
<Gionne> how would you do that?
<Gionne> i am really new to ocaml
<gildor> you cannot explain this to "native" caml
<Gionne> uh
<gildor> (there is way to do this, but this is not good way for OCaml introduction)
code17 has joined #ocaml
<gildor> i think it is closer to what you are expecting
<Gionne> yes it is
<Gionne> now i have some doubt about what is a nterm and what is a term
<gildor> can't help
<Gionne> you have been already helpful
<Gionne> thank you
<Gionne> i'll ask later if i have other questions.
|Jedai| has joined #ocaml
mishok13 has quit [Read error: 110 (Connection timed out)]
marmotine has joined #ocaml
pierre_m has left #ocaml []
Jedai has quit [Read error: 110 (Connection timed out)]
filp has quit ["Bye"]
jlouis has joined #ocaml
velco has joined #ocaml
johnnowak has left #ocaml []
_JusSx_ has joined #ocaml
vixey has joined #ocaml
<mfp> tsuyoshi: yeah, lots of upvotes overnight, unexpectedly, but it was 10-10 yesterday
<tsuyoshi> is there a debian package for batteries?
struktured has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux> is there no foss tool that can scan a windows computer and find which (security) updates it would need ?
<Camarade_Tux> (much like windows update)
<Kerris4> Camarade_Tux: I have no idea if it is open source, but I've used http://www.autopatcher.com/ several times
Yoric[DT] has joined #ocaml
<Yoric[DT]> hi
<Kerris4> hello Yoric :)
<Camarade_Tux> Kerris4, autopatcher is not what I'm looking for
<Camarade_Tux> hi Yoric[DT]
<vixey> hello
<Yoric[DT]> A new version of the package should be available soon.
<Yoric[DT]> As in "probably next week".
<flux> yoric[dt], how recent is the package in godi?
<Yoric[DT]> That's Alpha 1.
<Yoric[DT]> Alpha 2 will come out in a few days.
<Yoric[DT]> There will be an updated godi package.
<flux> great
<mfp> Yoric[DT]: about to finish installing GODI + OCaml 3.11 + batteries. As expected, doesn't work out of the box: issues with 3.11.0+beta2-dev2 and type-conv, patched & solved.
<Yoric[DT]> What kind of issues?
<mfp> I'm writing down the procedure
<mfp> 3.11: wrong permissions in a build script
<mfp> type-conv: camlp4 change
<mfp> type-conv, sexplib & camomile built correctly, /me crosses fingers
<mfp> uh
vixey has quit [Remote closed the connection]
<mfp> Error: The implementation src/core/baselib/batlib_Baselib_Unix.ml does not match the interface src/core/baselib/batlib_Baselib_Unix.cmi
<mfp> val getsockopt_int : file_descr -> socket_int_option -> int is not included in external getsockopt_int : file_descr -> socket_int_option -> int = "unix_getsockopt_int"
<mfp> let's see...
<mfp> looks like Unix has changed in 3.11, and doesn't expose it as an external
* mfp adds a patch to GODI's build sys
<Yoric[DT]> ah, ok
<Camarade_Tux> gosh, I really need tophide : ocaml is displaying me the result of parsing my 13MB xml file...
<Camarade_Tux> it's not been that long actually :)
seafood has quit []
<Yoric[DT]> :)
seafood has joined #ocaml
ygrek has quit [Remote closed the connection]
seafood has quit [Client Quit]
* Camarade_Tux wonders if pxp is not actually easier to use than xml-light
ygrek has joined #ocaml
<flux> well, it's difficult to be easier than xml-light..
<Camarade_Tux> you can have your file parsed with line of code and then,
<Camarade_Tux> List.nth (List.nth d#root#sub_nodes 1)#sub_nodes 1;;
<Camarade_Tux> it's incredibly easy
<Camarade_Tux> I remember having problems the first time I tried pxp though
Gionne has quit ["Leaving"]
seafood has joined #ocaml
seafood has quit []
hsuh has joined #ocaml
_JusSx__ has joined #ocaml
edi_99 has joined #ocaml
munga has quit [Remote closed the connection]
<edi_99> Hi guys I have a little problem and folks at #eclipse told me to come here... I have just installed OcaIDE (in Eclipse) and I'm getting an error : Could not start toplevel, please check its path and the preferences. Now I'm a complete novice - could you please help me?
<thelema> the toplevel is an executable named 'ocaml'
<edi_99> please clarify a bit
<thelema> have you installed ocaml?
<edi_99> yep
_JusSx_ has quit [Read error: 110 (Connection timed out)]
<thelema> can you verify that by going to a command line and typing [ocaml]?
<thelema> (without [])
<edi_99> terminal says it's missing
<edi_99> that's the problem
<edi_99> :)
<thelema> yup. how did you install ocaml?
<edi_99> should I install it just by sudo...
<edi_99> through software updates in eclipse
<thelema> ubuntu?
<edi_99> yep
<edi_99> basically I did the same as it's written in OcaIDE web page
<thelema> sudo apt-get install ocaml-base-nox
longh has joined #ocaml
<thelema> try [ocamlc] in command line
<edi_99> nope, I still have to install it
<edi_99> do I install it by sudo ... ocaml-nox?
<thelema> yes
<edi_99> ok
_JusSx_ has joined #ocaml
<edi_99> it works perfectly thank you very much thelema
<thelema> you're welcome.
_JusSx__ has quit [Read error: 110 (Connection timed out)]
seafood has joined #ocaml
seafood has quit [Client Quit]
itewsh has joined #ocaml
DroneZilla has joined #ocaml
<_zack> Yoric[DT]: can you expand about what is the problem in using module inclusion in .mli wrt ocamldoc api references?
<_zack> if, as I guess, it just means that the user will have one more click to go through, I believe it is acceptable, isn't it?
tomh has joined #ocaml
sporkmonger has joined #ocaml
itewsh has quit ["KTHXBYE"]
<thelema> _zack: what files are in your /usr/lib/ocaml/site-lib/zip dir?
<_zack> thelema:
<_zack> gzip.cmi gzip.mli META zip.cma zip.cmx zip.mli zlib.mli
<_zack> gzip.cmx libcamlzip.a zip.a zip.cmi zip.cmxa zlib.cmi
<_zack> thelema: ./configure problems?
<thelema> no, the configure ran fine, it just doesn't compile - I'm doing a by-hand ocamlfind install of camlzip
ygrek_ has joined #ocaml
ygrek has quit [Remote closed the connection]
<_zack> if META is ok, the actual files shouldn't be a problem
<mfp> SUCCESS! finally got OCaml 3.11 + Batteries with GODI
<_zack> my bet is that your META contains the wrong file names
<_zack> mfp: \o/
<thelema> what's in your META? All the metas I find only list zip.cmx and zip.cmxa
<_zack> archive(byte)="zip.cma"
<_zack> archive(native)="zip.cmxa"
<mfp> you have to patch godi-ocaml-src, godi-type-conv and godi-batteries, but nothing too serious
<thelema> _zack: same in mine, but I have to list the files I want installed
<thelema> do you have a [plain_uncompress] function in your camlzip?
<_zack> thelema: nope, at least not in the .mli
DroneZilla has quit []
<thelema> ok. Going through debian's patches for camlzip, there's an addition that adds such a function
<_zack> urgh, interesting, these days I've reinstalled upstream camlzip, that's probably why I don't have that function currently
<thelema> me too.
<_zack> but it isn't giving compilation problem here
<thelema> just bringing that to your attention.
<thelema> my batteries is compiling now.
vixey has joined #ocaml
<_zack> cool, I'm playing with INCLUDE instead of include to enforce common API adherence such as Common.Compress
<_zack> are INCLUDE paths always resolved wrt root?
<thelema> :) good job
<thelema> hmmm... I dunno, never used it.
<thelema> I imagine you'd want a relative path
<thelema> INCLUDE ../../core/src/filename.ml
<_zack> indeed, but it is not working for me, investigating ...
<mfp> _zack: relative to the pwd, I think --- now, I don't know if ocamlbuild builds from the root (build) or descends
* mfp trying to build git clone of batteries with 3.11
* thelema doesn't like autoconf dependency for git tree
<mfp> this is weird:
<mfp> ocamlfind ocamlc -c -package camomile -package sexplib -I src/core -I src -I src/libs -I src/main -I src/libs/camlzip -I src/libs/common -I src/core/baselib_threads -I src/core/baselib -I src/core/toolchain -I src/core/extlib -o src/core/extlib.cmi src/core/extlib.mli
<mfp> File "src/core/extlib.mli", line 2798, characters 4-424:
<mfp> Error: The variant or record definition does not match that of type
<mfp> Unix.socket_bool_option
<thelema> any chance we can hand-write the configure script?
code17 has quit ["Leaving."]
<thelema> mfp: that's because of ocaml 3.11's support for ipv6
<mfp> src/core/extlib.mli doesn't exist, obviously (it's a pack)
<thelema> mfp: hold a bit, I'll push my tree which has fixes for that.
<mfp> I know, I had to patch batteries alpha1 too
<mfp> the weird part is that src/core/extlib.mli
<thelema> yes, I dunno how that gets generated, but if you want to see the file, it's in the _build dir.
<thelema> mfp: try the thelema/master2 branch in git
<mfp> that's the 3.11 branch?
<_zack> thelema: ocamlbuild works under _build (as PWD), and the snippets i'm including aren't there
<_zack> that's explain the failure
<_zack> but config.ml isn't there either
<_zack> I don't get why that is working
<mfp> myocamlbuild.ml is scary
<mfp> 745l (!)
<mfp> thelema: works now, thanks. There was a typo in innerIO.ml http://www.eigenclass.org/sp.cgi/view/afs0ak
<thelema> mfp: you're right... now why didn't the compiler catch this for me.
jeddhaberstro has joined #ocaml
<thelema> hmm...
<thelema> File "_none_", line 1, characters 0-1:
<thelema> Error: Error on dynamically loaded library: dllcamlzip.so: dllcamlzip.so: cannot open shared object file: No such file or directory
<thelema> [-package batteries] doesn't auto-link dllcamlzip, it seems
<thelema> or there's a problem with my camlzip install...
<_zack> I vote for the latter :)
<thelema> yup, didn't install that file.
<thelema> fixed now.
<thelema> Error: Error while linking /home/thelema/bin/ocamlcvs//lib/ocaml/site-lib/batteries_threads/batteries.cma(Batteries_core_threads):
<thelema> Reference to undefined global `Extlib_threads'
<thelema> This one might be batteries' fault, though.
sporkmonger has quit []
sporkmonger has joined #ocaml
<thelema> easily fixed, though.
DroneZilla has joined #ocaml
DroneZilla has left #ocaml []
<Camarade_Tux> so, microsoft managed to create an incompatible xml...
tp76 has joined #ocaml
<thelema> yeah, but wasn't there some major open source project that made an incompatible xml too?
<thelema> no, I'm misremembering google / openid
<Camarade_Tux> thelema, actually it's sillier than that : they have xml-like files that have several toplevel elements
edi_99 has quit [Read error: 104 (Connection reset by peer)]
<thelema> .ini - style xml?
<Camarade_Tux> you just need to add <foo> at the beginning of the file and </foo> at its end to make it xml
<thelema> implied tags
<Camarade_Tux> I'll spend more times on this later but it seems they just took parts of their xml file and put them in different files
pango has quit [Remote closed the connection]
sporkmonger has quit []
jeddhaberstro has quit []
sporkmonger has joined #ocaml
pango has joined #ocaml
Gionne has joined #ocaml
<Camarade_Tux> I had made an error : I was working on older files from microsoft, the most recent ones are 800MB once expanded, I'm really wondering if my application will be any fast
<Kerris4> Camarade_Tux: you found how to check what security updates a windows computer need?
sporkmonger has quit []
vixey_ has joined #ocaml
vixey_ has quit [Read error: 104 (Connection reset by peer)]
vixey_ has joined #ocaml
vixey has quit [Nick collision from services.]
vixey_ is now known as vixey
sporkmonger has joined #ocaml
<hcarty> Yoric[DT]: Regarding your blog-comment discussion with JDH, is the collection of open IO handles Batteries-specific, or part of OCaml?
<Camarade_Tux> Kerris4, parsing a lot of xml and then checking the file versions of what is already installed versus what is shown in the xml files
sporkmonger has quit []
DroneZilla has joined #ocaml
<Camarade_Tux> btw, would anyone happen to know how to check the version of a windows dll from ocaml (or from C in fact) ?
<thelema> hcarty: batteries specific
<thelema> Camarade_Tux: your last question seems a great candidate for stackoverflow.com
<Camarade_Tux> thelema, good idea, I'll see there if I'm not too lazy and just ask in ##mingw/#mingw-w64 ><
DroneZilla has quit []
<Camarade_Tux> actually I found it : GetFileVersionInfoSize ( http://stackoverflow.com/questions/76472/checking-version-of-file-in-ruby ), thanks thelema :)
<hcarty> thelema: Thanks
hsuh has quit [Remote closed the connection]
<thelema> Camarade_Tux: I'll up-vote the question for you. which answer(s) helped?
<thelema> Camarade_Tux: that link points to the question
<thelema> I guess only one answer has "GetFileVersionInfoSize", so...
<Camarade_Tux> thelema, right I thought I had copied the answer this time : http://stackoverflow.com/questions/76472/checking-version-of-file-in-ruby#77447
<hcarty> thelema: For someone who wants to try out Batteries, would you recommend the version in GODI or git? "make doc" is failing for me on git, but otherwise it seems to work properly
<Camarade_Tux> now, out to buy some food
<thelema> hcarty: which branch?
<thelema> Camarade_Tux: good, we agree on the good answer. cheers
<hcarty> hcarty: Default branch? I git clone'd http://git.ocamlcore.org/batteries/batteries.git
<hcarty> Lots of "Warning: Element File.open_out not found" and similar warnings
<hcarty> Then a very long error from ocamlbuild
<hcarty> "Ocamlbuild knows of no rules that apply to a target named src/main/threads/Extlib_threads.odoc." with screens of "Failed to build all of these:" entries
<thelema> uh oh.
_zack has quit ["Leaving."]
<hcarty> thelema: Does this sound like an error on my end, or a Batteries bug/problem?
<thelema> I might have just broken that, although my fix fixes another problem I'm having.
<thelema> give me a sec to check.
<Yoric[DT]> hcarty: that's Batteries-specific.
<mfp> Yoric[DT]: saw the GODI + Ocaml 3.11 + batteries howto I linked to? Maybe it could be dropped somewhere...
<Yoric[DT]> mfp: oh no, sorry, I was away.
<Yoric[DT]> can you repost the url?
<mfp> ah also, you mentioned fds being closed by the GC... unless you've changed how things worked (which is what I suggested), OCaml is definitely NOT doing that atm.
<mfp> sure
<mfp> oops, I thought I'd addressed it to you to have your client hl it
<Yoric[DT]> No, OCaml doesn't do that by itself.
<Yoric[DT]> Batteries does.
<Yoric[DT]> And yes, this is what you suggested :)
<mfp> oh so you added yesterday, ok
<mfp> that was fast (and thus surprising :)
<mfp> *added it
<Camarade_Tux> Yoric[DT], you told me you had used ocaml under wine, did you compile it yourself or did you use precompiled binaries ?
<Yoric[DT]> precompiled
pango has quit [Remote closed the connection]
<Camarade_Tux> I'll probably try to compile ocaml on windows/mingw and the rest with wine ...
pango has joined #ocaml
Gionne has quit [Read error: 110 (Connection timed out)]
<mfp> is this normal? $ ocamlfind ocamlopt -verbose -package batteries -syntax batteries.pa_openin.syntax cat.ml -o cat
<mfp> ocamlfind: When using -syntax, the META variable 'preprocessor' must be set
<mfp> according to the META, -syntax batteries.syntax doesn't work anyway
<mfp> I always use -pp "camlp4o pa_whatever.cmo", not -syntax, because I use extensions not installed with ocamlfind, so don't know if I'm doing something wrong above
<Yoric[DT]> mfp: I've seen that problem already.
<Yoric[DT]> Iirc, it should be
<thelema> Yoric[DT]: I had to add Extlib_threads to threads/batteries.mllib, but this breaks documentation generation
<Yoric[DT]> ocamlfind ocamlopt -verbose -package batteries -package batteries.pa_openin.syntax -syntax camlp4o cat.ml -o cat
<Yoric[DT]> thelema: you had to?
<Yoric[DT]> Mmmhhhh....
<thelema> Yoric[DT]: it seemed the best way to fix the problem of Extlib_threads not being found when I compiled a threaded program.
<Yoric[DT]> Yeah, fair enough.
<Yoric[DT]> Can you submit a bug report on the documentation generation?
<mfp> Yoric[DT]: thanks, now ran into another error but it's a step forward :)
<Yoric[DT]> np
<thelema> Yoric[DT]: ok.
<mfp> I guess alpha1 didn't have the System module
* mfp installs from git tree
itewsh has joined #ocaml
<Yoric[DT]> mfp: actually, it did.
<Yoric[DT]> You probably need another syntax extension.
<Yoric[DT]> Or, more simply, the myocamlbuild.ml provided in doc/.
<mfp> then I don't know why it was complaining about System not being defined, when I did what you said with -linkpkg
<Yoric[DT]> mfp: because one of the syntax extension does a little module magic
<Yoric[DT]> Well, it does exactly [open Batteries].
<Yoric[DT]> And module System is actually Batteries.System .
<Yoric[DT]> It's syntax extension pa_batteries
<mfp> oh, so it's not pa_openin
tvn1981_0 has quit ["Leaving"]
<flux> I wonder why there are so many language specialized on digital synthesization, but few libraries seem to exist for generating sound from "normal" languages
<thelema> Yoric[DT]: should I revert that commit and leave threaded batteries broken, or leave it in and leave the doc generation broken?
<Yoric[DT]> thelema: no, keep threaded batteries working.
<Yoric[DT]> I think I see where the documentation issue comes from.
<Yoric[DT]> I'll try and fix it as soon as I can.
<thelema> Great.
<hcarty> Yoric[DT], thelema: "make byte opt" does not seem to build pa_batteries, but a plain "make" does
<Yoric[DT]> hcarty: that's true.
* Yoric[DT] will fix the Makefile.
<Yoric[DT]> hcarty: oh, it's actually not an error :)
<Yoric[DT]> hcarty: we're using GODI policies here.
<Yoric[DT]> If you want the bytecode version, you actually need [make all].
<Yoric[DT]> Rather than [make byte].
<Yoric[DT]> That policy is weird but, well, it's not our fault.
sporkmonger has joined #ocaml
<Yoric[DT]> More generally, I suggest [make all install].
sporkmonger has quit [Client Quit]
<hcarty> Yoric[DT]: Ah, ok thanks
<hcarty> Perhaps the README should be updated then
<hcarty> It suggests "make byte opt doc install"
* thelema fixes README
<mfp> has anybody used camlish? the toplevel + cmdline is intriguing http://www.reddit.com/r/programming/comments/7c6gi/camlish_shell_scripting_in_ocaml_and_mixed/
<Kerris4> nice find, mfp
<Camarade_Tux> mfp, no but I have a project that will certainly greatly benefit from camlish
<mfp> I like what I see regarding camlish for shell programming, but what really made me dl & inspect the code is the toplevel thing :)
<Camarade_Tux> the toplevel thing is actually what I want too :p
<flux> mfp, so did you replace your login shell with ocaml yet?
<mfp> hmm it uses the Toploop module; I somehow must have missed it in the manual, never heard of it
<mfp> not yet, flux
<mfp> reading code first :)
<mfp> I can't find Toploop in the manual, but there's the mli
<Camarade_Tux> rm /usr/bin/bash && ln -s /ocaml/bin/ocaml /usr/bin/bash
<Camarade_Tux> :)
<Camarade_Tux> mfp, iirc that's used by ocamlfind (and maybe batteries)
<mfp> I'm getting Exception: Unix.Unix_error (Unix.ECHILD, "waitpid", ""). whenever I run something from camlish's prompt
<Yoric[DT]> thelema: thanks
<mfp> Camarade_Tux: is camlish's prompt working for you (with no exns)?
<Camarade_Tux> mfp, I've not tried it yet but I'm gonna install it right now
dabd has joined #ocaml
<flux> mfp, they are too ashamed to document it.. after all, it has functions that return values of type Obj.t
<mfp> haha
<Camarade_Tux> mfp, so I installed camlish and tried "date;;" which worked
<mfp> no Unix.Unix_error?
velco has quit ["Ex-Chat"]
<Camarade_Tux> no, nothing
<mfp> it does run the cmd, but I get the exception afterwards
<mfp> maybe something in my .ocamlinit
<Camarade_Tux> everything is working for me (and btw I don't have a .ocamlinit)
<thelema> mfp: did you compile camlish with batteries?
<Camarade_Tux> thelema, is camlish in batteries already ?
<mfp> no, on the old 3.10.2 env
<maxote> what are the batteries?
<mfp> it doesn't use batteries
<mfp> Camarade_Tux: that was it, I had #require "unix";; in my .ocamlinit, which somehow disturbs camlish
velco has joined #ocaml
<Camarade_Tux> mfp, I tried #require "unix";; and got the same problem
<Camarade_Tux> I'm a bit suprised however
<Camarade_Tux> mfp, I tried
<Camarade_Tux> #use "topfind";;
<Camarade_Tux> #require "unix";;
<Camarade_Tux> #load "camlish.cma";;
<Camarade_Tux> and I have no problems
<Camarade_Tux> mfp, actually the problem is with ocaml : if you try to run ocaml with "ocaml unix.cma" and then later on do 'load "unix.cma";;', you will have the same problem, I guess it's related to the problem that has been raised on the mailing-list quite recently
<mfp> ah
<Camarade_Tux> which was that using 'ocaml unix.cma unix.cma' would cause problems
<Camarade_Tux> and it does :)
<mfp> good catch
threeve has joined #ocaml
<mfp> will play with camlish later, need to rest my hands :P
* mfp goes
<thelema> where should batteries' doc get installed?
threeve has quit [Client Quit]
<Yoric[DT]> thelema: that will end up distribution-specific.
<Yoric[DT]> For GODI, in the GODI documentation directory, for Debian in the Debian documentation directory, etc.
<thelema> hmmm and for installation from source?
<thelema> /usr/share/doc/batteries?
<Camarade_Tux> does batteries have a ./configure ?
<thelema> it does now.
<Camarade_Tux> then let people decide with a switch
<flux> surprising how fun it can be to play with a sound generating language :)
<thelema> but most people will use the default of...
<Camarade_Tux> and use /usr/share/doc I think
<Camarade_Tux> I *think*, because I'm using slackware and I know most programs don't put their documentation in /usr/doc ><
<Camarade_Tux> flux, which language is it ?
<flux> supercollider
<flux> ..I wouldn't mind if something like that was implemented in ocaml ;)
<flux> but perhaps I will see the benefits of a domain-specific-language (although it doesn't look very domain-specific to me)
<Camarade_Tux> the background colors on their website huuuuurts !
<flux> :)
struktured has joined #ocaml
<thelema> ?? supercollider.sf.net?
<flux> I guess he's talking about audiosynth.com
* thelema sees a white background
<Camarade_Tux> audiosynth.com ;)
* thelema sees a background named "Pastel-Rainbow-vertical.gif", but not on the page.
<flux> the file name says everything, no?-)
<flux> (it appears here fine)
apples` has joined #ocaml
<mbacarella> spend all week writing ocaml
<mbacarella> spend the weekend writing ocaml
* thelema is happy it doesn't here.
<mbacarella> *sigh*
<mbacarella> i wonder if there's more to life
* Camarade_Tux searches if there's more to life
<Camarade_Tux> Exception: Not_found.
<Camarade_Tux> =D
<mbacarella> best not to think about such things
<thelema> :)
<Yoric[DT]> Camarade_Tux: there's a switch.
<Camarade_Tux> I just checked, the default seems to be PREFIX/share/doc/appname
<mbacarella> my application is going to need to access the X11 paste buffer
<mbacarella> is there a way to do this natively?
DroneZilla has joined #ocaml
DroneZilla has quit [Remote closed the connection]
<Camarade_Tux> mbacarella, I don't think you can natively but if you're using lablgtk it should be possible, and if not, there are Xlib bindings somewhere
longh has quit [Read error: 104 (Connection reset by peer)]
<mbacarella> hmmm
<mbacarella> ok i'll be interfacing to lablgtk at some point anyway i suppose
itewsh has quit ["KTHXBYE"]
jeddhaberstro has joined #ocaml
<Kerris4> er, could anyone please tell me the maximum value for an integer on a 32-bit OS?
<mbacarella> unsigned? 2 ** 32
<Smerdyakov> mbacarella, I think the question is about OCaml.
<Smerdyakov> Kerris4, look in [Pervasives]. There's a value [max_int] or something.
<Kerris4> thanks Smerdyakov
<Kerris4> thanks mbacarella :P
<mbacarella> haha
<Kerris4> alright, that explains why my factorial was returning the right value on 22 (852369152) but a negative on 23
<Kerris4> s/85/95/
<flux> I'm guessing you're on a 32-bit platform and the 23'th factorial is larger than 1 billion
<thelema> Kerris4: look up big_num
<Smerdyakov> It's unlikely to be a good idea to calculate factorials that big, anyway. :P
<thelema> err, Big_int
<thelema> Smerdyakov: it's a great beginner's exercise at recursion
<Smerdyakov> Which doesn't mean you need to run many test inputs....
hkBst has joined #ocaml
<thelema> yes, but it's fun to see how fast it runs on bigger inputs, and when you get a negative answer, the quest to find out why ...
Snark has quit ["Ex-Chat"]
* thelema goes
threeve has joined #ocaml
Amorphous has quit [Read error: 104 (Connection reset by peer)]
<Yoric[DT]> thelema: what exactly is the point of [List.print_string]?
Amorphous has joined #ocaml
foo_ has joined #ocaml
<foo_> Hi! I wrote concat on lazy lists: operator |::| . What to do to be able to pattern-match on it like on :: ?
<Smerdyakov> Not possible without a syntax extension
<Smerdyakov> (And I'm not sure if that could be done in a way that integrates with regular [match])
<foo_> ok, I can live without it.
threeve has quit []
<Yoric[DT]> foo_: that already exists
<Yoric[DT]> Batteries Included has lazy lists.
<foo_> what is Batteries Included?
<foo_> you say that it has pattern matching on lazy lists or it has simple method to write your own pattern-matching syntax?
<Yoric[DT]> At the moment, it has lazy lists.
<Yoric[DT]> There was a syntax extension with pattern-matching on lazy lists.
<Yoric[DT]> This syntax extension needs to be updated but it will be made available around Alpha 3.
<Yoric[DT]> And Batteries Included is http://batteries.forge.ocamlcore.org/index-new.php .
<foo_> thanks, I'll read about it
<Yoric[DT]> np
<vixey> hm
<vixey> if you compile pattern matching into eliminators then you can change between lazy and strict just by flicking a switch
<Yoric[DT]> Eliminators?
<vixey> Yoric[DT]: I mean like List.fold_right except the generalization to any data type
<vixey> how does normal pattern matching in ocaml get compiled?
seafood has joined #ocaml
<Yoric[DT]> Ah, ok.
<Yoric[DT]> That looks rather hard to get to interact properly with the type system.
seafood has quit [Client Quit]
<Yoric[DT]> Iirc patterns are compiled to a fsm.
<Yoric[DT]> (which doesn't sound any easier to get to interact with the type system, mind you)
<Yoric[DT]> mfp: ping
seafood has joined #ocaml
Jedai has joined #ocaml
ygrek_ has quit [Remote closed the connection]
<hcarty> Yoric[DT]: Does Batteries include a general assert-like function? Something along the lines of "val verify : bool -> exn -> ()" which raises exn if bool is false?
<Yoric[DT]> Not for the moment.
<hcarty> Thanks.
<Yoric[DT]> But, well, OCaml offers assert.
<mfp> Yoric[DT]: pong
<hcarty> Yes, I want something more generic. It's simple to write, so I'll add it myself.
<Yoric[DT]> hcarty: don't hesitate to submit it :)
<Yoric[DT]> mfp: I just wanted to add a few words on the matter of channel closing.
<mfp> yes?
sporkmonger has joined #ocaml
<Yoric[DT]> Essentially, what we've changed is that outer channels now don't close inner channels.
<Yoric[DT]> It's now the opposite.
<Smerdyakov> hcarty, you might want to replace [exn] with [unit -> exn], to avoid allocating unused exceptions.
<Smerdyakov> hcarty, but I suppose that might allocate a closure, too.
<Smerdyakov> hcarty, versions specialized to particular exceptions seem best.
<Yoric[DT]> mfp: once this change has been done, we could let the garbage-collector do the trick.
<mfp> What's an "outer" vs an "inner" channel? One that consumes vs. one that is consumed? like an input that gunzips another channel?
Kerris4 has quit ["Leaving."]
<hcarty> Smerdyakov: I'm looking to shorten phrases like "... let () = if Array.length a = Array.length b then () else raise (Invalid_arg "crap!") in ..."
<hcarty> Smerdyakov: So, perhaps for this case at least, a "bool -> ()" would be better
<Smerdyakov> hcarty, you can already use [Pervasives.invalid_arg] to shorten it a little bit.
<hcarty> Smerdyakov: Yes, though that doesn't hold for most other exceptions. In this case it helps a bit though.
<Smerdyakov> I suggest an [Invalid_arg]-specific function, taking a [bool] and a [string].
<hcarty> Smerdyakov: Even better, thanks
<Smerdyakov> hcarty, is this meant for library code, where clients would mind if you used [assert] instead?
<hcarty> Smerdyakov: Not really. The code is related to my own research.
<hcarty> But if a simple function or two come out of this and end up being useful elsewhere then so much the better
<Smerdyakov> hcarty, then I recommend using [assert] instead.
<Smerdyakov> hcarty, you don't have to choose unique messages. You get file and position information printed when the assertion fails.
<mfp> Yoric[DT]: I don't know how interested you're in speed atm., but I have a tiny patch that makes IO.copy 50 times faster...
<mfp> you might also find interesting that foreach ($argv as $file_name) echo file_get_contents($file_name); reads the whole file in memory, unlike the Batteries-powered version, and is thus unusable ;-)
itewsh has joined #ocaml
<Yoric[DT]> mfp: I've just modified IO.copy.
<Yoric[DT]> And actually, I'm not sure it reads the whole file in memory.
* Yoric[DT] will check on a huge file.
<mfp> (it was an obvious depessimization)
<mfp> I'd think so, Ruby, at least, would
<Yoric[DT]> Well, I strongly doubt it does.
<Yoric[DT]> mfp: feel free to submit the patch, of course
<mfp> well, if you've already pushed yours, no need
<Yoric[DT]> Depends on what you've done.
<Yoric[DT]> Actually, I've just tested the php version for cat-ing 10 times a 600Mb version.
<Yoric[DT]> Actually, I've just tested the php version for cat-ing 10 times a 600Mb file.
<Yoric[DT]> That's about 45 ms.
<Yoric[DT]> The OCaml versions aren't finished yet.
<Yoric[DT]> Well, that's nearly the same change, except my version only uses 1024b of buffer.
<mfp> yes, it was an obvious change
<mfp> I don't think you need if len = 0 then raise No_more_input, do you? input already raises No_more_input on EOF
<Yoric[DT]> Well, according to my tests, not always.
<Yoric[DT]> Which surprised me.
<mfp> ah we need really_output? I believed IO.output guaranteed all bytes were written, duh
<Yoric[DT]> I believe it doesn't.
<Yoric[DT]> According to the documentation, it doesn't.
<mfp> if really_output exists, it surely doesn't (I thought it had been removed)
<Yoric[DT]> Well, according to the source code [really_output] attempts repeatedly to [output] until everything has been written.
<Yoric[DT]> And according to the source code, [input] can return [0] without it being an error.
hkBst has quit [Remote closed the connection]
<mfp> AFAICS both InnerIO.input_channel and input_string raise No_more_input on EOF in their in_input
foo_ has quit ["Ex-Chat"]
* Yoric[DT] is wondering whether a fast version of copy could be achieved with mmap.
* Camarade_Tux is compiling ocaml on windows
* Camarade_Tux think he saw an "implicit declaration of function caml_enter_blocking_section"
<Yoric[DT]> thelema: ping
love-pingoo has quit ["Connection reset by pear"]
<mfp> Yoric[DT]: the PHP script slurps the files into mem here (seems to first mmap and then copy to a string), PHP 4.4.4 (cli) (built: Nov 8 2008 23:20:27)
apples` has quit ["Leaving"]
apples` has joined #ocaml
_JusSx_ has quit ["leaving"]
<Yoric[DT]> mfp: did you find the source code for get_file_contents?
<mfp> haven't looked for it
* mfp tries
<Yoric[DT]> So how did you check?
<mfp> ran the program, and looked at the RSS
<Yoric[DT]> RSS?
<mfp> resident memory
* Yoric[DT] isn't familiar with this.
<mfp> if I cat a 1GB file, it mmaps it right away (VIRT goes to > 1GB), then RSS grows steadily
<Yoric[DT]> ah, ok
<mfp> a 170MB file did use 170MB of mem, and I killed the process cat'ing 1GB when it was taking over 500MB...
<Yoric[DT]> Well, that's probably something we could implement easily.
<Yoric[DT]> But not for Alpha 2.
<mfp> uh? what's the point?
<Yoric[DT]> Fast copy.
<Yoric[DT]> When needed.
<mfp> I believe it's mmapping, then copying to a string, then dumping to stdout
<mfp> not mmaping and writing from that area directly
<Yoric[DT]> That php script only took 0.041s to read and dump to stdnull 10x a 500Mb file.
<mfp> and did you see how much mem it took?
<Yoric[DT]> No, too fast.
<mfp> also, 10x500 / 0.041 = 121951 MB/sec
<mfp> also too fast
<Yoric[DT]> Mmmhh....
<Yoric[DT]> Let's check with something other than /dev/null .
<Yoric[DT]> Same thing with a file.
<Yoric[DT]> ...
<Yoric[DT]> Arf, I've found why it's so fast.
sporkmonger has quit []
<mfp> don't know what sort of machine you have
<Yoric[DT]> « Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 742842369 bytes) in /tmp/test.php on line 5
<Yoric[DT]> »
<Yoric[DT]> :)
<mfp> but usual ones don't have more than 4GB/s or so of RAM BW
<mfp> hah
sporkmonger has joined #ocaml
<mfp> so the moral is: "Never expect any cleverness from PHP".
<Yoric[DT]> I guess.
<Yoric[DT]> I expected something better.
* Yoric[DT] wonders what happens in Python.
itewsh has quit ["KTHXBYE"]
<mfp> I'd expect it to do the same (Ruby does)
<Yoric[DT]> It seems that the equivalent is readfile.
<Yoric[DT]> Erf, no.
<Yoric[DT]> File.read => reads all, unless otherwise specified.
<Yoric[DT]> Well, Python has facilities to read line-by-line.
sporkmonger has quit [Read error: 110 (Connection timed out)]
tp76 has quit ["ERC Version 5.2 (IRC client for Emacs)"]
<Yoric[DT]> Anyway, it's time to call it a night.
<Yoric[DT]> Goodnight everyone.
Yoric[DT] has quit ["Ex-Chat"]
<Raevel> there's like nothing happening on the internet tonight!
velco has quit ["Ex-Chat"]
johnnowak has joined #ocaml
johnnowak has quit [Client Quit]