flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.00.1 http://bit.ly/UHeZyT | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
ollehar has joined #ocaml
n06rin has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
mfp has quit [Ping timeout: 246 seconds]
ollehar has quit [Read error: Operation timed out]
n06rin has quit [Read error: Connection reset by peer]
carleastlund has joined #ocaml
<watermind> is there anything like haskell's hadock for OCaml?
<watermind> to produce html documentation from comments
<wmeyer> ocamldoc watermind
<wmeyer> it's included in the distro
<watermind> thank you wmeyer
madroach has quit [Ping timeout: 264 seconds]
madroach has joined #ocaml
q66 has quit [Quit: Leaving]
n06rin has joined #ocaml
darkf has joined #ocaml
talzeus has joined #ocaml
watermind has quit [Quit: Konversation terminated!]
Neros has quit [Ping timeout: 264 seconds]
pkrnj has joined #ocaml
<pippijn> wmeyer: I think I know what the problem is
<pippijn> wmeyer: after 12 hours of hunting
breakds has quit [Quit: Konversation terminated!]
<pippijn> haha
<pippijn> wmeyer: yep
<pippijn> wmeyer: fixed it
breakds has joined #ocaml
ben_zen has joined #ocaml
<pippijn> wmeyer: I'm happy :) the parser generator is now correct
ben_zen has quit [Ping timeout: 264 seconds]
<pippijn> wmeyer: now the untyped parse tree can be fully immutable
Obfuscate has joined #ocaml
mcsquiggedy has quit [Ping timeout: 240 seconds]
mcsquiggedy has joined #ocaml
n06rin has quit [Read error: Connection reset by peer]
n06rin has joined #ocaml
n06rin1 has joined #ocaml
n06rin has quit [Read error: Connection reset by peer]
ben_zen has joined #ocaml
pkrnj has quit [Quit: Computer has gone to sleep.]
n06rin1 has quit [Read error: Connection reset by peer]
n06rin has joined #ocaml
Arsenik has joined #ocaml
jk_ has joined #ocaml
jk_ has quit [Client Quit]
pkrnj has joined #ocaml
breakds has quit [Quit: Konversation terminated!]
Drup has joined #ocaml
ggole has joined #ocaml
Drup has quit [Client Quit]
Drup has joined #ocaml
ggole has quit [Ping timeout: 256 seconds]
ggole has joined #ocaml
derek_c has joined #ocaml
derek_c has quit [Read error: Connection reset by peer]
pkrnj has quit [Quit: Textual IRC Client: www.textualapp.com]
Simn has joined #ocaml
talzeus has quit [Remote host closed the connection]
carleastlund has quit [Quit: carleastlund]
ggole has quit [Read error: Connection reset by peer]
<adrien> morning
<pippijn> morning
<pippijn> _install/bin/arith-bison src/lang/glr/testsuite/elkhound/arith/tests/t0005.c 0.37s user 0.00s system 97% cpu 0.376 total
<pippijn> _install/bin/arith-menhir src/lang/glr/testsuite/elkhound/arith/tests/t0005.c 1.75s user 0.02s system 98% cpu 1.798 total
<pippijn> _install/bin/arith src/lang/glr/testsuite/elkhound/arith/tests/t0005.c 1.45s user 0.02s system 98% cpu 1.487 total
ggole has joined #ocaml
<pippijn> 1.5 seconds with the LALR(1) core
<pippijn> 2.8 with the GLR core
<pippijn> dypgen: 46 seconds
ulfdoz has joined #ocaml
<pippijn> 6.8 seconds with the pure GLR core (no LR for deterministic parts)
<pippijn> this is parsing 5MB of 1+1+1+1+1+1+...
<adrien> that's a fairly pathological case
<pippijn> not if it's deterministic
<pippijn> left-associative +
<pippijn> so it's a pretty simple case
<pippijn> my LALR(1) core is purely functional (except for the array for passing semantic values to user actions)
<pippijn> I get the 1.5 seconds only if I restrict semantic values to int
<pippijn> otherwise it's more than 1.6
<pippijn> oh
<adrien> I meant that it wasn't a real-life test
<pippijn> 1.3 now, if I pre-allocate that array
<pippijn> adrien: right
<adrien> brb, my French blood is telling me to go out and buy a baguette
<pippijn> 1.2 with int-only
<whitequark> mmmm baguette
<whitequark> guess i have a lot of french blood
<pippijn> me too :)
<pippijn> it's faster than menhir's table based backend, but twice slower than menhir's code backend
<pippijn> I wonder if JIT compiling would make sense
<pippijn> adrien: ok, so here is #include <ostream>
<pippijn> 0.562 secs for cpapa
<pippijn> the dypgen parser takes 7.8 seconds
<pippijn> bison takes 0.344 seconds
<pippijn> menhir can't parse c++
<whitequark> neither can humans
<whitequark> menhir shouldn't feel bad for it.
* whitequark pats menhir on its head
<pippijn> when I saw menhir's coq backend, I was all excited
<pippijn> hoping it would contain an automatically generated proof for "parser is correct"
<pippijn> but no
Arsenik has quit [Remote host closed the connection]
talzeus has joined #ocaml
ben_zen has quit [Ping timeout: 268 seconds]
<adrien> wmeyer: I feel like pausing a bit with the patches
ollehar has joined #ocaml
ontologiae has joined #ocaml
mfp has joined #ocaml
ollehar has quit [Ping timeout: 240 seconds]
<wmeyer> morning
<wmeyer> adrien: why?
<adrien> wmeyer: tiring
<adrien> not a huge pause but I want to do a few other things
<wmeyer> OK, there is absolutely no rush
Kane has joined #ocaml
Kane has quit [Remote host closed the connection]
<wmeyer> when will you get back to it?
_5kg has joined #ocaml
_5kg has left #ocaml []
Ptival_ is now known as Ptival
derek_c has joined #ocaml
<n06rin> how can i apply one function for all elements in array?
<n06rin> (this method called somethink like xxxxx.map)
<wmeyer> Array.map ? List.map ?
<wmeyer> List.map (fun x -> x * x) [1;2;3];;
<n06rin> yes. thanks
<n06rin> List.map work with string&
<n06rin> ?
<wmeyer> it does
<wmeyer> well?
<wmeyer> List.map? no, it will work with lists only
<wmeyer> there is no implicit overloading in OCaml
<n06rin> it's bad news
<wmeyer> why do you think n06rin it's a bad news?
<n06rin> it's bad news for me. Because i don't understand how to make once exercise from Jason Hickey
<n06rin> book
<def-lkb> what do you want to do ?
q66 has joined #ocaml
<n06rin> str.[num] <- exch [num]
<n06rin> str is a function argument. exch is a function who return char.
<n06rin> listing http://ideone.com/BVdVAN
ggole has quit [Ping timeout: 246 seconds]
<n06rin> need make a function crypt who make somethink like
<n06rin> crypt "bad"
<n06rin> and return is "ACB"
<wmeyer> n06rin: first of all, your pattern match is not exhaustive, it does not cover all the cases
<wmeyer> secondly, the syntax error is caused by missing dot before [num]
ontologiae has quit [Ping timeout: 264 seconds]
<def-lkb> no06rin: String.map ?
<def-lkb> … But string.map won't modify str in place.
<wmeyer> and finally, num > String.length str is wrong you should use >=
<n06rin> wmeyer: you think need to write str.[num] <- exch.[num] ?
<wmeyer> yes
<n06rin> but exch is function. Or isn't it?
<def-lkb> exch is just a string, as is str
<def-lkb> you probably want, str.[num] <- exch str.[num]
<n06rin> yes
<n06rin> but it's not work too
<def-lkb> in which case, exch is function from char to char, and you transform every character of str through it
<def-lkb> what do you mean by "it's not work"?
<def-lkb> (if you describe the context of the error, it will be easier to help you)
ggole has joined #ocaml
<n06rin> interesting... Ideone compilator and ocaml toplevel interpeteur see difference errors
<Asmadeus> missing a ; before the if in there
<Asmadeus> also missing parenthesis for (num+1), otherwise it tries to sum the result of crypt str num with 1
<n06rin> correct all.
<n06rin> why he can't find num?
void64 has joined #ocaml
<Asmadeus> hmm, I think you have to name it? Trailing optional arguments are generally not great because it can't tell if you use "crypt str" if you want the partial function or if you want it used with default num
<def-lkb> Also, replace <= by <, strings are 0-indexe so you don't never want to access str.[String.length str]
<n06rin> def-lkb: man, are you so amazing.
<n06rin> but how c -> c is work?
<n06rin> why c?
<n06rin> what is c in exch
<n06rin> ?
Neros has joined #ocaml
<def-lkb> c is a variable (as opposed to 'a', 'b', 'c'… which are literal characters)
<def-lkb> so it will match any value that has not yet been matched
<def-lkb> you can interpret this case as "for all remaining characters", and the action is identity, that is "left them untouched".
<n06rin> lol. I try to use you function. crept is return unit
<def-lkb> yes, you choose to modify "str" inplace, you'll have to look at the content of str if you want to see the results
<n06rin> oh, i see
<def-lkb> try "let crypt' str = String.map exch str" if you want to get a new string
<n06rin> ocaml is so hard to learn.
<def-lkb> what are your previous experiences in programming?
<n06rin> pascal. pure c, actionscript
<n06rin> lua
<def-lkb> ok, you never programmed in a typed language (--this may sound trollish, but types really has a different meaning in ocaml than in C or pascal--)
<def-lkb> this is the main things that you will have to learn (in my opinion), once you get used to reading type signatures and using types as guide for designing your software, ocaml will feel easy and consistent :)
<n06rin> i have trouble with sintaxing sugar likes a lot of function declaration and types.
derek_c has quit [Quit: leaving]
<def-lkb> it's not syntax sugar. There is really few syntax sugaring in ocaml (labelled/optional arguments being an exception, as are some recent syntax for type variables, but they can largely be avoided when beginning)
<def-lkb> I will advise you to avoid them at your point, and concentrate on core language.
<ggole> That's debatable. let f x = x is sugar for let f = fun x -> x, for instance.
<def-lkb> ggole: granted :).
<ggole> It took me a little while to figure out fun vs function and some other things, too.
hto has quit [Quit: Lost terminal]
hto has joined #ocaml
mcsquiggedy has quit [Ping timeout: 256 seconds]
Neros has quit [Ping timeout: 256 seconds]
Neros has joined #ocaml
ben_zen has joined #ocaml
Arsenik has joined #ocaml
ollehar has joined #ocaml
breakds has joined #ocaml
Kakadu has joined #ocaml
derek_c has joined #ocaml
derek_c has quit [Client Quit]
derek_c has joined #ocaml
derek_c has quit [Client Quit]
derek_c has joined #ocaml
derek_c has quit [Client Quit]
derek_c has joined #ocaml
n06rin has quit [Quit: Leaving.]
ontologiae has joined #ocaml
void64 has quit [Quit: Leaving]
void64 has joined #ocaml
oriba has joined #ocaml
cyanure__ has joined #ocaml
derek_c has quit [Read error: No route to host]
derek_c has joined #ocaml
oriba_ has joined #ocaml
lusory has quit [Ping timeout: 245 seconds]
oriba has quit [Ping timeout: 264 seconds]
cyanure__ has quit [Remote host closed the connection]
Arsenik has quit [Remote host closed the connection]
Arsenik has joined #ocaml
Arsenik has quit [Remote host closed the connection]
ontologiae has quit [Quit: WeeChat 0.4.0]
lusory has joined #ocaml
ulfdoz has quit [Ping timeout: 268 seconds]
oriba_ is now known as oriba
eikke has joined #ocaml
mort___ has joined #ocaml
aspiri has joined #ocaml
<eikke> fwiw: i toyed with 'composable folds' last night, i.e. have an API which allows to compose reified folds which can be calculated all in one pass over some list
<eikke> e.g. allows to calculate the average of a list of ints in one pass, calculating both the sum & the list length in one pass
ulfdoz has joined #ocaml
<ggole> Can't you do that with List.fold_left using a tuple?
<eikke> ggole: yes sure, and that +- what that code does, but in a more composable way
<eikke> (imho)
<ggole> Hmm.
<ggole> Reminds me a bit of Common Lisp's loop.
<eikke> I'm not familiar with CL
<ggole> (loop for x in (list 1 2 3 2 1) summing x into sum counting x into count finally return (list sum count (/ sum count)))
<ggole> All the functionality is built into the macro though.
<eikke> so 'summing' and 'counting' are built-ins, no way to do other things?
<ggole> Yep.
<ggole> This looks much more modular
<ggole> (This = your thing.)
<eikke> that's the goal ;)
<ggole> There's a bunch of the usual reductions like min, max
<eikke> let f l = Fold.run (Tuples.pair <$> Fold.Operations.minimum <*> Fold.Operations.maximum) l would give you min & max in a go (well, 'a list -> ('a option * 'a option))
<ggole> Right, so you've defined the obvious bits already
<ggole> Nice idea.
<ggole> I would tend to define a minmax from scratch though, since there is a comparison-avoiding trick.
<eikke> agree
<eikke> there's Fold.make ('acc -> 'a -> 'acc) 'acc : ('a, 'acc, 'acc) Fold.t which allows defining those yourself easily :)
<ggole> Oh, interesting
<eikke> most of the ones in Fold.Operations are defined like that, except for some which use explicit construction due to (I think) value restriction
derek_c has quit [Quit: Lost terminal]
Kakadu has quit [Ping timeout: 245 seconds]
mcsquiggedy has joined #ocaml
eikke has quit [Read error: Operation timed out]
aspiri has quit [Ping timeout: 250 seconds]
jbrown has quit [Ping timeout: 264 seconds]
jbrown has joined #ocaml
mort___ has quit [Quit: Leaving.]
eikke has joined #ocaml
n06rin has joined #ocaml
g0d has joined #ocaml
darkf has quit [Quit: Leaving]
pkrnj has joined #ocaml
<pippijn> https://paste.xinu.at/ZMPw/ lovely debugging
n06rin has quit [Quit: Leaving.]
Arsenik has joined #ocaml
cyanure__ has joined #ocaml
bungley has quit [Quit: Lost terminal]
tane has joined #ocaml
TDJACR has quit [Ping timeout: 245 seconds]
<adrien> woah
<Qrntz> it does that on a lot of library reference pages, in fact
<Qrntz> I have no idea why
thomasga has joined #ocaml
thomasga has quit [Client Quit]
pkrnj has quit [Ping timeout: 240 seconds]
Arsenik has quit [Read error: Operation timed out]
cyanure__ has quit [Read error: Operation timed out]
qdhfgfgh3gg1 has joined #ocaml
qdhfgfgh3gg1 has left #ocaml []
niko has joined #ocaml
<wmeyer> adrien: hi!
<wmeyer> pippijn: hi
<pippijn> hi wmeyer
<wmeyer> adrien: I already miss your patches
<pippijn> haha
<wmeyer> we have to get that working maan
<wmeyer> :D
<pippijn> wmeyer: help me find the bug in the glr core ;\
<adrien> :D
<pippijn> by the way, I'm really not happy with the gramanl (parser generator) code
<pippijn> you can tell it was done in a week
<adrien> had to get down to posix compat for some things in the last patch; it's been really annoying at times
<adrien> actually, I'm going to check what's in posix awk
<adrien> and I might do much more awk since it seems to have more things
<adrien> pippijn: how so?
<pippijn> adrien: it's not carefully designed
void64 has quit [Ping timeout: 264 seconds]
<pippijn> adrien: it depends on various ugly things
<pippijn> for example, it depends on the start state being 0
<pippijn> that, in turn, depends on the start symbol being the first non-terminal, which is achieved by naming it something with _ at the front
<pippijn> it also depends on the production of the start state being production 0
<pippijn> just a lot of (checked) assumptions everywhere
<adrien> well, you can try a second system :P
<pippijn> hm?
<adrien> a rewrite; but I had https://en.wikipedia.org/wiki/Second-system_effect in mind :P
<pippijn> ah
<pippijn> I'll probably rewrite it someday
<pippijn> but first I want to fix the parser core
<pippijn> adrien: that is actually a problem
<pippijn> it has a lot of features and is not very modular
<pippijn> I tried it, but not hard enough
void64 has joined #ocaml
g0d has quit [Quit: cya.]
othiym23 has quit [Ping timeout: 264 seconds]
othiym23 has joined #ocaml
ulfdoz has quit [Ping timeout: 246 seconds]
Snark has quit [Quit: leaving]
ggole has quit []
ulfdoz has joined #ocaml
luke_ has joined #ocaml
void64 has quit [Ping timeout: 264 seconds]
luke_ has quit [Read error: Operation timed out]
luke_ has joined #ocaml
mcsquiggedy has quit [Ping timeout: 256 seconds]
luke_ has quit [Quit: Leaving]
luke_ has joined #ocaml
skchrko has quit [Remote host closed the connection]
mcsquiggedy has joined #ocaml
<technomancy> is ledit my best bet if I want civilised line input without rlwrap?
<technomancy> I get "The dependency camlp5 of package ledit.2.03 is not available for your compiler or your OS." when trying to bring it in with opam
tani has joined #ocaml
<technomancy> which seems to be bogus; the home page for camlp5 says "It is compatible with OCaml versions from 1.07 to 4.01.0."
Anarchos has joined #ocaml
<technomancy> hm; maybe I shouldn't be on 4.01.0dev+trunk
milosn has joined #ocaml
tane has quit [Ping timeout: 240 seconds]
<Anarchos> technomancy why ?
<technomancy> Anarchos: just a guess; thinking camlp5 might be refusing to install because it's too new and it doesn't recognize the version
<technomancy> it's not a very detailed error
<Anarchos> technomancy just change the version number in the camlp5 source to accept the most recent one ?
<adrien> iirc camlp5 has a whitelist of supported ocaml versions
<adrien> which makes perfect sense
milosn_ has quit [Ping timeout: 264 seconds]
<technomancy> adrien: it does make sense, but failing to show the list when your current version is not in it is pretty crappy
<technomancy> "Sorry Mario, the Princess is in another compiler version."
<technomancy> ooh nice; ledit's documentation consists of a 6-line readme
<adrien> well, that's opam, not camlp5 :P
<technomancy> this is going to be fun =\
<adrien> hmm, are you sure?
<adrien> there's nothing else?
<technomancy> if there is more, it's well-hidden
chrisdotcode has joined #ocaml
tani is now known as tane
<Anarchos> I still wonder how to control my ocaml program from C++ world
<technomancy> I wonder if it would be better to FFI my way into readline proper
wmeyer has quit [Ping timeout: 245 seconds]
<technomancy> since ledit doesn't honor .inputrc
testcocoon has quit [Quit: Coyote finally caught me]
<technomancy> doesn't have a kill ring either =\
Arsenik has joined #ocaml
cyanure__ has joined #ocaml
<adrien> I'm fairly sure I've seen all this in ledit
testcocoon has joined #ocaml
<Anarchos> technomancy what is a killring ?
<technomancy> Anarchos: every time you make a kill, it pushes an entry on the kill ring list
<technomancy> C-y inserts the top entry, and M-y replaces the last insertion with the next entry on the ring
<technomancy> I guess you'd call it clipboard history
<technomancy> going through the FFI would probably make it a lot more difficult to customize tab completion though; which ledit seems to support from a cursory grep
Arsenik has quit [Remote host closed the connection]
cyanure__ has quit [Remote host closed the connection]
<technomancy> oh, nope. it has a "complete_fn" field, but it's an integer, not a function. =\
<technomancy> so much for that
wmeyer has joined #ocaml
<Anarchos> Who did a main program in OCaml, with a GUI in another language ?
<pippijn> I'd probably talk via pipes
<pippijn> stdin/stdout
<Anarchos> pippijn yes, so i need an infinite loop to deal with the commands arriving on the channels ?
<pippijn> yes
Simn has quit [Quit: Leaving]
ulfdoz has quit [Ping timeout: 240 seconds]
<Anarchos> pippijn but i don't know of an efficient way to define the syntax of the commands and their arguments
<pippijn> why?
<pippijn> what are you doing?
<Anarchos> pippijn a math verifier
<pippijn> oh
<pippijn> you're the dypgen guy?
<Anarchos> pippijn the guy using dypgen, yes :)
<pippijn> how is that going?
<Anarchos> i was able to parse ambigous propositional formulas perfectly :)
<pippijn> I was thinking about dynamic parsers a little
<Anarchos> i am not brave enough to try dynamic side of dypgen :)
<pippijn> does dypgen allow you to add rules while parsing?
<pippijn> if I someday take the time to learn how dypgen handles precedence parsing, I'll have my parser generator emit dypgen code
<pippijn> it already emits menhir code for easy comparison
<pippijn> without precedence, parsing C++ becomes super slow
<pippijn> you get an exponential number of parses
<pippijn> so comparison is impossible
<Anarchos> pippijn you can add your own priority graph to dypgen
<Anarchos> and assign the priority you want to each rule
<pippijn> yeah, I saw that
<pippijn> in the calc example
<wmeyer> adrien: ping
<pippijn> _install/bin/cpapa-bison wip/cc/ostream.i 0.12s user 0.00s system 95% cpu 0.130 total
<pippijn> _install/bin/cpapa -trivial wip/cc/ostream.i 0.84s user 0.04s system 98% cpu 0.882 total
<pippijn> => bison is 8 times faster than my ocaml glr core
<Anarchos> pippijn did you compile with ocamlopt and full optimizations options ?
<pippijn> 0.3 seconds without C compiler optimisation (gcc -O0)
<pippijn> hm
<pippijn> does ocamlopt remove if false () blocks?
<Anarchos> no idea
<pippijn> Anarchos: I didn't enable unsafe, and there are some asserts
<pippijn> I'll kill the asserts
luke_ has quit [Remote host closed the connection]
<wmeyer> pippijn: that's not too bad, how long does it take to parse boost headers
<pippijn> wmeyer: haha
<pippijn> I don't think I can parse boost headers, anymore
<pippijn> C++11 :(
<wmeyer> how about Qt
<pippijn> well
<pippijn> I don't think I can parse stdlib anymore, either
<pippijn> even in c++98 mode, gnu uses c++11 stuff
<pippijn> (meanies)
<pippijn> who wants to help me define the grammar for c++11? :)
<wmeyer> I see forest of hands !!!
<pippijn> removing asserts: _install/bin/cpapa -trivial wip/cc/ostream.i 0.80s user 0.03s system 102% cpu 0.815 total
void64 has joined #ocaml
* wmeyer shower time!
ollehar has quit [Ping timeout: 264 seconds]
chambart has joined #ocaml
ollehar has joined #ocaml
<pippijn> oh
<pippijn> well, ocamlopt isn't very good at optimising :)
<pippijn> "hello";
<pippijn> 0.544 seconds now
<Anarchos> pippijn ocamlopt should be renamed ocamlnative
<Anarchos> cause it emits assembly code but not agressively optimized, though performances are decent
<pippijn> it's ok
<pippijn> it does inlining
<Anarchos> yes but you have to ask for it explicitely
<pippijn> oh?
<pippijn> (9.569 seconds with bytecode)
<pippijn> ok, so the ocaml engine is less than 50% of bison
<pippijn> eh
<pippijn> less than 50% away from it
<pippijn> it's less than half as slow
<pippijn> unoptimised C
<pippijn> with optimised C, it's about 5 times slower
snearch has joined #ocaml
tane has quit [Quit: Verlassend]
<pippijn> wmeyer: did you see my LALR(1) parser?
<pippijn> wmeyer: it's faster than menhir ;)
<pippijn> wmeyer: and I was thinking that maybe JITing it would be interesting
eikke has quit [Ping timeout: 245 seconds]
<pippijn> I wonder if it's faster when using the operating system stack
<pippijn> instead of an explicit stack and having it be tail recursive
<mrvn> stack is stack. makes no difference. Alignment matters a lot though.
<pippijn> mrvn: the explicit stack is a (ParseTables.state_id × SemanticValue.t) list)
<mrvn> well, that isn't a stack
<pippijn> it would be an interesting comparison
<pippijn> immutable list vs. mutable array for stack
<mrvn> doing it recursive would limit the amount you can parse
<pippijn> right
<pippijn> ok, I don't want to write an array implementation now
<pippijn> to do it efficiently, it should be a ring buffer
<pippijn> ah no, not true
<Anarchos> did you use ocamlprof to see where you really waste time ?
<pippijn> Anarchos: lexing
<pippijn> I checked with valgrind
<Anarchos> for a recursive rule in ocamlyacc is it better to do S : A | S A or S : A | A S ?
<pippijn> the former
<pippijn> you build the list in reverse
<Anarchos> S A ?
<pippijn> yes
<Anarchos> left recursive ?
<Anarchos> anyway i just hav to parse less than 1000 occurrences of A so it don't really matters in fact :)
<Anarchos> but i like to have efficient code ;)
chrisdotcode has quit [Remote host closed the connection]
<pippijn> so, I made an array implementation
<pippijn> same speed
pkrnj has joined #ocaml
<Anarchos> and what standard module should i use if i need a map (key*value) over sorted keys, and i need to get the value and the next key for a key k1 ?
<pippijn> List :\
<pippijn> I don't think there is a module for that
<Anarchos> sorted dictionnaries ?
<pippijn> Map is sorted
<pippijn> but I don't think it has a "next" function
<Anarchos> ok i will use a list of pairs, and define my own comparison function to sort it
<Anarchos> oh no wait
<Anarchos> the result comes from an external unix process and i used " ... |sort" in it !
<pippijn> :)
<Anarchos> ok time to go to bed, i just stacked enough work for tomorrow
<pippijn> good night
<Anarchos> too long time i playd with ocamllex/ocamlyacc
<Anarchos> i can't never remember those syntax :(
snearch has quit [Quit: Verlassend]
<pippijn> oh, the array version is slower
<pippijn> quite much slower
<pippijn> 1.6 vs 1.3 seconds
<pippijn> the mutation costs
<Anarchos> yes it may triggers the gc a lot more than a pure functional list i guess
<pippijn> no
<pippijn> why?
<pippijn> the array is allocated once
<Anarchos> modifiying mutable celles must trigger the minor_gc no ?
<pippijn> it does?
<Anarchos> no idea !
<pippijn> I don't think so
<pippijn> but it goes through caml_modify
<Anarchos> which is the standard way to modify a cell in an array :)
<pippijn> yes
<pippijn> but I don't think there is a GC call involved
<Anarchos> and if you change the size of the data in the cell, you must realloc space and so on
<pippijn> but I don't do that
<pippijn> it's an (int * 'a) array
<Anarchos> ok so let valgrind set on the light :)
<pippijn> no need
<pippijn> it's slower than the list version
<pippijn> so I killed the array version
<pippijn> maybe having separate state/sval stacks would be faster
<pippijn> that would be an int array and a 'a list
<technomancy> trying to define a foreign function with Ctypes, I get «Exception: Dl.DL_error "/home/phil/.opam/4.01.0dev+trunk/lib/stublibs/dllctypes-foreign_stubs.so: undefined symbol: readline".»
<technomancy> does that mean libreadline isn't installed in a way that ctypes can find it?
<pippijn> 0.9 seconds if I don't call user actions
<pippijn> (and don't do anything with semantic values)
<pippijn> so the stack is just an int list
<pippijn> still slower than menhir's code backend (which is around 0.8 seconds)
<pippijn> 0.785 without int_of_string and producing an INT token
pkrnj has quit [Quit: Computer has gone to sleep.]
ollehar has quit [Ping timeout: 260 seconds]
<Anarchos> pippijn just study code from inria, they write clever code than you can think ever of !
<Anarchos> (of course if you work at inria forgot my comment)
<pippijn> haha
<pippijn> no, I don't
<pippijn> I don't speak french
<pippijn> I think my lexer bridge is a little inefficient
<pippijn> because it's very generic
<Anarchos> pippijn good night i really have to go
<pippijn> good night
<wmeyer> pippijn: good morning
<pippijn> morning wmeyer
Anarchos has quit [Quit: Vision[0.9.7-H-130604]: i've been blurred!]
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
contempt has quit [Ping timeout: 276 seconds]
<pippijn> cool
<wmeyer> but I think I have to look at K-framework
<pippijn> Identifer -> Identifier
<wmeyer> sure thanks
pkrnj has joined #ocaml