Re: Scripting for installing a module

2022-07-02 Thread adriano
Il giorno ven, 01/07/2022 alle 18.15 +0100, James Crake-Merani ha
scritto:
> Hello,
> 
> I was just wondering what approach people tend to take when writing a
> script which installs a module onto the load-path. I understand this
> path might be different on different machines so how do you make sure
> the module is installed in the right path? Would you use something
> like a Makefile?

not only a Makefile

The whole Autotools chain

There are 2 options:

1) you write the config.am and Makefile.am (or however they're called)
by hand and you deal with the Autotools directly, by hand

2) You use guile-hall and it will wrap the Autotools making the
experience a bit less frustrating



BUT

I wonder: why you want to install your module ?

You might want to distribute it as a simple handful of source files

Guile will compile it automagically at need

If your module has no dependencies, that could be an easy option

If it _has_ dependencies, then the Autotools might be of help

Did you think about this ?

I hate to second guess your question 

I understand it might be perceived as rude and I'm sorry for that

I just think these distinctions in use cases are not clear at all, in
the manual and in general

So this could be an easy pitfall



Re: Scripting for installing a module

2022-07-02 Thread James Crake-Merani
On 22/07/02 09:11am, adriano wrote:
> Il giorno ven, 01/07/2022 alle 18.15 +0100, James Crake-Merani ha
> scritto:
> > Hello,
> > 
> > I was just wondering what approach people tend to take when writing a
> > script which installs a module onto the load-path. I understand this
> > path might be different on different machines so how do you make sure
> > the module is installed in the right path? Would you use something
> > like a Makefile?
> 
> not only a Makefile
> 
> The whole Autotools chain
> 
> There are 2 options:
> 
> 1) you write the config.am and Makefile.am (or however they're called)
> by hand and you deal with the Autotools directly, by hand
> 
> 2) You use guile-hall and it will wrap the Autotools making the
> experience a bit less frustrating
> 
> 
> 
> BUT
> 
> I wonder: why you want to install your module ?
> 
> You might want to distribute it as a simple handful of source files
> 
> Guile will compile it automagically at need
> 
> If your module has no dependencies, that could be an easy option
> 
> If it _has_ dependencies, then the Autotools might be of help
> 
> Did you think about this ?
> 
> I hate to second guess your question 
> 
> I understand it might be perceived as rude and I'm sorry for that
> 
> I just think these distinctions in use cases are not clear at all, in
> the manual and in general
> 
> So this could be an easy pitfall

Hi,

Don't worry, you didn't come across as rude at all. My use case was simply that 
I wrote some modules that I wanted to distribute, and I thought that if I'm 
going to distribute them, I probably ought to put some sort of script in so 
users can install them as well. The modules in question are just a simple 
project which tests your conformance to a certain political ideology (which is 
not sophisticated at all because it was more of a joke between friends that I 
thought would make a good programming exercise). After seeing Guile Hall 
recommended by yourself, and Jeremy I thought this might be appropriate. My 
modules have no dependencies aside from those already part of Guile although I 
do intend to write another module which will depend on the previous module.

So if I were to take the latter approach of just distributing the source code 
then I presume users would have to load the file manually, or install it 
manually unless I'm missing something. In that case, I would've thought using 
something like Guile Hall would be more appropriate but again I might be 
missing something.

I have just found the manual pages detailing Guile Hall which I was not 
originally aware of. After reading them, it does seem to me that Hall would be 
appropriate for this but of course I would be willing to hear about 
alternatives to distributing the code.

Thanks for your response.



Re: Curiosity: Microkernel implemented in Guile ?

2022-07-02 Thread Matias Jose Seco Baccanelli
Hello fellow Guilers!
Thank you so much for the wide input!
So cool to see many thriving initiatives! 

Il giorno Thu, 23 Jun 2022 09:34:25 +0200
Maxime Devos  ha scritto:

> Matias Jose Seco Baccanelli schreef op do 23-06-2022 om 08:11 [+0200]:
> > Feels like a nice recipe for User Empowerment !
> 
> How does this empower users?  

My rationale is about having the advantage of scheme programming
approach than c paradigm. I feel this brings it's magic pedagogic and
mind friendly source code.

> Sure, if the user is a programmer they
> can modify their custom microkernel in Scheme, but then you have a
> very niche OS that practically no other software already supports,
> which is very inconvenient for the user and the user will have
> practical difficulties sharing the software with other people using
> other OSes

Indeed, i'm too newbie about the topic, i thought integration between
kernel and software was straightforward, but i can imagine that many
additional tools/steps might be required for that.

> ,so I think you're better of modifying another
> pre-existing microkernel to be usable from Guile (see answer by Dr.
> Arne Babenhauserheide).

I think that's a great idea and initiative! 

> Greetings,
> Maxime.

