irc.freenode.net changed the topic of #ocaml to: OCaml 3.08 "Bastille Day" Release available ! -- Archive of Caml Weekly News: http://pauillac.inria.fr/~aschmitt/cwn , A tutorial: http://merjis.com/richj/computers/ocaml/tutorial/ , A free book: http://cristal.inria.fr/~remy/cours/appsem, Mailing List (best ml ever for any computer language): http://caml.inria.fr/bin/wilma/caml-list
mrsolo_ has joined #ocaml
Xolution has quit [burroughs.freenode.net irc.freenode.net]
mfurr has joined #ocaml
Xolution has joined #ocaml
mrsolo_ has quit [Read error: 104 (Connection reset by peer)]
mlh has joined #ocaml
mattam_ is now known as mattam
pflanze has quit [Read error: 110 (Connection timed out)]
bk_ has quit ["Leaving IRC - dircproxy 1.1.0"]
gl has quit [Read error: 60 (Operation timed out)]
fab__ has joined #ocaml
srv has quit [Read error: 232 (Connection reset by peer)]
fab_ has quit [Read error: 110 (Connection timed out)]
srv has joined #ocaml
<Smerdyakov> srv, we don't say "stuffs" in English.
mfurr has quit ["Client exiting"]
okui53 has joined #ocaml
<okui53> hello
<okui53> heh
Xolution has quit [Read error: 54 (Connection reset by peer)]
* okui53 is away: sleep
gl has joined #ocaml
mrsolo_ has joined #ocaml
haelix has left #ocaml []
mlh has quit [Client Quit]
gim has joined #ocaml
mrsolo_ has quit [Read error: 110 (Connection timed out)]
gim has quit [Read error: 110 (Connection timed out)]
gim has joined #ocaml
budjet has joined #ocaml
vezenchio has joined #ocaml
mlh has joined #ocaml
budjet has quit [Remote closed the connection]
Axioplase has joined #ocaml
<Axioplase> Chat Lu!
Iter has joined #ocaml
gim has quit ["brb"]
gim has joined #ocaml
Xolution has joined #ocaml
wegzze has joined #ocaml
<Axioplase> ++
Axioplase has quit [Read error: 104 (Connection reset by peer)]
vezenchio has quit [Read error: 110 (Connection timed out)]
Iter has quit [Read error: 110 (Connection timed out)]
bk__ has joined #ocaml
bk__ is now known as bk_
gim has quit []
mlh has quit [Client Quit]
gim has joined #ocaml
tomp has quit [Read error: 110 (Connection timed out)]
okui53 has quit [Read error: 110 (Connection timed out)]
Robert has quit ["MONEY"]
CosmicRay has joined #ocaml
malte_ has quit ["so long and thanks for the fish"]
zul_ has joined #ocaml
vezenchio has joined #ocaml
wegzze has quit [Read error: 110 (Connection timed out)]
Robert has joined #ocaml
Frag-101 has joined #ocaml
vezenchio has quit ["Hydrocon technology produces two waste products: steam and green goo. We dispose of the steam through various vents, strategi]
joel__ has joined #ocaml
jrosdahl has quit [Read error: 60 (Operation timed out)]
zigong_ has quit ["Leaving"]
zigong_ has joined #ocaml
gim has quit [Read error: 104 (Connection reset by peer)]
CosmicRay has quit ["Client exiting"]
gim has joined #ocaml
zul_ has quit ["night all"]
joel__ is now known as jrosdahl
<vincenz> Hello peopl
<vincenz> Anyone familiar with ocamlyacc?
<Smerdyakov> I've used it by modifying existing source. :)
<vincenz> Well I have taken the ANSI-C std
<vincenz> (the one that's usable...with all the left/right and precedences taken care by in the rules themselves)
<Smerdyakov> Are you writing a C parser in OCaml?
<vincenz> if one makes a c-thing with it (aka bison) it has only one shift reduce, however I get 3 and two reduce/reduces
<vincenz> yes
<Smerdyakov> For what purpose?
<vincenz> is ocamlyacc much different from bison
<vincenz> Why do you ask?
<Smerdyakov> To see if it makes sense for you to be writing this instead of using something that already exists
okui53 has joined #ocaml
<vincenz> don't you think that I might be a better authority on what I best do?
<Smerdyakov> No, since you are probably not omnipotent.
<Smerdyakov> Er, omniscient.
<vincenz> I know about frontc
<vincenz> I know about elkhound
<vincenz> I use elkhound
<vincenz> but I want to make my own cparser to do some experiments before trying to use elkhound and do my research further with c++
<Smerdyakov> OK. So the reason you don't use frontc is that you want to parse C++?
<vincenz> no
<vincenz> the reason I don't use frnotc is cause a c-parser shouldn't be TOO hard and is thus a good learning experience
<vincenz> I'm not going to attempt c++
<vincenz> I'll use elkhound if necessary
<Smerdyakov> Why do you want to parse C code?
<vincenz> for my research
<vincenz> source-to-source transformations
<Smerdyakov> What is your research going to do with the parsed code?
<vincenz> source-to-source transformations
<Smerdyakov> If you're going to do any kind of semantic analysis, you should use Cil instead.
<Smerdyakov> Parsing C and making sense of it is extremely hard.
<vincenz> c is not THAT complex...not if you compare it to c++
<Smerdyakov> It took about 5 very smart people in my research group several years to get something that works with enough software to test.
<vincenz> what makes CIL > frontc?
<Smerdyakov> There are two orthogonal reasons:
<Smerdyakov> 1) It works with most all gcc and MSVC extensions.
<Smerdyakov> 2) It translates into a simple intermediate language with very few subsets, and that language can be viewed as a subset of C for easy source-to-source transformation.
<vincenz> I don't need an IR
<vincenz> well not a std one
<vincenz> cause I need to regenerate readable c
<Smerdyakov> It's not a question of _need_. It's a question of convenience.
<vincenz> I need to regenerate readable c
<Smerdyakov> CIL's pretty-printers generate readable code.
<Smerdyakov> It will just be more verbose than if you wrote it yourself.
<vincenz> preferably as close as possible to the input
<vincenz> except where I do the transfos
<Smerdyakov> Yes, it's possible that this is a no-win situation, but if you're doing any kind of semantic analysis, you will NOT get a tool that works with even a significant fraction of open source projects, for example.
<Smerdyakov> That (produing a system that deals with all these wrinkles) has been shown pretty convincingly to take several man years.
<vincenz> hmmm
<vincenz> alright then I'll look into CIL, but I'd like to make my own first as excercise
<vincenz> and if I want to go for something robust I might go for elkhound then
<Smerdyakov> CIL is robust.
<vincenz> CIL is C
<vincenz> elkhound is C++
<Smerdyakov> You just said you weren't interested in C++, I thought.
<vincenz> no
<vincenz> I said that as a start I'll do C and then migrate to c++
<Smerdyakov> OK. Yeah, CIL won't work for that. :)
<vincenz> basically I'm going to research intermediate variable removal for non scalar variables (mostly allocated ddts)
<Smerdyakov> Now, do you know that ocaml-yacc generates filename.desc files that will explain to you where conflicts occur?
<vincenz> es
<vincenz> yes
<Smerdyakov> OK. If you look at all the conflicts and they're fine by you, then what's the problem? :)
<vincenz> they're not fine by me
<vincenz> I get a shift/reduce conflict on a RBRACKET
<vincenz> ]
<vincenz> three to be exact
<vincenz> and two reduce/reduce one on && and one on || at the same spot
<Smerdyakov> What's the context?
<vincenz> Anyways I apologize about being snappy I've often had that "are you sure you want to do your own" or "use this" on c++ when it was not the case that I needed something they suggested... sometimes it just sounds a bit patronizing
<vincenz> One is very strange
<vincenz> direct_declarator : direct_declarator LBRACKET . constant_expression RBRACKET
<vincenz> direct_declarator : direct_declarator LBRACKET . RBRACKET
<vincenz> shift/reduce conflict on a RBRACKET
<vincenz> my idea is that I mistyped something
<Smerdyakov> Well, I work in the research group that developed CIL and Elkhound, so there's often a good chance that I know more about available tools than most people. :)
Axioplase has joined #ocaml
<vincenz> ah :)
<vincenz> so you know scott
<Smerdyakov> Yup
<Axioplase> Chat Lu!
<Smerdyakov> I wonder what a direct declarator is!
Hadaka has quit [Read error: 238 (Connection timed out)]
<vincenz> I mailed him once or twice with some questions (not particularly bright ones but I had just started)
Iter has joined #ocaml
<vincenz> This is a literal transcription (well typed as I wanted to get some learning... my background is not CS so I'm not good at compilers and hence learning...only had one course (book was appel) am now reading dragon for background, then I'll do modern compiler design from grune and munchnick
<Smerdyakov> Well, you should find out what a direct declarator is if you want to understand the problem.
<Smerdyakov> I'm sure the overall grammar makes it apparent to someone who knows C.
<vincenz> it's a variable declarator without pointers
<vincenz> the second part
<vincenz> not the type part
<Smerdyakov> Which rule is it using to reduce in that case?
<vincenz> still trying to figure out the syntax of this output file
<vincenz> ah
<vincenz> nm
<vincenz> if the . is before the RBRACKEt can it still reduce that rule with a RBRACKET?
<vincenz> (aka does the lookahead symbol get used for reduction)
<vincenz> apparently so
<vincenz> nm
<Smerdyakov> I think ocaml-yacc uses LR(1) or some variant, so reduction get one symbol of lookahead.
<vincenz> yes but the RBRACKET is not for reduction
<vincenz> cause the shift rule leads to a rule that reduces after the '.' is after the RBRACKET
<vincenz> (for the case that you have somtehing like int a[]
<vincenz> a[] = direct_declarator
<Smerdyakov> OK, so which rules are conflicting?
<vincenz> shift leads to direct_declarator LBRACKET RBRACKET . (which then obviously reduces)
<vincenz> reduce..
<vincenz> How do you read this .output file?
<vincenz> got it
<vincenz> constant_explaration = epsilon
<vincenz> constant_expression: {}
<vincenz> | conditional_expression {}
<vincenz> s the offender
<vincenz> notice the {} after the :
<vincenz> I always use an | bar even on the irst...
<vincenz> oh yeah...an interesting question popped today
<vincenz> a) variables and types share namespace
<vincenz> b) variables can shadow variables in super-blocks
<vincenz> -> variables can shadow typedefs in outer-blocks?
<vincenz> s/super/outer
<vincenz> ??
bk_ has left #ocaml []
<Smerdyakov> I don't know. Try it with gcc and see?
<vincenz> then if that is the case a second question pops up
<vincenz> outer-variables are availble RIGHT upto where the inner-varaible gets defined
<vincenz> so you can do
<vincenz> {
<vincenz> int x;
<vincenz> {
<vincenz> int x = x;
<vincenz> }
<vincenz> }
<vincenz> now...
<vincenz> { typedef int x;
<vincenz> { x x; /* allowed ? */
<vincenz> }
<vincenz> }
<Smerdyakov> Heheheh
<Smerdyakov> #c would probably be a better place for such questions.
<vincenz> another thing...according to my friend I should get a shift/reduce problem on if/else (obviously)...I don't have it..
* vincenz add c++-style comments as well as bool/true/false to his c-parser
<Smerdyakov> Too bad you're writing this grammar yourself, so you can't test it on most programs, which will use gcc or MSVC extensions. ;)
<vincenz> actually it's not my grammar
<vincenz> it's quite a famous one
<vincenz> it's the ANSI-C one
<Smerdyakov> There are opportunities for mis-translating it.
<vincenz> it's a literal copy paste
<vincenz> well manual
<vincenz> you worked on Cil?
<Smerdyakov> No, but I've used it in a research setting.
<vincenz> what do you research?
<Smerdyakov> My advisor and 4 of his students worked on it and maintain it.
<vincenz> and it's odd I never cmae accross it
<vincenz> in the past I've googled and had found frontc
<Smerdyakov> The research I used it with was model checking of C code.
<Smerdyakov> I work with proof-carrying code now.
<vincenz> ?
<Smerdyakov> What?
<vincenz> what is proof-carrying code?
<vincenz> Anyawys the topic (which I just started on, the last 6 mnths I was wokring on something else (DMM) but my topic changed) is advance signal substituion (also know as intermediate variable elimination)
<vincenz> it'd be nice if the elsa part of elkhound had an ocaml version
<vincenz> profile-driven intermediate variable elimination in multimedia software (my test case is the VTc, part of the MPEG4)... obviously not scalar variables as that has been solved, nor statically analyzable arrays as that is done with the polyhedral model(something I still need to read up on)
<Smerdyakov> Fascinatin'. I prefer to avoid dealing with optimization in my research. :)
<vincenz> well I work for imec
<vincenz> most if not all is related to optimization
<vincenz> (well in my group)
<vincenz> most notably power optimization
<Smerdyakov> Yup, I'm aware that there's lots to be done with optimization. I'm more interested in correctness, though.
<vincenz> ypu, fascinating as well
<vincenz> but seing I'm an EE Master and a CS Master that's a bit TOO far away from me
<Smerdyakov> I don't follow.
<vincenz> my background is electronics, not computer science
<Smerdyakov> There is a huge hardware verification community..
<Smerdyakov> Did you mean to say "an EE Master and _not_ a CS Master" above?
<vincenz> yes
<vincenz> sorry
<vincenz> anyways that might explain my little knowhow of compilers. So I'm trying to learn, might seem a bit in vain, but it'll be a good learning experience plus it's fun :)
<vincenz> anyways my point was that as EE Msc I started at imec (electronical research activity) and they they don't go quie as far in the CS direction. I think that my topic is about as far as they go into the CS world
<vincenz> am I correct to assume however that most related work will be found on ACM?
gim has quit ["ne nuit"]
<Smerdyakov> Probably
<vincenz> alright
ronwalf has left #ocaml []
<vincenz> can CIl handle declarations that are not at the begining of the body (I know this isn't c...but)
<vincenz> like in c++
<Smerdyakov> It can probably handle it if gcc or MSVC allows it.
<vincenz> multimedia software tends to be written in C++ but C++ without operator overloading, virtuals and templates. So a translation to c is quite easy...
<vincenz> anyways I'll look into it, thnx for the suggestion
<vincenz> still not sure on how I'll handle the problem though .. I'm considering either semantic rules on an AST or make some IR that's close enough to C so I can go back but that allows me to formally reason on it
<Smerdyakov> I would recommend trying to translate C++ to C, like you said, and then using Cil. :D
<vincenz> yup :)
<vincenz> C++ is too big to reason on, plus generating C++ again ...
<Smerdyakov> Cil is amazing. Everyone loves it.
<vincenz> hehe
<vincenz> nothing like promoting home, huh?
<vincenz> :D
<vincenz> excuse me for a minute, got to go to the nightshop around the corner before it lcoses
Naked has joined #ocaml
Naked is now known as Hadaka
<vincenz> just out of curiousity, have you ever heard of imec?
<Smerdyakov> No
* vincenz nod
<Smerdyakov> Have you ever heard of Berkeley? :)
<vincenz> hehe
<vincenz> it's logical you haven't hared of imec though, you're not into electronics
<Smerdyakov> That is true.
<vincenz> don't quote me on this but I think it's the biggest electronics research center in europe
<vincenz> www.imec.be if you're curious
<Smerdyakov> I never would have guessed that Belgium would be the location for such a thing.
<vincenz> there's many spinoffs from the KULeuven university
<vincenz> especially in the dsp world
<vincenz> unofficially... dsp-valley is an area of 100-200 km radius around leuven
<Smerdyakov> Hm. The front English page has some bad English. :P
<vincenz> hehe
<vincenz> and it's quite logical I haerd of berkeley.... I went to highschool in San Diego and we had an east coast/west coast college trip in the junior year, one of the campus's was berkeley :)
* vincenz mutters
<vincenz> it complains on ocamlopt cParser.ml that cParser.cmi doesn't exist
<vincenz> (general sort of Makefile for ocaml projects)
<vincenz> is it possible to have in the .ml.cmx: to require the cmi-file? with the same prefix?
<Smerdyakov> Beats me. Try twiddling with the macro definitions. :)
<vincenz> alright
<vincenz> by the way...what's the best representation for a body?
<vincenz> a list of sequences?
<vincenz> SEQ(STM1, SEQ( STM2, STM3))
<vincenz> or
<vincenz> [STM1; STM2; STM3]
<vincenz> frontc uses a sequenec but I think that adds unnecessary depth and perhaps even handling capabilities
<Axioplase> ++
Axioplase has quit [Remote closed the connection]
mlh has joined #ocaml
<vincenz> Smerdyakov: ?
<vincenz> Want to know something neat?