[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
statement expressions
- To: jit@gcc.gnu.org
- Subject: statement expressions
- From: Basile Starynkevitch <basile@starynkevitch.net>
- Date: Fri, 10 Jun 2016 14:33:16 +0200
- Authentication-results: sourceware.org; auth=none
- Authentication-results: ovh.starynkevitch.net (amavisd-new); dkim=pass reason="pass (just generated, assumed good)" header.d=starynkevitch.net
- Cc: David Malcolm <dmalcolm@redhat.com>
- Delivered-to: listarch-jit@gcc.gnu.org
- Delivered-to: mailing list jit@gcc.gnu.org
- Dkim-signature: v=1; a=rsa-sha256; c=relaxed/simple; d= starynkevitch.net; h=content-transfer-encoding:content-type :content-type:mime-version:user-agent:date:date:message-id :subject:subject:from:from:to; s=dkim; t=1465561996; x= 1466425997; bh=uCj7QT+yfke+KrdwP+WgE+ezANjh8wQgULrftSpuIBk=; b=k S/u9iTbRVqtdE3TRMRKoOrxhfQA0qudfMaxGALjhPWCSxc9fx9I2UafC7OJNaHlK i4roaV8euhS2wU5cRGHwmMFnuuTNQQkcXdheQY2bZg821vVjt/0T8KRRcTJLOXtD YyTTJY9neBWs1yE2CeqzQRnVD9AzJlTM5ZenjapETc=
- List-help: <mailto:jit-help@gcc.gnu.org>
- List-post: <mailto:jit@gcc.gnu.org>
- List-subscribe: <mailto:jit-subscribe@gcc.gnu.org>
- Mailing-list: contact jit-help@gcc.gnu.org; run by ezmlm
- Sender: jit-owner@gcc.gnu.org
- User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Icedove/45.1.0
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} ***