<pango_>
the only problem with that implementation is the cost when !debug = false ... debugging messages are evaluated, to be immediately discarded...
<flux__>
yes
<flux__>
it would require some language extension to go over that
<flux__>
or explicitly stating the if-statement all over the code
<flux__>
(hm, s/statement/expression/)
<zvrba>
camlp4 magic?
<pango_>
seems so
Carillon has joined #ocaml
Carillon_ has quit [Read error: 110 (Connection timed out)]
Carillon is now known as Carillon_
Eelis_ is now known as Eelis
slipstream has quit [Read error: 104 (Connection reset by peer)]
slipstream has joined #ocaml
finelemo1 has joined #ocaml
_velco has quit [niven.freenode.net irc.freenode.net]
_velco has joined #ocaml
finelemon has quit [Read error: 110 (Connection timed out)]
<|Lupin|>
How can onesee the ChangeLog of OCaml between, say, 3.08.3 and 3.09.2 ?
ziggurat has quit ["This computer has gone to sleep"]
ziggurat has joined #ocaml
<flux__>
yes
<|Lupin|>
flux__: Do you know howthe function yousuggestedthis morning could be written with OCaml 3.08 ?
<|Lupin|>
flux__: it seemsthat the ksprintf functio was introduced onli in 3.09...
<flux__>
|lupin|, pango suggested kprintf
<|Lupin|>
oh, yes
<|Lupin|>
flux__: But this becomes deprecated starting from 3.09 ?
<flux__>
yes
<|Lupin|>
So, there is no clean solution... ?
<|Lupin|>
Hmm I guessThe bestthing would be to have a code dependent on which version of Caml is installed...
<flux__>
just use the older function
<flux__>
or just support the latest ocaml
<flux__>
simple options ;)
<|Lupin|>
flux__: My preference would be toSupport only the latest Caml, but there are some users of mytool under Windows, there are no binaries for Cygwin for the latest versionof Caml, and when we tried to compile it + find lib, it failed, so I'm indeed going to use theolderfunction...
<flux__>
|lupin|, how is developing software for windows with ocaml going on for you?
<flux__>
|lupin|, are you writing command line/server-software or something with a gui?
ziggurat has quit ["Leaving"]
f78 has quit [Read error: 110 (Connection timed out)]
_fab has joined #ocaml
<|Lupin|>
flux__: no gui.
<|Lupin|>
flux__: just a command-line oriented program, in this good old-fashioned but efficient Unix way.
gottreu has joined #ocaml
|Lupin| has quit ["leaving"]
<gottreu>
I remember finding a book in a library several years ago that taught compiler construction using OCaml or ML and assumed no great prior knowledge of either.
<gottreu>
Does anyone know of any similar online resource(s)?
<gottreu>
why I am interesting, is that 1) I've been wanting to learn OCaml for a good long while now, and 2) I want to do source level transformation of C++ code, and writing that in Perl wouldn't be 'elegant' enough
<flux__>
I recall there was a tool around that converted c++ into simplified c++
<Smerdyakov>
This one does that and more.
<flux__>
hm, what language is oink written in?
<Smerdyakov>
C++
<Smerdyakov>
I certainly wouldn't use it, but then I don't care about C++.
<Smerdyakov>
However, I don't think there is anything else available to can compare to Oink for functionality.
<Smerdyakov>
It is basically impossible that you could write real C++ transformations without using Oink unless you are willing to spend 4 years developing your own infrastructure.
<velco>
heh
velco has quit ["Ex-Chat"]
<pango>
gottreu: it's interesting to compare the size the of errata for the first editions of the books... 11 screens for C version, 10 for Java, 7 for ML :)
<gottreu>
perhaps i misspoke when i said transformations, want I want is automatic inclusion of code at function and loop starts...no real refactoring or heavy lifting
<Smerdyakov>
gottreu, what does your code need to understand about its input C++ sources?
<gottreu>
nothing semantic, initially just where the beginning of a function definition is
<gottreu>
i'm trying to reinvent the wheel of source level profiling
<Smerdyakov>
Why are you using C++, anyway?
<Smerdyakov>
And are you planning to do simple 'grep'-style replacement, or do you actually want to parse C++ source?
smimou has joined #ocaml
Wild_Cat has quit ["Leaving"]
<Eelis>
C++ parsing is not for the faint of heart. even seemingly simple things like distinguishing between variable declaration and function call require the construction of a full compiler.
<Smerdyakov>
Yup. See Oink. :)
<Smerdyakov>
They can parse the majority of Debian packages.
<zvrba>
hm, why not use gcc-xml ?
<Smerdyakov>
Are you kidding? You really want to work with XML representations?
<Smerdyakov>
I'm not familiar with gcc-xml, but I know that Oink compiles code into a simplified internal language. Does gcc-xml do that?
<flux__>
apparently gcc-xml doesn't support c++ function bodies
<Eelis>
the representation hardly seems like a big issue, converting XML into something else is easy
<gottreu>
Smerdyakov: i don't want to do replacement, cause i'd still have to manually put in initial placeholder. I just want to be able to place a few c++ statements at the beginning of every (or almost every) c++ function
<gottreu>
and I want a valid-ish reason to learn OCaml
<Smerdyakov>
gottreu, I don't think you've answered either of my questions.
<zvrba>
Smerdyakov: it dumps xml syntax tree :)
<Smerdyakov>
zvrba, if it's the source-level syntax, then it's mostly worthless.
<zvrba>
gottreu: it might be easier to instrument object code, there are good tools for that (like PIN)
<Smerdyakov>
zvrba, C++ is too complicated to make working with source syntax practical.
<gottreu>
Smerdyakov: sorry, i'll retry after lunch...
<zvrba>
i don't know the details though
gottreu is now known as gottreu-afk
<zvrba>
Smerdyakov: what kind of simplified language is oink?
<zvrba>
i.e. translates it to
<Smerdyakov>
zvrba, the main author describes it as a core Java-like language.
pango has quit ["Leaving"]
pango has joined #ocaml
f78 has joined #ocaml
EsotericMoniker has quit [Remote closed the connection]
Snark has joined #ocaml
DRMacIver has joined #ocaml
DRMacIve1 has quit [Read error: 104 (Connection reset by peer)]
gottreu-afk is now known as gottreu
Snark has quit ["Leaving"]
_fab has quit [Read error: 104 (Connection reset by peer)]
_fab has joined #ocaml
_jol_ has joined #ocaml
<gottreu>
zvrba: (referring to the comments made a little over 3 hours ago) source has a few nice advantages to object code, one is that if you create an locally scoped object then when the function ends (regardless of the number of exit points) the object's desctructor will be called
<gottreu>
Smerdyakov: would you mind restating your questions?
<zvrba>
gottreu: huh, it'll be also called in the object code
<gottreu>
zvrba: i mean if in the source you add the object creation, then the destructor is automatically called. I assume that with object code you'd either have to add function exiting code at multiple places (if the function returns in multiple spots) or change the object code around to have only 1 exit point
<gottreu>
zvrba: but keep in mind i'm speaking about things at the edge of my knowledge, so i might be wrong
<zvrba>
what are you talking about, it's the compiler who generates code so that destructors are called whenever object goes out of scope
chessguy has joined #ocaml
<gottreu>
zvrba: i'm trying to say that if c++ parsing wasn't such a pain, it should be easier to automatically add code at the entrance and exit to a function at the source code level, than at the object code level
<gottreu>
because in source code, you can get the compiler to do stuff for you when it compiles, but if you add stuff to object code, you'd have to do those things yourself
<gottreu>
zvrba: sorry if i'm not clear, like i said i'm somewhat out of my league on this topic, and sorry to anyone else who finds this a little bit too offtopic for an OCaml channel ;)
shawn__ has quit ["This computer has gone to sleep"]
_jol_ has quit ["co'o rodo"]
Carillon has joined #ocaml
<_velco>
gottreu: alternatively one could instrument the various intermediate representations of GCC itself
<_velco>
like it's dont in mudflap, for instance
<_velco>
s/dont/done/
EsotericMoniker has joined #ocaml
Carillon_ has quit [Connection timed out]
Carillon is now known as Carillon_
postalchris has quit [Read error: 113 (No route to host)]
DRMacIver has quit [Read error: 104 (Connection reset by peer)]
DRMacIver has joined #ocaml
f78 has quit [Remote closed the connection]
dark_ has quit ["Leaving"]
Wild_Cat has quit []
gottreu has left #ocaml []
cratuki has joined #ocaml
<cratuki>
Has anyone here done web programming with ocaml? What do you use in the place of an ORM? I have complex needs, and want to buffer data between page loads and before a commit
<cratuki>
Keeping a transaction open might serve my needs..
<smimou>
you might want to have a look at dedicated extensions like ocsigen.org
<cratuki>
That seems to operate at the templating level. I want a managed translation layer to bridge a relational database to ocaml in such a way that the ocaml compiler can thereby pick up invalid relationships.