<vbmithr>
hcarty: ok, I’ll notify the author, it’s probably not normal :)
<djcoin>
This project was sponsored by Jane Street Capital during their OCaml Summer Project 2008. <= great :)
lggr has quit [Ping timeout: 265 seconds]
<hcarty>
djcoin: It's one of the few OSP projects I've seen which continued beyond the initial summer.
<djcoin>
hcarty: thanks for the link. And is 'pa' initial of something or ?
<vbmithr>
djcoin: Pretty much all syntax extensions are pa_something, but I don’t know what pa stands for
<djcoin>
I was wondering too, are camlp extension "composable" (not sure what I mean there)
<hcarty>
djcoin: I don't know the origin of 'pa' - it's common in syntax extensions
<djcoin>
ok :)
<hcarty>
vbmithr: Beat me to it :-)
<hcarty>
djcoin: Some are
<vbmithr>
:)
<hcarty>
djcoin: In that some can be used together
<hcarty>
Some can be used to build other extensions, including pa_do
Neros has joined #ocaml
lggr has joined #ocaml
<djcoin>
I saw there was some work on AST manipulation, I guess the goal is to make it easier and more composable ?
<djcoin>
(for syntax extension)
<djcoin>
And is there a list of all camlp and other type of syntax extension ?
jamii has joined #ocaml
<hcarty>
djcoin: I think you're correct on the AST manipulation additions. They look like they could make it into 4.01.
<hcarty>
As far as I know there is no universal list of syntax extensions, but the Caml Hump likely has the biggest ones
lggr has quit [Ping timeout: 244 seconds]
<djcoin>
All right, thanks
<djcoin>
composable syntax extension would be awesome I guess
<vbmithr>
I was wondering if Module.(foo…) would not conflict with local open…
lggr has joined #ocaml
Neros has quit [Ping timeout: 260 seconds]
<hcarty>
vbmithr: It did initially, but IIRC pa_do was modified to get around that
<vbmithr>
ok
<vbmithr>
Yeah it looks like it
<fx_>
pa means parser
<fx_>
there are pr_ camlp4 modules - those are printers
<djcoin>
oh ok
<djcoin>
thanks fx_ :)
<hcarty>
fx_: Thanks indeed!
<mcclurmc>
hi. i'm trying to use camlp4 to generate a module implementation from an mli file. i started using filters, but there are only sig -> sig or struct -> struct filters. is what i'm trying to do possible?
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 260 seconds]
answer_42 has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
lggr has joined #ocaml
cago has quit [Quit: Leaving.]
lucasaiu has joined #ocaml
lggr has quit [Ping timeout: 276 seconds]
smondet has joined #ocaml
lucasaiu has quit [Remote host closed the connection]
lggr has joined #ocaml
gnuvince_ has joined #ocaml
err404 has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 255 seconds]
hkBst has quit [Quit: Konversation terminated!]
lggr has joined #ocaml
Neros has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
gnuvince_ has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
ottbot has quit [Remote host closed the connection]
thomasga has quit [Ping timeout: 245 seconds]
larhat has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
Yoric has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
chambart has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
thomasga has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
GnomeStoleMyBike has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 272 seconds]
avsm has joined #ocaml
avsm has quit [Client Quit]
avsm has joined #ocaml
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
fraggle_laptop has quit [Quit: Quitte]
lggr has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
ski has quit [Ping timeout: 272 seconds]
ski has joined #ocaml
lggr has joined #ocaml
<wieczyk>
wmeyer: I live ;]
gnuvince_ has joined #ocaml
lggr has quit [Ping timeout: 240 seconds]
mcclurmc is now known as mcclurmc_away
lggr has joined #ocaml
flux has quit [Read error: Connection reset by peer]
flux has joined #ocaml
Yoric has joined #ocaml
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
beckerb has quit [Ping timeout: 245 seconds]
chambart has quit [Read error: Operation timed out]
larhat has quit [Quit: Leaving.]
djcoin has quit [Quit: WeeChat 0.3.7]
lggr has quit [Ping timeout: 256 seconds]
lggr has joined #ocaml
GnomeStoleMyBike has joined #ocaml
lggr has quit [Ping timeout: 276 seconds]
<ousado>
what was that IDE for ocaml again?
<bitbckt>
emacs :P
<bitbckt>
(sorry, obligatory)
<thelema>
:)
<ousado>
someone mentioned an actual IDE lately
lggr has joined #ocaml
<thelema>
ousado: typerex is an ocaml-ide in emacs
<thelema>
camelia is a standalone one
<ousado>
typerex it was
<thelema>
there's also a plugin for ocaml in eclipse
<ousado>
thanks
<thelema>
finally, there's cameleon
<thelema>
*cameleon2
<adrien>
jein
<ousado>
heh I'm always puzzled how eclipse manages to consume all resources you throw at it, even in 20012
<adrien>
afaik it's not really maintained
<ousado>
*2012
<bitbckt>
It's a Feature(TM)
<adrien>
vim also does
<adrien>
when you load 4GB files, it takes 4GB memory
<ousado>
thanks again, I'll relay that information :)
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
sepp2k has quit [Ping timeout: 245 seconds]
sepp2k has joined #ocaml
lggr has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
ontologi1e has joined #ocaml
ontologiae has quit [Ping timeout: 248 seconds]
elixey has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 260 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 245 seconds]
ontologi1e has quit [Ping timeout: 248 seconds]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
sivoais has quit [Ping timeout: 245 seconds]
lggr has quit [Ping timeout: 272 seconds]
gnuvince_ has quit [Ping timeout: 245 seconds]
lggr has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
sivoais has joined #ocaml
<pippijn>
argh
<pippijn>
camlp4o says: Quotation not terminated
<pippijn>
because of this comment: (* [726] AssignmentOperator -> <<= *)
lggr has joined #ocaml
<pippijn>
that's not cool.. why does it even consider comments?
<thelema>
orbitz: so this is more of an async question?
<orbitz>
thelema: problem seems to be around line 77
<orbitz>
thelema: yes perhaps. The problem I see is my stdin isn't closing
<orbitz>
If I usethis to run a program that reads input, it never gets EOF
<thelema>
orbitz: ah, maybe not an async problem, maybe a "communicating over pipes" problem
<thelema>
orbitz: are you doing line-oriented reading on the other end?
lggr has quit [Ping timeout: 260 seconds]
<thelema>
i.e. the problem may be that the other end is doing a blocking read that doesn't fail because of EOF
BiDOrD_ has joined #ocaml
<orbitz>
thelema: hrm it should, I tested with cat
lggr has joined #ocaml
<thelema>
cat of the exact same data that you're outputting with this program?
avsm has joined #ocaml
BiDOrD has quit [Ping timeout: 260 seconds]
<orbitz>
thelema: I did ~text:"foo" ~prog:"cat" ~args:[]
<orbitz>
and it jus twaits
<thelema>
orbitz: ah, you used cat as the reader....
<orbitz>
That should be equivalent to echo foo | cat, which prints "foo" on my shell
<thelema>
yes, maybe it's not closing immediately.
<orbitz>
Wiats for a long time..
<thelema>
the ; after Writer.write looks suspicious to me
<orbitz>
Writer.write is string -> unit
<thelema>
but close isn't... hmmm
lggr has quit [Ping timeout: 245 seconds]
<thelema>
flush?
<thelema>
although close should do that...
<orbitz>
I feel like this is some weird unixism I'm not aware of
<thelema>
ah... close ?force_close t waits for the writer to be flushed
<thelema>
hmm, no; close should be doing the flush
lggr has joined #ocaml
<orbitz>
Hrm
<orbitz>
my kind is wrong
<orbitz>
I have it for File
<orbitz>
but File returns a deferred that never realizes
<orbitz>
I think
<orbitz>
Maybe not
avsm has quit [Quit: Leaving.]
avsm has joined #ocaml
lggr has quit [Ping timeout: 246 seconds]
<orbitz>
avsm: you there?
<hcarty>
thelema: I'm happy with BatBounded staying in Incubator for a release or two. I'd rather have it right later than wrong now and be stuck with it.
<thelema>
hcarty: great. Now I just wish I could make the time to fix up batteries for a 2.0 release
<thelema>
there's not really that much work left to do before the next beta; I just have failed to do it anytime in the last 7 months
lggr has joined #ocaml
thelema_ has joined #ocaml
<thelema_>
and noone else has stepped up to the plate (note: this isn't a not-so-subtle push for you to do so, just me saying what's on my mind)
_andre has quit [Quit: leaving]
thelema has quit [Ping timeout: 256 seconds]
lggr has quit [Ping timeout: 260 seconds]
<hcarty>
thelema_: Understood :-)
avsm has quit [Quit: Leaving.]
<hcarty>
No per-module ord in the 2.0 release, is that correct?
lggr has joined #ocaml
<thelema_>
no, the other way; everything comparable should be
<thelema_>
but I can't see how to apply them to, for example, List
<hcarty>
Ah, ok. So BatOrd may stay in Incubator, but every comparable module should have a val ord : t -> t -> (Gt | Lt | Eq)
<thelema_>
yes, that part of BatOrd, I think we can get behind.
<thelema_>
ah, Container.S1
<thelema_>
hmm, but that doesn't extend comparable to lists...
<hcarty>
It would be nice to have Ord(er)able, Printable, ...
<thelema_>
oh well, I guess lists aren't comparable...
<thelema_>
hcarty: exactly; some of them don't really apply; stringable is obseleted by printable
zm has joined #ocaml
<thelema_>
and we're not doing binable or sexpable
<thelema_>
although, medium term, batteries should try to become less monolithic
lggr has quit [Ping timeout: 246 seconds]
<hcarty>
thelema_: Proper/more flexible name spaces would help there
<hcarty>
That's something I miss from Perl when writing/extending code in OCaml
<hcarty>
It would be nice if Batteries.Array could be provided by a different library than Batteries.Calendar
lggr has joined #ocaml
<thelema_>
quite true, but there's some internals that we'll have to expose; instead of having Foo.enum/of_enum, we would need some functions to enable Enum.foo/of_foo
<thelema_>
hcarty: actually, I'm not too concerned about that; it's sufficient for the toplevel namespace to be 1:1 with project names
<thelema_>
actually, not quite project names, but compilation collection names - a bunch of modules that are compiled together.
<thelema_>
s/together/at the same time/
<hcarty>
thelema_: It is nice, though, that in the Perl world Net::FTP and Net::SCP can be separate entities
cdidd has quit [Remote host closed the connection]
Yoric has joined #ocaml
<thelema_>
CPAN does a good job of enforcing a global namespace for these; OCaml needs some way to do the same.
<thelema_>
I don't think the Jane street people would appreciate me writing Core.Enum
<thelema_>
it makes sense to me that they should somehow "own" that namespace
<hcarty>
thelema_: I don't know. It would be nice to not have these general namespaces locked out.
<thelema_>
The idea of deep heirarchical namespaces doesn't really sit right with me.
<hcarty>
I'm not sure of the right way to put it
<hcarty>
s/put/design/
lggr has quit [Ping timeout: 248 seconds]
<hcarty>
But it would be nice if Core.Enum were possible without recompiling Core
<thelema_>
yes, there's a tiny benefit to having many people able to put code into Net::*, maybe a few other examples too
<hcarty>
I think that there's a big benefit. For example, I have local code to mix Batteries' IO support in CalendarLib.
<thelema_>
And I too wish for a world where this is easily doable
avsm has joined #ocaml
gnuvince_ has joined #ocaml
<hcarty>
Maybe in 4.01 :-)
<hcarty>
Or beyond
<thelema_>
clearly the right answer isn't to have batteries depend on calendar, or vice versa
<hcarty>
thelema_: Exactly
avsm has quit [Client Quit]
lggr has joined #ocaml
<thelema_>
at least that's not the right answer right now, and not even with cpam's auto-recompile when optional dep becomes available
<thelema_>
s/available/commonplace/
<thelema_>
The best solution I see is Calendar.IO, which depends on both and provides BatIO support for Calendar
<hcarty>
thelema_: That would be nice
<thelema_>
but I think that installing this library should not change the module signature of Calendar
<thelema_>
meaning that anything using Calendar would have to be recompiled, as the md5 wouldn't match
<thelema_>
with that, then the best solution is Calendar_IO
<hcarty>
thelema_: If Calendar = module, then that's a problem. If Calendar <> module then it's not a problem.
<thelema_>
hcarty: why shouldn't Calendar be a module?
<thelema_>
and why introduce a new entity just for namespacing? Modules do a great job already
lggr has quit [Ping timeout: 246 seconds]
<hcarty>
thelema_: I need to run, but I'm not sure that something new should be added. That's just the impression I got regarding what the namespace branch in OCaml svn was doing.
<hcarty>
thelema_: Some sort of module/namespace mixing
<wmeyer>
hcarty: I think we had quite few proposals
Yoric has joined #ocaml
<wmeyer>
I urge to have namespaces
<wmeyer>
they are needed
<wmeyer>
I keep reminding about CM - compilation manager in SML
<thelema_>
hcarty: cheers
answer_42 has quit [Read error: Operation timed out]
<thelema_>
namespaces branch 19 months ago
lggr has joined #ocaml
<bitbckt>
heh. I just looked it up, too.
<bitbckt>
the description in the README is promising.
<bitbckt>
I'd rather have "namespace X.Y" in lieu of "in X.Y" as the example describes, but that's a minor thing.
<thelema_>
bitbckt: agreed on the language extension
<bitbckt>
I also like the "open X.Y as N" syntax.
<wmeyer>
gasshe had a nice idea of DSL and namespaces dependent on a file system like modules in ocaml
<thelema_>
bah, I can't say I like the approach. we have file = module, I think we should have exactly one level of directory = module in the include path.
<wmeyer>
It's a pity, i didn't even look at the branch
* thelema_
approves of the "short-paths" branch strongly
<wmeyer>
btw: I think also Fabrice had also some nice & concrete DSL to manage modules, but don't know how far it went...
<bitbckt>
I prefer the convention-based namespace<->filesystem convention over the dictated method in, e.g., Java.
<bitbckt>
er. that second "convention" should be "conversion"
<thelema_>
bitbckt: project-name = base module
<bitbckt>
thelema_: yes.
<thelema_>
bitbckt: is that too dictated?
<bitbckt>
no.
<wmeyer>
bitbckt: OCaml is already bound to file system, so there is no way it can be done in a different way, i quite don't remember what the gashe proposal was but i quite liked it - but none of them had actuall read about SML CM
<bitbckt>
for an example of the "conventional" way, see something like Ruby.
<bitbckt>
the module = directory structure isn't required, but is encouraged.
<thelema_>
wmeyer: iirc, gasche's proposal was to have a mapping file from module names to .cmi files that would disambiguate
<wmeyer>
(not saying about java style, but minimal support for structuring namespaces via file system is required in OCaml)
lggr has quit [Ping timeout: 265 seconds]
<bitbckt>
the definition of "minimal" is the question.
<wmeyer>
bitbckt: in long run I don't like extreme case - "Java way"
<wmeyer>
that's not ironic - it's a clever idea
<wmeyer>
but it does not scale very well
<bitbckt>
I agree.
<wmeyer>
CM has notion of groups
<thelema_>
wmeyer: I disagree; I say it scales extremely well, but has too high a constant factor.
<bitbckt>
I can't recall the last time I've needed/wanted anything beyond 3 levels of nesting.
<thelema_>
(it=java namespacing)
<bitbckt>
but the Java system does provide what thelema_ was referring to earlier viz. Core.Enum.
<thelema_>
bitbckt: Can you give an example where one level of namespacing isn't sufficient?
thelema_ is now known as thelema
<wmeyer>
but then, I like file ~ module in ocaml relation, but i dont like namespace ~ directory as such. Even if i use mlpack to pack modules in a same directory
<wmeyer>
that's my choice
lggr has joined #ocaml
<wmeyer>
and convention i choose and not because the namespace manager forces me to do so
<bitbckt>
thelema: *thinking*
<thelema>
bitbckt: fabrice's example was something like microsoft, where they would want Microsoft.Office.* and Microsoft.Windows.*, etc.
<bitbckt>
right.
<thelema>
bitbckt: but I disagree; if office and windows are compiled separately, Microsoft_Office.* and MS_Windows.* have *no* disadvantage
<wmeyer>
thelema: and sometimes you actuall want to group different hierarchies but sharing the same modules
<wmeyer>
so then filesystem solution is unusuable
<wmeyer>
thelema: let's say you want lib with all the features present, some other lib with excluded features
<thelema>
wmeyer: project-based solution fixed same modules; each project can have at most one copy of a module (not unreasonable)
<thelema>
s/fixed/fixes/
<wmeyer>
thelema: and now i think about ocamlbuild - and actually start wanting melissa tea :S
<thelema>
wmeyer: melissa tea?
emmanuelux has quit [Remote host closed the connection]
emmanuelux has joined #ocaml
<wmeyer>
yes, its calming
<thelema>
:)
<wmeyer>
i am proponent; but i have obsessive thoughs already how to improve it
zm has quit [Ping timeout: 245 seconds]
<bitbckt>
thelema: I think the only times I've wanted more than the toplevel namespace are for disambiguation.
<bitbckt>
taking the earlier Calendar name as an example.
<wmeyer>
when I think about ocamlbuild supporing namespaces somewhat feel scared
<bitbckt>
I'd rather not have a _project_ named Calendar and a _module_ named calendar.
<thelema>
I think ocamlbuild would be simplified by directory-based namespaces, in that ocamlfind could be removed from the equation, and include paths be sufficient for all module-finding
lggr has quit [Ping timeout: 260 seconds]
<thelema>
(except for sub libs, I guess)
<wmeyer>
thelema: ocamlbuild is already a simple namespace manager
<wmeyer>
mlpack, mlypack, mllib etc.
<thelema>
bitbckt: it doesn't make sense to you for the project named Calendar to have all its work available as Calendar.*?
<thelema>
pack would also disappear in my world
<bitbckt>
pack needs to disappear.
<wmeyer>
thelema: pack is a hack.
<bitbckt>
in any world.
<wmeyer>
you could have
<bitbckt>
thelema: it's too general a name.
<thelema>
in my world, I don't see a huge use for .cma and .cmxa
<bitbckt>
"naming is hard"
<wmeyer>
<lib/*>: group(myexcellentlib)
<wmeyer>
however!
<wmeyer>
this is buggy!
<thelema>
they're already just poor substitutes for -I foo
<wmeyer>
nevertheless possible
<wmeyer>
better solution is
<wmeyer>
group <lib/*> myexcellentlib
<wmeyer>
or something like this
<thelema>
no need for ocamlbuild to know anything about packages or libraries
<wmeyer>
so tags sytnax at the moment is limited
<wmeyer>
however!
<wmeyer>
oasis can do this better.
<wmeyer>
so ocamlbuild should have exposed API
<wmeyer>
and Oasis should call it.
<wmeyer>
and provide minimal support
<thelema>
yes, ocamlbuild should have API
<thelema>
in compiler-libs/
<wmeyer>
that's what was the discussion on the OUD with Nicolas
lggr has joined #ocaml
<thelema>
wmeyer: ah, you talkes to nicolas about this at OUD?
<wmeyer>
when i proposed that; I think generally it would be cool to remove all those intermediate files
<thelema>
*talked
<wmeyer>
I did
<wmeyer>
and make oasis interprter and not a compiler
<thelema>
and he said that he was working on other things, but you could try to do this yourself?
<wmeyer>
something like that
<thelema>
:) not surprised
<wmeyer>
i didn't feel he liked too much the idea, but he said it's possible
<wmeyer>
i also talked to gildor
<wmeyer>
and i am preparing mentally to do this someday
<thelema>
it'd be a good project. You'd have to do a good job of it for it to be accepted upstream
<wmeyer>
yep
<wmeyer>
i can buy it with a test suite :-)
<wmeyer>
ocamlbuild bugs have one source, everybody is scared to do anything because it has no functional suite
<wmeyer>
i already started to work in git on it
<thelema>
nice.
<thelema>
b
<wmeyer>
ok, shower and back on the track
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
Simn has quit []
sepp2k has quit [Remote host closed the connection]
lggr has quit [Ping timeout: 246 seconds]
lggr has joined #ocaml
menace has joined #ocaml
paolooo has quit [Quit: Page closed]
f[x] has joined #ocaml
<menace>
if i define a function "let bad name = 5 ;;" and then type "bad -1 ;;" why does it gives me an expression error?
<_habnabit>
menace, bad -1 is parsed as (-) bad 1
<thelema>
because "bad -1" is parsed as "bad - 1", and you can't subtract 1
<thelema>
from a function
<_habnabit>
menace, you need to do either bad (-1) or bad ~-1
lggr has quit [Ping timeout: 240 seconds]
<thelema>
languages with lots of () and , for functions don't have this problem, a minor price to pay for being allowed to omit them
<_habnabit>
- being unary and binary is just handled oddly in ocaml imo
<thelema>
often it works, but when it doesn't, it's sometimes surprising
<thelema>
let x = -1 in bad x;;
lggr has joined #ocaml
<Drakken>
let bad = 2 in bad -1;; (* :) *)
<thelema>
Drakken: :)
ski has quit [Ping timeout: 248 seconds]
ski has joined #ocaml
lggr has quit [Ping timeout: 255 seconds]
lggr has joined #ocaml
Yoric has quit [Ping timeout: 256 seconds]
<menace>
yeah, i tried with bad (-1) ;; too, but i wondered
<menace>
but now i understand ocaml a little better... i think :D
<thelema>
menace: no problem
<thelema>
learn more by asking more questions
<menace>
thanks! :)
<menace>
first trying a few times is better ^^
<menace>
builds up courage, they say ;)
lggr has quit [Ping timeout: 252 seconds]
lggr has joined #ocaml
<wieczyk>
Has ocaml an imperative Set? Something like Hashtbl?
<thelema>
wieczyk: nope, use refs
<wieczyk>
;/
<wieczyk>
Does Ocaml do inter-modules optimalizations?
<thelema>
yes, although not through functors
gnuvince_ has quit [Ping timeout: 245 seconds]
<wieczyk>
How he does it? Ocamlopt produces .o files, which are usable onlu for linking
<wieczyk>
(also produces .cmx, but a lot of code seems to be in .o)
<thelema>
.cmx has information needed for cross-module optimization
lggr has quit [Ping timeout: 245 seconds]
<thelema>
including cross-module inlining
<wieczyk>
And he is inlining code from .o?
<thelema>
I think inlining-enabled code is kept in the .cmx in a parsed form
<wieczyk>
or some intermediate
<thelema>
yes, some AST form
<thelema>
err, yes, some intermediate
<wieczyk>
How does ocaml compile code?
<wieczyk>
I read about using CPS/ANF/SSA as intermediae languages
<wmeyer>
wieczyk: Xavier L has some nice lecture about intermediate representations. If you know ANF then probably you've already looked in the right place.
<wieczyk>
I have read about ANF in some old article 'The essence of compiling with continuations'
<wieczyk>
Does any compiler use CPS now? In ANF-article (1994?) i have read that CPS terms were very big, but in Kennedy article (2002)
<wieczyk>
I have read about more modern transformations which do not produce administrative redexes.
lggr has quit [Ping timeout: 265 seconds]
<wieczyk>
btw: It is funny in SML that it has ad-hoc polymorphism for + but does not use - for substraction and unary negation
<wmeyer>
wieczyk: intermediate representations should be stacked. Good compiler framework should be able to convert between them if it's possible. CPS <=> SSA is lossless for instance. SSA <=> RTL also.
<wmeyer>
all of them have some advantages and suitable for different compilation stages
lggr has joined #ocaml
<menace>
hacking perl for a long time helps me.. understanding finer grains of ocaml... :D
<wmeyer>
SSA <=> RTL is not entirely lossless, SSA => RTL introduces additional move instructions.
<wieczyk>
mhmh
<wieczyk>
Never seen RTL
<thelema>
menace: I made the transition from perl to ocaml as well; it's not as unnatural as some here believe
<wmeyer>
or perhaps I am wrong coloring introduces mov instructions
<wmeyer>
SSA conversion is not entirelly trivial. It's trivial in case if you want to introduce to many Phi nodes
<wmeyer>
but pruned version of SSA is perhaps more difficult - but doable, once you have a decent graph library and build control flow graph
<wmeyer>
to=too,build=built
<wmeyer>
ANF is something in between SSA and CPS
<wmeyer>
ANF just adds let bindings to CPS, but Phi nodes are expressed as continuations
<wmeyer>
(or you would say edges in the CFG)
fraggle_ has joined #ocaml
<wmeyer>
actuall proper SSA conversion is right now on my backlog
<wmeyer>
so 3 adress RTL is still very useful. Usually in the mid end and in the very late backend.
lggr has quit [Ping timeout: 260 seconds]
<wmeyer>
It's easy to generate RTL from some other intermediate form (but perhaps then C-- is better)
<wieczyk>
I dont see big difference between ANF and CPS
<wmeyer>
somewhere close to the frontend
<wieczyk>
especially when we speak about CPS-based-intermediate-language from Appel's book, not just lambda in CPS-style
<wmeyer>
because then SSA form is difficult to manager directly
<wmeyer>
wieczyk: lectures should tell you exact differences, there are not very different true, but details are important.
<wmeyer>
btw
<wmeyer>
this migt be interesting to study further