OCaml Forge
SCM

Detail: [#505] Camlp4 quotation for HLVM AST, and examples

Patches: Browse | Download .csv | Monitor

[#505] Camlp4 quotation for HLVM AST, and examples

Date:
2010-01-10 01:47
Priority:
3
State:
Open
Submitted by:
Gabriel Scherer (bluestorm)
Assigned to:
Jon Harrop (jdh302)
Resolution:
None
Version:
None
Component:
None
 
Summary:
Camlp4 quotation for HLVM AST, and examples

Detailed description
I had a look at HLVM progress recently, and the test.ml file is not so beautiful : lots of hand-crafted AST, not very classy for a supposedly benchmarkable language.

Here is a Camlp4 quotation providing a concrete syntax for the main HLVM constructs, and a port of (some parts of) test.ml that use it. It is loosely based on toplevel.ml and examples/compiler2 syntax, with arbitrary decisions when I didn't know wich syntax you'd want. The syntax is not there to stay, my idea was that you could hack it to your liking.

The quotations support only a fraction of HLVM (still in flux) syntax; all types are supported (I developped against the SVN trunk), but toplevel support is partial, and expressions support is _very_ partial : this is a proof of concept. Note however than thanks to the standard antiquotation mechanism, you are not limited when using the concrete syntax, as you can always revert to the bare constructors inside a quotation when there is no syntax available.


PS : in my opinion, the "The design documentation and good documentation is only to be found in my behind-the-paywall Ocaml Journal Article" really hurts HLVM openness. I understand the general idea behind your Ocaml Journal business model, but you really should make anything HLVM-related open-access. I don't think I would contribute anything serious to a project that doesn't release its documentation free of charge.

Followup

No Followups Have Been Posted

Attached Files:

Attachments:
test2.ml
pa_hlvm.ml

Changes:

Field Old Value Date By
assigned_tonone2010-01-16 10:51jdh302
File Added55: pa_hlvm.ml2010-01-10 01:47bluestorm
File Added56: test2.ml2010-01-10 01:47bluestorm