Re: Guix home and operating-system
Hi Andrew, On +2022-07-27 11:34:14 +0300, Andrew Tropin wrote: > On 2022-07-18 11:38, Ludovic Courtès wrote: > > > Hi, > > > > Andrew Tropin skribis: > > > >> I don't remember all the details and where I stopped, but the highlevel > >> idea is following: > >> > >> - Define a system services, which contains (user . home-environment) pairs. > >> - Build home environments on system reconfigure. > >> - Activate home environments on boot. > > > > That would be a nice addition! > > For future readers, the work is happenning in #56669 > (Message-ID: 63960cf762aec1ed2c4182f49cac66bc37fce2aa.ca...@rdmp.org) > > -- > Best regards, > Andrew Tropin I'm guessing you have handy emacs macros or other means to turn that message ID and/or bug number to a browsable URL, but for others it will save them time if you post a clickable URL also :) How much is missed by those who don't participate in IRC? I wonder how one would make a history book section to include all the "the work is happening" venues :) IMO zimoun sets a great example referencing resources, along with ludo, (not to leave out people whose posts are fine with one or two URLs :) I use this to browse a bug by number: --8<---cut here---start->8--- #!/usr/bin/bash # browse-bug num="$(echo "$1"|tr -cs '0123456789' ' '|tr -d ' ')" my_browser="${MY_BUG_BROWSER:-lynx}" if [ -n "$num" ];then $my_browser "https://debbugs.gnu.org/cgi/bugreport.cgi?bug=$num; else echo "\ Usage: [MY_BUG_BROWSER=] browse-bug BUG_NUMBER (not '$1' -> '$num') BUG_NUMBER will be taken from \$1 word stripped of non-digits if any If you set MY_BUG_BROWSER to firefox-esr, you can run this in the background like browse-bug '#56669' & but lynx will want interaction from you on stdin, so no '&' NB: if you Ctl-V the #, delete it or quote it, or bash will throw it away as comment. " exit 1 fi --8<---cut here---end--->8--- HTH :) -- Regards, Bengt Richter
Re: developing javascript with guix
On Wednesday, July 27th, 2022 at 10:25 PM, jgart wrote: > > > On Wed, 27 Jul 2022 11:33:43 +0200 Maxime Devos maximede...@telenet.be wrote: > > > Hi Maxime, > > Hope all is well. > > > Let's try not doing anything special: > > > Thanks for the repl example and for trying out a Guix developer js > workflow for me. Do you happen to know if the same approach works > for erlang? > > I think we should have language developer documentation for > general orientation of new Guix users. Ryan Prior, another Guix > contributor/developer has mentioned this idea to me before. Hey Guix! Since I'm mentioned here, I'll throw in a couple ideas. First, an issue about unexpected behavior. I tried running this: guix shell node-sqlite3 -- node <<<"console.log(require('sqlite3'))" It gave me an error saying it couldn't find the module sqlite3. Turns out it's because I was using node from my base profile and not from the shell. Running the shell with `--pure` makes it give a more helpful error, "node: command not found." Why isn't node a dependency for node-mersenne though? Is there really a use case for shipping the source code of a JavaScript library without the interpreter? At a minimum, can we make `guix shell` warn on stderr if you create a shell with one or more libraries but no interpreter? Second, a point about documentation. It's pretty obvious to most of us how to use JavaScript libraries (or Python, etc) with Guix, modulo small issues like the above. But Guix has two weaknesses here in comparison to other language-specific package managers: ## Explanation in context The language-specific package managers generally don't take for granted that people know anything about the language, because they're designed to be accessible to learners of the language. For example, PyPI's explanation for pip starts with the basic "can you even run Python?" and goes through a bunch of Python-specific package workflows: https://packaging.python.org/en/latest/tutorials/installing-packages/ We could write a guide like that with information and example commands specific to Python packaging, and another for JavaScript, etc. These provide explanation in context so beginners and people who are confused for whatever reason can see concrete examples of what you're supposed to do. ## Specificity implies belonging A Python-specific package manager is full of references to Python, libraries for Python, tools for Python programmers. If you're doing Python, the PyPI shouts loud and clear: "you are in the right place!" Likewise for JavaScript and npm, Ruby and gems, etc. Landing on the pages for any of those package managers confirms that you are in a place where you will find information and tools that will help you with your language and package commons of choice. When you do a search for "MySQL" on PyPI, you only see Python MySQL packages, not random other stuff. The interface and search quickly confirm that you have found the right place with the right stuff for you. Meanwhile, in the Guix docs, everything is abstract. We don't name any specific library commons or restrict package search to any specific namespace, we don't even have tags or categories for them. There is no link to Guix documentation I can give to a Python hacker that assures them, in the way PyPI's website does, that Guix has the stuff they need and they can find it and make it work. So Guix requires more faith and experimentation from users, which means a lot of people will just bounce off it. I talk to somebody about once a week who says "oh I've heard of Guix and keep meaning to try it." The project has built up a lot of indistinct good faith that it has yet to make good on, so to speak. I think we can make a much better experience for users from the various language library commons if we build language-specific landing pages with instructions, documentation, and package search that affirm they are in the right place and will find the right stuff, and don't make much assumption that the person knows what they are doing. I'll pitch in on this effort! I have experience with Ruby, JavaScript and Python packaging and tooling and am to help build out all those areas. Our emerging teams can help lend some structure to this effort too, I imagine. Cheers, Ryan
Re: developing javascript with guix
On Wed, 27 Jul 2022 11:33:43 +0200 Maxime Devos wrote: Hi Maxime, Hope all is well. > Let's try not doing anything special: Thanks for the repl example and for trying out a Guix developer js workflow for me. Do you happen to know if the same approach works for erlang? I think we should have language developer documentation for general orientation of new Guix users. Ryan Prior, another Guix contributor/developer has mentioned this idea to me before. How are users supposed to know to run node and node-mersenne?: > $ guix shell node-mersenne node > $ node > > mersenne = require('mersenne') A new js developer Guixer will be frustrated if they have to learn this through trial and error or by hanging out in the irc channel long enough to find out that insight on how to do this. Also, not every js developer will run code from a repl in their usual workflow. So, I think we should see what the js community does as common practices for loading js libraries and see if Guix could support that since this will be too disruptive for a js developer to adopt Guix if the workflow is radically different or completely undocumented. We should document and show them what to expect when using Guix with js libraries. > 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, ... I completely agree that it should be done for all of our supported language ecosystems. To give an example from Common Lisp, The common lisp community mostly uses quicklisp if they are not using roswell. Since Guix is a replacement for quicklisp, it asks users to understand how to load libraries via asdf which is a low level detail for most common lispers using quicklisp. I know this from my personal experiences. Phoe, a prominent lisper in the community, for example, uses quicklisp mostly, and does not usally load libraries from the asdf API in his workflow. The same can be said for other prominent lispers I've conversed with. If we are asking CL users to use asdf, which is not the most common way to load libraries in the CL community then we should document in the CL Guix documentation section how lispers should load CL code when using Guix. I realize that we may not know the right approach yet because very few common lispers use Guix. The other thing regarding CL that should be mentioned is the fact that you can not load lisp libraries dynamically in the repl or editor buffer without restarting the shell environment. This is a common expectation in the CL community and we should atleast make a note that they will not be able to do that dynamicaly in a repl when using Guix currently. If we do not want to support that because of our thesis or commitments or some other reason then we should document it for CL users. I think there are some efforts by charje to implement this but I'd have to dig it up from the mailing list archives. I can link that if anyone is interested. > (*) 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. Does this happen consistently/successfully across all languages supported by Guix? Sorry for my long rant above. I just want to make sure I document my experiences with these language ecoystems and their interaction with Guix tooling so that we can see where we can improve regarding documentation, user interface, as well as improving the Guixer's developer experience. all best, jgart https://whereis.みんな/ https://phoe.github.io/ https://github.com/charje/
Re: developing javascript with guix
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. OpenPGP_0x49E3EE22191725EE.asc Description: OpenPGP public key OpenPGP_signature Description: OpenPGP digital signature
Re: Guix home and operating-system
On 2022-07-18 11:38, Ludovic Courtès wrote: > Hi, > > Andrew Tropin skribis: > >> I don't remember all the details and where I stopped, but the highlevel >> idea is following: >> >> - Define a system services, which contains (user . home-environment) pairs. >> - Build home environments on system reconfigure. >> - Activate home environments on boot. > > That would be a nice addition! For future readers, the work is happenning in #56669 (Message-ID: 63960cf762aec1ed2c4182f49cac66bc37fce2aa.ca...@rdmp.org) -- Best regards, Andrew Tropin signature.asc Description: PGP signature