ChanServ changed the topic of #ocaml to: Discussions about the OCaml programming language | http://caml.inria.fr/ | http://www.ocaml.org | OCaml 4.01.0 announce at http://bit.ly/1851A3R | Logs at http://irclog.whitequark.org/ocaml
cody__ has quit [Quit: Leaving]
Thooms has quit [Quit: WeeChat 0.3.8]
huza has joined #ocaml
huza has quit [Remote host closed the connection]
philtor has quit [Ping timeout: 250 seconds]
tautologico has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
kvelicka1 has quit [Quit: Leaving.]
jprakash has quit [Quit: leaving]
nlucaron1 has joined #ocaml
nlucaroni has quit [Ping timeout: 240 seconds]
WraithM has quit [Ping timeout: 255 seconds]
ygrek has joined #ocaml
tautologico has quit [Quit: Textual IRC Client: www.textualapp.com]
huza has joined #ocaml
lordkryss has quit [Quit: Connection closed for inactivity]
maattdd has joined #ocaml
labichn has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
tautologico has joined #ocaml
<labichn> Anyone know how to install ppx_tools in 4.02.0+trunk? It won't compile dumpast.ml for me
huza has quit [Ping timeout: 250 seconds]
labichn has quit [Quit: Page closed]
ygrek has quit [Ping timeout: 245 seconds]
scriptdevil has left #ocaml [#ocaml]
fold has joined #ocaml
q66 has quit [Quit: Leaving]
WraithM has joined #ocaml
tac-tics has quit [Ping timeout: 245 seconds]
shinnya has joined #ocaml
eikke__ has joined #ocaml
WraithM has quit [Ping timeout: 240 seconds]
rgrinberg has joined #ocaml
WraithM has joined #ocaml
lpvb has left #ocaml [#ocaml]
BitPuffin has quit [Ping timeout: 264 seconds]
BitPuffin has joined #ocaml
WraithM has quit [Quit: leaving]
racycle has quit [Quit: ZZZzzz…]
BitPuffin has quit [Ping timeout: 255 seconds]
eikke__ has quit [Ping timeout: 272 seconds]
huza has joined #ocaml
jao has quit [Ping timeout: 272 seconds]
<toroidalcode> does anyone know of any parsers written with menhir that use menhir's error-recovery system?
huza has quit [Ping timeout: 244 seconds]
SethTisue has quit [Quit: SethTisue]
axiles has joined #ocaml
huza has joined #ocaml
MercurialAlchemi has joined #ocaml
Mercuria1Alchemi has joined #ocaml
Mercuria1Alchemi has quit [Ping timeout: 272 seconds]
MercurialAlchemi has quit [Ping timeout: 272 seconds]
rgrinberg has quit [Quit: Leaving.]
badon_ has joined #ocaml
badon has quit [Ping timeout: 244 seconds]
badon_ is now known as badon
rgrinberg has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
rgrinberg has quit [Quit: Leaving.]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
tautologico has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tac_ has joined #ocaml
huza has joined #ocaml
tac_ has quit [Client Quit]
tac_ has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
rgrinberg has joined #ocaml
huza has quit [Read error: Connection reset by peer]
ygrek has joined #ocaml
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
ggole has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
rgrinberg has quit [Quit: Leaving.]
ygrek has quit [Ping timeout: 255 seconds]
huza has joined #ocaml
Kakadu has joined #ocaml
huza has quit [Read error: Connection reset by peer]
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
Simn has joined #ocaml
huza has joined #ocaml
huza has quit [Read error: Connection reset by peer]
AltGr has joined #ocaml
tane has joined #ocaml
pminten has joined #ocaml
Algebr has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Quit: Leaving.]
thomasga1 has joined #ocaml
thomasga1 has quit [Quit: Leaving.]
thomasga has joined #ocaml
thomasga has quit [Quit: Leaving.]
Hannibal_Smith has joined #ocaml
kvelicka has joined #ocaml
rand000 has joined #ocaml
pminten has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
BitPuffin has joined #ocaml
MercurialAlchemi has joined #ocaml
Mercuria1Alchemi has joined #ocaml
maattdd has joined #ocaml
slash^ has joined #ocaml
dorei has joined #ocaml
eikke__ has joined #ocaml
ollehar1 has joined #ocaml
maattdd has quit [Ping timeout: 250 seconds]
ygrek has joined #ocaml
Thooms has joined #ocaml
BitPuffin has quit [Ping timeout: 255 seconds]
ivan\ has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
Hannibal_Smith has quit [Quit: Sto andando via]
darkf has quit [Quit: Leaving]
ollehar1 has quit [Quit: ollehar1]
eikke__ has quit [Ping timeout: 260 seconds]
ggole has quit [Ping timeout: 246 seconds]
ggole has joined #ocaml
rand000 has quit [Quit: leaving]
testcocoon has quit [Quit: Coyote finally caught me]
maattdd has joined #ocaml
ivan\ has joined #ocaml
huza has joined #ocaml
testcocoon has joined #ocaml
maattdd has quit [Ping timeout: 255 seconds]
Thooms has quit [Ping timeout: 260 seconds]
SethTisue has joined #ocaml
bezirg has joined #ocaml
q66 has joined #ocaml
bezirg has quit [Client Quit]
<Algebr> When menhir says that a production foo is never reduced, that means that foo is never reachable from the start state?
bezirg has joined #ocaml
bezirg has quit [Client Quit]
lordkryss has joined #ocaml
<Algebr> So confused on why I get an epsilon cycle on this code, http://lpaste.net/109163
<Algebr> happens on line 22
<def`> Algebr: or that it recognize no finite words (though the message cannbe slightly different)
bezirg1 has joined #ocaml
bezirg1 has quit [Client Quit]
bezirg1 has joined #ocaml
bezirg1 has quit [Client Quit]
bezirg1 has joined #ocaml
bezirg1 has quit [Client Quit]
bezirg1 has joined #ocaml
bezirg1 has quit [Client Quit]
bezirg1 has joined #ocaml
reventlov has quit [Quit: leaving]
<def`> Algebr: expressions can be empty, I think that's what your problem comes from
reventlov has joined #ocaml
huza has quit [Quit: WeeChat 0.3.8]
<Algebr> How do you track these things down?
<Algebr> Just reasoning through it?
<def`> yep, that's quite obvious
<def`> yagl_program can be empty and followed by a top_level_code
<def`> top_level_code is statement
<def`> statement can be expression
<def`> expression can be empty
<def`> so yagl_program can be empty in infinitely many ways
<def`> for more complex errors, menhir --explain will provide you with details
<def`> but in this case it's a really basic design error (don't worry, it happens when you discover parser generators), menhir can't even go on basic grammar analysis
bezirg1 has quit [Remote host closed the connection]
BitPuffin has joined #ocaml
typedlambda has quit [Ping timeout: 250 seconds]
typedlambda has joined #ocaml
sad0ur has quit [Ping timeout: 245 seconds]
axiles has quit [Ping timeout: 260 seconds]
eikke__ has joined #ocaml
sad0ur has joined #ocaml
kvelicka1 has joined #ocaml
axiles has joined #ocaml
kvelicka has quit [Ping timeout: 245 seconds]
bezirg has joined #ocaml
agarwal1975 has quit [Quit: agarwal1975]
axiles has quit [Ping timeout: 260 seconds]
<Algebr> k, thanks def`
eikke__ has quit [Ping timeout: 260 seconds]
anddam has joined #ocaml
<anddam> trying to build website I got https://gist.github.com/anddam/383ba13fb620b6c14685 "Error: The constructor Html_block expects 3 argument(s),"
<anddam> my goal was to have the tutorials available on my computer, should I just use a web crawler?
<anddam> what's this issue about?
bezirg has quit [Quit: Leaving.]
troydm has quit [Quit: What is hope? That all of your wishes and all of your dreams come true? (C) Rau Le Creuset]
bezirg has joined #ocaml
<flux> my guess is that Omd has updated, but the source has not been
<flux> https://github.com/ocaml/omd/blob/master/src/omd.mli#L67 says the constructor Html_block takes three arguments
<flux> but md_preprocess.ml uses only one argument
<flux> perhaps you can use an older Omd to workaround the issue
<flux> can't really tell from the more recent version how it should be rewritten
dsheets has joined #ocaml
cody__ has joined #ocaml
<anddam> the point is I don't know ocaml
<anddam> I've been throught first two tutorials, and those are very basics
<anddam> basic*
<anddam> even the ocamlopt invokation has its quirks for me
<anddam> s/vok/voc/
<Drup> anddam: just use a crawler
<Drup> also you might want to grab one of the books, which would provide a more comprehensive approach
<anddam> Drup: any name?
<anddam> I'm total noob wrt ocaml
<anddam> is opam strictly tied to ocaml?
<anddam> that's a side question, while setting it up I noticed the fish support is very broken
<Drup> technically no, but at the moment, it's used only for ocaml
<Drup> RWO is available freely, which is nice
agarwal1975 has joined #ocaml
shinnya has quit [Ping timeout: 244 seconds]
agarwal1975 has quit [Quit: agarwal1975]
axiles has joined #ocaml
koderok has joined #ocaml
koderok has quit [Remote host closed the connection]
Arsenik has joined #ocaml
philtor has joined #ocaml
avsm has joined #ocaml
martintrojer has quit [Ping timeout: 250 seconds]
AltGr has left #ocaml [#ocaml]
eikke__ has joined #ocaml
rgrinberg has joined #ocaml
mort___ has joined #ocaml
Arsenik has quit [Remote host closed the connection]
Arsenik has joined #ocaml
Arsenik has quit [Remote host closed the connection]
Hannibal_Smith has joined #ocaml
Arsenik has joined #ocaml
tautologico has joined #ocaml
Algebr has quit [Ping timeout: 250 seconds]
rgrinberg has quit [Quit: Leaving.]
rgrinberg has joined #ocaml
rgrinberg has quit [Client Quit]
rgrinberg has joined #ocaml
Algebr has joined #ocaml
kvelicka1 has quit [Quit: Leaving.]
<Algebr> How do programmers usually represent three address code? I get the idea, just unsure of the implementation, like would it be a list of tuples?
kvelicka has joined #ocaml
<ggole> Datatypes would be a more usual choice (in OCaml)
<ggole> The details vary considerably though
<Algebr> ggole: So would it be like type bin_op = Add(e1, op, e2)
<Drup> yes
<Algebr> err rather, type ('a, 'b', c') = Add(a, b, c)
<Algebr> ahhh, type ('a, 'b, 'c) bin_op
<Algebr> But then how isn't that basically bytecode?
<Drup> and Add of ('a * 'b * 'c)
<ggole> That's a little overparameterized, I think
<Drup> (slightly :D)
<dsheets> need the third address somewhere
<dsheets> and op seems superfluous for Add
<Algebr> But the address is what, like a key in a map/hashtable?
<ggole> It's OK, there's the op (Add) and three arguments
<ggole> Two inputs and the output
<dsheets> Add is a constructor
<ggole> Which represents the operation under consideration?
<ggole> Oh, I see.
<Drup> I would rather do
<Drup> type operation = Add of address * address | ...
<Drup> and command = address * operation
<ggole> It's mostly a matter of style
<ggole> There are lots of ways to design an IR.
<Drup> indeed
<dsheets> you can trade off the constructor as container and constructor as tag with gadts
<Algebr> and what would address be? type address = { }?
kvelicka1 has joined #ocaml
<dsheets> and then specifically type the other tuple elements according to the op but have op values, too
<Drup> int or string, I presume
<dsheets> int64?
<ggole> If you have "named" variables, it would be whatever representation you've chosen for that
<Algebr> I'm not seeing then what's the difference of bytecode and three address code
kvelicka has quit [Ping timeout: 260 seconds]
<ggole> If you have a nameless SSA style IR, it would be more like type insn = Add of insn * insn
<ggole> (Where the "output" is the identity of the instruction itself.)
<Drup> llvm does that
<Drup> It confused me a lot at first
<ggole> It's quite natural after a while.
<ggole> Lots of compilers take that approach.
<Drup> once you are used to it, it's indeed very natural
<Drup> you will need a bit more than just a construct, though
<ggole> For rewriting?
<Drup> for uniquness
<Drup> or maybe just hashcons everything
<ggole> A possibility is something like type insn = { id : int; def = def; } and def = Int of int32 | Add of insn * insn
<Drup> ( companion_cube would jump up and down if he was here :D)
<ggole> Yeah, hashconsing everything is basically GVN
<ggole> Works well if you have a graph IR
<ggole> You can be smart about it and rig the hash/comparison to merge equivalent instructions
<Drup> yes
<ggole> Hotspot does it that way IIRC
<ggole> (Going from Click's papers, anyway.)
<Drup> back to the topic, Algebr : what difference do you make between bitcode and 3-address anyway ?
<Drup> bytecode*
<Algebr> I was thinking that bytecode was for some imagined machine
<Algebr> and three address was for an easier time to translate to C/asm
<ggole> Algebr: to answer your question, three address code is simply the practice of defining instructions in terms of a quadruple operator * dest * src * src
<Algebr> My goal is to output C code, hence I was aiming for three address code. I also get the feeling that bytecode is easier for an interpreted approach
<ggole> You can represent that in a bytecode if you like
<ggole> Or you can represent it in memory for performing optimizations on, lowering to machine code, etc
brendan has quit [Ping timeout: 272 seconds]
rand000 has joined #ocaml
<Drup> Algebr: you will want an IR to manipulate your program and an IR to output the code. The two may (and are usually) not be the same.
martintrojer has joined #ocaml
tautologico has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ollehar1 has joined #ocaml
ollehar1 has quit [Client Quit]
brendan has joined #ocaml
Hannibal_Smith has quit [Ping timeout: 240 seconds]
Hannibal_Smith has joined #ocaml
troydm has joined #ocaml
philtor has quit [Ping timeout: 244 seconds]
martintrojer has quit [Ping timeout: 260 seconds]
martintrojer has joined #ocaml
ygrek has quit [Ping timeout: 246 seconds]
kvelicka1 has quit [Read error: Connection reset by peer]
kvelicka has joined #ocaml
kvelicka has quit [Read error: Connection reset by peer]
kvelicka1 has joined #ocaml
Algebr has quit [Ping timeout: 250 seconds]
iorivur has joined #ocaml
tac-tics has joined #ocaml
tac_ has quit [Ping timeout: 245 seconds]
mort___ has quit [Quit: Leaving.]
eikke__ has quit [Ping timeout: 255 seconds]
slash^ has quit [Read error: Connection reset by peer]
agarwal1975 has joined #ocaml
agarwal1975 has quit [Client Quit]
wattenbarger has joined #ocaml
wattenbarger is now known as jwatt
jwatt is now known as jjwatt
maattdd has joined #ocaml
jjwatt has quit [Remote host closed the connection]
hbar has quit [Ping timeout: 255 seconds]
Thooms has joined #ocaml
maattdd has quit [Ping timeout: 240 seconds]
ggole has quit []
fold has quit [Ping timeout: 272 seconds]
eikke__ has joined #ocaml
igitoor has quit [Ping timeout: 240 seconds]
typedlambda has quit [Ping timeout: 250 seconds]
igitoor has joined #ocaml
typedlambda has joined #ocaml
kvelicka1 has quit [Read error: Connection reset by peer]
kvelicka has joined #ocaml
axiles has quit [Ping timeout: 244 seconds]
lordkryss has quit [Quit: Connection closed for inactivity]
artagnon has joined #ocaml
agarwal1975 has joined #ocaml
<artagnon> How do I use the define_global function from the llvm bindings?
<artagnon> I keep getting isa<X>(Val) && "cast<Ty>() argument of incompatible type!"
axiles has joined #ocaml
<jpdeplaix> artagnon: how do you use it right now ?
igitoor has quit [Changing host]
igitoor has joined #ocaml
<artagnon> jpdeplaix: Just naively; define_global sym llexpr the_module
<artagnon> llexpr is a generated expression; not a constant.
<artagnon> That's the problem, isn't it?
yomimono has joined #ocaml
<jpdeplaix> yes of course
<jpdeplaix> it should be a constant value
<artagnon> Hm, damn.
hnrgrgr_ is now known as hnrgrgr
<artagnon> Perhaps we can add a note in the docstring to make this clear?
<artagnon> s/initializer/constant initializer/
tac-tics has quit [Quit: Leaving]
<mrvn> a const expression?
<artagnon> What is is_global_constant for then?
yacks has quit [Ping timeout: 255 seconds]
<artagnon> Also: how do I implement global variables?
<artagnon> I suppose I'll have to keep track of it in a hashtable in OCaml.
<jpdeplaix> artagnon: is_global_constant is about checking if an llvalue is a global defined value I guess.
<artagnon> Ah, okay.
kvelicka has quit [Read error: Connection reset by peer]
<jpdeplaix> What do you mean by implement ?
kvelicka has joined #ocaml
<jpdeplaix> Hashtables shouldn't be necessary
<artagnon> In my language.
<artagnon> For args, I use set_value_name and hastable-add.
<artagnon> (like Kaleidescope suggests)
<artagnon> For local variables, I alloca and add to hashtable.
<artagnon> LLVM can't keep track of names, I figured.
<artagnon> Except things like function names and global constants.
<jpdeplaix> artagnon: oh yes of course. I'm using a Map for this purpose
<artagnon> Ah, okay.
<jpdeplaix> (the « gamma » value in most of the backend functions
<jpdeplaix> )
<artagnon> Hm, the LLVM bit of your compiler is very small.
<artagnon> In mine, it is the dominant portion.
tac_ has joined #ocaml
<jpdeplaix> what do you mean ? The backend or the LLVM module (which is just a module which contains some abstractions) ?
<artagnon> I thought Backend was small compared to the rest of your compiler.
<artagnon> Hm, I'm still having problems with global variables.
<artagnon> I can declare a global constant, but then I have to build_store it in each function that follows.
<jpdeplaix> Oh yes. That's true. I've a quite many things now.
<jpdeplaix> why do you have to do that ?
* artagnon is confused
Arsenik has quit [Remote host closed the connection]
<jpdeplaix> I suppose your global isn't constant so you want to do store on it.
<artagnon> Actually, no.
<artagnon> It is a constant, but that can be generated by an expression
tac_ has quit [Ping timeout: 240 seconds]
<artagnon> Like a = 1 + 1;
<artagnon> The llval of (1 + 1) turns out to be quite complex because of the boxing/unboxing I'm doing.
<jpdeplaix> then your global isn't constant
<artagnon> Right.
<artagnon> How do I implement a variable global?
<jpdeplaix> you should define your global as « define_global name Llvm.const_null m »
<artagnon> Okay.
<artagnon> Then?
<jpdeplaix> and store your real value once and for all in your initializer
Hannibal_Smith has quit [Quit: Sto andando via]
<artagnon> Ah, I should generate an initializer function immediately after the definition.
<artagnon> Thanks, I'll try it :)
<artagnon> The functions won't change the value of the global, so no need to re-initialize at each function.
ollehar1 has joined #ocaml
<jpdeplaix> mmh I mean you should have a initializer function for your program (or your modules if your langages has modules)
ollehar1 has quit [Client Quit]
<jpdeplaix> (the initializer function being called by the main)
<artagnon> Right.
<artagnon> I'll set that up.
avsm has quit [Quit: Leaving.]
kvelicka has quit [Read error: Connection reset by peer]
kvelicka has joined #ocaml
artagnon has left #ocaml [#ocaml]
lordkryss has joined #ocaml
tac_ has joined #ocaml
avsm has joined #ocaml
tac_ has quit [Quit: Leaving]
Anarchos has joined #ocaml
libertas has joined #ocaml
fold has joined #ocaml
axiles has quit [Ping timeout: 240 seconds]
axiles has joined #ocaml
yomimono has quit [Ping timeout: 245 seconds]
Kakadu has quit [Quit: Konversation terminated!]
Anarchos has quit [Quit: Vision[0.9.7-H-20140108]: i've been blurred!]
tac_ has joined #ocaml
tane has quit [Quit: Verlassend]
tac_ has quit [Client Quit]
Mercuria1Alchemi has quit [Ping timeout: 244 seconds]
MercurialAlchemi has quit [Ping timeout: 240 seconds]
Thooms has quit [Quit: WeeChat 0.3.8]
avsm has quit [Quit: Leaving.]
Simn has quit [Quit: Leaving]
darkf has joined #ocaml
darkf has quit [Changing host]
darkf has joined #ocaml
nojb has joined #ocaml
eikke__ has quit [Ping timeout: 240 seconds]
nojb has left #ocaml ["ERC Version 5.3 (IRC client for Emacs)"]
dorei has quit []
bezirg has quit [Ping timeout: 255 seconds]
axiles has quit [Ping timeout: 255 seconds]
rwmjones has quit [Read error: Network is unreachable]
rwmjones has joined #ocaml
dsheets has quit [Ping timeout: 272 seconds]
madroach has quit [Ping timeout: 250 seconds]
madroach has joined #ocaml
NoNNaN has quit [Remote host closed the connection]
NoNNaN has joined #ocaml
tac_ has joined #ocaml
rand000 has quit [Quit: leaving]