flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | 3.11.0 out now! Get yours from http://caml.inria.fr/ocaml/release.html
<thelema> you're good at mismatching your data types with how you use them
<palomer> what do you mean?
<thelema> it seems like almost all your functions have a default case that raises an exception
<thelema> the whole idea of from_some means that somewhere you shouldn't be using an option.
<palomer> well, err, only lookup and from_some
<kaustuv> palomer: It seems to me that you want to do something like this: http://ocaml.pastebin.com/d5c0442d8 -- or have I missed something?
<palomer> I don't actually use from_some (I just forgot what I named my other functions)
<thelema> and safe_zip, although that's not as unreasonable.
<palomer> I see what you did there!
<palomer> yeah, I could use standard zip, but I prefer safe_zip
<palomer> that's a no brainer!
<palomer> kaustuv, whoa, that's wicked!!!
grirgz has joined #ocaml
<palomer> the only problem is that cons is not a function
<thelema> (List.map2 (fun con dat -> con dat) cons, dats)
<thelema> now it's a function.
<thelema> er, now it returns a function
wsmith84 has quit [Remote closed the connection]
<palomer> nice!
<palomer> sooo much better than my solution
* palomer is thinking of quitting his day job
<grirgz> hi
<palomer> high
* palomer has officially been shamed
<thelema> my solution involves reversing the original list and building a series of closures that each do the right thing to the next element of the list (i.e. inlining the map2). OTOH, it wouldn't be quite as clear as kaustuv's
<kaustuv> I thought of doing it via a fold, but I think closure creation overhead would kill there. In my version the left and right closures are allocated once and for all at module init
<kaustuv> The downside is that map is not (normally) tail-recursive, so you pay some piper
<thelema> kaustuv: lucky for us, batteries' map *is* tail-recursive
<kaustuv> Yes, but it uses magic in a way that confuses the GC, which is not used to lists growing at the tail.
hkBst has quit [Read error: 104 (Connection reset by peer)]
<thelema> it does work the GC a little bit hard in the case that the list doesn't fit in the minor heap, as each additional cons expands the GC's list of roots
<thelema> hmm, I thought bluestorm and I had come up with a different List.map implementation...
<thelema> ah, there it is... not map, fold_right
<kaustuv> if the list fits in the minor heap, the difference between TR and non-TR is a complete wash
<thelema> hmm, even the Jane Street guys thought it best to get tail recursion through rev...
<thelema> actually, non-TR is usually faster if the list fits in minor
vuln has joined #ocaml
<kaustuv> There's nothing wrong with rev in my opinion. Why, I rev 7 lists before breakfast every morning!
<thelema> http://ocaml.pastebin.com/m7964fb7d <- crazy List.fold_right implementation
<thelema> it would be in Batteries main, except it needs more review.
<kaustuv> Ow, my poor brain. I'll have to read it when I'm saner in the morning.
kate__ has quit [Connection timed out]
<thelema> :) yes, it's quite a tangle of recursion
<palomer> is it...faster?
Asmadeus has quit [Read error: 110 (Connection timed out)]
<thelema> it's much easier on the GC
<thelema> List.rev is very hard on the GC for large lists that go away quickly
<mrvn> bjorkintosh: Blaupunkt has build a car stereo that was programmed in a functional language and they had a german university formally verify the code for correctness. So yes, GC lnaguages are used in embedded devices.
ched__ has joined #ocaml
ched_ has quit [Read error: 110 (Connection timed out)]
<palomer> mrvn, haskell?
<mrvn> Not sure what it was. Was years ago that I heard it.
m3ga has joined #ocaml
jeddhaberstro has joined #ocaml
olegfink has quit [Read error: 60 (Operation timed out)]
olegfink has joined #ocaml
olegfink is now known as Guest6594
mal`` has quit ["Coyote finally caught me"]
mal`` has joined #ocaml
jeddhaberstro has quit []
rogo has quit [Read error: 113 (No route to host)]
vuln has quit ["leaving"]
Guest6594 is now known as olegfink
seafood has joined #ocaml
seafood has quit []
mishok13 has quit [Read error: 110 (Connection timed out)]
AxleLonghorn2 has joined #ocaml
kate__ has joined #ocaml
AxleLonghorn2 has left #ocaml []
seafood has joined #ocaml
AxleLonghorn has joined #ocaml
seafood has quit [Read error: 110 (Connection timed out)]
AxleLonghorn has left #ocaml []
ttamttam has joined #ocaml
ttamttam has left #ocaml []
seafood has joined #ocaml
Snark has joined #ocaml
m3ga has quit ["disappearing into the sunset"]
kate__ has quit [Read error: 110 (Connection timed out)]
mishok13 has joined #ocaml
kate__ has joined #ocaml
ttamttam has joined #ocaml
komar_ has joined #ocaml
eut has joined #ocaml
ygrek has joined #ocaml
olegfink has quit [Remote closed the connection]
olegfink has joined #ocaml
olegfink is now known as Guest86417
jbms has joined #ocaml
<jbms> Is there a camlp4 module for supporting the "try in" construct?
<flux> there are likely several :)
<jbms> any pointers?
<flux> caml humps perhaps?
<flux> it's an example
<flux> however that's for the old camlp4. but you can likely make use of the code with camlp5.
verte-work is now known as verte
s4tan has joined #ocaml
_zack has joined #ocaml
ygrek has quit [Remote closed the connection]
ttamttam has left #ocaml []
seafood has quit []
kate__ has quit [Read error: 60 (Operation timed out)]
ryosei has left #ocaml []
Asmadeus has joined #ocaml
OChameau has joined #ocaml
ttamttam has joined #ocaml
hkBst has joined #ocaml
Camarade_Tux has quit [Read error: 110 (Connection timed out)]
Camarade_Tux has joined #ocaml
verte_ has joined #ocaml
verte has quit [Nick collision from services.]
verte_ is now known as verte
pierre_m has joined #ocaml
Yoric[DT] has joined #ocaml
hkBst has quit [Remote closed the connection]
Yoric[DT] has quit ["Ex-Chat"]
Guest86417 is now known as olegfink
jamii__ has joined #ocaml
_andre has joined #ocaml
Alpounet has joined #ocaml
<flux> is there a way/some existing library that would allow me to find the ip addresses of network interfaces?
<flux> like, interface to getifaddrs
<Alpounet> the Unix module provides many such things... but maybe not exactly that feature, don't know :/
<flux> I need to bind any port of an (any, all?) external ip address and find out which address and port I've bind
<flux> finding out the port is easy, but getsockname just gives me 0.0.0.0 for the ip address
<flux> if I've used Unix.inet_addr_any during the binding that is
seafood has joined #ocaml
<Alpounet> flux, ok... you may want to bind yourself the necessary C API functions into OCaml via external...
orbitz has joined #ocaml
rogo has joined #ocaml
seafood_ has joined #ocaml
pierre_m has left #ocaml []
seafood_ has quit []
seafood has quit [Read error: 110 (Connection timed out)]
willb has joined #ocaml
verte has quit [":("]
orbitz_ has joined #ocaml
orbitz_ has quit [Remote closed the connection]
<flux> hmph.. I think ocaml should reveal more of its runtime libraries' header files in a final installation
<flux> for example it's a pain to deal with Unix.sockaddr when writing C code
orbitz has quit [Read error: 110 (Connection timed out)]
orbitz has joined #ocaml
orbitz has quit [Connection timed out]
orbitz has joined #ocaml
_andre has quit ["Lost terminal"]
_andre has joined #ocaml
willb has quit [Read error: 110 (Connection timed out)]
olegfink has quit [Remote closed the connection]
olegfink has joined #ocaml
olegfink is now known as Guest75292
th5 has joined #ocaml
Guest75292 is now known as olegfink
willb has joined #ocaml
Amorphous has quit [Read error: 110 (Connection timed out)]
Amorphous has joined #ocaml
kate__ has joined #ocaml
jeanbon has joined #ocaml
s4tan has quit []
<palomer> ocaml is dead??
<Alpounet> no, and that's exactly the point of the post.
<palomer> phew!
<Alpounet> That's an answer to people saying OCaml is dead, there aren't projects around OCaml
itewsh has joined #ocaml
ttamttam has left #ocaml []
kate__ has quit [Connection timed out]
<palomer> whew, took 3 days to rewrite this code
th5 has quit []
Spiwack has joined #ocaml
jeanb-- has joined #ocaml
kate__ has joined #ocaml
<_andre> anyone using ocsigen.opt? it complains about a missing sqlite3.cmxs and i don't know how to build it
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
_zack has quit ["Leaving."]
OChameau has quit ["Leaving"]
<Alpounet> is Cairo OCaml a good and efficient library for GUI ?
Yoric[DT] has joined #ocaml
kaustuv_ has joined #ocaml
<hcarty> Alpounet: It's a nice Cairo binding
<Alpounet> Is it handy ?
<Yoric[DT]> hi
<hcarty> Alpounet: What sort of GUI are you after?
<hcarty> I've used it with lablgtk for some simple GUI testing, and for mixing lablgtk with a plotting library
<hcarty> Yoric[DT]: Hello and congrats on surviving all the way to a Batteries beta release :-)
marmottine has joined #ocaml
<Alpounet> hcarty, a handy GUI library, that will have to surviving to my tests and little tools programming ;-)
<Yoric[DT]> hcarty: thanks :)
<Yoric[DT]> Now attempting to survive a bit further.
* Yoric[DT] has suffered from a nasty fever since Thursday morning.
<hcarty> Alpounet: Gtk and Tk are your two main GUI options in OCaml, I think
<hcarty> Yoric[DT]: Best of luck recovering
<Yoric[DT]> Thanks.
<Yoric[DT]> Commuting with fever is proving a tad tricky.
<Yoric[DT]> Commuting *and doing politics* is proving trickier even :)
bouzu has joined #ocaml
<bouzu> hi
<bouzu> does exist function "random" and he return any random int ?
<Alpounet> hcarty, that's what I think for the moment, yep.
<Alpounet> I am waiting much from Qt OCaml
<Alpounet> but will it be released some day ?
<Alpounet> Nobody knows ;-)
<hcarty> Unfortunately I don't think Qt OCaml has been updated since the last SoC ended
<hcarty> Or OSP rather
<Spiwack> Pierre-Yves hoped to have it done by this summer
<Spiwack> (Qt-caml)
<hcarty> bouzu: Check out the Random module
<Spiwack> However I'm sure he didn't have the time
<Spiwack> So expect it within a year from now :)
<bouzu> thanks
<hcarty> Spiwack: Do you know if it has been updated or maintained at all since the last OSP? It seemed quite promising, so it would be a shame for it to go away
<hcarty> I've been reasonably happy with lablgtk + Cairo for my limited needs so far
<Spiwack> I don't actually know, as I haven't seen the authors for a while, but I believe so
<palomer> I've always wondered
<palomer> would it be possible to have something like gtk's frame in ncurses
bouzu has quit [Client Quit]
<Spiwack> (gotta go, goodbye everyone)
<Alpounet> maybe we should invest it for Batteries ? :-p
Spiwack has quit ["Leaving"]
jah has joined #ocaml
<hcarty> I think FrGui, or something similar, is worth investing in for Batteries
<hcarty> I'd volunteer to work on it, but it would be close to a year, most likely, before I really could
<Yoric[DT]> FrGui was nice.
<flux> maybe these projects don't get the lift because there doesn't seem to be much demand for gui apps written in ocaml :-/
<flux> of open source ones I can only think of unison and mldonkey
<flux> oh, and some ides
<Camarade_Tux> and soon, a web browser ! \o/
<Camarade_Tux> ...soon...
<Alpounet> when ?!
marmottine has quit [Read error: 110 (Connection timed out)]
<Camarade_Tux> after webkit-gtk has the code for offscreen rendering
<Camarade_Tux> which will probably happen after I make it work properly for windows so I can trade it for that feature :p
<hcarty> flux: Yes - I wonder if the limiting factor is "I don't like lablgtk" or "I don't need/want to write a GUI app in OCaml"
<Camarade_Tux> I've only really enjouyed lablgtk after I wrote a library for it (actually a binding generator for all the .*gtk.* libraries)
<Camarade_Tux> s/u//
<palomer> is frgui still being maintained?
<palomer> reactive programming
<palomer> sounds like my 9th grade chemistry experiment
<Alpounet> Camarade_Tux, if you create an OCaml web browser, I'll be your first user :-)
<hcarty> palomer: I don't think it's being maintained. But it's in a usable, if very basic, state now in the 2007 Jane St. OSP Subversion repository
<Camarade_Tux> thanks :)
<flux> frgui looked very interesting, but I haven't yet have had the need to write a gui app in ocaml
<flux> ..well, atleast not one that would use widgets, I've written some SDL ones
<hcarty> palomer: There is also a Google Code repo, but it is an earlier and significantly different implementation
<Camarade_Tux> I'd like to port MMM to gtk
<flux> camarade_tux, unfortunately the core of your web browser isn't written in ocaml, which could be a compelling argument for using the browser in the name of browsing safety :)
<Camarade_Tux> flux, that's the reason I want to port MMM to gtk ;)
<flux> MMM looks ooold :)
<flux> but if its core is excellent, then perhaps it's worth the trouble..
<flux> I mean, how do websites these days look like when seen through that?
<flux> the screenshot on the website isn't all that bad
<flux> but hardly multimedia :)
<Alpounet> flux, SDL is rather for games or at least multimedia stuffs
<flux> alpounet, yes, I know
<flux> alpounet, http://modeemi.fi/~flux/goba/ :)
<maxote> what's MMM?
<flux> a web browser written in o'caml: http://pauillac.inria.fr/~rouaix/mmm/
<Alpounet> flux, great stuff ! You should put it into OCaml debian repos
<palomer> I once wrote a game using SDL
<Alpounet> Me too, but I was a C++ guy at that time.
<Camarade_Tux> flux, html support must be updated and then, if possible, IE6 level (minus the bugs ;) ) would probably be enough (it should be possible to select the rendering engine per tab so webkit will always be available)
<palomer> lemme upload a video of it on youtube
<flux> camarade_tux, the license of MMM is perhaps less than optimal..
<flux> camarade_tux, I guess it doesn't have javascript, and that would basically need to be implemented without other libraries too
<Camarade_Tux> I had forgotten the license =/
<Camarade_Tux> js should be doable with some time
Snark has quit ["Ex-Chat"]
<Alpounet> and motivation.
jbms has left #ocaml []
* Camarade_Tux whistles :p
jeanb-- has joined #ocaml
<Camarade_Tux> although there are already some nice js libs in ocaml
<flux> indeed, forgot about them
<flux> but do they actually run js?
<flux> but atleast they handle the parsing
<palomer> so...what's reactive programming?
<flux> palomer, well, did you look at the frgui examples?
<flux> getting them (js interpreters) to be really fast can be challenging, looking what people've needed to do to get that :)
<flux> hey, perhaps metaocaml could help with that..
<flux> which reminds me, how's metaocaml doing these days?
<Camarade_Tux> I don't intend to get fast JS ;p
<flux> I think someone said they (metaocaml) were supposed to follow O'Caml HEAD..
marmottine has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
marmottine has quit [Read error: 60 (Operation timed out)]
<Camarade_Tux> I remember that oo
<Camarade_Tux> *too
<palomer> http://www.youtube.com/watch?v=mfXryI67CeM <--game I wrote using SDL
<palomer> you'll need to boost the volume
<Camarade_Tux> argh, vista ! :p
<palomer> I don't know how to screencap in linux
<palomer> (the game is written in linux)
<Camarade_Tux> mplayer can do it
<palomer> mplayer can screencap??!?
<Yoric[DT]> It can ?
marmottine has joined #ocaml
<palomer> oh, mpeg creates jpeg sequences
<Camarade_Tux> that should be mjpeg
<palomer> I think that takes a screencap of the movie being played, no?
<Camarade_Tux> no, no, it works for the whole screen
* Camarade_Tux actually tried to find the command again
<Camarade_Tux> anyone know where are the links you "saved" on reddit ? ><
Narrenschiff has joined #ocaml
<Camarade_Tux> -s can take a resolution instead of a name (so -s 1280x800)
<palomer> what about sound?
<Camarade_Tux> I don't know, I've never tried it
kaustuv_ has quit [Remote closed the connection]
jeanb-- has joined #ocaml
kaustuv_ has joined #ocaml
jeanbon has quit [Nick collision from services.]
jeanb-- is now known as jeanbon
<palomer> hah, recordmydesktop works!
<palomer> but I need to change to metacity
Ariens_Hyperion has joined #ocaml
<palomer> no sound though
Narrenschiff has quit []
<palomer> oh well, can't have my cake and eat it too
ygrek has joined #ocaml
Narrenschiff has joined #ocaml
hkBst has joined #ocaml
_andre has quit ["leaving"]
Yoric[DT] has quit ["Ex-Chat"]
Ariens_Hyperion has quit [Read error: 110 (Connection timed out)]
Yoric[DT] has joined #ocaml
marmottine has quit [Read error: 110 (Connection timed out)]
jah has quit []
Fullma has joined #ocaml
<Alpounet> Gn all.
Alpounet has quit ["Quitte"]
tomaw is now known as meanie
meanie is now known as tomaw
jackie__ has joined #ocaml
seafood has joined #ocaml
Narrenschiff has quit []
jonafan_ has joined #ocaml
slash_ has quit [Client Quit]
jeanbon has quit [Read error: 110 (Connection timed out)]
jlouis has quit [Read error: 60 (Operation timed out)]
jlouis has joined #ocaml
itewsh has quit ["There are only 10 kinds of people: those who understand binary and those who don't"]
jonafan has quit [Read error: 145 (Connection timed out)]
jackie__ has quit [Remote closed the connection]
jonafan_ is now known as jonafan
det_ has joined #ocaml
det has quit [Read error: 104 (Connection reset by peer)]
Associat0r has joined #ocaml
Associat0r has quit [Read error: 104 (Connection reset by peer)]
hkBst has quit [Read error: 104 (Connection reset by peer)]
jsk has quit ["Leaving."]
verte has joined #ocaml
<palomer> ocamlers do it better
willb has quit [Read error: 110 (Connection timed out)]
<mrvn> palomer: You invented your own programming language for your game and called it linux?
<mrvn> palomer: Does the tube ever change direction?
Yoric[DT] has quit ["Ex-Chat"]
komar_ has quit [Remote closed the connection]
m3ga has joined #ocaml