gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.0+beta1 http://permalink.gmane.org/gmane.comp.lang.caml.inria/49168
jakedouglas has quit [Quit: Leaving.]
thieusoai1 has joined #ocaml
thieusoai1 has left #ocaml []
<travisbrady> wow. I wrote two implementations of the same program. One in OCaml and one in java. OCaml uses 24M of ram at max and java uses 400M
<travisbrady> Ocaml is roughly 25% faster as well
<travisbrady> OCaml really should be a lot more popular.
jakedouglas has joined #ocaml
<derdon> travisbrady: it's not a secret that Java is slow and OCaml is fast ;)
<derdon> travisbrady: but you're right: it should be more popular
<travisbrady> derdon: indeed. I was more surprised at the memory difference.
travisbrady has quit [Quit: travisbrady]
jakedouglas has quit [Quit: Leaving.]
ftrvxmtrx has quit [Ping timeout: 245 seconds]
neorab has joined #ocaml
ftrvxmtrx has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
Associat0r has joined #ocaml
__marius__ has quit [Remote host closed the connection]
joewilliams is now known as joewilliams_away
thrasibule has quit [Ping timeout: 240 seconds]
derdon has quit [Ping timeout: 264 seconds]
Edward__ has quit []
valross has quit [Quit: Ex-Chat]
elehack is now known as elehack|afk
jakedouglas has joined #ocaml
__marius__ has joined #ocaml
rbancroft has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 245 seconds]
jakedouglas has quit [Quit: Leaving.]
ftrvxmtrx has joined #ocaml
travisbrady has joined #ocaml
patronus has quit [Quit: leaving]
patronus has joined #ocaml
jakedouglas has joined #ocaml
thrasibule has joined #ocaml
RyanRN has joined #ocaml
joewilliams_away is now known as joewilliams
joewilliams is now known as joewilliams_away
Associ8or has joined #ocaml
Associat0r has quit [Ping timeout: 245 seconds]
ulfdoz has joined #ocaml
thrasibule has quit [Ping timeout: 264 seconds]
emmanuelux has quit [Remote host closed the connection]
jakedouglas has quit [Quit: Leaving.]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz_ has quit [Client Quit]
ulfdoz has joined #ocaml
jakedouglas has joined #ocaml
travisbrady has quit [Quit: travisbrady]
Yoric has joined #ocaml
ulfdoz has quit [Ping timeout: 276 seconds]
patronus has quit [Remote host closed the connection]
patronus has joined #ocaml
__marius__ has quit [Remote host closed the connection]
Amorphous has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
jeddhaberstro has quit [Quit: jeddhaberstro]
Amorphous has joined #ocaml
ikaros has joined #ocaml
mjsor has joined #ocaml
mjsor has quit [Remote host closed the connection]
jakedouglas has quit [Quit: Leaving.]
ftrvxmtrx has quit [Quit: Leaving]
ttamttam has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
Yoric has quit [Quit: Yoric]
patronus has quit [Remote host closed the connection]
patronus has joined #ocaml
f[x] has joined #ocaml
ygrek has joined #ocaml
Yoric has joined #ocaml
ftrvxmtrx has joined #ocaml
Yoric has quit [Ping timeout: 252 seconds]
_unK has joined #ocaml
ygrek has quit [Ping timeout: 245 seconds]
orphee has joined #ocaml
orphee has left #ocaml []
oriba has joined #ocaml
_unK has quit [Remote host closed the connection]
oriba has quit [Quit: Verlassend]
emmanuelux has joined #ocaml
robthebob has joined #ocaml
<robthebob> is anybody aware of a minimum version of ocaml to use with batteries included?
Edward_ has joined #ocaml
filp has joined #ocaml
<mfp> robthebob: 3.11 IIRC
<robthebob> mfp, thanks. I am running 3.11.0 and the syntax extensions will not load properly in the toplevel
<robthebob> i'm using the provided ocamlinit file
<robthebob> the output is: Loading syntax extensions...
<robthebob> Exception: Symtable.Error _.
<robthebob> after which any entry causes an exception:
<robthebob> # 5;;
<robthebob> Fatal error: exception Invalid_argument("index out of bounds")
<robthebob> it works fine if I go to 'battop.ml' and change "let ext_syntax = true" to false on line 35
<mfp> yes, I can see in my #ocaml logs that somebody had the same pb a few months ago and used a similar workaround
<Associ8or> does batteries work with 3.12 and TWT?
<Associ8or> also does anyone use TWT?
<mfp> few people if any, I believe
<mfp> haven't tried batteries + 3.12, but I can't see anything in 3.12's Changes that indicates it won't work
<Associ8or> TWT would also work with it?
<mfp> IIRC TWT is just doing dummy textual preprocessing, right? then it should be OK assuming batteries' syntax extensions don't confuse it
<Associ8or> I think so
<mfp> robthebob: do you know how to get the toplevel to show the Symtable.Error exception in full? that'd be most helpful
<robthebob> ah good point mfp, i'll try using OCAMLRUNPARAM="b"
<mfp> I don't think that'll work, since the exception doesn't escape the toplevel
<robthebob> you're right it doesnt
<mfp> hmm maybe if you copy bytecomp/symtable.cmo and .cmi from the ocaml sources to the current dir, and #load "symtable.cmo";; before loading the syntax extensions
<robthebob> i haven't compiled ocaml from source, so that isn't really possible unfortunately
<robthebob> i'm just going for lunch
<mfp> you can try this:
<robthebob> i'll have a grep when i get back
<mfp> use Std.dump to print the exn
<mfp> that'll give the in-mem representation, which can then be interpreted using the type def
<robthebob> # Std.dump;;
<robthebob> Fatal error: exception Invalid_argument("index out of bounds")
<robthebob> (Program not linked with -g, cannot print stack backtrace)
<mfp> you have to (1) disable the syntax extensions
<mfp> (2) define let pr_exn f = try f () with e -> Std.dump e
<robthebob> thanks, i will try more when i get back
<mfp> and finally (3) pr_exn (fun () -> ... stuff from ocamlinit that loads the extensions ...)
ikaros_ has joined #ocaml
ikaros has quit [Ping timeout: 245 seconds]
avsm has joined #ocaml
Associ8or has quit [Quit: Associ8or]
patronus has quit [Remote host closed the connection]
patronus has joined #ocaml
thrasibule has joined #ocaml
patronus has quit [Remote host closed the connection]
patronus has joined #ocaml
derdon has joined #ocaml
thrasibule has quit [Ping timeout: 245 seconds]
<robthebob> pr_exn (fun () -> Topfind.load_deeply ["camlp4"; "batteries.pa_string.syntax";
<robthebob> "batteries.pa_comprehension.syntax"] );;
<robthebob> - : string = "((\"Symtable.Error\"), (\"Dynlink\"))"
<robthebob> thats for mfp btw
<robthebob> good tip!
_andre has joined #ocaml
<robthebob> so if i #require "dynlink" before the loading of camlp4 etc then it works!
<robthebob> i think this may be a bug in findlib?
elehack|afk has quit [Quit: not a typewriter]
elehack has joined #ocaml
elehack has quit [Client Quit]
Associat0r has joined #ocaml
elehack has joined #ocaml
<mfp> robthebob: IIRC right after 3.11 was released camlp4's META didn't specify the dynlink dep and that was solved in a subsequent findlib release
<sgnb> I would even say thet dynlink was statically linked into camlp4's cma at one time
<mfp> at any rate the workaround can be included in batteries, Topfind.load_deeply ["dynlink"; "camlp4"; "batteries.pa_string.syntax"; "batteries.pa_comprehension.syntax"]; in battop.ml should do the trick
<robthebob> ah I see, yes
<robthebob> i put the #require in battop.ml, but your solution is cleaner still
<mfp> sgnb: ic, so that's why it worked in bytecode without loading dynlink
filp has left #ocaml []
Associat0r has quit [Quit: Associat0r]
__marius__ has joined #ocaml
<gildor> mfp: can I ask you a question about ocsigen?
<gildor> mfp: do you use staticmode for your website ?
<mfp> yes
<gildor> mfp: is there a way to know what is the path to static dir ?
<gildor> mfp: from within the OCaml code
<mfp> hmm I've never seen that
<gildor> (because I want to make a link between the CSS stored in /static/ from another url)
<mfp> ah
<mfp> do you mean the path on the local FS,
<mfp> or just creating a link from another page?
<gildor> the URL of the CSS in fact
<mfp> the stuff in the static dir doesn't correspond to a service, but you can generate the URI manually
<gildor> ok
<mfp> Eliom_predefmod.Xhtml.css_link
<mfp> takes an ~uri which you can build manually with XHTML.M.uri_of_string
<gildor> the uri has to be absolute
<mfp> so the pb is that you want the "root" of the site?
<gildor> yes
<mfp> I don't remember if there's a function to get it somewhere in Eliom_sessions or such
<mfp> but you can build it as follows:
<mfp> if you have a service mounted at the top of the site, generate a string url with make_string_uri ~absolute:true ~service ~sp () and then you can concatenate the (sub)path to the static file
<mfp> you're always going to have a service at the top anyway, so it can serve as the site root used to build absolute URLs as strings
<sgnb> it sounds cleaner to register an external service (but basically is the same)
<gildor> in fact there is Eliom_sessions.get_site_dir which seems to give the root of the website
<mfp> good find
<gildor> it works
<gildor> sgnb: is there something integrated to create absolute URL to static resource files (provided by staticmod) ?
<sgnb> gildor: it sounds silly, but I don't know how it could be... staticmod is completely independant from eliom last time I checked
<sgnb> I would probably create a so-called "external" service in this case
_unK has joined #ocaml
<gildor> sgnb, mfp: are there a good example website of ocsigen that I can study to know how to do basic things
<gildor> (PG connection, page template et al)
<gildor> nurpawiki? eigenclass?
<mfp> this is my micro-blogging engine > http://github.com/mfp/ocsiblog
<mfp> doesn't use a DB, though, so probably not very helpful as a reference
<sgnb> there is nurpawiki indeed... also lambdium... and ocsimore, of course
<mfp> gildor: have you looked at ocsimore?
<sgnb> gildor: it depends on what you want to do
<sgnb> gildor: the ocsigen.org website itself can provide some inspiration
<gildor> learning ?
<gildor> sgnb: I am quite afraid by ocsigen.org for now (after it has been programmed by almost the hand of god -- in ocsigen world)
<sgnb> gildor: don't be
murph has quit [Ping timeout: 265 seconds]
<sgnb> for a long time, it was really a shame
<sgnb> it has been better since it uses ocsimore
<sgnb> there is still room for improvements
_andre has quit [Quit: leaving]
joewilliams_away is now known as joewilliams
_andre has joined #ocaml
_andre has quit [Quit: Lost terminal]
_andre has joined #ocaml
__marius__ has quit [Remote host closed the connection]
jakedouglas has joined #ocaml
Snark has joined #ocaml
__marius__ has joined #ocaml
_andre has quit [Quit: Lost terminal]
_andre has joined #ocaml
__mariu__ has joined #ocaml
__marius__ has quit [Ping timeout: 260 seconds]
boscop_ has joined #ocaml
boscop has quit [Ping timeout: 276 seconds]
travisbrady has joined #ocaml
ttamttam has quit [Quit: Leaving.]
julm has quit [Ping timeout: 252 seconds]
julm has joined #ocaml
travisbrady has quit [Ping timeout: 245 seconds]
travisbrady has joined #ocaml
<hcarty> I just found Batteries' pa_string support for named printf elements. That's too cool.
itewsh has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
<flux> how does it work?
<hcarty> flux: Print.printf p"%(name:s) has %{xs:int list}" ~name:"X. Leroy" ~xs:[1; 2; 3]
<flux> oh, nice
<flux> I wonder how the same approach would be modified to work for generating sql
<flux> hm, or maybe html as well
__marius__ has joined #ocaml
<hcarty> Likely so
__mariu__ has quit [Ping timeout: 260 seconds]
<hcarty> It is not in the documentation as far as I can tell, but it is in the pa_string example
ygrek has joined #ocaml
komar_ has joined #ocaml
komar_ has quit [Quit: WeeChat 0.2.6]
Edward_ has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
iratsu has quit [Ping timeout: 245 seconds]
__marius__ has quit [Remote host closed the connection]
iratsu has joined #ocaml
Associat0r has joined #ocaml
__marius__ has joined #ocaml
Snark has quit [Quit: Ex-Chat]
<flux> does ocsigen's xhtml module know about canvas these days?
ygrek has quit [Ping timeout: 245 seconds]
<elehack> flux, I don't know for sure, but I doubt it. xhtml supports XHTML 1.0 and perhaps 1.1; canvas won't be in a real XHTML (only the XML serialization of HTML5)
Anarchos has joined #ocaml
ttamttam has joined #ocaml
itewsh has quit [Quit: There are only 10 kinds of people: those who understand binary and those who don't]
<adrien> anyone have a link/study about cache-friendly algorithms? I'm trying to make someone understand why avoiding to hit swap is a real need
<theDroggl> if you find something please post the link here, sounds like an interesting topic
<adrien> I'm not even sure that the best "name" for them: google doesn't seem to return many interesting or general results
Edward_ has joined #ocaml
<gildor> adrien: you mean CPU cache ?
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
<theDroggl> if I got it right it is about RAM caching, i.e. swapping
<adrien> gildor: yeah, cpu cache because I don't think there's a lot of litteratute about swap and the problem is the same
<gildor> the AlphaSortSigmod paper is precisely about that
<gildor> but it is quite old and as a matter of fact things have changed
ttamttam has quit [Quit: Leaving.]
Associat0r has quit [Quit: Associat0r]
avsm has quit [Quit: Leaving.]
__marius__ has quit [Remote host closed the connection]
_andre has quit [Quit: leaving]
komar__ has joined #ocaml
komar__ is now known as komar_
ulfdoz has quit [Ping timeout: 265 seconds]
boscop_ has quit []
jeddhaberstro has joined #ocaml
fraggle_ has quit [Quit: -ENOBRAIN]
fraggle_ has joined #ocaml
__marius__ has joined #ocaml
ftrvxmtrx has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml
ikaros_ has quit [Quit: Leave the magic to Houdini]
joewilliams is now known as joewilliams_away
komar_ has quit [Remote host closed the connection]
komar_ has joined #ocaml
__marius__ has quit [Remote host closed the connection]
__marius__ has joined #ocaml