"Templates as a Special Form of Functors"

I am very much into meta-programming, that is, writing code that
generates code. By generating template-based code in ATS2, one gets
to re-implement certain templates to alter the behavior of the generated
code.On Saturday, September 5, 2015 at 12:47:11 AM UTC-4, Barry Schwartz wrote:

I just want to say that “Templates as a Special Form of Functors”
stuff is nifty.

And of course I am fond of Scheme with
psyntax in part because it contains such a powerful preprocessor.

:slight_smile:

Yes, we are looking into this. I am fond of it, too.

We plan to investigate the following issues:

  1. Using types to guide code generation
  2. Being able to typecheck generated code
  3. Being able to modify the behavior of generated code
    without actually modifying the generated codeOn Saturday, September 5, 2015 at 5:10:17 PM UTC-4, Barry Schwartz wrote:

gmhwxi <gmh...@gmail.com <javascript:>> skribis:

I am very much into meta-programming, that is, writing code that
generates code. By generating template-based code in ATS2, one gets
to re-implement certain templates to alter the behavior of the generated
code.

There are still some things I’d like to do that I’m not sure can be
done except by means of a separate preprocessor. The C preprocessor,
for instance, but really I mean something like m4, but with syntax
more suitable to the task. There is much code in the standard Postiats
libraries that could be simplified with such a tool.

(I once wrote a FORTH system entirely in Intel’s 8086 assembler and
constructing the initial dictionary was a breeze with the
macroprocessor. It was tedious converting the same implementation to
Microsoft’s crummy assembler. And of course I am fond of Scheme with
psyntax in part because it contains such a powerful preprocessor.)