caml-list - the Caml user's mailing list
 help / color / mirror / Atom feed
From: oleg@okmij.org
To: bobzhang1988@gmail.com
Cc: caml-list@inria.fr
Subject: [Caml-list] Re: Call for collaboration on the future of camlp4
Date: 22 Sep 2012 07:50:08 -0000	[thread overview]
Message-ID: <20120922075008.24778.qmail@www1.g3.pair.com> (raw)
In-Reply-To: <505B091A.7080806@gmail.com>


> Yes, it's [MetaOCaml] a run-time optimizer with type safe assurance. It can do
> partial evaluation to generate some optimized code. 

Let me stress once again how narrow this view is. MetaOCaml goes well
beyond partial evaluation. For example, MetaOCaml, as a general code
generation framework, was used to derive optimal (in the number of
multiplications) FFT kernels. Partial evaluation will not give you
that.

Code generation is a very promising technique in High-Performance
computing. Most of the tools used in practice -- FFTW, ATLAS, SPIRAL
-- are all off-line tools. They generate a large number of candidate
codes and choose the best performing. What's important is to quickly
generate a large number of very tedious programs. Assurance of
correctness are important: a programmer, especially a domain expert,
will not want to even look at the generated code let alone debug it.
I see MetaOCaml target the same area.

> I agree it would be useful to have a native eval, but this requires
> non-trivial changes to the compiler which I don't expect it will be
> realized in a short term.
The assessment is mistaken. MetaOCaml v3.09 did have a native
back-end. I know quite well what changes were required. Those changes
are no longer needed since dynamic linking has since become part of
OCaml proper.

> If you take a look at the history of Template Haskell, they finally
> step back from type checking everything to give up type checking some
> quasi-quotations. 

This is a mistaken impression. While Template Haskell as a whole will
remain untyped for a long time -- after all, Template Haskell can
generate data and type class _declarations_, whose typing is far from
clear -- there is a definite push towards MetaOCaml-like type safety
for expressions. 
  http://hackage.haskell.org/trac/ghc/blog/Template%20Haskell%20Proposal

see especially
  Part B: Add new MetaML-style constructs for strongly-typed metaprogramming.

If this is implemented, TH becomes quite like MetaML.

> We don't want to sacrifice too much experssivity for type safety, this
> is especially important in macros. In common lisp, there is also a
> kind of macros called "Anaphoric macros" which you will find painful
> to do in Scheme.

That is not a very good argument since R5RS macros in Scheme were
intentionally limited in their expressivity. The macro system was
designed to be just enough expressive for the special forms
introduced in the Report. (Later on the system was found to be quite
more expressive than its designers have anticipated.)

The anaphoric macros are easily expressible in the system of our JFP
2011 paper (staging with a very limited delimited control). No
subversions of hygiene are needed.



  reply	other threads:[~2012-09-22  7:50 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-09-20  9:36 [Caml-list] " oleg
2012-09-20 12:16 ` [Caml-list] " Hongbo Zhang
2012-09-22  7:50   ` oleg [this message]
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

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20120922075008.24778.qmail@www1.g3.pair.com \
    --to=oleg@okmij.org \
    --cc=bobzhang1988@gmail.com \
    --cc=caml-list@inria.fr \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).