gildor changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 3.12.1 http://bit.ly/nNVIVH
milosn has quit [Ping timeout: 248 seconds]
<oriba> mark_slice eats up about 10% of my time, caml_page_table_lookup about 7%
<oriba> how can I optimize?
<adrien> operating on big sets?
everyonemines has joined #ocaml
<oriba> using ocamlgraph; not sure what it is internally, but I also use Map
<oriba> the program easty nearly all my ram
<oriba> and swaps
<oriba> but the above mentioned gprof reults are without swapping
<oriba> but nevertheless it needs much ram
<adrien> I mean: do you yse a set/map/whatever with lots oelements?
<oriba> 4194304 entries
<oriba> so, it's not a very small number
<everyonemines> You can use Array.iter instead
<oriba> depends on what you understand under "lots"
<everyonemines> and do in-place operations
<adrien> you can try to tweak the garbage collector to make it work less, see the documentation of the Gc module
<everyonemines> map creates a new array every time, then it needs to be GC'd
<adrien> of course, not giving work to the gc in the first place is an even better solution
<adrien> if you want to play with Gc, increase the size of the minor heap
<oriba> ok, I will try this
<adrien> night
<oriba> can#t this be done via OCAMLRUNPARAM?
<oriba> night, adrien
<adrien> it can iirc
<oriba> ok
<everyonemines> but it sounds to me you need to write more imperative style code
<oriba> hmhh
<oriba> I used pcamlgraph with imperative ...
<oriba> I used ocamlgraph with imperative graphs
<oriba> maybe it's just too much data?
<oriba> the program needs up to more than 1.2 GB
<oriba> maybe I need to change my data from strings to int's, before feeding into the graphs
<adrien> Gc.(increase minor_heap_size to fit the L2 cache, lower space_overhead before a compaction, trigger compactions when you want them to happen)
emmanuelux has quit [Ping timeout: 240 seconds]
<oriba> adrien, I tried around with Gc.compact and usd print_stats from Gc. here the stats beofre and after a Gc.compact(): http://paste.pocoo.org/show/515612/
<oriba> does this say you something?
<oriba> (I'm far from being a Gc expert...)
<oriba> with "minor_heap_size to fit the L2 cache", you mean the minor heap size should be as big as the L2 cache?
destrius has joined #ocaml
<oriba> hmhh-... with a bigger minor heap size, now mark_size is down to 7%
<oriba> and compare_val is at top now ;)
nixfreak has quit [Ping timeout: 244 seconds]
jknick has joined #ocaml
nixfreak has joined #ocaml
oriba has quit [Quit: oriba]
ftrvxmtrx has quit [Read error: Connection reset by peer]
ftrvxmtrx has joined #ocaml
adrien has quit [Read error: Operation timed out]
jknick has quit [Quit: leaving]
adrien has joined #ocaml
jknick has joined #ocaml
sepp2k1 has quit [Remote host closed the connection]
sebz_ has quit [Quit: Computer has gone to sleep.]
khia0 has joined #ocaml
khia0 has left #ocaml []
dsheets has quit [Ping timeout: 244 seconds]
nixfreak has quit [Ping timeout: 252 seconds]
dsheets has joined #ocaml
sebz has joined #ocaml
sebz has quit [Client Quit]
sebz has joined #ocaml
Drakken has joined #ocaml
dnolen has joined #ocaml
dnolen has quit [Quit: dnolen]
<everyonemines> the guy here the other day wanted to know what I was working on
<everyonemines> it's an automatic regex generator from examples
arubin has quit [Quit: arubin]
<Drakken> dan[~]$ ocaml
<Drakken> Objective Caml version 3.12.1
<Drakken> # #load "camlp4o.cma";;
<Drakken> Error: Reference to undefined global `Dynlink'
<Drakken> oh goodie
<Drakken> more linking issues
larhat has joined #ocaml
ulfdoz has joined #ocaml
sebz has quit [Quit: Computer has gone to sleep.]
chmmn has joined #ocaml
chmmn has quit [Quit: 离开]
chmmn has joined #ocaml
<Drakken> # Grammar.Entry.print Pcaml.expr;;
<Drakken> Error: Unbound module Grammar
ankit9 has quit [Quit: Leaving]
EmmanuelOga has quit [Ping timeout: 244 seconds]
<everyonemines> what are you trying to use camlp4 for
<everyonemines> and do you have findlib installed
ulfdoz has quit [Ping timeout: 260 seconds]
<Drakken> I have findlib, although I haven't been using it for this particular program, and want to use camlp4 to write some macros/syntax extensions.
<everyonemines> #use "topfind";;
<everyonemines> #require "library";;
<Drakken> I didn't download any packages.
chmmn has quit [Quit: 离开]
<everyonemines> Huh? That's how you use libraries in the toplevel with findlib.
<Drakken> Why do I need findlib when the libs are all in /usr/local/lib/*?
hto_ has quit [Quit: Lost terminal]
hnrgrgr has quit [Ping timeout: 258 seconds]
hnrgrgr has joined #ocaml
ftrvxmtrx_ has joined #ocaml
ankit9 has joined #ocaml
raichoo has joined #ocaml
<everyonemines> Did you get it working then?
edwin has joined #ocaml
emmanuelux has joined #ocaml
cago has joined #ocaml
ankit9 has quit [Quit: Leaving]
ankit9 has joined #ocaml
milosn has joined #ocaml
ikaros has joined #ocaml
<adrien> Drakken: rely on ocamlfind/findlib
<adrien> in the toplevel: #use "topfind";; #camlp4o;;
everyonemines has left #ocaml []
ikaros has quit [Quit: Ex-Chat]
thomasga has joined #ocaml
<Drakken> adrien how about this:
<Drakken> dan[onlisp]$ cat camlp4.ml
<Drakken> Grammar.Entry.print Pcaml.expr;;
<Drakken> dan[onlisp]$ ocamlfind ocamlc -c -package dynlink,camlp4 -syntax camlp4o -linkpkg ./camlp4.ml
<Drakken> File "./camlp4.ml", line 1, characters 0-19:
<Drakken> Error: Unbound module Grammar
Kakadu has joined #ocaml
<adrien> Drakken: I don't have any "grammar.cm*" file from camlp4, only camlp5
<adrien> the manual seems to mention it but I don't have any module named like that
<adrien> Camlp4.Sig.Grammar
<adrien> also, you don't need the syntax stuff in your example
<Drakken> dan[onlisp]$ cat camlp4.ml
<Drakken> Camlp4.Sig.Grammar.Entry.print Pcaml.expr;;
<Drakken> dan[onlisp]$ ocamlfind ocamlc -c -package dynlink,camlp4 -linkpkg ./camlp4.ml
<Drakken> File "./camlp4.ml", line 1, characters 0-30:
<Drakken> Error: Unbound module Camlp4
<adrien> can you try without -linkpkg?
<Drakken> adrien then how do I display the current standard grammar?
<adrien> it's *only* used when linking
<Drakken> adrien no change.
<adrien> this is the error I get: Error: Unbound module Camlp4.Sig.Grammar.Entry
<adrien> does it say "Camlp4" or "Camlp4.Sig.Grammar.Entry"?
<Drakken> just "Camlp4"
<adrien> how did you install ocaml/findlib?
<adrien> also, don't pass -package dynlink; ocamlfind pulls that as a dependency automatically
<Drakken> I think I downloaded the tarball for each and installed according to the INSTALL file or whatever was in the distribution.
ikaros has joined #ocaml
<Drakken> Oh, and do I really want camlp4, or is it camlp5? I don't see camlp5 in `ocamlfind list`, but that's the new name of the old syntax system, right? So are my camlp4 libs the old or the new? And if they're the new, is there a Grammar module in the new system or did that get changed?
<adrien> camlp5 is the new name of the old camlp4, yes
<Drakken> wtf
<Drakken> It's like they're trying to confuse things as much as possible.
<flux> and succeeding!
<adrien> yruk
<Drakken> with me at least :(
<flux> it is indeed quite confusing. too bad inria never thought of changing the name when they made the new backwards-incompatible version.
<adrien> camlp5 in godi seems fubared: no META and it's installed under "std-lib"
<adrien> flux: it's not too late for a new name! :P
<adrien> so we can have three names =)
<flux> I think the damage has been done already
<Drakken> So what are all these camlp4 libs in my installation? New or old?
<adrien> neqw
<adrien> new*
<flux> was it ocaml 3.09 that still had the old camlp4?
<diml> yes
_andre has joined #ocaml
<adrien> I didn't know it was possible for a package in godi not to have a META file; camlp5 proved me wrong ><
<Drakken> So the Grammar module might have been moved or renamed or something.
<Drakken> and where's the FM?
<diml> Drakken: the Grammar module is Camlp4.PreCast.Gram
<diml> your example is now: Camlp4.PreCast.Gram.Entry.print Format.std_formatter Camlp4.PreCast.Syntax.expr
<Drakken> diml are there some docs somewhere?
destrius has quit [Quit: Leaving.]
<diml> i don't know, i only read Sig.ml from the ocaml sources...
<Drakken> diml okay thanks
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
Cyanure has joined #ocaml
<Drakken> diml how do you know Gram is inside Camlp4.PreCast?
sebz_ has joined #ocaml
<Drakken> oh, I guess it's in PreCast.mli
<Drakken> What's the status of the revised syntax? Is it recommended for new code?
<flux> I'm under the impression that a minority uses it, and it doesn't seem like it's about to change
ikaros has quit [Ping timeout: 252 seconds]
<flux> also perhaps it's a little bit more difficult to teach to newcomers, given that it requires the use of camlp4 and camlp4 error messages are worse than non-camlp4-errors :(
raichoo has quit [Read error: Connection reset by peer]
raichoo has joined #ocaml
<adrien> I like half of it; would it be possible to have a mix? =)
musically_ut has joined #ocaml
ikaros has joined #ocaml
ankit9 has quit [Ping timeout: 248 seconds]
<musically_ut> Is there a way of converting generic exceptions to string?
<adrien> musically_ut: see the Printexc module
<adrien> for use in a particular setting?
<musically_ut> adrien, looking at it, thanks.
<musically_ut> adrien, perfect, just what I needed for prototyping.
<adrien> =)
ftrvxmtrx_ has quit [Quit: Leaving]
ftrvxmtrx_ has joined #ocaml
sebz_ has quit [Quit: Computer has gone to sleep.]
thelema has quit [Remote host closed the connection]
thelema has joined #ocaml
Cyanure has quit [Remote host closed the connection]
oriba has joined #ocaml
ftrvxmtrx_ has quit [Ping timeout: 255 seconds]
ftrvxmtrx_ has joined #ocaml
ftrvxmtrx_ has quit [Ping timeout: 244 seconds]
ankit9 has joined #ocaml
mcclurmc has quit [Excess Flood]
ftrvxmtrx_ has joined #ocaml
mcclurmc has joined #ocaml
_habnabit has quit [Quit: ZNC - http://znc.sourceforge.net]
_habnabit has joined #ocaml
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
mcclurmc has quit [Excess Flood]
mcclurmc has joined #ocaml
ftrvxmtrx has quit [Quit: This computer has gone to sleep]
EmmanuelOga has joined #ocaml
Kakadu has quit [Quit: Page closed]
<Drakken> Okay, the code compiled, but now the linker says global Camlp4 is undefined.
<adrien> -linkpkg?
<Drakken> yep
mnabil has joined #ocaml
<Drakken> where "yep = "It's already included" && "still not working"
<adrien> iirc it says which object is refering the module: is it your code?
mcclurmc has quit [Excess Flood]
<adrien> also, you can pass -verbose and pastebin the whole command-line + output
mcclurmc has joined #ocaml
<Drakken> ocamlfind ocamlc -verbose -o print_expr.b -package camlp4 -linkpkg print_expr.cmo
<Drakken> Effective set of compiler predicates: pkg_camlp4,autolink,byte
<Drakken> + ocamlc.opt -verbose -o print_expr.b -I /usr/local/lib/ocaml/camlp4 print_expr.cmo
<Drakken> File "_none_", line 1, characters 0-1:
<Drakken> Error: Error while linking print_expr.cmo:
<Drakken> Reference to undefined global `Camlp4'
<Drakken> ocamlc.opt returned with exit code 2
<Drakken> make: *** [print_expr.b] Error 2
<adrien> I guess you need to use -package camlp4.FOO
<adrien> see the output of "ocamlfind list" (I'm speculating here)
<Drakken> what's FOO? gramlib?
<f[x]> for syntax extension it is camlp4.extend
mnabil has quit [Read error: Connection reset by peer]
<Drakken> f[x] I'm not extending anything yet. I'm just trying to print out a grammar entry.
<f[x]> then try lib
<f[x]> or better don't link anything at all
<f[x]> use it directly : camlp4o print_expr.cmo source.ml
<f[x]> or the same in toplevel
<Drakken> well, camlp4o worked. Does that tell us anything about the error from ocamlc?
<Drakken> btw, omitting -linkpkg had no effect.
<adrien> you'd link your program in order to get an executable; it's not really how you do something with camlp4 usually
<adrien> you make a module that is dynlink'ed
<f[x]> use camlp4.fulllib and/or .extend and/or .quotations
Kakadu has joined #ocaml
sepp2k has joined #ocaml
<Drakken> adrien I want to create executables eventually, so I'd like to find out why the code has an undefined reference.
ttamttam has joined #ocaml
TaXules has quit [Ping timeout: 245 seconds]
gnuvince_ is now known as gnuvince
<diml> Drakken: you have to use -package camlp4.lib, the camlp4 package is only for syntax extensions
<diml> but the entry will be empty. you have to add that line before printing it:
<diml> let module M = Camlp4OCamlParser.Make(Camlp4OCamlRevisedParser.Make(Camlp4.PreCast.Syntax)) in ()
<diml> you can then compile it with: ocamlbuild -tag use_dynlink,use_camlp4_full print_expr.byte
edwin has quit [Remote host closed the connection]
nixfreak has joined #ocaml
nixfreak has quit [Ping timeout: 240 seconds]
nixfreak has joined #ocaml
_andre has quit [Quit: Lost terminal]
_andre has joined #ocaml
ttamttam has quit [Ping timeout: 255 seconds]
<Drakken> diml is there some documentation about all this or do I have to read the source code to figure it out?
<Drakken> The weekend is approaching and I don't want to be stuck with nothing to do.
<diml> Drakken: there is some doc here: http://brion.inria.fr/gallium/index.php/Camlp4
<diml> for the "let module M = ..." i don't remember how i found this
probst has quit [Quit: probst]
dnolen has joined #ocaml
dnolen has quit [Client Quit]
ankit9 has quit [Quit: Leaving]
spearalot has joined #ocaml
raichoo has quit [Quit: leaving]
<Drakken> diml thanks
Drakken has left #ocaml []
ijp has joined #ocaml
sebz has joined #ocaml
Drakken has joined #ocaml
kuscotopia has joined #ocaml
<kuscotopia> How can I define a Hashtbl of a certain type within a record?
hto has joined #ocaml
<kuscotopia> I know I can use Hashtbl.create and Hashtbl.add to define the type of the hash table...but I would like to do so within a type definition.
<thelema> kuscotopia: type r = {x: (int, string) Hashtbl.t}
<kuscotopia> You all always make it look so easy.
<kuscotopia> Thank you.
<thelema> :)
oriba has quit [Quit: oriba]
sebz has quit [Quit: Computer has gone to sleep.]
cago has quit [Quit: Leaving]
ulfdoz has joined #ocaml
ftrvxmtrx_ has quit [Quit: Leaving]
ankit9 has joined #ocaml
thelema has quit [Ping timeout: 245 seconds]
larhat has quit [Quit: Leaving.]
thelema has joined #ocaml
maufred has quit [Quit: leaving]
edwin has joined #ocaml
spearalot has quit [Quit: Computer has gone to sleep]
_habnabit has quit [Changing host]
_habnabit has joined #ocaml
ttamttam has joined #ocaml
jonludlam has left #ocaml []
Modius has joined #ocaml
emmanuelux has quit [Remote host closed the connection]
kuscotopia has left #ocaml []
emmanuelux has joined #ocaml
ankit9 has quit [Quit: Leaving]
Anarchos has joined #ocaml
ftrvxmtrx has joined #ocaml
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
sepp2k has quit [Ping timeout: 248 seconds]
sepp2k has joined #ocaml
ikaros has quit [Quit: Ex-Chat]
metadave has joined #ocaml
metadave has left #ocaml []
ttamttam has quit [Read error: Connection reset by peer]
_andre has quit [Quit: leaving]
andre__ has joined #ocaml
andre__ is now known as Guest42039
Guest42039 has quit [Ping timeout: 244 seconds]
andre___ has joined #ocaml
andre___ is now known as Guest31583
Guest31583 has quit [Client Quit]
ygrek has joined #ocaml
nixfreak has quit [Remote host closed the connection]
ikaros has joined #ocaml
raichoo has joined #ocaml
fschwidom has joined #ocaml
srcerer has quit [Quit: ChatZilla 0.9.87 [Firefox 3.6.24/20111103063747]]
srcerer has joined #ocaml
sepp2k has quit [Remote host closed the connection]
fschwidom has quit [Ping timeout: 248 seconds]
sebz_ has joined #ocaml
ftrvxmtrx has quit [Quit: Leaving]
ftrvxmtrx has joined #ocaml
ftrvxmtrx has quit [Client Quit]
ftrvxmtrx has joined #ocaml
metasyntax|work has quit [Quit: WeeChat [quit]]
Kakadu has quit [Read error: Operation timed out]
NaCl has quit [Ping timeout: 248 seconds]
smango has quit [Ping timeout: 248 seconds]
NaCl has joined #ocaml
smango has joined #ocaml
thomasga has quit [Quit: Leaving.]
brooksbp has joined #ocaml
<adrien> NaCl: updated with many more flames: http://notk.org/~adrien/hq/
ztfw has joined #ocaml
EmmanuelOga has quit [Ping timeout: 244 seconds]
edwin has quit [Remote host closed the connection]
ijp has left #ocaml []
<NaCl> adrien: I would look at that, but my Internet connection would probably not be too happy
chambart has quit [Ping timeout: 260 seconds]
rgrinberg has quit [Ping timeout: 260 seconds]
chambart has joined #ocaml
oriba has joined #ocaml
ygrek has quit [Ping timeout: 248 seconds]
rgrinberg has joined #ocaml
sepp2k has joined #ocaml
Anarchos has joined #ocaml
Morphous has quit [Ping timeout: 255 seconds]
Morphous has joined #ocaml
hto has quit [Quit: Lost terminal]
milosn has quit [Quit: leaving]
milosn has joined #ocaml
raichoo has quit [Quit: leaving]
ikaros has quit [Quit: Ex-Chat]
ztfw has quit [Read error: Connection reset by peer]
ztfw has joined #ocaml
spearalot has joined #ocaml