Re: PowerShell core?

2021-02-03 Thread Yasuaki Kudo
Wow! It does look very interesting, indeed!

One of the reasons why I became so interested in Racket (not just PowerShell) 
is that it installed without a hitch in my corporate Windows.   (I tried to 
install Haskell as well but it got stuck when it came to using Stack)

It is also interesting that the rash paper on the homepage  
http://willghatch.net/publications/rash-gpce-2018-preprint.pdf mentions 
PowerShell many times. 

Empowering the IT workers!  Power to the workers!! 

-Yasu


> On Feb 4, 2021, at 03:53, Bengt Richter  wrote:
> 
> Hi,
> 
>> On +2021-02-03 02:28:26 +0100, zimoun wrote:
>> Hi,
>> Well, speaking about an
>>>  attempt to pull command
>>> interpreters out of the 70s
>> ads:  :-)
>> (I previewed the talk and it is worth watching!  Even, I previewed all
>> the talks of the «room» and they are all inspired and inspiring, see you
>> on Sunday. :-))
>> Cheers,
>> simon
> 
> [1]https://docs.racket-lang.org/rash/index.html
> 
> If you have racket or raco at your command line,
> rash is only one or two commands from interaction with you :)
> 
> I.e.,
>   racket -l rash/repl
> and/or to install rash
>   raco pkg install rash
> 
> A repo is at [2]
> 
> [2] https://github.com/willghatch/racket-rash/blob/master/README.md
> 
> Seems interesting, though I'm more into wayland innards right now,
> so I haven't done anything rash :)
> 
> -- 
> Regards,
> Bengt Richter


Re: Installing a wrapper guile script in /bin

2021-02-03 Thread elaexuotee
Thank you for the thoughtful input.

Maxime Devos  wrote:
> * forego representing `wrapper-script` as a gexp (using #~), instead represent
>   `wrapper-script` as something quasiquoted.  Then write this expression to
>   a file (with 'write', and include an appropriate shebang line)

> * The procedure ‘program-file’ turns a gexp into a representation of a store 
> item.

After spending most of the day figuring out how to manually create and build
derivations. I hit a fundamental problem including that code in a package def
which made me realize that manually embedding scripts is a flawed approach.

The issue is that a script itself has dependencies, e.g. guile, bash, whatever.
Those dependencies also need to show up in the transitive closure of whatever
package embeds this script.

> * Define a wrapper package.  See wrap-python3 in packages/python.scm
>   for an example. (This option probably has to be combined with one of the
>   first two options.) 

Your suggestion here eventually set me on the right track. Say we want the
final executable to end up at /bin/X. The basic idea is this:

1) Creat original package with a name like X-lib, and leave /bin/X empty,
2) Write a wrapper script as a gexp argument to program-file. In this gexp we
   reference the X-lib package, and finally
3) Create an trivial-build-system package X that includes the program-file
   wrapper as an input. The build step will copy this input script to
   /bin/X!

This way dependencies are correctly tracked, and there's no need for manual
derivation building hackery.

Anyway, thanks for the pointers! They motivated me to keep pushing until
something worked.



Re: PowerShell core?

2021-02-03 Thread Bengt Richter
Hi,

On +2021-02-03 02:28:26 +0100, zimoun wrote:
> Hi,
> 
> Well, speaking about an
> 
> >attempt to pull command 
> > interpreters out of the 70s
> 
> ads:  :-)
> 
> (I previewed the talk and it is worth watching!  Even, I previewed all
> the talks of the «room» and they are all inspired and inspiring, see you
> on Sunday. :-))
> 
> Cheers,
> simon
> 

[1]https://docs.racket-lang.org/rash/index.html

If you have racket or raco at your command line,
rash is only one or two commands from interaction with you :)

I.e.,
racket -l rash/repl
and/or to install rash
raco pkg install rash

A repo is at [2]

[2] https://github.com/willghatch/racket-rash/blob/master/README.md

Seems interesting, though I'm more into wayland innards right now,
so I haven't done anything rash :)

-- 
Regards,
Bengt Richter



Re: Blog post about the upcoming FOSDEM + Guix Day

2021-02-03 Thread Bonface Munyoki K .
Efraim Flashner  writes:

> Send coffee. Lots of coffee ;D
>

Tea is more polite(?) :)

-- 
Bonface M. K. D4F09EB110177E03C28E2FE1F5BBAE1E0392253F
Humble GNU Emacs User / Bearer of scheme-y parens
Curator:  / Twitter: @BonfaceKilz


signature.asc
Description: PGP signature


Re: Blog post about the upcoming FOSDEM + Guix Day

2021-02-03 Thread Development of GNU Guix and the GNU System distribution.
We will start the day with coffee, continue with tea, and finish the day with 
some belgian beer. :)

Sent from ProtonMail mobile

 Original Message 
On Feb 3, 2021, 12:32, Bonface Munyoki K. wrote:

> Efraim Flashner  writes: > Send coffee. Lots of coffee ;D > Tea is more 
> polite(?) :) -- Bonface M. K. D4F09EB110177E03C28E2FE1F5BBAE1E0392253F Humble 
> GNU Emacs User / Bearer of scheme-y parens Curator:  / Twitter: @BonfaceKilz

Re: Installing a wrapper guile script in /bin

