From mboxrd@z Thu Jan 1 00:00:00 1970 From: zimoun Subject: Re: Configuring Guix with JavaScript? Date: Thu, 23 Apr 2020 19:42:20 +0200 Message-ID: References: <20200422010422.GA7603@singpolyma-beefy> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Return-path: Received: from eggs.gnu.org ([2001:470:142:3::10]:52356) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1jRfrx-0004Kc-Hj for help-guix@gnu.org; Thu, 23 Apr 2020 13:42:37 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.90_1) (envelope-from ) id 1jRfrt-0006k7-2h for help-guix@gnu.org; Thu, 23 Apr 2020 13:42:37 -0400 Received: from mail-qt1-x82e.google.com ([2607:f8b0:4864:20::82e]:38653) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1jRfrs-0006jn-Ja for help-guix@gnu.org; Thu, 23 Apr 2020 13:42:32 -0400 Received: by mail-qt1-x82e.google.com with SMTP id i68so5566274qtb.5 for ; Thu, 23 Apr 2020 10:42:32 -0700 (PDT) In-Reply-To: <20200422010422.GA7603@singpolyma-beefy> List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: help-guix-bounces+gcggh-help-guix=m.gmane-mx.org@gnu.org Sender: "Help-Guix" To: Stephen Paul Weber Cc: help-guix Dear, On Wed, 22 Apr 2020 at 03:09, Stephen Paul Weber wrote: > However, Guile can also understand other syntaxes, notably advertising > ECMAscript (JavaScript) and EMACS Lisp syntax. So my question is: can I > configure Guix using JavaScript instead of Scheme? If not, is it a > fundamental limitation or something worth me poking at? If so, has anyone > tried it? Does anyone have a suggestion where I should start in trying this > out? Interesting idea. :-) AFAIK, it is currently not possible. Recently, experimental JSON support has been added [1]. Well, I am not sure that Guile can combine several languages. Other said, Guile can compile and run Scheme scripts and it can too compile and run say ECMAscript but I do not know if one could write/define a module using Scheme and call this very module from ECMAscript; as for example Python and Hy [2] (lisp) do using the Python AST module. And combining is not easy because some "concepts" in one language does not necessary apply to another language. It is not because the compiler has several front-ends (for different languages) and use the same internals [3] that it can mix them; e.g., GCC: Fortran, C, Ada, etc. and it is not straightforward to combing them. Otherwise, life would be too simple. ;-) But I should miss a point... [1] https://debbugs.gnu.org/cgi/bugreport.cgi?bug=40629 [2] https://docs.hylang.org/en/stable/ [3] https://www.gnu.org/software/guile/manual/html_node/Compiling-to-the-Virtual-Machine.html As a starting point, I would ask to Guile's mailing list how to write a module in say Scheme and use it from say ECMAscript --- or least where start from to do so. All the best, simon