<gasche>
after months of reading reddit and occasionally submitting stuff here and there, I still have no clue about why my submitted links sometime gather no point at all on r/programming and never seem to appear in the list
caligula has quit [Ping timeout: 245 seconds]
osa1 has joined #ocaml
q66 has joined #ocaml
caligula has joined #ocaml
<kerneis>
gasche: I read hacker news, which has the "hellban" system which is even worse
<kerneis>
now I don't post anything, just lurke
<ggole>
Hacker news is pretty awful
<ggole>
Although every now and then there is interesting discussion.
<kerneis>
I find an interesting place, from a sociological point of view
<kerneis>
I find it*
def-lkb_ is now known as def-lkb
ollehar has quit [Ping timeout: 276 seconds]
skchrko has joined #ocaml
<Kakadu>
hi
<Kakadu>
AFAIR ocamlbuild/oasis don't support creating syntax extensions for camlp4/5 and using them immediately
<Kakadu>
Is bug about it already created or I should make one?
Drup has joined #ocaml
justdit has joined #ocaml
<Kakadu>
also, do u know something about integration menhit with ocamlbuild?
<Kakadu>
s/u/you/
<Drup>
Kakadu: "ocamlbuild -use-menhir"
<Kakadu>
Drup: thanks
mort___ has joined #ocaml
<ggole>
Isn't it a bit worrying that all these various things are special cased in ocamlbuild? :/
_andre has joined #ocaml
Sim_n has joined #ocaml
Simn has quit [Ping timeout: 245 seconds]
darkf_ has joined #ocaml
darkf has quit [Ping timeout: 245 seconds]
<Kakadu>
can I pass -rectypes to menhir somehow?
* Kakadu
don't see any useful in menhir --help
darkf_ has quit [Ping timeout: 245 seconds]
darkf_ has joined #ocaml
ulfdoz has quit [Ping timeout: 264 seconds]
darkf_ is now known as darkf
mort___ has quit [Quit: Leaving.]
n06rin has joined #ocaml
Anarchos has joined #ocaml
Xom has joined #ocaml
justdit has quit [Ping timeout: 268 seconds]
vpm has quit [Excess Flood]
vpm has joined #ocaml
ulfdoz has joined #ocaml
ygrek has quit [Ping timeout: 240 seconds]
<gasche>
Kakadu: try --ocamlc "ocamlc -rectypes"
<gasche>
you can also just avoid the --infer option and not have menhir call ocamlc at all
<Kakadu>
Cool
<Kakadu>
The last step is to put it to myocamlbuild somehow
<gasche>
hm
<gasche>
Kakadu: there is a known bug in ocamlbuild that make it not send the ocaml flags to menhir when expected
<gasche>
this is fixed in trunk and will thus be fixed in the next version
<gasche>
but in the meantime, there is also a known workaround
<gasche>
just use a .mlypack file with the name of your .mly module inside, and compile that file
<gasche>
eg. if you have toto.mly, define blah.mlypack with content "Toto", and 'ocamlbuild blah.cmo' will do what you expect if you have the rectypes tag activated
<gasche>
(you can give the same name to the .mly and the .mlypack, and it works)
n06rin has quit [Quit: Leaving.]
<kerneis>
mlypack? so many magical extensions
ollehar has joined #ocaml
<whitequark>
gasche: why do you need --infer at all ?
<whitequark>
I don't understand it
<Kakadu>
thanks, gasche
Neros has quit [Remote host closed the connection]
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
<gasche>
kerneis: menhir supports building a grammar from several .mly files
<gasche>
.mlypack was a natural choice to enable building that
<gasche>
the full story is that the bug "ocamlbuild doesn't pass the right options to menhir" was noticed by Nicolas and fixed... but only in the part handling compilation from mlypack
<gasche>
there was some duplication with the code handling single .mly and, by mistake, this one wasn't fixed
<kerneis>
ah, never used menhir
<gasche>
which is why the workaround work
<gasche>
it's actually quite neat
<kerneis>
maybe I should (struggling with a grammar file currently)
<gasche>
but now I need to look at the manual to answer whitequark's question
mikleog has joined #ocaml
<Anarchos>
gasche i am looking for a grammar tool allowing concatenation as an operator and even if possible "abuse of notation" as we do in maths....
<gasche>
I'm not sure what "allowing concatenation as an operator" means, given that in a yacc/menhir grammar (foo bar) will already parse any foo followed by any bar
<gasche>
but menhir will not make grammar descriptions syntactically lighter than yacc
<gasche>
and it is restricted to LR grammars, so if you are looking for significantly ambiguous grammars you should probably use a GLR tool instead
<whitequark>
gasche: menhir has x?, x* and x+
<whitequark>
it's sort of lighter (but I'm not sure if that is what you meant)
<gasche>
that's right
<gasche>
I forgot about those
<gasche>
generally I consider menhir's syntax to be more readable, but also more explicit than yacc's, because of the variable naming
<gasche>
(optional but that I personally strongly prefer to reading numeric positions in productions)
* whitequark
nods
<whitequark>
also, menhir's higher-order rules read to much much more readable code.
<whitequark>
pair, separated_list, etc, are invaluable
<ggole>
What's that for, things like 'a, b, c'?
<Anarchos>
ggole what is the context ?
<gasche>
yep
<ggole>
Nice. I do find it annoying every time I have to write one of those.
<gasche>
separated_list(var, comma) or something like that
<gasche>
summary: because rule inlining duplicate code, inferring types before makes for more readable messages
<gasche>
typing error messages
<whitequark>
I see, thanks
ygrek has joined #ocaml
mort___ has joined #ocaml
mort___ has quit [Client Quit]
mort___ has joined #ocaml
<whitequark>
how do I add a path ocamlfind can traverse?
<whitequark>
for example I have an llvm package in /usr/lib/ocaml/llvm-3.4/META.llvm
<whitequark>
OCAMLPATH.
venk` has joined #ocaml
<gasche>
whitequark: note that if the software called "ocamlfind install ..." at install-time, the META file should have been copied to a place ocamlfind knows about already
venk has quit [Ping timeout: 245 seconds]
mikleog has quit [Read error: Connection reset by peer]
mort___ has quit [Quit: Leaving.]
smondet has joined #ocaml
dtg has quit [Ping timeout: 264 seconds]
mort___ has joined #ocaml
dtg has joined #ocaml
<whitequark>
gasche: well, I'm trying to combine opam and .deb packaged LLVM
<gasche>
ok
dsheets has joined #ocaml
<whitequark>
(because I want to run all this on CI, there are no proper packages for most of the stuff I want, and opam install llvm compiles it, which is unacceptable for CI)
<gasche>
hm
<kerneis>
whitequark: man findlib.conf
<gasche>
there is ongoing work on distributing binary packages with OPAM I think, you should ask thomasga
<kerneis>
the "path" variable is what you want
<gasche>
besides, I'm not sure installing through OPAM would mean each CI run would recompile
<whitequark>
kerneis: thanks. OCAMLPATH worked for me though
<gasche>
can you not save the OPAM environment over multiple runs?
<whitequark>
gasche: that's how Travis works: no
<gasche>
Travis doesn't allow to save some base environment shared between all runs?
<kerneis>
no, you've got 20 minutes, full stop
<kerneis>
if I remember correctly
<gasche>
meh
<kerneis>
and apt-get
<gasche>
hm
<whitequark>
yeah
<gasche>
so you could put that base environment on a distant sever
<gasche>
and wget it at the beginning of the build :-'
<whitequark>
so, I've successfully compiled llvm with ocaml bindings as a deb package for ocaml 4
<whitequark>
but it fails to link
<gasche>
completely different topic: kerneis, when discussing the .mllib stuff with Damien, I learned to my surprise that .p.cmx weren't an ocamlbuild invention
<kerneis>
ha
<whitequark>
from the messages, it looks like it did not discover that it needs to do -lc++
<whitequark>
is it a known bug with ubuntu?
<whitequark>
I recall something about -Wl,-no-as-needed
<gasche>
kerneis: in a sense that's good news, because it means it's legitimate to ask for compiler fixes on .foo.cmx issues
<whitequark>
-cclib -lstdc++ fixes that
<gasche>
it also means that we should probably not try to phase them out of ocamlbuild (but of course reducing the redundancy in implementation would be nice)
<gasche>
hm
<gasche>
Travis CI looks like yet another proprietary service that is eager to have your project infrastructure depend upon it
<gasche>
that said, there is probably much less opportunity for lock-in than for many other things
<kerneis>
the worse that can happen is that you lose your CI tool
<kerneis>
like "no more tests"
<kerneis>
which is the case for a lot of projects anyway :-)
<pippijn>
gasche: travis ci is minimally intrusive
<kerneis>
it depends how much you rely on it, just like github
<kerneis>
but at least, they don't own your data
<pippijn>
also, isn't it open source?
<kerneis>
(the way github owns your wiki or issue tracker for instance)
<pippijn>
right, that's bad
<pippijn>
eh
<pippijn>
no, the wiki is not true
<pippijn>
but yes, the issue tracker
<pippijn>
the wiki is just another git repo
<kerneis>
oh, right
<pippijn>
it would be nice if the pages were also a separate git repo
<pippijn>
not a branch
<pippijn>
it feels dirty..
<kerneis>
well, a branch can be a completely different repo, in a sense
<gasche>
regardless of exportability of data, switching away from a centralized service always has a non-neglectible cost
<kerneis>
at least, have a separate root
<kerneis>
but yes, it's a bit ugly
<pippijn>
kerneis: sure it can, and it is, but I don't have to like it
<gasche>
you'll not be happy with wiki pages in the git repo if you don't have a simple procedure to make them available somewhere else
<gasche>
I witnessed that again when Google Reader closed
<gasche>
of course, a feed list is easy to import/export, but migration was in fact significantly harder than I thought it would be
<kerneis>
what do you use now btw?
<gasche>
(in particular for people that had, say, starred favorite items to be able to find them back quickly)
<pippijn>
exporting the github wiki in a read-only fashion is very easy
<gasche>
right now I'm using OpenShift to host a TinyTiny RSS instance for me
<gasche>
I'm only moderately happy with TT-RSS interface but it makes do
<pippijn>
making it into another wiki is not as easy
dsheets has quit [Ping timeout: 245 seconds]
<kerneis>
yes, TT-RSS is a bit annoying, rsslounge is unmaintained and buggy
<kerneis>
I finally switched back to rss2email
<kerneis>
it does the job, and I spend my life in my email client anyway
<gasche>
I'm better at batching RSS feeds than batch emails
<kerneis>
oh, I scheduled it to run only once per night
<gasche>
that's a good idea
<kerneis>
it has in fact improved my batching
<kerneis>
I should do the same with email
<gasche>
one minor problem with self-hosted solutions is that you become aware of their technical stack
<kerneis>
I host my emails anyway, so…
<kerneis>
but it's time-consuming, you shouldn't do it unless you find it fun
<gasche>
I'm deeply saddened when I have to deploy PHP software, and have been not trying ownCloud for that very single reason
<gasche>
whereas I couldn't care less what Google Reader was using internally
<kerneis>
oh yeah, I switched to flickr recently for that reason
<kerneis>
sharing photos with my family was just too annoying
<kerneis>
this is getting very off-topic, sorry
<pippijn>
this channel doesn't have a strict topic policy
<kerneis>
so, after three dozen iterations over several months, I think I finally have an almost satisfaying makefile for CIL
<pippijn>
CIL as in the C parser?
<kerneis>
and I feel anxious about doing git push
<kerneis>
pippijn: yes
<pippijn>
hmm
<pippijn>
I should finish my C parser :)
<kerneis>
no, you should use CIL ;-) (or cabs, which is included in CIL, if you don't want the lowering part)
<pippijn>
maybe
<pippijn>
maybe I should fix CIL
<kerneis>
if you have any issue with CIL, please submit bug reports
<pippijn>
I never used it
<kerneis>
ok
<pippijn>
I just compared my parser with it at some point
<pippijn>
my parser wasn't serious, anyway
<pippijn>
it was my first ocaml project
<pippijn>
CIL has some polynomial time edge cases in the parser
<Kakadu>
Well, my parser-combinators have become faster
<Kakadu>
(I switched to generate Ast instead of pretty printing immediately)
zpe_ has joined #ocaml
<Kakadu>
What I do not understand is why LR parsing with pretty printing works 2s and Combinators with pretty printing 26
<pippijn>
pretty printing?
<Kakadu>
but Yacc with Ast works 0.5 s and Combinators with Ast - 2s
<pippijn>
oh
<Kakadu>
pretty printing immediately withoud building Ast
<pippijn>
so at first you had pretty printing directly?
<pippijn>
ok
zpe has quit [Ping timeout: 246 seconds]
<pippijn>
well, I don't know either :)
<pippijn>
what are you making?
<Kakadu>
Just testing how slow combinators are
<pippijn>
you wrote them?
<Kakadu>
a kind of
<Kakadu>
original combintors library was slow and I decided to rewrite them by hands
<pippijn>
ok
<Kakadu>
So I dropped nice error reporting and probably something else
<pippijn>
do they work in linear time?
<gasche>
the obvious guess would be that the Yacc versions and the combinator-parser versions did not print things in the same way
Anarchos has quit [Ping timeout: 246 seconds]
<gasche>
(eg. you changed something in the productions that made them run massively more slowly)
<Kakadu>
gasche: output files seems to be the same
<gasche>
or maybe they recognize the same input in different ways, and the combinator-produced AST is massively harder to pretty-printer
<gasche>
that would be surprising but could make sense
<gasche>
I would still guess it's a difference in semantics in the pretty-printing part, not a parsetree-structure difference
<gasche>
Kakadu: what happens if you write the pretty-printer by pattern-matching on the AST
<gasche>
and plug that implementation after both the LR and the combinator parser?
<Kakadu>
em
<gasche>
(this is why we write AST in the first place; they are the free structure that can allow any transformation from them)
dsheets has joined #ocaml
<Kakadu>
I mentioned that above
<Kakadu>
0,5s for yacc and 2s for combinators
<kerneis>
yeah, another ocamlbuild bug!
<Kakadu>
it is what I did
yacks has quit [Quit: Leaving]
<kerneis>
it doesn't work to put a "foo.docdir/index.html" inside a .itarget
<kerneis>
at least not for CIL
<Kakadu>
ALso I have count how often pretty printers are called: numbers seems to be same
<gasche>
Kakadu: so your 0.5s timing includes the final pretty-printing time?
<gasche>
what happens if you do not pretty-print at all, and simply ignore the resulting AST?
<kerneis>
okay, it was an include issue
<Kakadu>
gasche: It is only ast construction. pretty printing ast is not included in 0.5
<gasche>
so if you plug the pretty-printer after this AST construction
travisbrady has joined #ocaml
<gasche>
what performance figures do you get in both cases?
<Drup>
gasche: "(16:43:48) Kakadu: What I do not understand is why LR parsing with pretty printing works 2s and Combinators with pretty printing 26"
lifeng has quit [Ping timeout: 264 seconds]
lifeng has joined #ocaml
<flux>
I was under the impression that it was common knowledge that parser generators generate very fast parsers?
ben_zen has quit [Ping timeout: 240 seconds]
mort___ has quit [Ping timeout: 276 seconds]
<Kakadu>
hm
<Kakadu>
Generating Ast and generating pretty printer of this Ast take 8 and 50s for yacc and combinators respectively
tane has joined #ocaml
<flux>
kakadu, btw, did you try tuning gc parameters?
<Kakadu>
yeah, with minor heap 8Gb combinators are becoming faster
<Kakadu>
faster than 26 seconds
hkBst has quit [Quit: Konversation terminated!]
Drup has quit [Ping timeout: 268 seconds]
ollehar has quit [Quit: ollehar]
walter has quit [Quit: This computer has gone to sleep]
travisbrady has quit [Quit: travisbrady]
travisbrady has joined #ocaml
yacks has joined #ocaml
Drup has joined #ocaml
Kakadu has quit [Quit: Konversation terminated!]
nlucaroni has joined #ocaml
dsheets has quit [Ping timeout: 245 seconds]
chrisdotcode__ has joined #ocaml
chrisdotcode has quit [Ping timeout: 276 seconds]
jpdeplaix has quit [Ping timeout: 264 seconds]
dnm has joined #ocaml
jpdeplaix has joined #ocaml
ben_zen has joined #ocaml
skchrko has quit [Quit: Leaving]
ben_zen has quit [Ping timeout: 264 seconds]
milosn has joined #ocaml
wwilly has joined #ocaml
<wwilly>
bonsoir
wmeyer has joined #ocaml
<wmeyer>
ping adrien [usual business]
<rks`>
wmeyer: 10:19:49 < adrien> I left for my holidays but I have the next patch mostly ready; I'll rewrite mkconfig.sh and mkmyocamlbuild_config.sh completely to avoid the sed-abomination too (and then I have one cosmetic issue left)
demonimin has quit [Ping timeout: 264 seconds]
<rks`>
(that was like 2 days ago)
demonimin has joined #ocaml
technoma` is now known as technomancy
<wmeyer>
rks`: thank you, makes sense
<rks`>
you're welcome
<wmeyer>
rks`: i saw commits of gasche
chrisdotcode has joined #ocaml
<wmeyer>
to camlbuild
<rks`>
right?
<wmeyer>
( rks` in the meantime however I am going to wait for adrien to confirm)
<wmeyer>
nice that he has take a great care, i had not much time these days
chrisdotcode__ has quit [Ping timeout: 276 seconds]
<rks`>
(to confirm what? :D)
<rks`>
(I'm lost here)
<wmeyer>
rks`: that he still works on this patches
<wmeyer>
eh, agda does not work on ARM
<wmeyer>
actually yes, I might try to fix it
Anarchos has joined #ocaml
ygrek has quit [Ping timeout: 256 seconds]
osa1 has quit [Remote host closed the connection]
osa1 has joined #ocaml
mcclurmc has quit [Quit: Leaving.]
dsheets has joined #ocaml
zachrab_ has joined #ocaml
<zachrab_>
ok
<zachrab_>
im in a coding competition for the next 1.5 hours
<Anarchos>
who ever tried dypgen ?
<zachrab_>
so whoever could help me that would be awesome
<rixed>
then you want a function from string to (int * suit)
<rixed>
this function use Scanf.sscanf as described
<rixed>
makes sense?
zpe has joined #ocaml
mcclurmc has joined #ocaml
<zachrab_>
Error: Unbound value suit_of_char
<rixed>
something like: let card_of_string s = try Scanf.sscanf s "%u%c" (fun v c -> v, suit_of_char c) with _ -> Scanf.sscanf s "%c%c" (fun v s -> value_of_figure v, suit_of_char c)
<rixed>
etc
<Drup>
zachrab_: instead of trying to blindly grasp some piece of code, you should read a proper tutorial
ben_zen has joined #ocaml
<rixed>
of course suit_of_char and value_of_figure are not in the stdlib :)
<rixed>
you'd have to write them, but they are very simple
<rixed>
Drup: he has only 1h left, he's in the middle of a coding competition :)
<rixed>
let suit_of_char = function 'C' -> Clubs | 'D' -> Diamonds and so on
<Drup>
huh, that's weird to do a coding competition in a langage you don't know ...
<rixed>
let value_of_figure = function 'J' -> you got it
<rixed>
Drup: apparently that's all the fun about it
<rixed>
That's a good way to force poeple into trying other languages
<ousado>
.. which has been extended to a social engineering competition
<rixed>
ousado: that's probably part of it :)
<Drup>
rixed: then, you're not helping :3
<ousado>
such excercises are not about solving these toy problems, they are about learning how to aquire what it takes to solve them.
<ggole>
zachrab_: you have to suit_of_char *before* its use
<ggole>
*to write
darkf has quit [Quit: Leaving]
zpe has quit [Ping timeout: 240 seconds]
<rixed>
He need a minimum of understanding of the syntax before he can write anything himself