<phao>
I thought that page showed only those "most recent ones" (because I didn't see that those where the most recent ones -- I thought they were all the ones)
tufisi has quit [Ping timeout: 244 seconds]
tufisi has joined #ocaml
tufisi has quit [Ping timeout: 245 seconds]
struktured has joined #ocaml
eikke has quit [Ping timeout: 244 seconds]
Anarchos has quit [Quit: Vision[0.9.7-H-090423]: i've been blurred!]
ulfdoz_ has joined #ocaml
ulfdoz has quit [Ping timeout: 248 seconds]
ulfdoz_ is now known as ulfdoz
emmanuelux has quit [Read error: Connection reset by peer]
bokuk has joined #ocaml
bokuk has quit [Client Quit]
bokuk has joined #ocaml
furafollas has joined #ocaml
furafollas has left #ocaml []
adrien has joined #ocaml
bokuk has quit [Quit: 전 이만 갑니다.]
dsheets has joined #ocaml
isson has joined #ocaml
BiDOrD_ has joined #ocaml
BiDOrD has quit [Ping timeout: 265 seconds]
iratsu has quit [Ping timeout: 248 seconds]
Hussaind has joined #ocaml
Hussaind has left #ocaml []
phao has quit [Quit: Not Here]
lamawithonel has joined #ocaml
dwmw2_go` has quit [Read error: No route to host]
phao has joined #ocaml
lamawithonel has quit [Remote host closed the connection]
lamawithonel has joined #ocaml
dwmw2_gone has joined #ocaml
phao has left #ocaml []
hto has quit [Read error: Connection reset by peer]
phao has joined #ocaml
ftrvxmtrx has quit [Ping timeout: 245 seconds]
<phao>
the == operator is more like scheme's eq? or eqv? ?
<adrien>
the (==) equality is: if mutating one of the argument also mutates the other, then both args are equal
<adrien>
i.e. they're using the same memory location
<phao>
it looks like eq?
<phao>
adrien, the main "problem" is when it comes to literals
<phao>
3 == 3, returns true... I will never change one of these 3 to see if the other changed =)
<phao>
x is 3, x == 3 ?
<phao>
if yes (for all numbers, chars, ...), then == looks more like eqv? actually
<adrien>
yeah, ints are different
<adrien>
iirc, basically whatever does not get allocated in a block or something like that
<adrien>
there's doc about this too but you have the big picture
* adrien
afk for the day
greggies has quit [Ping timeout: 245 seconds]
osa1 has quit [Quit: Konversation terminated!]
bjorkintosh has quit [Read error: Connection reset by peer]
pango is now known as pangoafk
djcoin has joined #ocaml
Sablier has joined #ocaml
thomasga has joined #ocaml
<phao>
the keyword fun well describes functions.
<phao>
and that was really nerdy
<kaustuv>
phao: beware of false intuitions: 1.0 == 1.0 ;;
<phao>
yeah
<phao>
I should probably use == if I need to check value equality.
silver has joined #ocaml
<flux>
I wonder if people new to ocaml should even be taught about == or not. but if they know another language, they probably use == by accident at some point, and may find that their code 'works' and become extra-confused
<mrvn>
exactly.
<mrvn>
They should be told not to use == and why :)
<phao>
in ocaml, using = mostly is not actually a problem
<taruti>
isn't (==) just pointer equality and (=) the value equality? why is it so complex?
<phao>
in scheme, using equal? is something I really don't like, because a lot of decisions about types are done at run-time
<mrvn>
taruti: == is physical equality (yes, the address for pointers). The problem is that people don't always know what is a pointer and what not
<phao>
in ocaml, that's not an issue... and using = is fine
<flux>
it's not complex, but if you think == works the same as in python or perl, you might first find that indeed it does work that way, except it doesn't.
<flux>
for example with strings.
<mrvn>
taruti: # 1.0 == 1.0;;
<mrvn>
- : bool = false
<mrvn>
# 1 == 1;;
<mrvn>
- : bool = true
<flux>
also I think pointer equality is quite rarely used thing anyway.
<phao>
== doesn't seem to be pointer equality
<phao>
x = 3, x == 3 is true
<mrvn>
You need it for functions and circular structures
<taruti>
yes, could use a longer name.
<phao>
I double 3 even has an address.
<mrvn>
phao: integers are stored as tagged values, not as pointers
<phao>
=)
<flux>
well, it works as = for values that are untagged
<phao>
I like to think of ==, and eq? as a pointer equality for functions and variables
<phao>
but I just don't use them for literals
<phao>
doesn't make sense, and it's too confusing, for me.
<mrvn>
== depends on the implementation of the memory layout in the GC.
beckerb has joined #ocaml
<phao>
see, too confusing =D
<flux>
maybe it would be fair for == to throw an exception for untagged values, like = throws for functional etc values :)
<mrvn>
it would help to have a == | = operator that doesn't throw an exception for functions or goes into enless loops with identical caclic structures
<mrvn>
gotta catch a train, *wave* back soon
<kaustuv>
Unless you understand OCaml's object model, just don't use ==. You don't understand it.
<kaustuv>
PS, for fun and laughs, try: Obj.magic [] == Obj.magic None ;;
ankit9 has joined #ocaml
ftrvxmtrx has joined #ocaml
eni has joined #ocaml
<flux>
that works with plain = as well
<kaustuv>
I think the documentation for (==) is seriously misleading. It says that for e1 and e2 of a boxed type, e1 == e2 *iff* mutating also "affects" e2, but this is bogus. http://paste.debian.net/172761/
<kaustuv>
clearly it is necessary but *not* sufficient that mutating one affects the other
<Ptival>
"On mutable types such as references, arrays, strings, records with mutable fields and objects with mutable instance variables"
eikke has joined #ocaml
<Ptival>
let's argue :)
<kaustuv>
What is there to argue? You can trivially modify my example to use a record with a mutable field instead of a pair. Anyhow the documentation specifies a runtime behaviour for (==), and there is no difference between a pair and a record with two mutable fields at runtime.
Cyanure has joined #ocaml
<mrvn>
kaustuv: you aren't modifying e1/e2, you are modifying (snd e1).m
<Drakken>
Where is that misleading claim about (==)?
<kaustuv>
I was paraphrasing. Read the actual text if you want to quibble
<kaustuv>
I guess it does depend on what "physical modification" means. I interpret it to mean mutation, but I suppose it is possible to imagine that it means something else
<Drakken>
The statement only applies to mutable types. Tuples aren't mutable.
<kaustuv>
bah!
avsm has joined #ocaml
<Drakken>
booyah!
isson has left #ocaml []
emmanuelux has joined #ocaml
thomasga has quit [Quit: Leaving.]
Cyanure has quit [Remote host closed the connection]
mfp has quit [Ping timeout: 265 seconds]
<phao>
nice docs
cago has joined #ocaml
mfp has joined #ocaml
ankit9 has quit [Ping timeout: 260 seconds]
ankit9 has joined #ocaml
eni has quit [Quit: Leaving]
ankit9 has quit [Quit: Leaving]
Tobu has quit [Ping timeout: 272 seconds]
_andre has joined #ocaml
Tobu has joined #ocaml
<Drakken>
Failure: lexing: empty token.
<Drakken>
ocamlbuild said that right after I added a _tags file.
<Drakken>
but there's nothing in _tags about that target.
Yoric has joined #ocaml
<Drakken>
The error goes away when I remove _tags.
tmaedaZ has quit [Ping timeout: 240 seconds]
<Qrntz>
Drakken, could you pastebin your _tags?
tmaedaZ has joined #ocaml
<Drakken>
Qrntz there's only one entry:
<Drakken>
MetlString.ml: pp(camlp4rf)
<Drakken>
And I get the error when building Metl.cmo
<Drakken>
MetlString depends on Metl
<Drakken>
There's also Metl.mlpack, Metl/ and Metl/_tags
silver has quit [Read error: Connection reset by peer]
avsm has quit [Quit: Leaving.]
osa1 has joined #ocaml
cdidd has joined #ocaml
silver has joined #ocaml
<Drakken>
Does ocambuild ignore Foo/_tags if ./_tags exists and I'm building Foo.cmo?
<Drakken>
even if the source files are in Foo/ ?
cdidd has quit [Read error: Connection reset by peer]
cdidd has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
<Drakken>
Oh. I forgot the angle brackets.
Tobu has joined #ocaml
avsm has joined #ocaml
cago has quit [Quit: Leaving.]
bjorkintosh has joined #ocaml
rgrinberg has quit [Ping timeout: 265 seconds]
<ssbr_>
How should I find out how camlp4 lexes a string?
<ssbr_>
I'm trying to debug a parsing failure
<kaustuv>
calling camlp4of (and friends) should print out the modified ast by default
<ssbr_>
this isn't ocaml code, it's prolog code that uses the default lexer
companion_cube has joined #ocaml
<ssbr_>
eh, it's prolog code, and the parser uses the default lexer*
<kaustuv>
Hmm... maybe use #syntax on the toplevel and cut-and-paste code?
<kaustuv>
err, #camlp4o, not #syntax
<kaustuv>
(that's part of ocamlfind...)
<kaustuv>
actually, I have no idea what I'm talking about. Never mind.
<ssbr_>
camlp4o, huh?
<ssbr_>
ok. :(
<ssbr_>
I just want to see the token stream
<kaustuv>
I misunderstood your question, sorry
rgrinberg has joined #ocaml
<ssbr_>
ugh I have no idea how else to debug this
<ssbr_>
I add some syntax and things magically blow up? I guess it gets parsed by the wrong thing? But why?
<ssbr_>
and how am I supposed to know how it parses things, since it doesn't/can't prettyprint parse results?
<Drakken>
What's the error message?
thomasga has joined #ocaml
<Drakken>
How do you make sure Bar gets included in Foo when you're loading Foo with Dynlink?
<Drakken>
I tried including Bar in Foo.Bar, but that didn't work.
greggies has joined #ocaml
<Drakken>
Or more simply, how do you compile one module into the .cmo file of another module?
<Drakken>
It looks like Dynlink can't make modules available to each other.
<ssbr_>
my problem was that I was doing LIDENT instead of UIDENT because I forgot what LIDENT means. :|
beckerb has quit [Quit: Konversation terminated!]
<ssbr_>
Yup, that was it.
<Drakken>
rockin'! :)
<ssbr_>
I am so glad I have a lexer printer thinger now. This will help lots. :)
rwmjones has quit [Excess Flood]
rwmjones has joined #ocaml
Sablier has quit [Read error: Connection reset by peer]
Tobu has joined #ocaml
silver has quit [Remote host closed the connection]
othiym23 has quit [Ping timeout: 244 seconds]
gmcabrita has quit [Ping timeout: 244 seconds]
gmcabrita has joined #ocaml
gmcabrita is now known as Guest62475
Guest62475 is now known as gmcabrita
NaCl has quit [Ping timeout: 244 seconds]
NaCl has joined #ocaml
NaCl has quit [Changing host]
NaCl has joined #ocaml
greggies has quit [*.net *.split]
cyphase has quit [*.net *.split]
wtetzner has quit [*.net *.split]
ssbr_ has quit [*.net *.split]
alxbl has quit [*.net *.split]
tomprince has quit [*.net *.split]
Sablier has joined #ocaml
rixed has quit [Ping timeout: 244 seconds]
rixed has joined #ocaml
thomasga has quit [Ping timeout: 244 seconds]
djcoin has quit [Quit: WeeChat 0.3.2]
greggies has joined #ocaml
cyphase has joined #ocaml
wtetzner has joined #ocaml
ssbr_ has joined #ocaml
alxbl has joined #ocaml
tomprince has joined #ocaml
eni has joined #ocaml
bjorkintosh has quit [Ping timeout: 256 seconds]
Snark has joined #ocaml
<taruti>
Is there any good way to interface with C++ libraries?
seanmcl has joined #ocaml
<thelema_>
taruti: via c wrappers
<thelema_>
not directly
<_habnabit>
taruti, same as with C libraries; just make sure to wrap the bits that call the ocaml code with extern C
<_habnabit>
oh, is there a problem with doing it directly?
<taruti>
thelema_: it is quite a large api, thus would need to write/generate lots of wrappers.
<_habnabit>
oh, there's swig for ocaml
<thelema_>
_habnabit: object method calls
<_habnabit>
thelema_, I don't know how you do that in C
<taruti>
swig was painfull at least some years back
<taruti>
(e.g. custom operator new etc)
<_habnabit>
taruti, er, did you mean C++ objects or ocaml objects?
<taruti>
_habnabit: C++ library with custom allocators, templates, exceptions and other nasty critters.
eni has quit [Ping timeout: 252 seconds]
<taruti>
I suppose I can look into how swig works these days
<_habnabit>
oh, sorry, mistell
<_habnabit>
the, er, did you mean C++ objects or ocaml objects?
<_habnabit>
thelema_ ^
<thelema_>
Haseo: c++ objects
<thelema_>
_habnabit: c++ objects
othiym23 has joined #ocaml
<adrien>
avoid swig
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
zorun has quit [Ping timeout: 252 seconds]
zorun has joined #ocaml
<mrvn>
_habnabit: For doing it directly you would have to reimplement the c++ name mangling in ocaml and you would still need c++ wrappers to translate the ocaml values to c++ values and back.
<mrvn>
_habnabit: easier to use extern "C" and let gcc handle the name mangling for you.
<_habnabit>
mrvn, yeah, I mentioned extern C
<mrvn>
taruti: ^^^
zorun has quit [Ping timeout: 250 seconds]
<mrvn>
sorry, ENICK
zorun has joined #ocaml
avsm has joined #ocaml
mgodshall has quit [Quit: leaving]
zorun has quit [Ping timeout: 244 seconds]
zorun has joined #ocaml
zorun__ has joined #ocaml
zorun has quit [Ping timeout: 240 seconds]
zorun__ has quit [Read error: Connection reset by peer]
greggies has quit [Ping timeout: 245 seconds]
zorun has joined #ocaml
mgodshall has joined #ocaml
osa1 has quit [Quit: Konversation terminated!]
osa1 has joined #ocaml
pangoafk is now known as pango
wmeyer has joined #ocaml
<wmeyer>
hi
<adrien>
morning :p
<mrvn>
evening
<wmeyer>
mrvn: adrien afternoon
fraggle_ has quit [Read error: Connection reset by peer]
<wmeyer>
I think Camlp4FoldGenerator is wonderful
<wmeyer>
there would be more work to support other visitors though
dsheets has quit [Ping timeout: 244 seconds]
<wmeyer>
in particular FoldMap style with full full descent control
<wmeyer>
I just tried and I love SYB idea done in OCaml
flux has quit [Ping timeout: 245 seconds]
greggies has joined #ocaml
dsheets has joined #ocaml
tufisi has joined #ocaml
avsm has quit [Quit: Leaving.]
andreypopp has joined #ocaml
fraggle_ has joined #ocaml
seanmcl has quit [Quit: seanmcl]
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
seanmcl has joined #ocaml
itewsh has joined #ocaml
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
ftrvxmtrx has joined #ocaml
SanderM has joined #ocaml
Snark has quit [Quit: Quitte]
rwmjones has quit [Ping timeout: 250 seconds]
Submarine has joined #ocaml
Submarine has quit [Changing host]
Submarine has joined #ocaml
thomasga has joined #ocaml
thomasga has quit [Client Quit]
_andre has quit [Quit: leaving]
andreypopp has quit [Quit: Quit]
smondet has joined #ocaml
avsm has joined #ocaml
Yoric has quit [Ping timeout: 264 seconds]
osa1 has quit [Quit: Konversation terminated!]
Cyanure has quit [Read error: Connection reset by peer]
wmeyer has left #ocaml []
wmeyer has joined #ocaml
<wmeyer>
if that Camlp4FoldGenerator was slightly more flexible
seanmcl has quit [Quit: seanmcl]
eni has joined #ocaml
rwmjones has joined #ocaml
<pippijn>
I like how type inference enables the existence of camlp4
<Hodapp>
pippijn: Out of curiosity, what is it about type-inference that enables its existence
<Hodapp>
...?
<pippijn>
without type inference, you would need to make a lot more effort and maybe even perform a full type check
<Hodapp>
That sounds more like making it easier than enabling its existence
<pippijn>
sure
<pippijn>
but the harder something becomes, the less likely it exists
<adrien>
hmmm
<adrien>
that's not how a man's brain works ;p
<pippijn>
it is
<pippijn>
why are there no proper refactoring tools for C++?
<pippijn>
why are there a shitload of them for java?
<adrien>
oh, they exist
<pippijn>
because java is a super easy language to parse
<taruti>
java code is so bad it needs constant refactoring? :P
<adrien>
they don't necessarily work well however :P
<Hodapp>
because... C++.
<pippijn>
my point has been made
<taruti>
and no-one wants to rewrite C++.
<Hodapp>
Java can be parsed with LALR, C++.......... has a formally undecidable grammar.
<taruti>
C++ feels larger than CL and that is a lot
<Hodapp>
it's a monstrosity.
<Hodapp>
and people use it to build even uglier monstrosities.
<Hodapp>
and then they convince themselves that the fact that they just built a monstrosity must mean that they're good at coding.
<pippijn>
I used to
Tobu has quit [Ping timeout: 272 seconds]
Tobu has joined #ocaml
<wmeyer>
pippijn: C++ is a badly designed languagage - it promotes code abuse more then any other language. Supports mulitple paradigms but each one in a broken way. Refactoring C++ and completion is hard because of existance of templates - that are turing complete - and not only needs interpreter to unroll, but can't be analysed without compiler support.
<wmeyer>
Apart from that it has regulard #defines
<wmeyer>
all this stuff just makes crazy to support in tooling
<wmeyer>
not mentioning broken ABI
<pippijn>
wmeyer: proper java refactoring also needs compiler support
<wmeyer>
which is basically C ABI with mangling and additional tweaks to support multiple symbols generated by the templates
<pippijn>
wmeyer: the difference is that a complete java parser and type checker can be done within a day
<wmeyer>
pippijn: Sure, but with C++ is way harder. Java hasn't got preprocesor and template, which support weird way of metaprogramming
<pippijn>
and the same for C++ takes weeks if not months
sivoais has quit [Ping timeout: 250 seconds]
<wmeyer>
pippijn: I agree with that
<wmeyer>
pippijn: the other problem is not well formed standard, had occasion to deal with that huge book where there are some places that the creators dont comprehend
itewsh has quit [Quit: o/]
<wmeyer>
it has lot of ifs & butts that the tools need to support (including compilers)
<wmeyer>
sometimes combination of these just breaks things
<pippijn>
yes, C++ is not fun
cdidd has quit [Ping timeout: 252 seconds]
<wmeyer>
pippijn: i am so happy it
<wmeyer>
it
<pippijn>
?
<wmeyer>
it's #ocaml not #c++
<pippijn>
ah
<pippijn>
yeah
<wmeyer>
sorry my laptop keyboard is broken
<pippijn>
I'm in ##c++ actually ;)
<wmeyer>
damn! ;)
<wmeyer>
pippijn: what r u doin' there
<pippijn>
I used to write a lot of C++
<wmeyer>
me too
<pippijn>
I still do, occasionally
<pippijn>
but in the Qt framework
<wmeyer>
me too unfortunately
<pippijn>
which is a lot less absurd than what I used to do
<wmeyer>
MFC?
<wmeyer>
;)
<pippijn>
no, my own stuff with heavy template magic
<jonafan>
i used MFC
<pippijn>
I'm one of those guys who understand most of boost
<jonafan>
not cool
sivoais has joined #ocaml
<pippijn>
I'm happy to not know anything about MFC except that it has a CString
<wmeyer>
templates are quite cool - i wasn't heavy boost user - but i did have STL programs - including adapters, functors etc.
<wmeyer>
s/have/heavy/
<pippijn>
they are
<pippijn>
you can build really pretty client code with it
<wmeyer>
jonafan: MFC is bad! :-)
<wmeyer>
jonafan: wtl is maybe better
<jonafan>
i never used wtl
<pippijn>
but the things you have to do before you get your pretty client code are.. not pretty
<jonafan>
MFC did suck though
<wmeyer>
pippijn: I agree, the interface might look good, but when I see this spaghetting in the implementation..
<pippijn>
yep
<wmeyer>
they are quite powerful abstractions - i think they provide sort of type inference (throgh function templates) and type classes or modules (through template specialisaion)
<wmeyer>
but how they do is broken and was not designed for it
<pippijn>
that's the big problem
eikke has quit [Ping timeout: 265 seconds]
<pippijn>
and the awesomeness
<pippijn>
C++ can be used to build a lot of things that can be found in other languages
<pippijn>
with enough trickery, you can build almost anything
<adrien>
s/C++/asm/
<wmeyer>
pippijn: still compile needs to compile that without bugz ;-)
<adrien>
and you don't even need trickery
<wmeyer>
s/compile/compiler/
<pippijn>
wmeyer: yeah
<pippijn>
I remember something really weird I had to do to work around a gcc bug
<pippijn>
no, I don't remember
<pippijn>
let me see if it's still there
<wmeyer>
If I can wave my hand - templates are *good* but objects in C++ are *broken*, one of the things are just good and not broken that is
<wmeyer>
pippijn: i have a pleasure to work on proprierity C++ compiler ;-)
<pippijn>
ok, it's not there anymore
<wmeyer>
pippijn: perhaps there are another two lurking
<wmeyer>
and another one in the standard
<pippijn>
I had to add "int dummy = 0;" to a function body in some template so gcc wouldn't crash
<wmeyer>
:D
<wmeyer>
yes, that's quite normal - add static and volatile and see what will happen
<wmeyer>
+ 5 deep hierarchy of classes with multiple inheritance and lot of diamonds in it
<pippijn>
diamonds are forever
<wmeyer>
in fact this is cite of what one of the bug reports
<wmeyer>
and complaining that sometimes is badly compiled
<wmeyer>
pippijn: :D
<wmeyer>
pippijn: yes c++ is no fun
<wmeyer>
pippijn: no fun anymore
<pippijn>
right
<wmeyer>
and your colegues will not appreciate you on getting wild with templates
<pippijn>
very true
<wmeyer>
they will abuse allocators instead
<pippijn>
battling each other with crazy C++ abuses
<wmeyer>
one of the things that is present in every old C++ codebase, is custom memory managment
<pippijn>
yes
<wmeyer>
people just love to cast to void* and provide nice replacements for new
<wmeyer>
not mentioning custom allocators for STL
<pippijn>
I made one, using g_slice allocator
<pippijn>
from glib
<pippijn>
and it made sense, and it still does
<wmeyer>
pippijn: yes, i notice that C++ programmer wakes up with one eager in the morning, depending on the mood, she has a great choice of "abstractions" to abuse - ranging from c preprocessor, through template meta programming, reinterpret_casts, to objects and RTTI, and null pointers
<wmeyer>
pippijn: never done custom allocator - apart from the custom new operator for debugging
<pippijn>
STL allocators are not fun
<pippijn>
95% boilerplate
<wmeyer>
pippijn: and i think not easy to get right
<pippijn>
indeed
<wmeyer>
I would like to see Camlp4MapFoldGenerator
<pippijn>
map, fold, iter
<wmeyer>
yes, but the idea is that it scraps a lot of bolierplate
<wmeyer>
these unit placholders are locations and type information?
<pippijn>
yep
<wmeyer>
nice :-)
<pippijn>
I have a partial implementation of a type check
<pippijn>
but I had to stop due to a lack of time
<pippijn>
| TypedExpression of (*ty*)ctype * (*value*)Constant.t * (*expr*)expression
<wmeyer>
is you had more man power do you consider to also support C++? Just curious
<pippijn>
I really want to write | TypedExpression of { ty : ctype; value : ...
<pippijn>
wmeyer: I already considered it
<pippijn>
and I already have a working C++ parser in ocaml
<wmeyer>
pippijn: the reason for this question is - c++ is crap but we need to support it
<pippijn>
but not the least bit of type check and AST
<pippijn>
just a parser that returns unit
<pippijn>
or a parse tree
<pippijn>
made of strings and lists
<wmeyer>
pippijn: there is a feature description in mantis about it
<wmeyer>
inline records
<pippijn>
yeah, I know
<pippijn>
I'm waiting for it to happen
<pippijn>
then I will immediately change my AST to use them
<wmeyer>
keep nagging on mailing list - it might help
<pippijn>
or not, because I will work on the C++ parser instead
<pippijn>
I don't know yet
<pippijn>
C++ is such a beast
<wmeyer>
i think Alain is quite keen - and knowing him eventually will get that to trunk
tomprince has left #ocaml []
<wmeyer>
pippijn: any git repository?
<wmeyer>
i like the idea
<pippijn>
https://github.com/pippijn <- all the pieces are here, but broken apart. I just wanted to upload them so someone who likes it can use it
<wmeyer>
it's a good thing to compile c++ because - then your frontend or compiler is "certified" to be able to compile c++ which is sad but true
<wmeyer>
sad because c++ is powerful but a bit broken language and supporting is must but difficult
<pippijn>
my plan with this C thing was first to create a clean C parser in ocaml
<wmeyer>
sad because people think still is the only powerful language s out there..
<pippijn>
and also, it was my first ocaml project
<pippijn>
my introduction to ocaml
<pippijn>
and the further plan was to add features and source to source translation
<pippijn>
because it supports almost all GNU extensions and it could translate them to C89
<pippijn>
and that would be fun
<wmeyer>
pippijn: I am impressed
<pippijn>
the grammar is ugly
<pippijn>
and attributes are stupid
<wmeyer>
and this was what i was thinking about for quite long time - if i could get dragonkit working with the subset of C it would be good, but i am not there yet! but i consider this even now
<wmeyer>
so you keep your branch of Menhir? is that because C/C++ grammar is so ugly?
<pippijn>
no, menhir has sucky error messages
<pippijn>
"Syntax error" is all the information I can get
<pippijn>
unless I put error branches everywhere
<pippijn>
which either introduces conflicts or is way too coarse
<wmeyer>
OK, i know found the messages they look cool
<pippijn>
this way I can gave one error message per token/state pair
<wmeyer>
do you recover after parsing?
<pippijn>
no
<wmeyer>
s/parsing/error/
<pippijn>
it's either recovery or good error messages
<pippijn>
I can allow for recovery too
<pippijn>
but right now I handle errors with exceptions
<wmeyer>
ok
<pippijn>
error recovery was not my priority
<pippijn>
it could be done without much effort
<pippijn>
and it could be pretty awesome, too
<wmeyer>
this is the problem, but could be done
<wmeyer>
yes
<pippijn>
but
<pippijn>
you can basically forget menhir and C++
<pippijn>
parsing C++ with LALR is possible
<wmeyer>
with lexer support i suppose?
<pippijn>
no
<pippijn>
after the parse, you need to do some fixups of misparses
<pippijn>
some of them using type information
<pippijn>
but it's not pretty
<pippijn>
and I want pretty
eni has quit [Ping timeout: 260 seconds]
<wmeyer>
Of course, the prettines is a major factor that contributes to good quality :) looks good. you could have two ASTs
smondet has quit [Quit: ERC Version 5.3 (IRC client for Emacs)]
<wmeyer>
pippijn: I like that you have not invented another recursive descent parsing in spaghettin like code
<wmeyer>
the thing which is also letting me down in such projects like llvm and clang (apart from other reasons) is that everything is parsed by hand - for unknown reasons to me
<pippijn>
error messages
<pippijn>
which is why I modified menhir to produce proper ones
manu3000 has quit [Remote host closed the connection]
<wmeyer>
pippijn: I am cloning your cparser :-)
<wmeyer>
i will try to do the camlp4 part for time being
<wmeyer>
pippijn: do you commit there your stuff?
<pippijn>
no
<pippijn>
wait
<wmeyer>
ok
ski has quit [Ping timeout: 265 seconds]
<wmeyer>
pippijn: but it's worth to know about this good stuf