This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Ann: MELT 0.9.9 plugin release for GCC 4.6, 4.7, 4.8
- From: Basile Starynkevitch <basile at starynkevitch dot net>
- To: gcc at gcc dot gnu dot org
- Cc: gcc-melt at googlegroups dot com, ctuning-discussions at googlegroups dot com
- Date: Sat, 22 Jun 2013 23:04:21 +0200
- Subject: Ann: MELT 0.9.9 plugin release for GCC 4.6, 4.7, 4.8
- References: <20130601083608 dot GA11138 at ours dot starynkevitch dot net>
Dear All,
(see http://gcc.gnu.org/ml/gcc/2013-06/msg00066.html
& http://gcc.gnu.org/ml/gcc/2013-06/msg00018.html
& http://gcc.gnu.org/ml/gcc/2013-06/msg00001.html announcing release candidates;
I have corrected all the bugs found or reported on them)
It is my pleasure and honor to announce the long-awaited MELT 0.9.9 plugin
for GCC 4.6, 4.7 and 4.8
MELT is a high-level domain specific language (implemented as a GCC meta-plugin)
to extend the GCC compiler. See http://gcc-melt.org/ for more about MELT.
This is a major MELT plugin release (developped on GNU/Linux).
Please upgrade if using older MELT plugins.
You can download either bz2 or gzip-ed source tar archives:
The MELT plugin 0.9.9 release (for GCC 4.6, 4.7 and 4.8) is available as
a bzip2-ed source tarball from
http://gcc-melt.org/melt-0.9.9-plugin-for-gcc-4.6-or-4.7-or-4.8.tar.bz2
of 3706132 bytes (3.6Mbytes) of md5sum ce50c55d64b6c906a5787818f078c86d
or as a gzip-ed source tarball from
http://gcc-melt.org/melt-0.9.9-plugin-for-gcc-4.6-or-4.7-or-4.8.tar.gz
of 5865547 bytes (5.6Mbytes) of md5sum b3c2a10787485202ad1e8b057d8170d2
both archives (they are the same when uncompressed) are extracted from
GCC MELT branch svn rev. 200300 on june 22th 2013.
################################################################
NEWS for 0.9.9 MELT plugin for GCC 4.6 & 4.7 & 4.8
[[june, 22nd, 2013]]
This is a significant release. A lot of new features are
appearing. Much more ability to mix arbitrary C/C++ & MELT code in any
way and both directions!
This is the last MELT release supporting GCC 4.6 and GCC compilers in
C only. Future MELT releases with will be C++ only (i.e. emit C++
code), for GCC 4.7 & 4.8
Language improvements
=====================
***
* Code chunks can contain void side-effecting expressions of :VOID
ctype, translated to some C/C++ block. Hence code chunks can even
be indirectly nested. Within the macro-string, write $(...) for
the expression. You may want to make it a PROGN ending with
(VOID) to force it to be void. Sub-expressions -of :VOID ctype-
inside code chunks are evaluated at the place of appearance, and
are expanded to C/C++ blocks at their occurrence.
***
* Expression chunks are expanded into C/C++ expressions. Syntax is
(EXPR_CHUNK <state-symbol> <ctype> <macro-string> ...)
For instance, to get the pid of the cc1 running your MELT extension, use
(expr_chunk getpid_chk :long #{/*$GETPID_CHK*/ (long)getpid()}#)
Important notice: any sub-expression appearing in some EXPR_CHUNK
is evaluated before, like for primitives, so will always be
evaluated.
***
* Ability to emit some C code in the implementation part. Syntax
(CIMPLEMENT <code-string>)
This is a companion to the existing CHEADER. Useful to declare some
specific non-inlined C++ function or static variable with CHEADER
and to define it with CIMPLEMENT.
***
* New ability to add module "static" value variables in MELT
(DEFVAR <varname>)
The so defined variable <varname> is (in the generated C/C++ code)
a pointer [to some MELT value] inside a static array. Garbage
collection support is generated. The variable <varname> cannot be
exported with EXPORT_VALUES, you need to export functions accessing
or changing it. Once defined, you can use SETQ to assign to such a
module variable (and also DEFHOOK with :VAR)
***
* New ability to define hooks, that is C/C++ functions coded in
MELT. Syntax is
(DEFHOOK <hookname> <input-formals> <output-formals> <ctype>
[:var <module-variable>] <body...>)
The optional <module-variable> given with a :var annotation should be
a module variable previously defined with DEFVAR.
For example, with the following code
(defvar varlist)
(setq varlist (list))
(defvar varhook)
(defhook appendnumhk (:long n) (:long outlen) :void
:var varhook
(list_append varlist (constant_box n))
(setq outlen (list_length varlist)))
you get two generated extern "C" functions in the emitted C/C++ code
void melthook_APPENDNUMHK (melt_ptr_t hook, long n, long* outlen);
and
void melthookproc_APPENDNUMHK (long n, long* outlen);
which you could use e.g. in some other code_chunk-s. The first
function melthook_APPENDNUMHK needs the hook value `appendnumhk' as
its first argument; the second function melthookproc_APPENDNUMHK
is generated because a :var annotation has been given, and uses
the hook value automagically stored in that `varhook' module
variable.
Many functions previously coded in C/C++ inside the melt-runtime.c
have been migrated to predefined hooks coded in MELT inside
melt/warmelt-hooks.melt etc...
Hooks are a very important addition: with them you can mix C/C++ & MELT code
at will.
***
* New ability to call hooks,
Expresssions can also call known hooks given by their operator. But
the hook cannot be unknown: only applications can be done with
statically unknown operators.
***
* EVAL function
An EVAL function has been added, it wraps the existing
TRANSLATE_RUN_MELT_EXPRESSIONS utility function so works by
generating C/C++ code then loading and running it.
Runtime improvements
====================
***
* To register your MELT pass, use the INSTALL_MELT_PASS_IN_GCC
function instead of the obsolete INSTALL_MELT_GCC_PASS
primitive. Notice that INSTALL_MELT_PASS_IN_GCC is incompatible
with the older INSTALL_MELT_GCC_PASS, because you need to pass
the :after keyword instead of the "after" cstring, etc, etc...
***
* Many plugin events are interfaced (using hook machinery).
Some of them are incompatible with previous MELT releases.
***
* Add macro melt_low_debug_value(Message,Value) to debug-print
some arbitrary MELT value in C/C++ code or chunk.
This goes thru a predefined hook, similar to the DEBUG macro of MELT.
***
* Add C variable melt_plugin_name containing the name of the MELT
plugin, useful for using register_callback.
***
* Raised default threshold for GC. The MELT full garbage
collector is less called.
***
* Many bug fixes and internal improvements... Emitted C/C++ code
contains more checks.. REPL and EVAL modes are working much better.
***
* More primitives and functions
#########################################
Please download MELT plugin 0.9.9, and report success and bugs on
the gcc-melt googlegroup list : gcc-melt@googlegroup.com
(within a day, I will also announce on SourceForge & FreeCode ...)
Regards.
--
Basile STARYNKEVITCH http://starynkevitch.net/Basile/
email: basile<at>starynkevitch<dot>net mobile: +33 6 8501 2359
8, rue de la Faiencerie, 92340 Bourg La Reine, France
*** opinions {are only mines, sont seulement les miennes} ***