Cyanure has quit [Remote host closed the connection]
sg has quit [Quit: sg]
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
pango is now known as pangoafk
<pippijn>
I moved the bitset to C++
<pippijn>
now it went from 40% to 6% of time spent in merging bitsets
lggr has quit [Ping timeout: 246 seconds]
ankit9 has quit [Quit: Leaving]
lggr has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
djcoin has joined #ocaml
Yoric has joined #ocaml
astertronistic has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
ftrvxmtrx has quit [Quit: Leaving]
lggr has joined #ocaml
<pippijn>
custom operations are really expensive
<pippijn>
I noticed I spend quite some time creating new bitsets, so I figured I could re-use GC'd ones, but that slowed things down
lusory has joined #ocaml
<pippijn>
from 0.8 to 1.2 seconds
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
ankit9 has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
cago has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
ocp has joined #ocaml
lggr has quit [Ping timeout: 264 seconds]
Obfuscate has quit [Ping timeout: 268 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
ftrvxmtrx has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
ontologiae has joined #ocaml
thomasga has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
sepp2k has joined #ocaml
lggr has joined #ocaml
testcocoon has quit [Quit: Coyote finally caught me]
testcocoon has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
GnomeStoleMyBike has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
milosn has quit [Ping timeout: 244 seconds]
milosn has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
lggr has joined #ocaml
ontologiae has quit [Read error: Connection reset by peer]
Kakadu has joined #ocaml
ontologiae has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
tufisi has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
tufisi has quit [Ping timeout: 255 seconds]
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 244 seconds]
chambart has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
<fasta>
How would you write a parser which matches exactly one or two digits in some kind of composable grammar? E.g. "1 " , "21 ", "21" would be valid, but "213" would not.
<thizanne>
fasta: with ocamllex, ['0'-'9']['0'-'9']
<thizanne>
with ?
<thizanne>
['0'-'9']['0'-'9']?
<fasta>
thizanne: can I assign that to a first class value and compose that with other stuff?
<thizanne>
yes
<thizanne>
do you know ocamllex ?
<fasta>
thizanne: by name
<thizanne>
well this is simple enough to be writed in classic ocaml then
<fasta>
thizanne: but ocamllex isn't a library.
<fasta>
thizanne: I would need a build system to use ocamllex.
<fasta>
thizanne: not that this is anything special, but if you use Parsec, you don't need that.
<fasta>
There are OCaml parsec implementations too, though, but I don't know how good they are.
<fasta>
thizanne: in that I can assign parsers to identifiers within the language.
<fasta>
thizanne: I don't need to call external tools to use it.
<fasta>
If I have a parser to parse "foo" and I have a parser to parse "bar", I can just do foo <|> bar to have one that parses both.
<Kakadu>
fasta: You can use ocamllex+yacc to create LR-parser for your grammar, You can write parser-combinator library to parse it using LL(k) or You can write ad-hoc hack soultion. What do you want?
lggr has joined #ocaml
<fasta>
Kakadu: what do you mean by k, is that any k which has to be known at compile time?
<thizanne>
fasta: then you could write `let (<|>) f g = x -> (f x) || (g x)`
<Kakadu>
it is lookahead for k tokens
<thizanne>
or do you want a library which already supports these classical operations ?
<fasta>
Kakadu: sure, but Parsec has infinite lookahead.
<fasta>
Kakadu: that is, any arbitrary k.
<Kakadu>
fasta: I haven't said that k is a positive number :D
<fasta>
Kakadu: ok
<Kakadu>
also this lazy parsec-style parsers will work better & faster in lazy languages like Haskell
lggr has quit [Ping timeout: 260 seconds]
larhat has quit [Quit: Leaving.]
mcclurmc is now known as mcclurmc_away
lggr has joined #ocaml
fusillia has joined #ocaml
<GnomeStoleMyBike>
Hi All
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
astertronistic has quit [Ping timeout: 264 seconds]
lggr has quit [Ping timeout: 256 seconds]
astertronistic has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
ottbot has joined #ocaml
larhat has joined #ocaml
lggr has quit [Ping timeout: 262 seconds]
thomasga has quit [Quit: Leaving.]
astertronistic has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
ankit9 has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 248 seconds]
lggr has joined #ocaml
ankit9 has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
ocp has quit [Quit: Leaving.]
fusillia has quit [Ping timeout: 260 seconds]
lggr has quit [Ping timeout: 256 seconds]
chambart has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Remote host closed the connection]
Sablier has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
<pippijn>
Kakadu: hey
<pippijn>
Kakadu: I'm very unhappy
<pippijn>
%%% LR item sets construction took 0.847328 seconds
<Kakadu>
where?
<pippijn>
my program
lggr has joined #ocaml
<pippijn>
can you ask your friend how long LR item set construction is supposed to take?
<Kakadu>
pippijn: I'm unhappy too. I'm too stupid to understand how to use git-dpm
<hcarty>
adrien: That assumes you have libev installed to make Lwt happy... if not then there is an extra step to set an environment variable to limit what is installed by default.
<adrien>
hmmmm
<adrien>
ocamlbrew works by sourcing a file?
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
<hcarty>
adrien: You can download it manually
<hcarty>
The file that's piped into bash downloads and calls ocamlbrew automatically
<Kakadu>
I happens beacuse module has type 'a key_ = Key.t inside
<Kakadu>
and this type appears as type for value named `str`
<Kakadu>
and I don't know how to kill this '_a
lggr has quit [Ping timeout: 255 seconds]
<thelema>
wieczyk: # let f ld = let module LD = (val ld: LDT) in let module M = LF(LD) in ();;
<Drakken>
wieczyk: let f (module L: LTYPE) = L.f() (* or whatever you want to do with Ld *)
<Drakken>
oops. duplicate posts.
<thelema>
wieczyk: apparently it's not allowed to directly pass the unpacking of a first class module to a functor, but unpacking it to a name seems to work.
<wieczyk>
Ah I understand why I could now defend my first-class modules problem.
<wieczyk>
Programming with 3.12 and reading manual for 4.0 isnt good idea.
<thelema>
yes, use 4.00
<thelema>
wieczyk: ocamlbrew can install just released 4.00.1
<wieczyk>
mhmh
lggr has quit [Ping timeout: 240 seconds]
<wieczyk>
thelema: I have swithced to OCamlbuild, yes, it is much better than my own Makefile
<wieczyk>
What is an OASIS?
<thelema>
wieczyk: oasis is a tool that will generate a build system for you
<thelema>
it is also related to oasis-db, which takes the same input and categorizes packages in a global repository
<wmeyer>
Write in C
<thelema>
no, ocaml
<wieczyk>
Something like cabal?
<thelema>
yes, something like cabal
<wieczyk>
Well, I am not fanatic that I cannot use ocaml software which was not written in Ocaml.
<thelema>
although I'm not qualified to back that up, as I've never used cabal
<wmeyer>
I used
<wmeyer>
worse, possibly more stable: that's a direct and honest comment
<thelema>
oasis is definitely newer
<wmeyer>
at least it does not generate any files at the moment (optionaly it generates single setup.hs)
lggr has joined #ocaml
<wieczyk>
Nice
<wieczyk>
so again, I cannot understand why Haskell is much much more popular than Ocaml ;
<thelema>
oasis can generate ocamlbuild configurations for you
<wieczyk>
mhmh
<thelema>
wieczyk: oasis is quite new, and not all projects use it.
<thelema>
in fact, batteries hasn't quite migrated to using it for build.
<thelema>
it has an _oasis file, but that oasis file just says to use the makefile for build
<wieczyk>
mhmh
<wieczyk>
Maybe you should write some blog about Ocaml.
<wieczyk>
some info about news in Ocaml's software, in language, some ,,patterns''
<wieczyk>
(update topic)
ftrvxmtrx has joined #ocaml
<wmeyer>
wieczyk: we don't blog we developp :-) that's one of the failures of the community - no blogs about the monads.
<thelema>
wieczyk: planet.ocamlcore.org
<thelema>
wmeyer: we develop from scratch, even
<wieczyk>
HAskell's people also develop from scratch
<wieczyk>
to have library ion some monad, transfoer etc
<wieczyk>
too much purity for me, too less pragmatic
<thelema>
I see a lot of projects that build on top of others.
<wieczyk>
But ok, maybe i am Haskell antifan I am too much bad for this language.
<thelema>
although maybe that's my small sample
mnabil has joined #ocaml
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<wieczyk>
How did you meet ocaml?
paolooo has quit [Quit: Page closed]
lggr has quit [Ping timeout: 256 seconds]
<tac>
I met ocaml cordially.
<thelema>
In a dark alley.
<tac>
Well, I couldn't meet him in daylight hours. The Haskell community would shun my associating with such an impure personality.
<thelema>
:)
<thelema>
Oddly enough, I came to OCaml from Perl, via wanting to use 'map' and 'grep' and pipelines of transformers more
lggr has joined #ocaml
<wieczyk>
:D
<wieczyk>
From Perl to Ocaml, buitifull
<wmeyer>
thelema: When you told me during our Camlers dinner, I thought I wouldn't survive this kind of enlighement, I would delve into hallucination for 3 days in a row.
<thelema>
they're both wonderfully expressive languages with (and this isn't obvious to perl outsiders) flexible type systems
<wmeyer>
thelema: you still a perl hacker it sounds ....
<wieczyk>
hihi
<thelema>
nah, haven't coded perl in a long time.
<thelema>
am doing all my work in OCaml/C++ now
<wmeyer>
wieczyk: don't be discouraged I was genuinely surprised that it's possible: such a seameless switch
<thelema>
oddly enough, some of it involves OCaml generating C++ code.
<wieczyk>
In Perl I have written only very small scripts.
err404 has joined #ocaml
<wmeyer>
wieczyk: that's still sane. I think thelema was writting biger scripts and he was kicked badly by the duck typing
lggr has quit [Ping timeout: 245 seconds]
<wmeyer>
(not confirmed!)
<wieczyk>
hehe
mnabil has quit [Ping timeout: 246 seconds]
<tac>
Haskell retains the "beauty" of Perl
<thelema>
having terrible problems with object typing did drive me away from them. :)
<wieczyk>
It is possible to have something similar to Haskell's ($) in Ocaml?
<wieczyk>
I am asking because this language is not ,,indent-driven''
<wmeyer>
thelema: that's the weirdest route I can imagine. So next thing you tried were OCaml objects?
<wmeyer>
:-)
<thelema>
I didn't immediately go from perl to ocaml objects (my perl style wasn't particularly object-oriented)
lggr has joined #ocaml
<thelema>
but I did try to fit what I wanted to say into ocaml's object system, and found that I wasn't able to make things work well.
<wmeyer>
wieczyk: point free notation, you have it, I think i mentioned there is builting called revapply which you can bind to (<|)
<thelema>
wieczyk: the ocaml version of ($) is (|>), which is reversed: x |> f1 |> f2 |> f3
<wieczyk>
Hm, yes, you have have already told me about this.
<wieczyk>
Can you give me a list of some usefull definitions etc?
<thelema>
I don't recommend revapply as ocaml's eager nature doesn't match with it
<wmeyer>
oh yes, i always get it wrong
<thelema>
wieczyk: that's the one thing I write myself when I don't include a stdlib.
<flux>
the way I see it $ isn't about lazy evaluation but about omitting parens.
<thelema>
s/stdlib/extended stdlib/, like batteries or core
<thelema>
flux: and |> does the same for me
<wieczyk>
Can I find those definitions in stdlib or batteries?
<thelema>
wieczyk: in batteries. |> is spelled |! in core
<wmeyer>
not in stdlib
<wmeyer>
why they chosen the shreek :)
<wmeyer>
|$ maybe
<thelema>
wmeyer: a mistake, which is too costly to fix at this point.
<flux>
thelema, but how about this: some_function_that_takes_an_argument_and_a_callback 42 $ fun a -> a + 1
<wmeyer>
hmm is the precedence driven by lexographicaly calculating precedence of each of the characters of the operator?
<Anarchos>
wmeyer there are some rules like that into the ocaml grammar
<wmeyer>
thelema: ooops.
<thelema>
flux: eww.
lggr has quit [Ping timeout: 248 seconds]
<flux>
thelema, it's pretty nice if you have continuation-passing-style code.
<thelema>
wmeyer: yes, the ocaml grammar determines precedence and associativity from the first character(s) in the operator
<thelema>
flux: I can see that. i don't program in continuation passing style much
<flux>
|> is nice when you are 'piping data' but not when you are transferring control flow
<Anarchos>
nobody used dypgen GLR generator ?
ftrvxmtrx has joined #ocaml
<thelema>
monadic style in ocalm still allows `y >>= fun x -> ...`
<thelema>
*ocaml
<flux>
thelema, and what is better way to use higher order functions within each other than this? flip Array.iter array $ fun row -> flip Array.iter row $ fun x -> Printf.printf "%d" (x + x)
eni has joined #ocaml
lggr has joined #ocaml
<flux>
(you can indent it nicely)
<thelema>
flux: if you're using 'flip', you're probably doing it wrong
<flux>
thelema, well, why is flip in batteries then?-)
<flux>
the problem is that not always the function part is last, which of course wouldn't fit that
<thelema>
some darned fool put it in, and backwards compatibility keeps us from removing it.
<thelema>
labels may fix this
<thelema>
although they may still have issues in such pipelines
<flux>
I don't think it would be confusing to see that fragment of code when, say, summing over a 3d array elements
<flux>
actually it might, because folds have three arguments, no flip there :)
lggr has quit [Ping timeout: 264 seconds]
mcclurmc_away is now known as mcclurmc
<wmeyer>
thelema: flip List.map [1;2;3] <- isn't that useful?
<wmeyer>
i know. I shouldn't recomend flip to anyone
_andre has quit [Quit: leaving]
<thelema>
I've tried using flip, and have come to the conclusion that it's not the right tool for understandable programming
<thelema>
and understandability is critical.
<flux>
it's just a matter of recognizing certain patterns in code
<wmeyer>
thelema: Haskell programmers don't like flip either - they say it's sometimes useful - mainly for implementing embedded Forth in Haskell
<flux>
I think it's at times useful to have the 'long' part of the argument last
lggr has joined #ocaml
<thelema>
flux: labeled arguments
<thelema>
which I wish batteries had as default.
<flux>
labeled arguments have their own problems, especially in partial applications
ulfdoz has joined #ocaml
<flux>
probably the reason ocaml doesn't use labels just everywhere, but has separate "Labeled" modules
<thelema>
I don't think those problems are unsolvable; the compiler can be a bit more generous in how it matches.
<flux>
I'll believe it when I see it :)
<flux>
in any case when you have a function that takes two arguments and one of them is a function..
<flux>
you could imagine even a language where you can just put those arguments in any order and it just works
<flux>
the fact that there's word "flip" there is just a small thing I need to do to appiese the compiler
<flux>
(s/pie/pea/)
tac has quit [Ping timeout: 240 seconds]
tac_ has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
Yoric has quit [Ping timeout: 246 seconds]
<Drakken>
flip is nice in the absence of labels. I don't like having to track down the second arg when the first one is a big lambda function.
lggr has joined #ocaml
<wmeyer>
Drakken: I share the same observation, the problem begins when you will start "refactoring" stuff transforming everything to free point notation with flips to be pure
<thelema>
point-free notation is probably also not productive in terms of readability
<wmeyer>
so flip is powerful but not sure about readability
<wmeyer>
it's crazy
<Drakken>
wmeyer that's a cultural problem in the Haskell community.
<wmeyer>
with list comprehensions and recursion ideally
<Drakken>
They love to overuse (.)
<wmeyer>
we love ; :-)
<flux>
thelema, so would you say partial applications in general reduce comprehensibility?
<thelema>
flux: a bit, yes, although by themselves, they're not as bad as the other techniques.
<flux>
the extremes are alwyas, well, extreme. I'd like to think for most techniques there's a golden middle way.
<thelema>
when partial applications are bound to a useful identifier, this helps a lot
<flux>
sadly you (the one reading the code) must still be familiar with all of them to be able to rapdily comprehend what's going on.
<wmeyer>
that's why we have (fun o -> ...) and not \o -> ... (you can see the difference)
<thelema>
Supposedly, most C++ shops program in a subset of C++, probably for exactly this reason - limiting the number of cogs that have to turn in peoples' heads
<flux>
iirc someone wrote a syntax extension for 'holes' in ocaml, it was pretty nifty
<thelema>
flux: bluestorm did, iirc
<flux>
the notation was (iirc): \(foo + _)
<flux>
or maybe it was _1 instead of plain _, raising the question of unused parameters etc
lggr has quit [Ping timeout: 256 seconds]
<flux>
bluestorm hasn't been around for quite a while
<thelema>
iirc, _# and _ were both allowed
<thelema>
allowing one to do \(_2 + _1)
<thelema>
(not that it matters for +
<wmeyer>
thelema: that's a nice twist
lggr has joined #ocaml
<wmeyer>
the problem is
<wmeyer>
usual
<wmeyer>
psychological
<wmeyer>
people are insecure about OCaml
<wmeyer>
Camplp4
<wmeyer>
Camlp4 not OCaml
<flux>
well, camlp4 changes things
<wmeyer>
and don't use all these goodies
<flux>
in particular error messages
<wmeyer>
no we have a strong maintainer
<wmeyer>
that's one reason, it could be a packrat parser to be honest
<flux>
and then there is this camlp4/camlp5-thing
<flux>
and the sad state of camlp4 documentation
<wmeyer>
I wish these holes, pa_monad, etc. light syntax extensions were in wild