caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
* [Caml-list] Call for collaboration on the future of camlp4
@ 2012-09-20  9:36 oleg
  2012-09-20 12:16 ` [Caml-list] " Hongbo Zhang
  0 siblings, 1 reply; 9+ messages in thread
From: oleg @ 2012-09-20  9:36 UTC (permalink / raw)
  To: bobzhang1988; +Cc: caml-list


Hongbo Zhang wrote:
  > Meta-ocaml is orthogonal to camlp4 as well, but I did not see any hope
  > that it will be pushed into ocaml compiler,
  > since the main purpose of meta-ocaml is to do some run-time
  > optimization, without a native jit compiler support, It does
  > not make sense.

I believe you might be short-changing MetaOCaml. First of all, why
MetaOCaml needs JIT? It is already possible in MetaOCaml to generate
code at run-time, to compile it and link-in. The new code is generated
by the OCaml compiler itself, and works as if it were part of the
original code. Such run-time optimization can indeed be useful (e.g.,
profile-based optimization). I don't see why we need JIT if we already
have the original compiler itself.

However viewing MetaOCaml as a run-time optimizer misses a
lot. MetaOCaml is a code generator with certain assurances of
correctness -- it generates code that one would not write by hand. The
recent example of generating code for stencil computations in
high-performance computing

	http://okmij.org/ftp/meta-programming/HPC.html#stencil

was quite illustrative: MetaOCaml has generated code for edge
cases that human really did not want to write (and did not actually
write). Edge cases are really tedious and really difficult to get
right; automation is of great help. The generated code can be
printed-out and used in a project as any other code. MetaOCaml can be
used to generate libraries of specialized high-performance code.

  > Personally, I prefer common lisp's macros to scheme. It's painful
  > to play with racket's macros as well

Well, it is painful for some people to use typed languages
too. Untyped languages offer so much freedom, some think. What is
often forgotten is that the benefit of the type system is not in what
code you can write, but what code you cannot. Likewise, a syntax
extension should be evaluated not only on what it allows but also on
what it prevents.


As I general remark: it is not clear why so much fixation on
camlp4. Other people have tried extensible syntaxes. For example:

	- Felix
	- Notation of Coq
	- Stratego
	http://strategoxt.org/
In particular, see
	http://strategoxt.org/Sdf/SdfLanguage

Stratego could do program transformations in concrete syntax. Maybe
that would be a better approach? Maybe Stratego would satisfy all our
needs?




^ permalink raw reply	[flat|nested] 9+ messages in thread
* [Caml-list] Call for collaboration on the future of camlp4
@ 2012-09-18 19:11 bob zhang
  2012-09-19 19:55 ` Wojciech Meyer
  2012-09-30 17:02 ` bobzhang
  0 siblings, 2 replies; 9+ messages in thread
From: bob zhang @ 2012-09-18 19:11 UTC (permalink / raw)
  To: Caml List; +Cc: Steve Zdancewic

[-- Attachment #1: Type: text/plain, Size: 2773 bytes --]

Dear OCaml programmers,
   Last week, I give a talk about the future of Camlp4 in the ML workshop,
the slides are here
http://www.lexifi.com/ml2012/slides_panel_hongbo.pdf(some are already
done, some are work in progress).
   For a long time, in the caml community, thanks to the talented work of
Daniel and Michel,  we know there is a very very powerful tool called
*camlp4*, if there are some bolierpolate code you write here and there,
someone will tell you "hey, you can do it in camlp4" though he may not know
how to do it in camlp4.
   But it's a bit embarassing that camlp4 did not evolve very well(partly
due to the fragmentation of camlp[4,5]), another fact is that camlp4 is not
*designed*, it's like a prototype that works but not carefully designed,
and it does not provide anything out of the box  and itself was written in
a verbose way.
   It's time to bring the powerful tool back, my advisor Steve and I
started a new project Fan, which is mainly to evolve the camlp4 macro
system to be more expressive and more powerful, push the Camlp4 to the next
level. For me, I am a long-term Lisp programmer, I appreciated the value of
macros, I would really be happy to see we could make a such powerful macro
systems.
   Here is my repo https://bitbucket.org/HongboZhang/camlp4
   I already finished some cool staff,  to mention just a few:
   1. A very robust bootstrapping system, previously it takes me 20 minutes
to ver*ify my patches to camlp4 can reach a fixpoint or not, but now you
can compile your modification within seconds, and reach a fixpoint under 2
minutes, this accelerate the development cycles immediately.*
*   2. Now you can customize your lexer now, previously it's impossible(
and a number of bug fixes) you can do deep anti-quotation like *
*  <:expr< <:expr< $($(deepantiquot)) >> >> *
   3. Linking the compiler and a number of cool features (see the slides)
   4. A macro which write macros to scrap all the bolierpolate code for
generic programming, now you can customize your deriving stuff  in ten
lines (previously thousands of lines of code to write camlp4 plugin)
    5. A number of mini-DSLs  and more to be expected
   I love macros, I would commit to the project for a long time(probably my
Ph.D term), I promise that I would write the documentation to make users
happy( I am also writing a book about macros, it's un-readable though). And
I am really happy to co-laborate with anyone who love camlp4.
   Syntax matters, if you see that coffescript is now already a success,
camlp4 or Fan is actually more expressive than that, Dear ocaml
programmers, let us find a way to make ocaml more beautiful. I am also open
minded to any discussion about the future of camlp4
   Many thanks (sorry for my bad English)
-- 
Regards
-- Bob

[-- Attachment #2: Type: text/html, Size: 3165 bytes --]

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-09-30 17:03 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-09-20  9:36 [Caml-list] Call for collaboration on the future of camlp4 oleg
2012-09-20 12:16 ` [Caml-list] " Hongbo Zhang
2012-09-22  7:50   ` oleg
2012-09-22 12:02     ` Hongbo Zhang
2012-09-22 12:53     ` Jacques Carette
2012-09-22 13:13       ` Hongbo Zhang
  -- strict thread matches above, loose matches on Subject: below --
2012-09-18 19:11 [Caml-list] " bob zhang
2012-09-19 19:55 ` Wojciech Meyer
2012-09-19 21:21   ` [Caml-list] " Hongbo Zhang
2012-09-19 21:35     ` Hongbo Zhang
2012-09-30 17:02 ` bobzhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).