From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Vong Subject: Re: JIT compiling Date: Sat, 13 Aug 2016 19:48:26 +0800 Message-ID: <87r39svqid.fsf@gmail.com> References: <87h9b0ij9x.fsf@gmail.com> <87wpjvhfpg.fsf@elephly.net> <87eg62d5p4.fsf@gmail.com> <20160808200018.GA20179@jasmine> <871t1yvsn8.fsf@gmail.com> <20160809172728.b6wijrzccd5wdv37@galago.mtmxr.com> <87k2fpktsi.fsf@gmail.com> <20160811062627.mbaiqhssaejwh4hw@galago.mtmxr.com> <87fuqbl40a.fsf@gmail.com> <1471002346.7915.4.camel@octave.org> <1995101673.1196029.1471014517428@mail.yahoo.com> <9ccb2c8c-a24d-4c7d-0a41-cc97bf09bf24@posteo.de> <914319201.1534801.1471050197227@mail.yahoo.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:44597) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1bYXQj-00039o-3D for guix-devel@gnu.org; Sat, 13 Aug 2016 07:48:48 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1bYXQg-0008GB-TM for guix-devel@gnu.org; Sat, 13 Aug 2016 07:48:43 -0400 In-Reply-To: <914319201.1534801.1471050197227@mail.yahoo.com> (Sergei Steshenko's message of "Sat, 13 Aug 2016 01:03:17 +0000 (UTC)") List-Id: "Development of GNU Guix and the GNU System distribution." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guix-devel-bounces+gcggd-guix-devel=m.gmane.org@gnu.org Sender: "Guix-devel" To: Sergei Steshenko Cc: Jordi =?utf-8?Q?Guti=C3=A9rrez?= Hermoso , "help-octave@gnu.org" , Oliver Heimlich , "guix-devel@gnu.org" , Mike Miller Sergei Steshenko writes: > ----- Original Message ----- >> From: Oliver Heimlich >> To: Sergei Steshenko ; Jordi Guti=C3=A9rrez Hermoso >> ; Alex Vong >> Cc: Ricardo Wurmus ; "guix-devel@gnu.org" >> ; Leo Famulari ; >> "help-octave@gnu.org" ; Mike Miller >> >> Sent: Friday, August 12, 2016 7:06 PM >> Subject: Re: JIT compiling >>=20 >> On 12.08.2016 17:08, Sergei Steshenko wrote: >>=20 >>>> ________________________________ >>>> From: Jordi Guti=C3=A9rrez Hermoso >>>> To: Alex Vong =20 >>>> Cc: Ricardo Wurmus ; guix-devel@gnu.org; Leo=20 >> Famulari ; help-octave@gnu.org; Mike Miller=20 >> >>>> Sent: Friday, August 12, 2016 2:45 PM >>>> Subject: JIT compiling >>>>=20 >>>>=20 >>>> On Thu, 2016-08-11 at 23:27 +0800, Alex Vong wrote: >>>>> Finally, some unrelated stuff, I hope octave would have a byte code >>>>> interpreter soon. I would suggest to write it in rpython, it seems >>>>> to be the easiest way to have jit these days. >>>>=20 >>>> That is a faraway pipe dream. Can you help? >>>>=20 >>>> - Jordi G. H. >>>>=20 >>>>=20 >>>=20 >>>=20 >>> Julia ( http://julialang.org/ ) quite developed since it's been=20 >> discussed here. They claim to have close to "C" performance and JIT. >>>=20 >>=20 >> There is a good language introduction available as a talk from JuliaCon: >> https://youtu.be/rAxzR7lMGDM >>=20 >> As far as I can see, Julia compiles the code if it can predict the types >> of the variables. Otherwise, it is slow. This is explained in the first >> part of the talk. >>=20 >> Best >> Oliver >>=20 > > > If the type can't be predicted, then runtime checks need to be made > and the object might have to be recreated. E.g. if 12345678 is a > number, it fits a 32 bit integer, and if it is a string, it will need > 9 bytes in case of "C" representation. > I think in the case of jit, many of the checks can be removed by making certain assumptions and inserts guards to check those assumptions. If the assumptions turn out to be false, then the compiled code will be trashed and available for jitting again. > > So the limitation does not look to me like a Julia-specific one. > > --Sergei.