unofficial mirror of help-guix@gnu.org 
 help / color / mirror / Atom feed
* Configuring Guix with JavaScript?
@ 2020-04-22  1:04 Stephen Paul Weber
  2020-04-23 17:42 ` zimoun
  0 siblings, 1 reply; 3+ messages in thread
From: Stephen Paul Weber @ 2020-04-22  1:04 UTC (permalink / raw)
  To: help-guix

[-- Attachment #1: Type: text/plain, Size: 680 bytes --]

Hello all!

I have what may be a bit of an oddball question.  Guix is configured using 
Guile.  Guile's default language is Scheme.  The Guix website actually says 
it is configured with "Guile Scheme" and all documentation is in Scheme.  So 
far so good.

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?

Thanks to anyone who humours me.

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Configuring Guix with JavaScript?
  2020-04-22  1:04 Configuring Guix with JavaScript? Stephen Paul Weber
@ 2020-04-23 17:42 ` zimoun
  2020-04-23 17:50   ` Christopher Lemmer Webber
  0 siblings, 1 reply; 3+ messages in thread
From: zimoun @ 2020-04-23 17:42 UTC (permalink / raw)
  To: Stephen Paul Weber; +Cc: help-guix

Dear,

On Wed, 22 Apr 2020 at 03:09, Stephen Paul Weber
<singpolyma@singpolyma.net> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Configuring Guix with JavaScript?
  2020-04-23 17:42 ` zimoun
@ 2020-04-23 17:50   ` Christopher Lemmer Webber
  0 siblings, 0 replies; 3+ messages in thread
From: Christopher Lemmer Webber @ 2020-04-23 17:50 UTC (permalink / raw)
  To: help-guix; +Cc: Stephen Paul Weber

The main challenge in configuring-Guix-with-Javascript probably
surrounds usage of macros that are not available in Javascript... I'm
not sure how many there are that are a sufficient barrier to use.  That
and that the Javascript implementation is still a little bit shaky (but
could use help).  But this is all said without having tried it.

I would think that defining packages would not be possible with
Javascript, but defining a system definition probably would be.  I am
not sure.  It could be worth exploring, and at minimum would be an
interesting result.

zimoun writes:

> Dear,
>
> On Wed, 22 Apr 2020 at 03:09, Stephen Paul Weber
> <singpolyma@singpolyma.net> 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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2020-04-23 17:50 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-04-22  1:04 Configuring Guix with JavaScript? Stephen Paul Weber
2020-04-23 17:42 ` zimoun
2020-04-23 17:50   ` Christopher Lemmer Webber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).