<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>
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
<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 ><
<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>
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>
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
<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
<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.
<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]>
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