guix-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: developing javascript with guix


From: Maxime Devos
Subject: Re: developing javascript with guix
Date: Wed, 27 Jul 2022 11:33:43 +0200
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0

On 27-07-2022 02:25, jgart wrote:

Should we make a guide for developing with js and guix?

For example, how does a js developer use `guix shell` to load a js lib like
node-rimraf in a repl currently?
This one is not in Guix, so I'll replace it by node-mersenne.
There's currently no doc for getting started with that iirc

Let's try not doing anything special:

$ guix shell node-mersenne node
$ node
> mersenne = require('mersenne')
{
  MersenneTwister19937: [Function:think we need documentati MersenneTwister19937],
  rand: [Function (anonymous)],
  seed: [Function (anonymous)],
  seed_array: [Function (anonymous)]
}
> mersenne.MersenneTwister19937
[Function: MersenneTwister19937]

No setup appears to be required beyond simply installing node and the node library and using node's 'require' function, so I don't think we need documentation for this in Guix (I'm assuming that node documents 'require'), though I suppose we could have it for completeness  (*).  If doing that is considered a good thing, it seems to me that it should then also be done for Guile, Python, C/C++/etc, Minetest, Vim, ...

Greetings,
Maxime.

(*) E.g., when looking for the 'require' function, there was initially some slight confusion with 'require' accepting relative and absolute file names so I was fearing it might need to be passed $GUIX_ENVIRONMENT/lib/node_modules, but this turned out to be unfounded.

Attachment: OpenPGP_0x49E3EE22191725EE.asc
Description: OpenPGP public key

Attachment: OpenPGP_signature
Description: OpenPGP digital signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]