From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Andy Wingo Newsgroups: gmane.lisp.guile.devel Subject: Re: A Working (but Minimal) JIT Date: Sat, 20 Nov 2010 14:37:04 +0100 Message-ID: References: NNTP-Posting-Host: lo.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Trace: dough.gmane.org 1290260111 10763 80.91.229.12 (20 Nov 2010 13:35:11 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 20 Nov 2010 13:35:11 +0000 (UTC) Cc: guile-devel@gnu.org To: Noah Lavine Original-X-From: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Sat Nov 20 14:35:06 2010 Return-path: Envelope-to: guile-devel@m.gmane.org Original-Received: from lists.gnu.org ([199.232.76.165]) by lo.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1PJnar-0005DL-PJ for guile-devel@m.gmane.org; Sat, 20 Nov 2010 14:35:05 +0100 Original-Received: from localhost ([127.0.0.1]:51378 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJnar-0000P2-5N for guile-devel@m.gmane.org; Sat, 20 Nov 2010 08:35:05 -0500 Original-Received: from [140.186.70.92] (port=59258 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PJnZU-0000E3-Rc for guile-devel@gnu.org; Sat, 20 Nov 2010 08:33:58 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PJnZ0-0004Z2-41 for guile-devel@gnu.org; Sat, 20 Nov 2010 08:33:40 -0500 Original-Received: from a-pb-sasl-sd.pobox.com ([64.74.157.62]:63255 helo=sasl.smtp.pobox.com) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PJnYz-0004YM-VQ for guile-devel@gnu.org; Sat, 20 Nov 2010 08:33:10 -0500 Original-Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id 0449C3C6B; Sat, 20 Nov 2010 08:33:21 -0500 (EST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=3QShz9E819ynUN2YzW1WKzaQ/bI=; b=IBoxqW qhb+zs9xKqCzl17uaVw7gKiIEwF0ZsoNcODhp2aBsdEJhI45gNwBGntTSBs5n6Gv KGuqDHmLM/9jwegmoO1f6LC0JylEh1J0SAbv4psrS52YxBVzEdesomLyxJri7qlg I2oOeCjEVenJJqrW256Xh2L6eIQ8XLNvAklBo= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=Q4m8dzQYFz+29zxAcUeqVThG/jV5V0U1 D4svcsTSLBj75Rvs2z8yOfdbLShwJpd9R/jN6E75PDUh6MeSdpMKR0ddtSxgny7c byKkFoNCpUth832coiffWtrL3UODQkMLJA034b8PSleaaTAoyxa1bhLNz4ZZp4UN NE5f0NRDitY= Original-Received: from a-pb-sasl-sd.pobox.com (unknown [127.0.0.1]) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTP id CE0183C6A; Sat, 20 Nov 2010 08:33:19 -0500 (EST) Original-Received: from unquote.localdomain (unknown [88.0.167.219]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (No client certificate requested) by a-pb-sasl-sd.pobox.com (Postfix) with ESMTPSA id 00E293C69; Sat, 20 Nov 2010 08:33:17 -0500 (EST) In-Reply-To: (Noah Lavine's message of "Fri, 22 Oct 2010 00:29:52 -0400") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux) X-Pobox-Relay-ID: BD1111B8-F4AA-11DF-84EE-B53272ABC92C-02397024!a-pb-sasl-sd.pobox.com X-detected-operating-system: by eggs.gnu.org: Solaris 10 (beta) X-BeenThere: guile-devel@gnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: "Developers list for Guile, the GNU extensibility library" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Original-Sender: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Errors-To: guile-devel-bounces+guile-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.lisp.guile.devel:11157 Archived-At: Hi, On Fri 22 Oct 2010 06:29, Noah Lavine writes: > After not emailing for a while, I have some good news: a JIT engine is working! Great news! I have been behind on things a bit, so apologies for taking a month to get back to you, and then only partially. In any case Ludovic probably knows more both about assembly and JIT work, so I'm happy to not be a "gatekeeper" of sorts here... That said, I am concerned about complexity. The current VM, though obviously slow, does have the advantage of being relatively simple. Adding a JIT complicates things. Well, adding another form of compilation complicates things, JIT or AOT or whatever -- so my primary concern is that, as we add native compilation, we need to keep things mentally tractable. I have worked with many people who seem to be able to keep an inhuman number of names and relationships in their head at one time. I fear I am not such a person, so we will have to keep things extra-simple :) So what I would really like to see would be: * Ideally, a 4-word objcode representation that includes native code. * A well-defined convention for that native code. That's to say that the native code could come from JIT compilation, or from AOT compilation. * A uniform way to invoke native code from the VM, and VM code from native code -- *preserving tail calls*. This seems to require either trampolines within the VM or platform-specific tail-call assembly. * A uniform interface to create JIT code as needed, in the call instructions. i.e. if (SCM_UNLIKELY (SCM_NEEDS_JIT (proc))) scm_jit_x (proc); or something. We should be able to merge all of that into Guile before any JIT code goes in, and maybe even before 2.0 if the patches were small enough and came fast enough ;-) Then we could take our time experimenting on how best to do native compilation. So, to reiterate: *simple*, with a good *tail call* story. If we can find a solution that has those characteristics, fantastic :) Andy -- http://wingolog.org/