From mboxrd@z Thu Jan 1 00:00:00 1970 From: Alex Sassmannshausen Subject: Re: Switching to ECMAscript Date: Tue, 01 Apr 2014 12:02:09 +0200 Message-ID: <87sipxv04e.fsf@serenity.home> References: <87k3b9l6xs.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Return-path: Received: from eggs.gnu.org ([2001:4830:134:3::10]:60039) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUvWV-0004m1-NO for guix-devel@gnu.org; Tue, 01 Apr 2014 06:02:32 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1WUvWJ-0007YJ-TA for guix-devel@gnu.org; Tue, 01 Apr 2014 06:02:27 -0400 Received: from mail-wi0-f177.google.com ([209.85.212.177]:47249) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1WUvWJ-0007Y1-N7 for guix-devel@gnu.org; Tue, 01 Apr 2014 06:02:15 -0400 Received: by mail-wi0-f177.google.com with SMTP id cc10so4789310wib.10 for ; Tue, 01 Apr 2014 03:02:14 -0700 (PDT) In-reply-to: <87k3b9l6xs.fsf@gnu.org> 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-bounces+gcggd-guix-devel=m.gmane.org@gnu.org To: =?utf-8?Q?Ludovic_Court=C3=A8s?= Cc: guix-devel Hi Ludo, I think this sounds like a great plan! I think a year's re-writing of package definitions is definitely a price worth paying so we can get rid of the "ivory tower" functional paradigm: just think of all the other developers we could recruit to Guix! I might not be able to help though as my JS is pretty rusty… Alex Ludovic Courtès writes: > Hello, > > Over the last few months I have been questioning some of the choices > that were initially made for Guix. So I finally took the time to > investigate more what could be done about it, and specifically I’ve been > playing with Guile’s ECMAscript front-end. > > This is what’s already possible with Guile 2.0: > > --8<---------------cut here---------------start------------->8--- > scheme@(guile-user)> ,L ecmascript > Happy hacking with ECMAScript! To switch back, type `,L scheme'. > ecmascript@(guile-user)> require('guix'); > ;;; : warning: possibly unbound variable `require' > $1 = #< 1e325a0> > ecmascript@(guile-user)> require('gnu.packages.vim'); > $2 = #< 1660370> > ecmascript@(guile-user)> $2['vim']; > $3 = # > ecmascript@(guile-user)> $1['open-connection'] (); > $4 = # > ecmascript@(guile-user)> $1['package-derivation']($4, $3); > $5 = # /gnu/store/3wacq9b5qhnk1vn82jggnc10rb1ib4hl-vim-7.4 2d25cd0> > --8<---------------cut here---------------end--------------->8--- > > Pretty cool, no? > > ECMAscript lacks some features that we’re used to, such as records and > macros (which we rely on a lot for package definitions, see [0]), but > OTOH it has the neat notion of “object properties.” And of course, it’s > very popular, and GNU hackers are usually familiar with it. > > In fact, as I already mentioned in my FOSDEM talk [1], things like npm > already nicely leverage that, so we don’t even have to come up with a > new format for package definitions. > > So the plan would be to start rewriting package definitions in JS, to > start with, and then go ahead with the (guix ...) modules. Hopefully > we can reach feature parity with the current Guix within a year or so. > > Another thing I would like to improve in the next months is the > packaging model. The functional paradigm has its pros, but it has also > been causing us difficulties. I would like to allow build processes to > access the root file system, so we can do things like “post-install > hooks.” I don’t have any clear road map on this one though, so > suggestions are welcome! > > Comments? > > Thanks, > Ludo’. > > [0] Section 3.3, http://arxiv.org/abs/1305.4584 > [1] See around slide 29, > http://www.gnu.org/software/guix/guix-fosdem-20140201.pdf