Thanks for the interesting reflection!
Again my knowledge on these fields are still under
development^^ so this are mainly curiosities and sensations!
Thanks!



Re: Pattern matching: what does (= f pat) do?

2022-07-02 Thread Abhiseck Paira
> Dear guile users,

> The pattern matching manual has a strange description for the (= f pat)
> pattern. It reads:

> (= field pat)   a ``field'' of an object

> However, the next example shows how you can apply a function in field
> without having anything to do with a field of an object.

> Based on the given example, and some experiments on my part, I think
> that the description should be:

> (= f pat) applies f, and matches pat in the result

> Am I correct?

> Vivien

It seems your interpretation is correct!  Thanks to your message I could
figure out what this spec means as it didn't make much sense in the
manual or in srfi-200 documentation[0] (The specification seems to have
been copied verbatim from srfi-200).

[0] https://srfi.schemers.org/srfi-200/srfi-200.html


-- 
Abhiseck Paira
E34E 825B 979E EB9F 8505  F80E E93D 353B 7740 0709
https://paira.in


signature.asc
Description: PGP signature


Re: Scripting for installing a module

2022-07-02 Thread Zelphir Kaltstahl



On 7/2/22 10:46, James Crake-Merani wrote:

On 22/07/02 09:11am, adriano wrote:

Il giorno ven, 01/07/2022 alle 18.15 +0100, James Crake-Merani ha
scritto:

Hello,

I was just wondering what approach people tend to take when writing a
script which installs a module onto the load-path. I understand this
path might be different on different machines so how do you make sure
the module is installed in the right path? Would you use something
like a Makefile?

not only a Makefile

The whole Autotools chain

There are 2 options:

1) you write the config.am and Makefile.am (or however they're called)
by hand and you deal with the Autotools directly, by hand

2) You use guile-hall and it will wrap the Autotools making the
experience a bit less frustrating



BUT

I wonder: why you want to install your module ?

You might want to distribute it as a simple handful of source files

Guile will compile it automagically at need

If your module has no dependencies, that could be an easy option

If it _has_ dependencies, then the Autotools might be of help

Did you think about this ?

I hate to second guess your question

I understand it might be perceived as rude and I'm sorry for that

I just think these distinctions in use cases are not clear at all, in
the manual and in general

So this could be an easy pitfall

Hi,

Don't worry, you didn't come across as rude at all. My use case was simply that 
I wrote some modules that I wanted to distribute, and I thought that if I'm 
going to distribute them, I probably ought to put some sort of script in so 
users can install them as well. The modules in question are just a simple 
project which tests your conformance to a certain political ideology (which is 
not sophisticated at all because it was more of a joke between friends that I 
thought would make a good programming exercise). After seeing Guile Hall 
recommended by yourself, and Jeremy I thought this might be appropriate. My 
modules have no dependencies aside from those already part of Guile although I 
do intend to write another module which will depend on the previous module.

So if I were to take the latter approach of just distributing the source code 
then I presume users would have to load the file manually, or install it 
manually unless I'm missing something. In that case, I would've thought using 
something like Guile Hall would be more appropriate but again I might be 
missing something.

I have just found the manual pages detailing Guile Hall which I was not 
originally aware of. After reading them, it does seem to me that Hall would be 
appropriate for this but of course I would be willing to hear about 
alternatives to distributing the code.

Thanks for your response.


Hello James!

If your code is Guile code exclusively, then you might not need Guile Hall for 
packaging your code. You can make a GNU Guix package without Guile Hall. That is 
not to say, that Guile Hall does not work well, but I had a project, which I 
wanted to package and ultimately I did not want to depend on all the autotools 
machinery, which I do not understand. It has been a while, since I have packaged 
anything (I should really clean the repo a bit …), but the project I have is 
https://notabug.org/ZelphirKaltstahl/guile-fslib. I think tag 0.2.1 should 
contain a valid guix.scm. This repo also still has files from previous Guile 
Hall attempts. However, you might have to study the docs to get things working 
for your own project and how to test it with guix. I remember, that I used a VM 
for testing installation of the package. Somewhere I have a repository, which 
describes the process.


Regards,
Zelphir

--
repositories: https://notabug.org/ZelphirKaltstahl




Re: Scripting for installing a module

2022-07-02 Thread Matt Wette

Another option is some variant of

    $ sudo cp xyz/file.scm `guile -c '(display 
(%global-site-dir))'`/xyz/file.scm


On 7/1/22 10:15 AM, James Crake-Merani wrote:

guile -c '(display (%global-site-dir))'Hello,

I was just wondering what approach people tend to take when writing a script 
which installs a module onto the load-path. I understand this path might be 
different on different machines so how do you make sure the module is installed 
in the right path? Would you use something like a Makefile?

Thanks.