[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

statement expressions



Hello all and David,

In https://gcc.gnu.org/ml/jit/2016-q1/msg00003.html I mentioned that a gcc_jit_block_expr would be very useful, in particular for most functional languages (including Lisp & Scheme).

The suggestion was to provide, in GCC JIT, the equivalent of GCC C statement exprs https://gcc.gnu.org/onlinedocs/gcc/Statement-Exprs.html

David, I really think such a feature would be useful. In particular it would permit to easily encode in GCCJIT the equivalent of the comma operator and of the ternary conditional operator of C.

More generally, it would help a lot those using GCCJIT for Scheme like or Ocaml like languages (and I believe it is as useful as the tail recursion thing work).

Without such a feature, most programs using GCCJIT for "functional" or "expression-oriented" frontends would have to build a representation in A-normal form (see https://en.wikipedia.org/wiki/A-normal_form flor details), which the internal transformation inside GCC itself (notably to SSA gimple) is nearly already doing.

David, what is your opinion on this? Are you opposed to the idea? If not, how would you think it can be implemented?


Cheers

--
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 mine, sont seulement les miennes} ***