flux changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | OCaml 4.01.0 http://bit.ly/1851A3R | http://www.ocaml.org | Public logs at http://tunes.org/~nef/logs/ocaml/
BiDOrD has quit [Quit: No Ping reply in 180 seconds.]
BiDOrD has joined #ocaml
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
<Kelet> Has anyone managed to compile Ocsfml on Windows? I keep having several problems using a base installation for Ocaml for Windows.
ontologiae has quit [Ping timeout: 256 seconds]
mfp has quit [Ping timeout: 260 seconds]
chrisdotcode has quit [Ping timeout: 264 seconds]
ollehar has quit [Ping timeout: 264 seconds]
chrisdotcode has joined #ocaml
Drup has quit [Quit: Leaving.]
n06rin has joined #ocaml
zRecursive has joined #ocaml
rwmjones has quit [Ping timeout: 264 seconds]
chrisdotcode has quit [Ping timeout: 256 seconds]
chrisdotcode has joined #ocaml
madroach has quit [Ping timeout: 264 seconds]
rwmjones has joined #ocaml
madroach has joined #ocaml
Kelet has quit [Quit: Leaving]
boogie has quit [Remote host closed the connection]
q66 has quit [Quit: Leaving]
Kelet has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
kronixx has quit [Remote host closed the connection]
dsheets has joined #ocaml
milosn has joined #ocaml
gnuvince has quit [Ping timeout: 246 seconds]
n06rin has left #ocaml []
n06rin has joined #ocaml
n06rin has quit [Client Quit]
Xom has joined #ocaml
Xom has quit [Client Quit]
zRecursive has left #ocaml []
gour has joined #ocaml
ygrek has joined #ocaml
walter has joined #ocaml
Neros has quit [Ping timeout: 264 seconds]
shinnya has quit [Ping timeout: 245 seconds]
es917 has quit [Quit: es917]
adu has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
boogie has joined #ocaml
<gour> morning
<gour> starting with RWO book...have core-109.40.00 installed along with ocaml-4.01.0 (via opam), but "open Core.Std;;" gives: Error: Unbound module Core" ?
jbrown has quit [Remote host closed the connection]
pango_ has joined #ocaml
pango has quit [Ping timeout: 264 seconds]
Snark has joined #ocaml
ben_zen has quit [Ping timeout: 260 seconds]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
<gour> what is the rationale for using ' (quote) for naming type variables in comparison with e.g. haskell where it is not required?
walter has joined #ocaml
walter has quit [Quit: This computer has gone to sleep]
zpe has joined #ocaml
zpe has quit [Remote host closed the connection]
bondar has quit [Ping timeout: 264 seconds]
<adrien> morning
mal`` has quit [Ping timeout: 264 seconds]
caligula_ has joined #ocaml
ygrek has quit [Ping timeout: 260 seconds]
caligula has quit [Read error: Connection reset by peer]
tov has quit [Ping timeout: 268 seconds]
mal`` has joined #ocaml
tov has joined #ocaml
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
<adrien> was going to answer jdh on opengl bindings not being up-to-date but I deleted my email
<adrien> had the occasion to remember the main issue with him
<adrien> he'll talk about how something would improve the state of ocaml so much, he manages to lay out plans
<adrien> and
<adrien> you stop hearing about him after that
chrisdotcode_ has joined #ocaml
chrisdotcode has quit [Ping timeout: 260 seconds]
Kakadu has joined #ocaml
<gour> adrien: in order to have some 'gui-backup', what are your plans in regard to gtk3 branch and/or some post 2.16.0 release?
bondar has joined #ocaml
bondar has quit [Max SendQ exceeded]
<adrien> well, "2.16" for lablgtk is a bad name
<adrien> it's always difficult to version your bindings
<adrien> you can consider it 2.24 actually
<adrien> as for gtk3, I need to look into it
<adrien> (gtk2 is safe for many years though)
<gour> so, gtk2 is done ;)
bondar has joined #ocaml
bondar has quit [Max SendQ exceeded]
<adrien> if some api is missing, it's added upon request
<adrien> otherwise that leads to bitrot
<gour> what tool would you use today to provide ocaml bindings for C?
<gour> *C lib
<adrien> depends
<gour> RWO book speaks about ctypes
<gour> of course, besides C wrapper, i want thick bindings
<adrien> I worked on "cowboy", a tool to help the process
<gour> ahh, right, now i remember about cowboy...excuse me for asking again :-(
<adrien> it reads C headers, give a light AST for them and from that you can have several output stages
<adrien> and so far I've written one for glib-based libs
<gour> cute
<adrien> that said, it works best when the API is sane and regular
<adrien> e.g. for glib-based libs, the first argument is always the "objecct"
<adrien> lots of conventions
ulfdoz has joined #ocaml
<gour> i see...i'm not sure it's the case with the lib i need, although i know they use return value for diagnsotics and last argument is char* err for error message
<gour> btw, i find ocaml much more compact than (verbose ada) and very clean...
ocp has joined #ocaml
<adrien> cowboy is interesting for larger libs; if you have 20 or 30 functions and a couple data structures, it won't pay off
<adrien> well, unless these move quickly and you need to update often
Simn has joined #ocaml
<adrien> and I haven't practiced ada much but iirc it's fairly verbose; ocaml aims at providing many of the same things but while being much lighter to write in
<gour> no, releases are not so often and API is very stable
<gour> how is it that 'warm fuzzy things' are not mentioned so often in ocaml?
<adrien> which ones do you mean?
<gour> monads :-)
<adrien> probably because we don't abuse them
<gour> lol
ggole has joined #ocaml
boogie has quit [Remote host closed the connection]
boogie has joined #ocaml
adu has quit [Quit: adu]
weie has joined #ocaml
<gour> in comparison with F#, i also prefer ocaml's community, open-source-dness and not depending on NET/Mono
Yoric has joined #ocaml
talzeus has joined #ocaml
talzeus__ has quit [Read error: Connection reset by peer]
Yoric has quit [Ping timeout: 264 seconds]
ygrek has joined #ocaml
boogie has quit [Remote host closed the connection]
talzeus has quit [Remote host closed the connection]
talzeus has joined #ocaml
ulfdoz has quit [Quit: deprecated]
cdidd has quit [Remote host closed the connection]
ulfdoz has joined #ocaml
cdidd has joined #ocaml
hcarty has quit [Read error: Operation timed out]
davekong has quit [Ping timeout: 276 seconds]
hcarty has joined #ocaml
davekong has joined #ocaml
ocp has quit [Quit: Leaving.]
boogie has joined #ocaml
boogie has quit [Ping timeout: 256 seconds]
iZsh has quit [Excess Flood]
iZsh has joined #ocaml
chrisdotcode_ has quit [Ping timeout: 260 seconds]
talzeus has quit [Remote host closed the connection]
ggole has quit []
chrisdotcode has joined #ocaml
boogie has joined #ocaml
boogie has quit [Ping timeout: 260 seconds]
ggole has joined #ocaml
ggole has quit [Client Quit]
ggole has joined #ocaml
shinnya has joined #ocaml
yezariaely has joined #ocaml
shinnya has quit [Ping timeout: 260 seconds]
Yoric has joined #ocaml
dsheets has quit [Ping timeout: 264 seconds]
ygrek has quit [Ping timeout: 260 seconds]
ulfdoz has quit [Ping timeout: 260 seconds]
Yoric has quit [Ping timeout: 264 seconds]
darkf has quit [Quit: Leaving]
ulfdoz has joined #ocaml
ulfdoz has quit [Ping timeout: 260 seconds]
ulfdoz has joined #ocaml
<Kakadu> hi!
Yoric has joined #ocaml
Yoric has quit [Ping timeout: 260 seconds]
chrisdotcode has quit [Ping timeout: 260 seconds]
<yezariaely> hi
Yoric has joined #ocaml
yezariaely has quit [Quit: Leaving.]
Yoric has quit [Ping timeout: 260 seconds]
boogie has joined #ocaml
Yoric has joined #ocaml
boogie has quit [Ping timeout: 264 seconds]
mfp has joined #ocaml
ontologiae has joined #ocaml
<adrien> wmeyer: hi, you typo'ed there: ocamlbuild/testsuite/level0.ml: ~options:[`package "camlp4.macro";`tags ["camlp4o.opt"; "syntax\\(camp4o\\)"];
<adrien> wmeyer: you wrote "camp4o" without the 'l' (I just did exact same typo :P )
<pippijn> hi
Albe has joined #ocaml
<Albe> hi
<Albe> can i ask you some questions?
<Albe> about caml
<def-lkb> Yes, this is the right place.
<def-lkb> Just ask, don't ask to ask :)
<adrien> wmeyer: blah, found an issue in my patches: you can't get the same effect as make install DESTDIR=... anymore when installing camlp4 and ocamlbuild
<Albe> I need to write a CAML prog ( not OCAML) that given three 3-letter words serch if the letters are present in the given words and in that case it will return true otherwise false. The program must use the deterministic automata. Do you have any idea? thanks
<adrien> wmeyer: there's a simple solution and then there's replacing build/partial-install.sh with a makefile :)
<Albe> sorry for bad english
<Albe> i have made this
<Albe> let string_check c1 c2 string = (index_char string c1)>0 && (index_char string c2)>0;; let rec progCaml a b s_list = match s_list with [] -> false | x::xs -> try (string_check a b x) with Not_found -> progCaml a b xs;;
<Albe> but I am not able to implement the automata
<adrien> how so?
<adrien> what is the issue?
<adrien> wmeyer: also, what do we do about build/install.sh? shall it disappear?
q66 has joined #ocaml
<pippijn> ggole: I find myself using postfix-or the most
<pippijn> ggole: in perl
<pippijn> ggole: also, exit if $should_exit;
<adrien> is Edwin Török on the channel?
Yoric has quit [Read error: Operation timed out]
<rwmjones> ocamlbuild is truly the most on-crack build system ever invented
<whitequark> is it?
<rwmjones> how are you supposed to add the -g option to ocamlopt?
<rwmjones> yes it is
<adrien> tag "debug"?
<whitequark> ^
<rwmjones> ok maybe boost jam is worse
<rwmjones> where do I put 'tag "debug"' in this huge file?
<adrien> oasis-generated?
<rwmjones> no idea, how would I know?
<rwmjones> this is ocaml bisect 1.3
<adrien> I see two issues with ocamlbuild: it tries to do too much automatically, and development stopped in the middle
<Kakadu> gour: hi!
<rwmjones> (3) it's impenetrable, especially to people who don't know ocaml, even to those who do
<adrien> rwmjones: is there an "_oasis" file? setup.ml? does "head _tags" mention oasis?
<rwmjones> no, there is no _oasis file
<adrien> for (3), plugin*s* would help
<adrien> well, setup.ml?
<adrien> ok, no
<adrien> _tags for bisect is 36 lines, including 20 lines of comments...
<gour> what will repalce oasis? ocp-build?
<adrien> anyway
<gour> Kakadu: hiya
<adrien> something like:
<adrien> <src/**>: debug
<adrien> should do it
<Kakadu> gour: have yo found dev packages for Qt5?
<Kakadu> you*
<rwmjones> adrien: no, no setup.ml here
<rwmjones> ok, so I put that in _tags?
<rwmjones> that worked, thanks adrien++
<adrien> yeah, that should do it
<adrien> :)
ulfdoz has quit [Read error: Operation timed out]
<gour> Kakadu: did install some extra Qt5-related pkgs, but Qt5Qml is still not found :-(
<Kakadu> I think that Qt5 dev packages are not present in sid
<Kakadu> I have testing in ubuntu 13.04 and it's OK there
<Kakadu> If your machine is good enought probably it will be faster to spend 5 minutes to recompile Qt5
hcarty has quit [Read error: Operation timed out]
<adrien> (5? :D )
<Kakadu> Somebody from IRC have tried
hcarty has joined #ocaml
<Kakadu> If use 8 cores we can fit 5 minutes:)
* adrien wants the same machine ='(
* Kakadu too
morolin has quit [Ping timeout: 260 seconds]
<gour> Kakadu: i've linux mint & ubuntu installed on my netbook as guest OS-es running under vbox on pc-bsd...i''ll check it there...however, atm, netbook is compiling vbox :-)
morolin has joined #ocaml
<Kakadu> I can't recommend Virtualbox
<Kakadu> I have not succeeded to enable OpenGL there
<gour> hmm
<Kakadu> so QtQuick are not work on my ubuntu VBox
<gour> i see
ollehar has joined #ocaml
rwmjones has quit [Ping timeout: 264 seconds]
<pippijn> gour: a friend of mine works at jolla
<gour> you'll get some nice phone soon?
<pippijn> maybe :)
<Albe> .
rwmjones has joined #ocaml
yacks has quit [Ping timeout: 256 seconds]
ulfdoz has joined #ocaml
yacks has joined #ocaml
<gour> i'm rm-ing qt5 from my system, will try to install from the src later, now eating...
<wmeyer> adrien: Just go ahead and remove it if you feel it's the right decision. Myself no strong opinion, but I'm wondering why it's not part of makefiles. Eventually we want to get rid of all the ocamlbuild scripts too.
<wmeyer> adrien: should I apply: 0001-build-replace-build-mk-config-myocamlbuild_config-.s-2.patch?
<adrien> wmeyer: ok, I'll check a bit but it's mostly that I'm letting it bitrot a bit for now; I'll try to have a pass at cleaning the build/ directory after the cross-compilation is done
<adrien> wmeyer: that's where I found an issue :D
<adrien> give me a few minutes to clean things up and I'll send an updated version
<wmeyer> I admire your efforts, if you fancy to spend time on it, then I have long standing beer debt :)
<wmeyer> adrien: OK, thanks
<adrien> well, I've spend enough time on the build system to starting knowing it so it shouldn't take me too long to make a quick pass
<wmeyer> adrien: OK :)
Neros has joined #ocaml
<wmeyer> adrien: do you want me to apply: 0001-build-replace-build-mk-config-myocamlbuild_config-.s-2.patch ? I'll try to do it now.
Kakadu has quit [Ping timeout: 264 seconds]
<adrien> wmeyer: I'm readying the new version
<wmeyer> ok thank you
<adrien> wmeyer: have you looked at the latest tarball or at the patch before that?
<adrien> the tarball has a bunch of other patches, including simple fixes
<adrien> (4 first patches)
<wmeyer> not yet, I think I committd everything before that
<adrien> ok, don't use 0001-build-replace-build-mk-config-myocamlbuild_config-.s-2.patch or 0001-build-replace-build-mk-config-myocamlbuild_config-.s.modified.patch
<adrien> I'm going to upload a new tarball since there are merge conflicts in a couple files
<wmeyer> adrien: sorry to keep you waited
<adrien> no prob
shinnya has joined #ocaml
ggole_ has joined #ocaml
tobiasBora has joined #ocaml
<tobiasBora> Hello,
ggole has quit [Ping timeout: 240 seconds]
ggole_ is now known as ggole
<tobiasBora> I'd like to compute fractals with Ocaml so I need to have a great precision during the computation. Is there a way to increase the precision of floats ?
<ggole> No.
<ggole> They are 'double precision' already. If you need more precision, you'll need to use an arbitrary precision library.
<adrien> tobiasBora: no but you can look at the "Num" module (ocamlfind "nums" package)
<adrien> it's going to be slower though
<adrien> and I'm wondering whether you really need the high precision; a common approach is to not render more than you can display and only go into more details as you zoom in
<tobiasBora> Thank you. I don't mind if it's slower because I wan't to create a beautifull picture and if the picture takes 10mn to display it doesn't matter. What's the difference between Num and changing double precision ?
ulfdoz has quit [Ping timeout: 264 seconds]
<adrien> Num is arbitrary-precision
<adrien> meaning it can be *lots* of bits
<adrien> when you ask it 1/2, it doesn't compute but it keeps it in memory as "1 divided by 2"
<tobiasBora> And we have the final value at the end ?
<pippijn> Big_int would benefit from uniqueness typing
<wmeyer> adrien: thanks, but still not able to commit :(
<wmeyer> (sent an email already)
<wmeyer> but I will review them now
<tobiasBora> And does a complex number arbitrary precision library exists ?
<wmeyer> oh: Error while executing "gzip -c -q -d < /home/danmey/src/ocaml-trunk/cross-patches-2013-09-07-fixed.tar.gz"
<wmeyer>
<wmeyer>
<wmeyer> gzip: stdin: not in gzip format
bondar has joined #ocaml
<wmeyer>
<wmeyer> hi pippijn
bondar has quit [Max SendQ exceeded]
<pippijn> hi
<pippijn> how's treematch?
<wmeyer> oh I will have a look now
<pippijn> did you try the new obuild?
<wmeyer> nope
<adrien> wmeyer: hmm
<wmeyer> should I pull pippijn ?
<pippijn> yes
<adrien> wmeyer: it's not a gzip'ed file; it's only tar actually
<adrien> stupid me :)
<pippijn> git clone --branch=master --depth=1 https://github.com/pippijn/obuild
<pippijn> git clone --branch=master --depth=1 https://github.com/danmey/treematch
<pippijn> cd treematch
<pippijn> ../obuild/script/obuild
<adrien> actually, instead of Num, https://forge.ocamlcore.org/projects/zarith/ might better
<pippijn> (assuming baselib is installed)
<pippijn> if not:
<pippijn> git clone --branch=master --depth=1 https://github.com/danmey/treematch stuff/treematch
<pippijn> git clone --branch=master --depth=1 https://github.com/pippijn/baselib stuff/baselib
<pippijn> echo 'recurse-into (baselib treematch)' > stuff/OMakefile
<pippijn> cd stuff
<pippijn> ../obuild/script/obuild
<pippijn> (all untested, but this should do it)
<wmeyer> sorry pippijn I got now my machine working, (still didn't recover everything from the HDD failure)
<pippijn> oh
<pippijn> hdd failure :\
<wmeyer> adrien: OK, stupidly enough I didn't think it's tar, no worries :)
<adrien> well, I was really wondering what was going because "tar xf" worked while "vim foo.tar.gz" didn't :P
<adrien> need to have the fixed command in my shell history now though :
<adrien> :P
ulfdoz has joined #ocaml
<wmeyer> I had a quick look, so far looks good, I'll have another glance once I will fix git svn issue
<wmeyer> pippijn: yah, it was sometime ago, the trouble was of course, that not everything works as expected
<pippijn> what doesn't work?
contempt has quit [Ping timeout: 256 seconds]
contempt has joined #ocaml
pippijn has quit [Quit: Segmentation fault]
pippijn has joined #ocaml
breakds has quit [Quit: Konversation terminated!]
<wmeyer> that works thanks
<wmeyer> well, I had my sources only on the netbook
<wmeyer> but I unisoned them now
<pippijn> did I miss anything?
<wmeyer> no
<pippijn> what works?
<wmeyer> it works
<wmeyer> treematch
<pippijn> ok
<pippijn> good
<pippijn> you don't need to prepare-tree anymore
<pippijn> just "obuild" in the treematch source dir
ulfdoz has quit [Ping timeout: 264 seconds]
<wmeyer> I just noticed that my Emacs has support for ansi escape codes in the buffer
<wmeyer> oh no Perl
<pippijn> hm?
<pippijn> you have no perl?
<wmeyer> obuil is perl?
<wmeyer> i have
<wmeyer> the question is Y you did it to me :)
<pippijn> well
<pippijn> did you actually look at the script?
<wmeyer> yes
<wmeyer> i am looking now
<pippijn> obuild = omake rootdir=$(dirname $(which obuild))
<tobiasBora> Is there a way to do sqrt with the Num library ?
<wmeyer> pippijn: Is it script/obuild directory?
testcocoon has quit [Ping timeout: 245 seconds]
<pippijn> ah, actually no
<pippijn> $(dirname $(dirname $(which obuild)))
ulfdoz has joined #ocaml
<pippijn> and also setting the OMAKEPATH
<pippijn> because you need to add the obuild directory to OMAKEPATH, so omake can find the obuild omake scripts
<pippijn> wmeyer: what should it be written in, according to you?
<wmeyer> it worked for the first time
<wmeyer> but now I have
<wmeyer> ah
testcocoon has joined #ocaml
<pippijn> what did you do?
<wmeyer> ok works
<pippijn> did you execute the script I gave you?
<wmeyer> it does not in treematch
<wmeyer> works sorry
<pippijn> wmeyer: does remake work?
<pippijn> $obuildpath/script/remake
<Albe> anyone could help me?
<Albe> I need to write a CAML prog ( not OCAML) that given three 3-letter words serch if the letters are present in the given words and in that case it will return true otherwise false. The program must use the deterministic automata.
<wmeyer> pippijn: yes
<wmeyer> now I am able to work on this
<pippijn> remake rebuilds treematch on every file change
<wmeyer> actually I will start using merlin now :-)
<wmeyer> today will be recovering configuration day
<rks`> about time wmeyer :)
Drup has joined #ocaml
Kakadu has joined #ocaml
Kakadu has quit [Client Quit]
Kakadu has joined #ocaml
dsheets has joined #ocaml
n06rin has joined #ocaml
Albe has quit [Ping timeout: 250 seconds]
<n06rin> you know some frameworks or libraries for gamedeveloping on ocaml?
<Kakadu> lightning
<wmeyer> rks`: :-)
<n06rin> file README
<n06rin> ha ha ha
<n06rin> you serious?
<adrien> ?
<Kakadu> yep
<pippijn> recovering configuration takes a few minutes here
<pippijn> moving to a new machine or restoring an old one
<pippijn> recovering the rest of the files takes an hour or 2 (large backups)
<pippijn> wmeyer: you need better backup processes
<Kakadu> > What is the state of Qt bindings for OCaml these days?
<Kakadu> I'm curious what should I answer
<pippijn> I'm curious, too
<pippijn> but you're the only one who can decide it
<adrien> well
<adrien> which features are missing?
<Kakadu> users
<adrien> haha
<Kakadu> )
<adrien> you shouldn't write an email to the caml-list but put that in the documentation and point the caml-list to it
<adrien> so: what is there, what is missing, what is coming soon, how stable is it
<adrien> do you have screenshots of applications you've made using it?
gour has quit [Disconnected by services]
gour_ has joined #ocaml
<wmeyer> pippijn: right, the failures don't happen that often ...
<pippijn> yeah
<pippijn> still :)
<pippijn> I have had 1 hdd failure in my life
<Kakadu> adrien: some halloworlds are there: http://kakadu.github.io/lablqt/qtquick-helloworld.html
<Kakadu> and I can make one of qocamlbrowser
<wmeyer> pippijn: remake works
<pippijn> nice
<gour_> Kakadu: some more missing stuff :-( - http://pastebin.com/iq4wXihF
<wmeyer> actually it doesn't
<pippijn> in what way?
gour_ is now known as gour
<pippijn> oh yeah
<pippijn> of course
<pippijn> ok.. hm
<Kakadu> > /usr/bin/ld: warning: libicui18n.so.51, needed by /home/gour/Qt/5.1.1/gcc_64/lib/libQt5Core.so, not found (try using -rpath or -rpath-link)
<pippijn> wmeyer: remake expects all your sources to be in src/
<gour> Kakadu: yeah, i've only so.48
<pippijn> I'll lift that limitation someday
<gour> Kakadu: it looks as sid is too old for lablqt
<Kakadu> gour: can it be debian packaging issue?
<wmeyer> pippijn: so what should I do?
<gour> Kakadu: you're also on debian?
<Kakadu> Afair I have not put any libICU secific linking commands
<pippijn> wmeyer: mkdir src
<Kakadu> gour: yes, but I use Qt5 built from source
<pippijn> wmeyer: mv baselib treematch src/
<pippijn> wmeyer: echo 'recurse-into (src)' > OMakefile
<pippijn> wmeyer: remake
<gour> Kakadu: i also installed qt5 via installer
<adrien> Kakadu: hmmm
talzeus has joined #ocaml
<adrien> Kakadu: you have the contents but there's something missing
<adrien> I find it a bit hard to follow
<Kakadu> I have never been good at writing...
<adrien> Kakadu: do you know asciidoc?
<Kakadu> what is this?
<gour> it's nice, but i don't like docbook toolchain
<adrien> it's a language and a tool to generate cute documentation from tet with light markup
<gour> ala resT/Sphinx
<adrien> you can avoid the docbook toolchain iirc; especially for html output
<gour> yeah, but not for pdf
<wmeyer> OK I did that
talzeus__ has joined #ocaml
<pippijn> I'm using markdown and POD for my website for now
<wmeyer> pippijn: but still the same problem, the initial build worked
<adrien> you can port a README from plain README to asciidoc in a few minutes
<wmeyer> I moved stuff/ to src/
<adrien> it could be any other tool but I find asciidoc pretty good
<wmeyer> then spawned remake
<pippijn> wmeyer: so, you are now in a directory in which you have _build/ and src/ (and other stuff)?
<pippijn> wmeyer: and then you do "remake"
<wmeyer> and where should I execute it, in the root/, src/ or treematch/
<pippijn> in the root
<adrien> it will give you automatic TOC, visual styles, blocks for code with an appropriate style, ....
<Kakadu> adrien: asciidoc?
talzeus has quit [Ping timeout: 240 seconds]
<wmeyer> pippijn: I launched the script in root and it still does nothing http://pastebin.com/rNmihcLx
<wmeyer> (maybe it's doing something but can't see it from the output)
<adrien> that or any other tool with a similar approach; should make your doc easier to read without requiring you to spend hours on it
<pippijn> wmeyer: code 2?
<pippijn> I have no idea
<pippijn> can you launch it in a proper terminal emulator?
Kakadu has quit [Quit: Konversation terminated!]
<wmeyer> I don't use terminal when building, but I use Emacs, but wait a second: http://pastebin.com/1TZBc6fA
<pippijn> and then?
<wmeyer> well, that's what I do, when the file is changed only first line appears
<wmeyer> do/doing appear/apparing
<pippijn> hm
<pippijn> oh, I know
<pippijn> obuild is not in your path
<pippijn> I'll fix it
<wmeyer> ok
<pippijn> wmeyer: why did you get the message twice?
<wmeyer> I will add it to the path
<wmeyer> no idea
<wmeyer> nope
<wmeyer> the same
Kakadu has joined #ocaml
Kakadu has quit [Remote host closed the connection]
Kakadu has joined #ocaml
<pippijn> wmeyer: so running remake does not give you any output with "*** omake" in it?
<wmeyer> the good news is that the initial build worked without a hitch
<wmeyer> no
<pippijn> but running "obuild" does?
<rks`> one question for you : why are you using omake ?
<adrien> gildor: hi, around? I'm trying to get the archives of the developer list for lablgtk but I can't find which credentials I have; everything I've tried has failed (my nick on it is "camarade_tux")
<pippijn> rks`: I'm too lazy to answer it for the 15th time
<rks`> ok pippijn, let me rephrase
<rks`> why are you using omake and not jenga? :)
* pippijn checks jenga
<pippijn> never heard of it
<pippijn> oh, I did hear of it
<wmeyer> pippijn: obuild is working but nit remake
<pippijn> the monadic thing?
wmeyer has left #ocaml []
<rks`> I wouldn't describe it at the monadic thing, more as « the thing janestreet decided to implement because omake was too slow for them »
wmeyer has joined #ocaml
<pippijn> omake is slow
<pippijn> that's why I have remake
<wmeyer> what remake does?
<pippijn> apparently nothing for you
<rks`> :D
<wmeyer> that's good, I enjoy blazingly fast build
<pippijn> wmeyer: can you send me a strace output of it?
<wmeyer> too bad that the binaries are unchanged
<wmeyer> yes.
<adrien> gildor: found; I was assuming the password was the same as the forge one
<pippijn> rks`: I might look into it
<adrien> (aaaaannnndddddd there was nothing to see in the archives)
<pippijn> rks`: but now I already have the whole omake infrastructure
<pippijn> wmeyer: btw, pull in obuild
<rks`> pippijn: well, you could write an alternative omakeroot
<rks`> which would output something that jenga could easily understand
<pippijn> yes
<rks`> from all your omakefiles
talzeus has joined #ocaml
<pippijn> that's actually planned
<rks`> but I understand it's a pain
<pippijn> but it's not so easy
<rks`> oh, good for you
<rks`> yeah
<pippijn> omake has a bug that keeps me from using its OO features
<pippijn> which is really sad
<pippijn> because those features would make everything a lot cleaner
<pippijn> and that would make "generate $otherbuildsystem scripts" easy, too
<pippijn> easier*
<wmeyer> pippijn: here is the strace log: http://danmey.org/log
talzeus__ has quit [Ping timeout: 256 seconds]
<pippijn> what happened to that log?
<wmeyer> what do you mean?
<pippijn> it has everything twice
<pippijn> did you look at the log?
<pippijn> brk(0brk(0) = 0x9e6000
<pippijn> ) = 0x9e6000
<wmeyer> pippijn this is an output from : strace remake 2&> log
<pippijn> is your strace broken?
<pippijn> why does it output everything twice?
<pippijn> not twice
<pippijn> it's unreadable :\
<pippijn> some of it is 20 times
<wmeyer> does obuild spawn many proceses?
<wmeyer> then you have an answer
<pippijn> but obuild is not spawned, is it?
<wmeyer> it's not remake is being executed
<pippijn> wmeyer: strace -f remake 2> log
<pippijn> I don't know what the & in your 2&> does
<wmeyer> OK, done
<wmeyer> suppose to be 2>&1
<wmeyer> ;)
<wmeyer> i barely remember re-direction flags of zshell
<pippijn> ok
<adrien> strace -tt -f -o log remake
<wmeyer> \o/
<adrien> "-o log" is way superior
<pippijn> oh yes
<pippijn> -tt is not important
<pippijn> but -v
<adrien> habit :)
<wmeyer> that's or other way pippijn you have it now
<wmeyer> please take a look
<pippijn> yes, where is it?
<pippijn> oh, at log?
<wmeyer> the same location
<pippijn> yes, better
* wmeyer will take a short nap
<pippijn> well
ollehar has quit [Ping timeout: 260 seconds]
<pippijn> execvp is a stupid system call
<pippijn> I mean library call
<pippijn> it does execve on every possible path in $PATH
<pippijn> until one succeeds
<pippijn> I guess it's faster than stat'ing first..
<pippijn> wmeyer: [pid 22192] write(1, "*** omake: reading OMakefiles\n", 30 <unfinished ...>
<pippijn> wmeyer: are you *sure* you don't see that when running remake?
<adrien> pippijn: if you're going to do a ssycall anyway and the kernel is going to check the file exist anyway
<adrien> yeah, execve without stat should be faster
<adrien> that said, you could cache results
<adrien> otoh I don't think it's what takes time
<pippijn> no, you can't
<pippijn> unless you also invalidate that cache when PATH changes
<pippijn> and then I don't think it's worth it
<pippijn> besides
<pippijn> adrien: the old process is dead after a successful execve
<pippijn> where is the cache?
<adrien> I meant, cache it from yhour application
<pippijn> if you're going to do a lot of fork+exec, yes
<pippijn> anyway
<pippijn> now I do want -tt
<pippijn> because it was interrupted
<pippijn> [pid 22191] kill(22192, SIGINT) = 0
<pippijn> wmeyer: 16:38 < pippijn> wmeyer: so running remake does not give you any output with "*** omake" in it?
<pippijn> wmeyer: first of all, are you sure about this?
<pippijn> wmeyer: and second: can you run "strace -tt -f -o log remake"?
demonimin has quit [Ping timeout: 245 seconds]
demonimin has joined #ocaml
asmanur has quit [Ping timeout: 264 seconds]
asmanur has joined #ocaml
talzeus has quit [Read error: Connection reset by peer]
Oejet has joined #ocaml
ontologiae has quit [Ping timeout: 246 seconds]
xavierm02 has joined #ocaml
<xavierm02> Hey. I recall seing something about a function that would somehow get typed by its first call and if you then wanted to call it on something with another type, you got an error. And to prevent that, you had to kind of "force" polymorphism. But I can't recall more than that and couldn't make it happen by trying a few weird functions. Does it ring a bell for anyone here?
<mrvn> happens
<mrvn> let f = let a = ref [] in function x -> a := x :: !a;;
<mrvn> val f : '_a -> unit = <fun>
<mrvn> but maybe that isn't what you ment. Because you can't make this polymorphic at all.
Yoric has joined #ocaml
<mrvn> You also can loose polymorphism when you have "let foo = Foo.foo" instead of "let foo x = Foo.foo x".
<ggole> let map_id = List.map (function x -> x)
<ggole> And the fix is to eta expand: let map_id xs = List.map (function x -> x) xs
<mrvn> I can't think of an example offhand but sometimes you also have a perfectly polymorphic function but by using it in the same module ocaml decides you didn't want it polymorphi and inferes a specific type.
<xavierm02> Thank you for answering. :) I'm not sure I got it though. It's a module thing? I can't get one example without a module?
<mrvn> The first one, the ref, works without module
<ggole> I gave you an example.
<ggole> Which is from the manual, no less!
<xavierm02> it's in the manual?
<xavierm02> I couldn't find it >_<
<mrvn> xavierm02: If you reimplement List.map then I think it would still break even though its in the same module.
boogie has joined #ocaml
<xavierm02> I tried
<xavierm02> Error: The type of this expression, '_a list -> '_a list, contains type variables that cannot be generalized
<mrvn> xavierm02: well, you need to fully use it
<mrvn> xavierm02: the problem is the same, you just get a different error because nothing inferes what the '_a is.
<xavierm02> hm
ben_zen has joined #ocaml
<xavierm02> but if I give the second argument, it doesn't force a type
<ggole> Apply it to two different types.
<ggole> let map_id = List.map (function x -> x) in map_id [1], map_id [None];;
<mrvn> # reverse [1;2;3];;
<mrvn> - : int list = [3; 2; 1]
<mrvn> # reverse [1.;2.;3.];;
<mrvn> Error: This expression has type float but an expression was expected of type int
<ggole> let map_id xs = List.map (function x -> x) xs in map_id [1], map_id [None];;
<xavierm02> it doesn't let me define reverse
<xavierm02> I get the error right away
<mrvn> xavierm02: works fine in the toplevel
<xavierm02> oh
<mrvn> can't work if you compile a module
<xavierm02> yay
<xavierm02> it works :)
<xavierm02> (or doesn't but that's what I wanted :D )
<xavierm02> Thank you :)
palomer has joined #ocaml
<palomer> hey, I'm using lwt to write an http server
<palomer> (fun!)
<palomer> my current mail loop is: let rec loop () = accept socket >>= fun (fd, addr) -> process fd addr >>= fun _ -> loop () in loop ()
<palomer> unfortunately, that's not tail recursive
<palomer> or is it?
<def-lkb> it seems ?
<palomer> it seems what?
<def-lkb> it eems tail-recursive.
<def-lkb> monadic style build continuation functions allocated on heap, not on stack
<palomer> why is it tail recursive?
<mrvn> because the recursion is at the tail
<palomer> the tail is (>>=), no?
<mrvn> the tail is loop ()
<mrvn> I assume the >>= operators are tail recursive too
<def-lkb> yes, in this sense you are right: your call is tail-recursive if (>>=) is tail recursive, hopefully it is in Lwt
<palomer> let rec foo x = add (foo (x + 1) ) <-- clearly this isn't tail recursive, yes?
<def-lkb> yes, but your code is wrapped in a fun () -> _ that delays execution
<mrvn> palomer: no, but let rec foo x = add (fun _ -> foo (x + 1) ) could
<def-lkb> so evaluation of the continuation is left under control of (>>=)
Yoric has quit [Ping timeout: 264 seconds]
Yoric has joined #ocaml
<wmeyer> hi pippijn
<wmeyer> (nap done)
palomer has quit [Ping timeout: 255 seconds]
<whitequark> is there any progress wrt/ Windows cross-compilation?
Yoric has quit [Ping timeout: 256 seconds]
<pippijn> hi wmeyer
<wmeyer> whitequark: once I resolve issue with my machine, there will be, rest of the patches being reviewed for inclusion at the moment
Yoric has joined #ocaml
chrisdotcode has joined #ocaml
tane has joined #ocaml
<whitequark> wmeyer: awesome
Yoric has quit [Ping timeout: 260 seconds]
ygrek has joined #ocaml
Drup has quit [Ping timeout: 260 seconds]
xavierm02 has quit [Ping timeout: 256 seconds]
zpe has joined #ocaml
walter has joined #ocaml
n06rin has quit [Quit: Leaving.]
pango_ is now known as pango
xavierm02 has joined #ocaml
Drup has joined #ocaml
Drup has quit [Client Quit]
Drup has joined #ocaml
<whitequark> so I need to wrap this method in ocaml: http://pastie.org/8325813
<whitequark> (cough)
<whitequark> what's the best way of doing it? labelled arguments all the way down?
<adrien> erk
<adrien> does it have default values?
<whitequark> I think so, but not the mutators for them
<whitequark> so, once created, forever created.
<adrien> then yeah, maybe labels and optional arguments
zpe has quit [Remote host closed the connection]
<whitequark> yeah... thanks
<whitequark> 16 arguments. probably the worst API I've ever seen
<adrien> don't worry
<adrien> it'll change by next version :D
<whitequark> it's been pretty stable actually; it's pinned to DWARF more or less
<ggole> Wow. Reminds me of the Windows API.
<whitequark> the alternative is assembling debug metadata by hand, and trust me, it's much worse.
<mrvn> shouldn't some of those be in a struct?
<mrvn> Like File + LineNo would be a location
<whitequark> mrvn: dunno. what it does is assembles metadata, think "type metadata = String of string | Integer of int | Metadata of metadata list"
<whitequark> so it's a pretty thin wrapper
<mrvn> LLVMValueRef is basically just a pointer, right?
<whitequark> yes, it's an opaque pointer.
<whitequark> `metadata' appears externally as LLVMValueRef's.
Drup has quit [Ping timeout: 256 seconds]
<mrvn> Hey, C pointer have types. Lets not use that and make them all the same so we don't detect errors.
<whitequark> mrvn: I don't think C type system can represent inheritance
dkg has joined #ocaml
<mrvn> no. but you can still have different pointer types.
<whitequark> there are different pointer types... for example there's LLVMTypeRef and others
<whitequark> but all the hierarchy of values has to be flattened into one type, I guess.
<mrvn> LLVMValueRef Ty. I bet that should be a LLVMTypeRef.
<whitequark> nope, it's a reference to (DWARF) metadata describing the type, not the actual type itself.
<mrvn> the LLVMDwarfRef
<mrvn> +n
ygrek has quit [Ping timeout: 246 seconds]
<whitequark> then you would limit yourself to only being able to feed metadata emitted by DIBuilder back into it
Kelet has quit [Read error: Connection reset by peer]
Kelet has joined #ocaml
<whitequark> which is surely not what I want, if I develop a compiler for a new language which is by definition not covered by default (read: geared to C/C++) metadata classes.
<mrvn> yeah, that would totaly prefent passing the LLVMValueRef Fn as dwarf info :)
zpe has joined #ocaml
<whitequark> it's slightly funny actually. OCaml type system combined with checks in LLVM makes interacting with it rather safe
<whitequark> however if you use FFI from Ruby, it'll just segfault if it doesn't like anything
<whitequark> and C types won't help you if you do FFI
zpe has quit [Remote host closed the connection]
<dkg> hi, i have some ocaml that has what i think is a "string" object, and i want to test if it is a single-byte string where the byte is the null byte. how can i test that?
<whitequark> str = "\x00"
<dkg> whitequark: thanks!
<wmeyer> ping pippijn
Drup has joined #ocaml
tobiasBora has quit [Read error: Connection reset by peer]
Kelet has quit [Quit: Leaving]
Kelet has joined #ocaml
Kelet has quit [Client Quit]
Kelet has joined #ocaml
ihm1 has joined #ocaml
Kelet has quit [Read error: Connection reset by peer]
Kelet has joined #ocaml
ihm1 has quit [Quit: ihm1]
Yoric has joined #ocaml
skchrko has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
ihm1 has joined #ocaml
<wmeyer> pippijn: I am building treematch with ocamlbuild
ulfdoz has quit [Read error: Operation timed out]
boogie has quit [Remote host closed the connection]
tobiasBora has joined #ocaml
Yoric has joined #ocaml
ulfdoz has joined #ocaml
palomer has joined #ocaml
rwmjones has quit [Ping timeout: 264 seconds]
Yoric has quit [Ping timeout: 256 seconds]
<pippijn> wmeyer: pong
<Kakadu> adrien: Is better now? http://kakadu.github.io/lablqt/tutorial.html
<pippijn> wmeyer: ok, treematch alone is fine to build with ocamlbuild, omake is mainly useful for me when I have 30 projects with interdependencies 5 of which I develop simultaneously
zpe has joined #ocaml
Yoric has joined #ocaml
<pippijn> wmeyer: still, I would like remake to work
rwmjones has joined #ocaml
zpe has quit [Ping timeout: 258 seconds]
<palomer> I'm trying to get a backtrace, but I'm getting this error: (Program not linked with -g, cannot print stack backtrace)
<palomer> here's how I'm compiling: ocamlfind ocamlc -g -package lwt -package lwt.unix -ppopt -lwt-debug -linkpkg -o /home/palomer/mysrc/ocaml/server /home/palomer/mysrc/ocaml/lwtserver.ml
ihm1 has quit [Quit: ihm1]
<pippijn> wmeyer: what's wrong with obuild, though?
<adrien> Kakadu: yeah, it's much nicer to browse
chrisdotcode has quit [Ping timeout: 264 seconds]
<adrien> Kakadu: can you provide a name or a title for each code sample?
<adrien> for instance, I'm not sure what is the code right before "QtQuick Controls, Layouts and Model/View pattern"
darkf has joined #ocaml
<adrien> Kakadu: also, "API documentaion can be found there and there." <- you don't have links for the "there"
q66 has left #ocaml []
<adrien> and you need to make "In method data we will return dataItem from our list if role of element is OK." a comment
q66 has joined #ocaml
rwmjones has quit [Ping timeout: 264 seconds]
<adrien> apart from that, it feels a bit heavy but that's certainly because it is still young
<pippijn> that is because it's young :)
<pippijn> just like irssi scripts ;'(
xavierm02 has quit [Ping timeout: 256 seconds]
derek_c has joined #ocaml
ihm1 has joined #ocaml
<wmeyer> pippijn: Nothing. I appreciate your work quite much, it's heavy weight though. :-)
<wmeyer> let's switch to jabber
<pippijn> wmeyer: I'm on jabber
<pippijn> wmeyer: does your client support OTR?
ggole has quit []
Snark has quit [Quit: leaving]
rwmjones has joined #ocaml
boogie has joined #ocaml
<Drup> there is an ocaml jabber chan ?
Neros has quit [Remote host closed the connection]
boogie has quit [Ping timeout: 256 seconds]
chrisdotcode has joined #ocaml
dsheets has quit [Quit: Leaving]
dsheets has joined #ocaml
<gour> Kakadu: i've problem building qt even from source - http://pastebin.com/tzgFVZRG :-/
<Kakadu> Oh
<adrien> hmmm
<adrien> fairly obvious that it errors out
<adrien> not obvious why it didn't error at configure
<Kakadu> gour: if http://qt-project.org/wiki/Building_Qt_5_from_Git will not help we should move to #qt
<gour> i passed -qt-xcb 'cause was not able to fulfill deps despite installing so many pkgs
<wmeyer> pippijn: not able to connect at the moment.
<pippijn> ok
<pippijn> does your irc client support otr?
<wmeyer> pippijn: the client is Emacs based
<pippijn> there is emacs-otr
<wmeyer> should do yes, whatever it is
<pippijn> off the record messaging
<adrien> gour: you're missing the X headers probably; most are named something-proto
<pippijn> end to end encryption
<gour> adrien: i'll leave it for tomorrow...too tired today
<dkg> does anyone know if ocaml will give me tail recursion if i use the || operator ? for example:
<dkg> let rec z = function | [] -> 0 | l::list -> test l || z list
<dkg> sorry, that should be:
<adrien> well, it's easy to test
<dkg> # let rec z = function | [] -> false | l::list -> test l || z list ;;
<dkg> adrien: how can i test it?
<adrien> change that slightly to loop infinitely
<adrien> if it doesn't "stack_overflow" within ten seconds, it's tail-rec
<dkg> oh, and see if i overwhelm the heap?
<dkg> or the stack, rather
<dkg> dang i'm rusty
<dkg> huh, it's chewing up CPU, but RAM is constant
<adrien> :)
* dkg ♥ when tools just do the Right Thing
ulfdoz has quit [Ping timeout: 264 seconds]
<dkg> adrien: thanks
<adrien> you're welcome
tobiasBora has quit [Ping timeout: 240 seconds]
ihm1 has quit [Quit: ihm1]
oriba has joined #ocaml
ulfdoz has joined #ocaml
tobiasBora has joined #ocaml
rwmjones has quit [Ping timeout: 264 seconds]
boogie has joined #ocaml
ben_m has joined #ocaml
boogie has quit [Ping timeout: 264 seconds]
<pippijn> wmeyer: ok, so you gave up on remake?
gour has quit [Quit: WeeChat 0.4.1]
<pippijn> wmeyer: you're not going to answer my questions?
tobiasBora has quit [Quit: Konversation terminated!]
tobiasBora has joined #ocaml
rwmjones has joined #ocaml
<wmeyer> pippijn: sorry, having a tea break. I am not going to give up pippijn
<pippijn> ok
<wmeyer> this is one of the two important projects I want to do at the moment
<pippijn> I'll wait for your answers, then
<wmeyer> so i am on the jabber now?
<pippijn> no
<Drup> wmeyer: the the break is an important project ? :]
<Drup> tea*
<adrien> definitely: makes you forget about the rain
<wmeyer> nope it's just reminesence of how I acted before I started drinkig coffee, and seems I don't do this at the moment it's a nice feeling :)
<wmeyer> sorry pippijn to disapoint you, we are going to make it, but give some "relaxation time" I have to run with the code
<pippijn> I'm not disappointed
<Drup> adrien : I know only the scottish part of britain, and they use whisky to forget.
<pippijn> I know what to expect
<wmeyer> I haven/t been doing hard code OCaml for quite while to note !
<wmeyer> :)
<wmeyer> and I am eagering to start again
<wmeyer> adrien: yah.
<pippijn> I have so many ideas
<pippijn> I'm looking forward to the end of my masters
Kakadu has quit []
<wmeyer> Drup: whiskey or some other form of more pure ethanol would be good, yes
<pippijn> I think I'll make a ppx thing with compiler libs for closure elimination
<wmeyer> having a compiler libs is good thing, you can retype your AST
<wmeyer> there is code of converting back to the parse tree too
<pippijn> yes
<pippijn> I won't need types, though
<pippijn> I just need scope binding
<pippijn> I think ocaml has a separate phase for that
<pippijn> at least that's what I infer from the error messages
<pippijn> and I also want perl bindings
<pippijn> I started the repo at pippijn/ocaml-perl
<pippijn> but I won't have time to code anything before the end of this month
<wmeyer> one of the ideas is too convert parse tree to Treematch tree
<wmeyer> that ringed my bell
<wmeyer> and see if we can implement some of the passes using treematch
<pippijn> yes
<pippijn> but you know I won't let you hold me back
<pippijn> if treematch isn't ready, I'll code it by hand
<wmeyer> let me get back to loop
<wmeyer> I trust we can come back to pre-winter time
<Drup> I head that a few time but, what is treematch, ?
<pippijn> of course, when it becomes ready, I will gladly adapt my code to treematch
<wmeyer> this time, I have to say, have less time
<pippijn> Drup: a bunch of great ideas with no implementation
<pippijn> there is a parser, though :)
<wmeyer> Drup: you would ask what treematch aims ot be :)
<wmeyer> pippijn: not only to defend slightly myself
<Drup> What will be treematch ? :D
<wmeyer> there is codegen, simple typing, and AST inference
<pippijn> Drup: structural rewriting
<wmeyer> Drup: in short rewrite engine
<pippijn> Drup: like maude
<pippijn> but in ocaml and in cool
<pippijn> with lots of neat features that make it more usable than anything else
<wmeyer> yes!
<wmeyer> treematch rocks (when it's ready)
<pippijn> treematch will rock
<wmeyer> the name is misleadin though now
<wmeyer> but will keep it
<pippijn> glrgen sort of rocks already, I think
<pippijn> producing dypgen style dynamic parsers with it would also be possible at no additional performance hit
<wmeyer> yes, I am certain about it.
<pippijn> my LR item set computation is quite fast (0.4 seconds for the C++ grammar)
<pippijn> I think it could be faster, though
<pippijn> menhir takes way less time.. I don't know how they do it, I don't understand their code
<pippijn> I'm faster than dypgen in every aspect
<pippijn> item set computation and runtime
<Drup> dypgen got other quality than pure speed :]
<pippijn> maybe if I run my de-closure transform on the item set code, it could be faster
<pippijn> I'm not sure how much closure allocation I do in inner loops
<Drup> the whole self-extensible thingy us quite ... impressive.
<Drup> is*
<pippijn> Drup: it is nice, yes
<pippijn> but not really that impressive from the quick glance I took at it
<pippijn> maybe I didn't quite get it yet
<wmeyer> so it will be cool for the user or even the engine to choose backend
<wmeyer> i don't know why it's slower than menhir
<wmeyer> but for sure if you detect the CFG grammar you could make it as fast as menhir
<wmeyer> in other amigious cases use GLR
<pippijn> wmeyer: hm?
<pippijn> oh, well
<wmeyer> it's not decidable problem?
<pippijn> you misunderstood
<pippijn> it is perfectly decidable
<pippijn> and extremely simple
<pippijn> I'm not talking about the parser core, though
<pippijn> 23:05 < pippijn> my LR item set computation is quite fast (0.4 seconds for the C++ grammar)
<pippijn> 23:06 < pippijn> menhir takes way less time..
<pippijn> that means, generating the tables
<pippijn> Drup: can dypgen add rules while parsing?
<pippijn> Drup: or only before parsing?
<pippijn> because the latter is very easy
<Drup> the former
<pippijn> then that's impressive
<pippijn> any idea how they do that?
<Drup> no fucking idea
<wmeyer> pippijn: they don't use table
<wmeyer> tables they directly generate the code
<pippijn> wmeyer: how do you know?
<wmeyer> you could even use LLVM backend
<wmeyer> from the manual
<pippijn> what their compiler does is produce a data structure that represents the grammar
<pippijn> all the rules are simply there as lists of strings and closures for semantic actions
<pippijn> but at runtime, they must produce tables (or not?)
darkf has quit [Read error: Connection reset by peer]
<pippijn> or do they produce a graph?
<pippijn> still, table = graph
<pippijn> they do have LR item sets
darkf has joined #ocaml
<pippijn> so whether or not they have actual tables for their graph or do it another way
<pippijn> in effect, they have the LR item set graph
<pippijn> can you just add rules to the graph after it's been produced?
<pippijn> maybe you actually can
<pippijn> wmeyer: I've been thinking about the LLVM thing
<pippijn> wmeyer: my LR backend (not GLR) is very simple (100 lines of ocaml)
<wmeyer> yeah, why not
<pippijn> why not what?
<wmeyer> LLVM backend
<pippijn> ah
<pippijn> you mean runtime code generation?
<wmeyer> no, you can even go to generate static ir files
<pippijn> it would have to call caml_applyN for the semantic actions
<wmeyer> i can give you ast and pretty printer
<pippijn> no, that's no fun :)
<pippijn> it's more fun to JIT the LR tables
<wmeyer> it's your choice, i don't know the details :-)
<pippijn> because then you have potential runtime extensibility
<pippijn> the GLR code is very complex, though
<wmeyer> i know it can spelize some of the nodes, or mark them hotter
<pippijn> it's several orders more complex than LR
<pippijn> LR parsing is a simple loop with 2 branches
<pippijn> if shift => do shift else if reduce => do reduce else => error
<wmeyer> but the LR generator must be more complex
<pippijn> the stack is a stack
<wmeyer> try to generate the code instead
<wmeyer> look at the menhir output
<pippijn> I know
<pippijn> I can generate ocaml code, like menhir
xavierm02 has joined #ocaml
<pippijn> but I don't know how to do that for GLR
<pippijn> in LR, you're always in 1 state
<pippijn> which corresponds to 1 function
<wmeyer> probably you need intermediate language
<wmeyer> that supports fork operation
<pippijn> in GLR, you have no idea how many states you can be in
<pippijn> could be 1, 2, 30 or 144111
<pippijn> or anything else
<pippijn> wmeyer: but you suggested generating ocaml code
<wmeyer> yes, from that IR
<wmeyer> it's a matter of choosing IR
<wmeyer> and compiling/interpreting that IR
<pippijn> I think you're quite hung up to "IR is the magic answer to everything"
<pippijn> just pick the right IR and all your problems are solved
<wmeyer> for prolog you have WAM machine, for GLR it's a interesting research problem
<wmeyer> yes I believe so :-)
<pippijn> for GLR, you have tables you interpret
<pippijn> just like LR
<wmeyer> sorry, that's it from what I can say about GLR :)
<pippijn> LR tables encode a recursive program
<pippijn> they *are* the IR
<wmeyer> the other topic is that IR itself
<wmeyer> everything is a language
<wmeyer> but maybe not optimial
<pippijn> LR tables have been found to be pretty optimal, though
<wmeyer> you can compile Caml code to BF too
<pippijn> this is not constructive
ben_m has left #ocaml []
<pippijn> anyway, it would be a nice thing to have JITed LR tables
<pippijn> and I think not particularly hard
<pippijn> I'd probably compile the complete table before starting
<wmeyer> because LR algorithm is so simple
<wmeyer> then tables are enough
<pippijn> what?
<pippijn> GLR also uses tables
<wmeyer> and that's even justifies using GLR
<pippijn> what do you mean "tables are enough"?
<pippijn> tables are always enough
<wmeyer> so, tables are very low level
<wmeyer> OK let me explain
Drup has quit [Ping timeout: 264 seconds]
Drup has joined #ocaml
<wmeyer> tables are subset of Turing Machine
<wmeyer> so once you generate them you can't do anything on them, pretty much simple optimisations
<wmeyer> but when you have slightly higher IR that is close to semantics of your algorithm
<wmeyer> then you can apply these domain specific optimisations
<wmeyer> and still compile to tables
<wmeyer> if you wish
<wmeyer> or to code, more easily reusing full language, not only state machine
<pippijn> ok, I see what you mean
<pippijn> GLR is a state machine algorithm
<wmeyer> but maybe it does not need to be
<pippijn> what you're suggesting is *not* using GLR
<pippijn> no, it is
<pippijn> GLR is an algorithm
<pippijn> which uses a state machine
<pippijn> end of story
<pippijn> you're suggesting going a different route, *not* using GLR but rather some other algorithm that doesn't use a state machine
<wmeyer> i though you can treat this three letter acronym as just subset of grammar it handles :-)
<pippijn> ah
<wmeyer> i'd put it like this, if it parses the language is fast, and gives result equal to GLR parser than it's fine
<pippijn> you're right
<wmeyer> last requirement is up to you
<pippijn> maybe you can
<pippijn> but
<pippijn> what will you end up with?
<pippijn> parsing is always using a state machine
<pippijn> whatever "full language" constructs you use to encode it
<pippijn> you get a token, and your program transitions into another state
<pippijn> that's how stream parsing works
<pippijn> and to be honest, I'm not impressed with the performance of high level ocaml constructs
Simn has quit [Quit: Leaving]
<pippijn> I think I'll look at menhir's output some time
<pippijn> because I'm curious how their code backend can be 4 times faster than my table backend
<pippijn> I guess it must be the array lookups that are omitted
<pippijn> this could actually speed up the GLR one quite much, too
Yoric has quit [Ping timeout: 256 seconds]
derek_c has quit [Ping timeout: 240 seconds]
<pippijn> wmeyer: I want JIT
<wmeyer> sure, use LLVM.
<wmeyer> I know you want it ...
<pippijn> I think it shouldn't be hard to generate LLVM IR that cooperates with ocaml
<wmeyer> actually the hardest task is picking the IR, this is always very problematic, but there are some rules
<pippijn> just need to call caml_applyN_exn
<pippijn> why?
<pippijn> why do I even need an IR?
<pippijn> I have a graph, which is trivially turned into code
<wmeyer> it will make your life simpler (i mean for GLR)
<wmeyer> and it only makes sense
<pippijn> oh, GLR
<wmeyer> it's pretty simple for LR
<wmeyer> but for GLR not
<pippijn> I don't even want to think about GLR code backends now
<pippijn> it's too horrible :P
<pippijn> actually not
<pippijn> wmeyer: GLR and LR are the same
<wmeyer> tablegen thouh
<wmeyer> could be BF right?
<pippijn> tablegen?
<wmeyer> so make it closer to the algorithm for generating the tables
<pippijn> I think the code produced by a GLR backend would look pretty much the same as LR
TDJACR has quit [Quit: Quit]
<wmeyer> it must not
<pippijn> except that instead of match current_state with 1 -> state_5 stack | 2 -> state_3 stack | ...
<pippijn> you get
<wmeyer> it must encode the semantics of algorithm
<wmeyer> that's the lower language
<wmeyer> that's the language you are compilng too
dkg has left #ocaml []
<wmeyer> but there is always a mid tier
boogie has joined #ocaml
<pippijn> List.map (function stack, 1 -> state_5 stack | stack, 2 -> state_3 stack | ...) states
<pippijn> overly simplified :)
ollehar has joined #ocaml
<pippijn> actually
<pippijn> it can fork in each state
<pippijn> so it's like [state_5 stack; state_10 stack]
<pippijn> also matching the token
<pippijn> GLR is stupid, anyway
<pippijn> O(n^3)
<pippijn> all C++ compilers in the wild do their typing during parsing
<pippijn> still, I think with the right optimisations, a GLR based C++ parser could be competetive
boogie has quit [Ping timeout: 264 seconds]
<pippijn> https://paste.xinu.at/ubGKd/ <- most of the C++ standard library
ontologiae has joined #ocaml
Oejet has quit [Quit: Leaving.]
<wmeyer> oups
<pippijn> btw
<pippijn> wmeyer: %%% [+2.486128s = 2.788328s] parsing user actions
ihm1 has joined #ocaml
<pippijn> 2.5 seconds for parsing
<pippijn> and another 2 for codegen
<pippijn> most of the time is spent in camlp4 code
<wmeyer> pippijn: I trust you can still do better than tables, tables where invented because they are compact, and the generator is faster
<wmeyer> but I don't know how
<wmeyer> (actually they are not that compact)
<wmeyer> before LALR was invented
<pippijn> they can be compact
<pippijn> there are table compression algorithms
<pippijn> wmeyer: yes, I think I can do better
ollehar has quit [Ping timeout: 240 seconds]
xavierm02 has quit [Remote host closed the connection]
ulfdoz has quit [Ping timeout: 264 seconds]
<pippijn> https://paste.xinu.at/jZyw/ <- #include <QtCore>
Drup has quit [Ping timeout: 264 seconds]
<wmeyer> what are the proportions, ratio?
<adrien> pippijn: you work on post-processed data btw, right?
<pippijn> post-processed?
<wmeyer> adrien: it's a C++ header adrien, he parses C++ and building AST
derek_c has joined #ocaml
<wmeyer> (big ones, C++ headers like Qt)
<wmeyer> ah cpp
<adrien> before or after 'cpp'
<adrien> :)
<wmeyer> sorry, yes, I believe it's piped through cpp before going to his parser
<pippijn> adrien: after cpp
<adrien> ='(
<pippijn> adrien: https://paste.xinu.at/Fv8/
<adrien> well, not a surprise
<adrien> still going to rely on yacfe
<pippijn> what exactly do you need?
<pippijn> do you need information on macros?
<pippijn> or do you need to undo macro expansion?
<adrien> verbatim macros
<adrien> but it's not really parseable
<pippijn> what do you need them for?
<adrien> the idea behind yacfe is that macros look like C(++)
<pippijn> yes, if they do
<adrien> macro and comments bring more information on functions and their arguments (think doxygen for instance)
<adrien> I use that to generate bindings
<adrien> need to go to bed; I'm getting really tired
<pippijn> ah
<pippijn> this is the front-end entry point
<pippijn> good night
<wmeyer> adrien: have a good night (I resolved the problem :-) )
ihm1 has quit [Quit: ihm1]
Drup has joined #ocaml
pippijn has quit [Quit: Segmentation fault]
ontologiae has quit [Ping timeout: 264 seconds]
pippijn has joined #ocaml
tane has quit [Quit: Verlassend]
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
milosn has quit [Read error: Connection reset by peer]
milosn has joined #ocaml
ollehar has joined #ocaml
gnuvince has joined #ocaml
tobiasBora has quit [Quit: Konversation terminated!]
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
TDJACR has joined #ocaml
gnuvince has quit [Client Quit]
gnuvince has joined #ocaml
gnuvince has quit [Changing host]
gnuvince has joined #ocaml
ontologiae has joined #ocaml
ontologiae has quit [Ping timeout: 260 seconds]
walter has quit [Quit: This computer has gone to sleep]
derek_c has quit [Ping timeout: 260 seconds]
ollehar has quit [Ping timeout: 246 seconds]
Neros has joined #ocaml