<rixed>
I would use a "lwt smthin = handle_password flags prompt in ...". I never use >>=.
<pippijn>
I liked it, because it shows the flow of the result from handle_password into send "reply"
Zanders has joined #ocaml
<pippijn>
send "reply" is a functional value (curried function with 2 arguments)
<rixed>
Your version es very readable too.
<rixed>
I guess there are no argument for or against >>=, it's just some are more used to one or the other.
<pippijn>
an alternative to the >> thing would be lwt () = ... in Lwt.return env
* Hodapp
wonders when the devs he works with are going to see the connection between their repeated insistence of "No one needs this in a programming language" about something common in languages like OCaml, and the fact that they keep re-implementing parts of it in very ad-hoc, ugly ways
<pippijn>
never
<Hodapp>
:(
<Hodapp>
I guess this is what Greenspun's Tenth Rule was getting at
<pippijn>
change your job
<Hodapp>
to what?
<pippijn>
work with better people
<pippijn>
to a company that uses better languages
<Hodapp>
such as?
<pippijn>
I don't know, look on a job site
<pippijn>
microsoft, for instance
<Hodapp>
I'm not working for Microsoft.
<Hodapp>
I have enough friends who work there, and I have enough experience with their products, that I want to steer far away.
eni has joined #ocaml
roha has quit [Ping timeout: 260 seconds]
rzys has quit [Ping timeout: 264 seconds]
zolk3ri has quit [Remote host closed the connection]
roha has joined #ocaml
rzys has joined #ocaml
Submarine has quit [Quit: Leaving]
ulfdoz has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
eni has quit [Ping timeout: 252 seconds]
cago has quit [Quit: Leaving.]
mika1 has quit [Quit: Leaving.]
cixaxa has joined #ocaml
avsm has joined #ocaml
tufisi has quit [Ping timeout: 260 seconds]
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
Juzor has joined #ocaml
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
ulfdoz_ has joined #ocaml
tmaeda is now known as tmaedaZ
maufred has quit [Remote host closed the connection]
avsm has quit [Read error: Connection reset by peer]
avsm has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ is now known as ulfdoz
avsm has quit [Read error: Connection reset by peer]
<hcarty>
thelema: Any update on change the Ulib module name in Batteries?
avsm has joined #ocaml
<hcarty>
s/change/changing/
avsm has quit [Read error: Connection reset by peer]
<thelema>
hcarty: The plan is to move it all into BatText
letrec has quit [Ping timeout: 264 seconds]
<thelema>
hasn't been done yet
<hcarty>
thelema: Ok, thanks
<thelema>
hcarty: will be done before 2.0 releases
maufred has joined #ocaml
<hcarty>
thelema: Ok. I've run into some issues with Batteries from oasis-db because of this.
<thelema>
That will be updated too.
<thelema>
probably before the 2.0 release
tmaedaZ is now known as tmaeda
<thelema>
I hope to take care of the ulib code, release beta3 (and announce it for testing), then clean up the docs and fix bugs and release 2.0
<thomasga>
is that possible to use oasis with ocamlbuild but without ocamlfind ?
<thelema>
thomasga: to write a package that builds with oasis but without ocamlfind
<thomasga>
(I don't want my build script to call "ocamlfind ocamlopt …" for every command line invocation)
<thelema>
or to use someone else's package that assumes ocamlbuild + ocamlfind on a system w/o ocamlfind?
<thelema>
ok, the first.
<thelema>
why not?
<thomasga>
yup the first
emmanuel__ has quit [Ping timeout: 264 seconds]
<thomasga>
because with "ocamlfind ocamlopt" all the META files are scanned and parsed (which invoke scanning again all backward dependencies each time you parse a META) for EACH compiler invocation
<thomasga>
that's crazy ...
JoeyA has joined #ocaml
<hcarty>
imfld03$$
<thelema>
really? that's pretty sucky.
<hcarty>
Gah... search clearing garbage in the wrong window...
<thomasga>
I'm ok to use ocamlfind in a Makefile where the first thing you do is: "INCLUDES = `ocamlfind query A B C -format …`
<thomasga>
but using it with "ocamlfind ocamlopt …" is wrong ...
<thelema>
You can use oasis without ocamlbuild at all, by using the custom configure/build/install targets
<thelema>
thomasga: might be worth reporting this as a bug to gerd
<thomasga>
well, it's more a bug in the `myocamlbuild.ml` generated oasis I guess
emmanuel__ has joined #ocaml
<thomasga>
well, I'll use custom scripts then …
<thelema>
oh, I see - you want ocamlfind ocamlopt to scan the META files only once
<thelema>
instead of on each invocation
<thomasga>
yup
<thelema>
it does need the data from the first scan each invocation
<thelema>
but maybe ocamlfind could cache it in a .foo in the current directory?
roha has quit [Read error: Operation timed out]
<thelema>
and maybe just check the timestamps of the META files instead of full parsing?
rzys has quit [Ping timeout: 252 seconds]
<thomasga>
well, I guess that's the build-system problem to not call ocamlfind too often
<thomasga>
but yes, I can submit a feature request to Gerd: "remove the 'ocamlfind <compiler>' option" :-)
snearch has joined #ocaml
<thelema>
thomasga: no, that's not a reasonable request.
<thelema>
but you're right; maybe ocamlbuild should call ocamlfind differently
JoeyA has quit [Ping timeout: 240 seconds]
<adrien>
thomasga: I've never found ocamlfind's META-lookup overhead to be crazy
skchrko has joined #ocaml
<adrien>
I think I had checked how long it took and found it pretty fast
oriba has quit [Quit: oriba]
<thomasga>
it really depends how many packages you have installed
<adrien>
couple hundreds
<thomasga>
hum
<adrien>
165 on this installation
<adrien>
I mean: 165 META files; 261 packages from ocamlfind list
<thomasga>
and what's the difference between calling "ocamlopt" and "ocamlfind ocamlopt -package foo" ?
<thelema>
thomasga: ocamlfind will detect ocamlopt.opt and use it
<thomasga>
last time I checked the overhead was quadratic in the number of installed packages
<thelema>
and will add flags for that package based on the current tags
<thelema>
thomasga: eww.
<thomasga>
but maybe few things have changed since then
<thomasga>
I haven't benchmarked it for a long time
<adrien>
well, without compiling anything and on a micro and unreliable benchmark and with a hot cache, ocamlfind ocamlopt -package lablgtk2 is faster than only "ocamlopt"
<Hodapp>
The strictness of OCaml is interesting, when I compare with some other languages; it's like that compile-time strictness ends up gaining you a lot, while still not making you care about the irrelevant.
<adrien>
need to set a few things and strace ocamlfind
<thomasga>
well, compare "ocamlopt.opt" and "ocamlfind ocamlopt" to be fair, then :-)
<Hodapp>
it sounds like Scala is also somewhat similar
<thelema>
Hodapp: you mean the strictness of the type system?
<adrien>
thomasga: still faster, and ocamlfind ocamlopt actually runs ocamlopt(.opt) here too
<adrien>
.opt, hmm
<adrien>
hah
<adrien>
that's why: I've configured my ocamlfind to use the .opt versions :-)
<Hodapp>
thelema: Strictness of the type system, and strictness of how you specify things, perhaps.
ulfdoz has quit [Quit: kernel upgrade.]
<Hodapp>
yet still being very concise
<adrien>
still, it's 20-25ms vs 3ms or so
<pippijn>
it needs better utf8 libraries
<Hodapp>
it's showing well that strict need not mean pedantic
<thomasga>
well, when you build a project with hundred of compiler invocations, it makes a big difference
Juzor has quit [Ping timeout: 272 seconds]
<adrien>
Hodapp: ocaml tries hard to bring the benefits of strictness while making sure it will be usable
<adrien>
thomasga: of course but I wonder how long it takes to do the META lookup/parsing
<adrien>
thomasga: also, are you running with powersaving features on?
<adrien>
pmake 4.95s user 1.92s system 81% cpu 8.430 total
<adrien>
pmake 3.99s user 1.54s system 79% cpu 6.944 total
<adrien>
first is with governor = ondemand; second is with it = performance
<adrien>
sometimes, ocamlopt compiles so quickly that it never actually makes the ondemand governor switch to the highest frequency I think
<thomasga>
adrien: are you running ocamlopt.opt or "ocamlfind ocamlopt" ?
<pippijn>
maybe someone here has a good idea for how to solve this..
<adrien>
ocamlfind ocamlopt (it's through oasis; I don't exaclty see it but I know that ocamlfind gets invoked _several_ times; I'm quite confident it's invoked for each file)
<thelema>
pippijn: utf8?
<pippijn>
I have binary input (as string) of the following format: byte byte utf8char
<adrien>
let me strace it
<thelema>
adrien: just look at _build/_log
<adrien>
strace's overhead <3
<thomasga>
anyway, this doesn't solve my initial problem, I'm going back to my code :-)
<adrien>
running "pgrep ocamlfind" several times gave a result each time, and with a different PID each time
<adrien>
thomasga: back to code? it's getting late (and sunny for the first time today!)
<pippijn>
how can I efficiently extract that utf8 character from the string/stream?
<thomasga>
well it's always sunny where I live, so night coding is better :-)
<Hodapp>
adrien: I'm liking that property of the language, though I'm still quite new to it.
<thomasga>
pippijn: you can use ulex syntax extension
<pippijn>
it's: byte byte utf8char
<pippijn>
the bytes can be anything (they are 8 bit integers)
<Hodapp>
adrien: I'd be curious to see, on some highly mathematical things, how it compares to C/C++, and perhaps likewise to how it compares to some of the OO atrocities I see in C++.
<adrien>
thomasga: ah, I had assumed you were in Paris ;-)
<adrien>
and some numbers: 1.5ms (slow laptop) to go through Unix' META
<adrien>
Hodapp: if you use floats in ocaml, you won't gain much since it models the standard float stuff that you also get in C, C++ and many others
ulfdoz has joined #ocaml
<pippijn>
thelema: you mean copy it out and use it?
<Hodapp>
adrien: Flow control can still be complex sometimes, even using floats; something like OCaml might be able to decude better what it can precompute, were I to guess.
<Hodapp>
s/decude/deduce/
<pippijn>
thelema: I've written that kind of code..
Hussaind has quit [Remote host closed the connection]
<adrien>
thomasga: under strace, I get roughly 35ms for the ocamlfind-specific part and 100ms for the ocamlopt-specific on; the files are fairly simple so the ocamlopt-specific part would be bigger in almost any project (my files are _very_ simple)
<adrien>
Hodapp: it won't precompute but gcc will (now and for a few years thanks to gmp, mpfr, and some other libs)
<adrien>
where ocaml helps however is that you definitely will think twice before converting between ints and floats and you'll be fully aware when you do (unlike with silent casts)
<Hodapp>
ah, yeah
djcoin has quit [Quit: WeeChat 0.3.2]
cyphase has quit [Ping timeout: 252 seconds]
cyphase_ has joined #ocaml
pangoafk is now known as pango
larhat has quit [Quit: Leaving.]
<hcarty>
thelema: Are you still willing to put out a 1.4.2 release with the Set.map fix?
<hcarty>
Or was it Map.map...
<thelema>
hcarty: If someone fixes it. It was Set.map, because this changes the keys
cyphase_ is now known as cyphase
eni has joined #ocaml
cyphase has quit [Changing host]
cyphase has joined #ocaml
rzys has joined #ocaml
roha has joined #ocaml
<hcarty>
thelema: I can push a branch if that would help
Snark has quit [Quit: Quitte]
<hcarty>
The only additional commit would be replacing the old map implementation with the fold version
roha has quit [Ping timeout: 260 seconds]
rzys has quit [Ping timeout: 260 seconds]
rzys has joined #ocaml
roha has joined #ocaml
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
BiDOrD has joined #ocaml
snearch has quit [Quit: Verlassend]
BiDOrD_ has quit [Ping timeout: 246 seconds]
jamii has joined #ocaml
<hcarty>
thelema: A patch against the v1.4.1 tag if you have time to take a look - http://vpaste.net/jSfgl
<thelema>
testing...
JoeyA has joined #ocaml
cixaxa is now known as tufisi
<thelema>
pushed to github
<thelema>
release running now
<hcarty>
thelema: Thanks. Do you have a problem with 1.4.2 living in odb-stable, with 2.x living in testing and/or unstable?
<hcarty>
It may be a good idea to keep oasis back to the latest 0.2-based release. Otherwise the resulting packages won't work on oasis-db.
<thelema>
good point
<thelema>
oasis version dropped
avsm has joined #ocaml
smondet has joined #ocaml
eni has quit [Ping timeout: 260 seconds]
avsm has quit [Client Quit]
<pippijn>
http://paste.xinu.at/IZJkcI/ <- any ideas how to do this in a cleaner way? I'm especially not happy about the list ref in parse_glyph (line 92)
<pippijn>
I'm also not happy with codepoint (line 23)
<thelema>
You could probably also adapt UTF8.get for a list of chars
<pippijn>
I'd rather not copy code
<thelema>
well, batteries currently doesn't have uchar parsing from an enum. we could add this if you write it.
<thelema>
or you can put it on my TODO list and I'll get to it, probably around the time I redo unicode in 2.0
<pippijn>
I'm going to live with it for now and maybe someday when I have more time on my hands and I want to get involved with batteries, I can do some things
<pippijn>
any ideas on how to make parse_glyph not use ref?
<pippijn>
(except by inlining parse_glyph_part and extending the state machine)
<thelema>
pippijn: yes, this is easy
<pippijn>
ok, wait
<thelema>
let parse_glyph data = let rec pg_loop acc = if is_empty data then List.rev acc else pg_loop (parse_glyph_part data :: acc)
<pippijn>
right
<thelema>
in pg_loop []
<thelema>
You could also use Enum.unfold if you were feeling extra functional
<pippijn>
ah, I'll look at that
<pippijn>
no, not nice, I'll stick with the manual recursive function
<thelema>
(fun d -> if is_empty d then None else Some (parse_glyph_part data, d))
<pippijn>
thelema: I asked, because I was hoping there is a function that does exactly this (like a Stream.fold, but non-destructive)
<pippijn>
thelema: yes, but then I end up with an enum
<thelema>
List.of_enum
<thelema>
or just use the enum
<pippijn>
maybe later
penryu has left #ocaml []
Zedrikov has joined #ocaml
iago has quit [Ping timeout: 260 seconds]
ftrvxmtrx has joined #ocaml
sgnb has quit [Ping timeout: 265 seconds]
jamii has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
Xizor has joined #ocaml
thomasga has quit [Quit: Leaving.]
larhat has joined #ocaml
Tobu_ has quit [Ping timeout: 260 seconds]
larhat has quit [Remote host closed the connection]
larhat has joined #ocaml
sgnb has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 246 seconds]
roha has quit [Read error: Operation timed out]
ftrvxmtrx has joined #ocaml
rzys has quit [Ping timeout: 272 seconds]
rzys has joined #ocaml
Tobu has joined #ocaml
Submarine has quit [Quit: Leaving]
wagle has quit [Read error: Connection reset by peer]
The_third_bug has quit [Ping timeout: 260 seconds]
roha has joined #ocaml
The_third_bug has joined #ocaml
wagle has joined #ocaml
djcoin has joined #ocaml
smerz has joined #ocaml
The_third_bug has quit [Ping timeout: 260 seconds]
emmanuel__ has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
iago has joined #ocaml
oriba has joined #ocaml
avsm has joined #ocaml
The_third_bug has joined #ocaml
skchrko has quit [Quit: ChatZilla 0.9.88.2 [Firefox 11.0/20120401163544]]
JoeyA has quit [Quit: Leaving]
Zedrikov has quit [Ping timeout: 260 seconds]
eni has joined #ocaml
Juzor has joined #ocaml
emmanuelux has quit [Read error: Connection reset by peer]
Yoy_ has joined #ocaml
<Yoy_>
Hello, I've got some troubles with the ocaml Random module. It seem's that I don't have it install, Is'nt it a generic module for ocaml ? Can somebody say me where to download it?
emmanuel__ has joined #ocaml
The_third_bug has quit [Ping timeout: 245 seconds]
<adrien>
it is indeed generic
<adrien>
so the questions are: how do you know you don't have it, and how did you "install" ocaml?
Tobu has quit [Ping timeout: 272 seconds]
Cyanure has quit [Ping timeout: 272 seconds]
emias has quit [Ping timeout: 265 seconds]
The_third_bug has joined #ocaml
<Yoy_>
mmh.. I've installed the ocaml-devel package I think
<Yoy_>
I try to compile a little program where I just use Random.int and I've got the "unbound Random" message
<Yoy_>
(thks for responding btw :) )
<adrien>
you're probably not calling ocaml/ocamlc/ocamlopt correctly
<adrien>
you need to add the module to the command-line call
<adrien>
or not
jamii has quit [Ping timeout: 246 seconds]
<adrien>
hmmm, no, you don't need to for Random; you should give more details: distribution, compiler invocation, code
* adrien
is going to bed; good night
Zanders has quit [Quit: Leaving]
eni has quit [Ping timeout: 246 seconds]
<Yoy_>
I don't think I misuse it, it properly works on an other laptop
Xizor has quit [Ping timeout: 260 seconds]
<Yoy_>
my system is fedora 16 and Objective Caml version 3.12.0
emias has joined #ocaml
emmanuel__ has quit [Remote host closed the connection]
abdallah has joined #ocaml
tufisi has quit [Ping timeout: 240 seconds]
sivoais has quit [Quit: Lost terminal]
sivoais has joined #ocaml
Tobu has joined #ocaml
djcoin has quit [Quit: WeeChat 0.3.2]
roha has quit [Ping timeout: 264 seconds]
rzys has quit [Ping timeout: 245 seconds]
ggherdov has joined #ocaml
emmanuel__ has joined #ocaml
smondet has quit [Remote host closed the connection]
ggherdov has left #ocaml []
emmanuel__ has quit [Read error: Connection reset by peer]