2021-02-03 Thread Maxime Devos
> The script contents are not what I'm confused about. I don't know how to turn
> my gexp script into a file under /bin/. This is conceptually what I want:
> 
> (package
>   (name "foo")
>   ...
>   (arguments
>`(...
>  #:phases
>  (modify-phases %standard-phases
>  ...
>  (replace 'install
>(lambda* (#:key outputs #:allow-other-keys)
>  (let ((out (assoc-ref outputs "out"))
>(wrapper-script #~(...)))
>  ... ; Do normal install stuff
>  (copy-file wrapper-script (string-append out "/bin/foo"))
>  ... ; Finish install stuff
>  )))
> 
> Of course `copy-file` doesn't work here because `wrapper-script` is a gexp not
> a file. What code do I replace this with?

Three options I have in mind:

* forego representing `wrapper-script` as a gexp (using #~), instead represent
  `wrapper-script` as something quasiquoted.  Then write this expression to
  a file (with 'write', and include an appropriate shebang line)

  Something like this:

  (let ((wrapper-script-contents `(exec* ,(string-append out "/bin/.foo-real") 
"--extra-library-stuff" other-arguments)))
rename-upstream-binary
write-wrapper-binary
  )

* The procedure ‘program-file’ turns a gexp into a representation of a store 
item.

  Write your script to accept arguments like this:
  YOUR-SCRIPT REAL-BINARY ARGUMENTS
  
  And write a small wrapper shell script to /bin/foo. Maybe with something 
like this
  (format PORT "#!~a~%exec ~a ~a #$@" bin-sh-something #$THE-SCRIPT-GEXP 
/bin/.foo-real)

  (Warning: the above shell script might be incorrect.  I'm not very familiar
  with using the shell as a programming language.)

* Define a wrapper package.  See wrap-python3 in packages/python.scm
  for an example. (This option probably has to be combined with one of the
  first two options.) 

Greetings,
Maxime


signature.asc
Description: This is a digitally signed message part


Re: Installing a wrapper guile script in /bin

2021-02-03 Thread Development of GNU Guix and the GNU System distribution.
Maxime Devos  wrote:
> Let's presume the binary is called $X.
> 
> What I would do: add a build phase after the "install" phase that renames
> /bin/$X to /bin/.$X-real using the rename-file procedure.  Create
> your wrapper script at /bin/.$X-real with call-with-output-file, some
> I/O procedures and chmod (to make the wrapper script executable).
> 
> I hope that helps, Maxime.

Thanks for the pointers.

The script contents are not what I'm confused about. I don't know how to turn
my gexp script into a file under /bin/. This is conceptually what I want:

(package
  (name "foo")
  ...
  (arguments
   `(...
 #:phases
 (modify-phases %standard-phases
 ...
 (replace 'install
   (lambda* (#:key outputs #:allow-other-keys)
 (let ((out (assoc-ref outputs "out"))
   (wrapper-script #~(...)))
 ... ; Do normal install stuff
 (copy-file wrapper-script (string-append out "/bin/foo"))
 ... ; Finish install stuff
 )))

Of course `copy-file` doesn't work here because `wrapper-script` is a gexp not
a file. What code do I replace this with?

I am vaguely aware things like `build-expression->derivation` to reify a gexp
into a derivation; however, I'm not sure what to do with the derivation object
in this case or if this is even on the right track.

Cheers!



Re: Installing a wrapper guile script in /bin

2021-02-03 Thread Maxime Devos
> Say I have a script that reads /proc/cpuinfo and runs my executable with the
> correct flags to load the library with the best CPU features possible. How can
> I embed such a script in the package definition (as a gexp?) and install it
> under /bin/?

Let's presume the binary is called $X.

What I would do: add a build phase after the "install" phase that renames
/bin/$X to /bin/.$X-real using the rename-file procedure.  Create
your wrapper script at /bin/.$X-real with call-with-output-file, some
I/O procedures and chmod (to make the wrapper script executable).

I hope that helps, Maxime.


signature.asc
Description: This is a digitally signed message part


Re: Blog post about the upcoming FOSDEM + Guix Day

2021-02-03 Thread Efraim Flashner
Send coffee. Lots of coffee ;D

On Wed, Feb 03, 2021 at 08:35:36AM +0100, Pjotr Prins wrote:
> We start Monday at 5am UTC (6am AMS/Berlin, 7am Athens) to cater for
> some of Asia. The day ends when the last one switches off the lights
> :).  Manolis, Efraim and Bonface have promised to be there. The
> bluebutton link will be announced a day ahead.
> 
> Pj.
> 
> On Tue, Feb 02, 2021 at 05:40:04PM -0500, Leo Famulari wrote:
> > On Tue, Feb 02, 2021 at 07:07:47PM +0100, Ludovic Courtès wrote:
> > > Here we go!
> > > 
> > >   https://guix.gnu.org/en/blog/2021/meet-guix-at-fosdem-2021/
> > 
> > People in #guix were asking, "When exactly does it start?" Can we update
> > the blog post to say?
> > 

-- 
Efraim Flashner  אפרים פלשנר
GPG key = A28B F40C 3E55 1372 662D  14F7 41AA E7DC CA3D 8351
Confidentiality cannot be guaranteed on emails sent or received unencrypted


signature.asc
Description: PGP signature