unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* Is it possible to write program only in Guile?
@ 2023-10-18 10:23 CToID
  2023-10-18 12:51 ` Basile Starynkevitch
                   ` (2 more replies)
  0 siblings, 3 replies; 19+ messages in thread
From: CToID @ 2023-10-18 10:23 UTC (permalink / raw)
  To: guile-user

Hello guys, a common lisper here.  I've recently developed some 
interests in Guile, and wonder if I can make a program entirely written 
in Guile.

The reason why I am asking this question is because Guile seems to be 
designed as an extension language that will be embedded into other programs.




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

* Re: Is it possible to write program only in Guile?
  2023-10-18 10:23 Is it possible to write program only in Guile? CToID
@ 2023-10-18 12:51 ` Basile Starynkevitch
  2023-10-18 13:31   ` CToID
  2023-10-18 13:10 ` Olivier Dion
  2023-10-18 13:12 ` Zelphir Kaltstahl
  2 siblings, 1 reply; 19+ messages in thread
From: Basile Starynkevitch @ 2023-10-18 12:51 UTC (permalink / raw)
  To: guile-user; +Cc: funk443


On 10/18/23 12:23, CToID wrote:
> Hello guys, a common lisper here.  I've recently developed some 
> interests in Guile, and wonder if I can make a program entirely 
> written in Guile.
>
> The reason why I am asking this question is because Guile seems to be 
> designed as an extension language that will be embedded into other 
> programs.


Guile can be seen as a competitor to Python. You can code a program in 
Guile, and you could also extend an existing program with Guile. You can 
code in C your low level primitives and invoke them from Guile scripts.


A good example of extending a program with Guile is GNU make 
<https://www.gnu.org/software/make/> (a builder program driving 
compilers and linkers, etc etc). It can be compiled as being extensible 
with GUILE code.


BTW, my pet open source project is the RefPerSys open source inference 
engine (some explanations on http://refpersys.org/ ...). See 
https://github.com/RefPerSys/RefPerSys/ (work in progress)


Regards from near Paris in France


PS. I can read but not write Russian. I am French, and can read and 
write English (and of course French, which is my mother tongue)

-- 
Basile Starynkevitch
  <basile@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/


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

* Re: Is it possible to write program only in Guile?
  2023-10-18 10:23 Is it possible to write program only in Guile? CToID
  2023-10-18 12:51 ` Basile Starynkevitch
@ 2023-10-18 13:10 ` Olivier Dion
  2023-10-18 13:32   ` Marc Chantreux
  2023-10-18 13:12 ` Zelphir Kaltstahl
  2 siblings, 1 reply; 19+ messages in thread
From: Olivier Dion @ 2023-10-18 13:10 UTC (permalink / raw)
  To: CToID, guile-user

On Wed, 18 Oct 2023, CToID <funk443@yandex.com> wrote:
> Hello guys, a common lisper here.  I've recently developed some 
> interests in Guile, and wonder if I can make a program entirely written 
> in Guile.

Yes.

> The reason why I am asking this question is because Guile seems to be 
> designed as an extension language that will be embedded into other
> programs.

I see 2 ways of programming with Guile:

 1. The program is written in C.  Guile is used as a scripting language.
 This is the case for Gnu Makefile for example.  This is often the case
 if you have already started the project in C and would like to allow
 users to script your application.

 2. The program is written in Guile.  It can access C routines with the
 foreign function interface (FFI).  This includes popular C libraries
 such as SQLite or SDL2.  An equivalent in Python is Numpy.  The FFI can
 also be used to interface with routines private to the project.  This
 is useful if you need the speed of C for an algorithm.  For example,
 you might want to implement a convolution operation on signals and
 would like to use C to benefit from SIMD instructions.

There is a third way that I personally use.  I use the FFI to make
bindings of the public interface of a low-level C library I work on.
These bindings are not meant to be used by users.  They are instead used
to write tests in Guile.

Overall, if you are a common lisper and do not have an existing C
code-base or that you are not making a C library, the second way is the
best way IMHO.

NOTE: I've been mentioning C here because C is actually the only runtime
that has a well defined and not insaned ABI.  Using FFI with C++ is
simply not possible and you will need something like SWIG.

Regards,

old

-- 
Olivier Dion




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

* Re: Is it possible to write program only in Guile?
  2023-10-18 10:23 Is it possible to write program only in Guile? CToID
  2023-10-18 12:51 ` Basile Starynkevitch
  2023-10-18 13:10 ` Olivier Dion
@ 2023-10-18 13:12 ` Zelphir Kaltstahl
  2 siblings, 0 replies; 19+ messages in thread
From: Zelphir Kaltstahl @ 2023-10-18 13:12 UTC (permalink / raw)
  To: CToID; +Cc: Guile User

On 10/18/23 12:23, CToID wrote:
> Hello guys, a common lisper here.  I've recently developed some interests in 
> Guile, and wonder if I can make a program entirely written in Guile.
>
> The reason why I am asking this question is because Guile seems to be designed 
> as an extension language that will be embedded into other programs.
>
Hello CToID!

When I was first looking at GNU Guile, I had the same question. This might be 
due to it being promoted as an extension language on the official website (I think).

Yes it is possible to write programs exclusively in GNU Guile : ) Just like you 
can write whole programs with Racket or other similar languages.

It is one of the more used Scheme dialects. At least I think it is, from the 
perspective of my own bubble.

Many exciting developments happened over the last 1–2 (or is it 3?) years. There 
is the whole Guix thing for example. Recently for example Guile Hoot, if you 
want to look that up. However, as a non-mainstream language, of course you might 
also come across some rougher corners and might need to implement things on your 
own or ask around what others already have. People on the mailing list are often 
helpful.

Welcome!

Best regards,
Zelphir

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




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

* Re: Is it possible to write program only in Guile?
  2023-10-18 12:51 ` Basile Starynkevitch
@ 2023-10-18 13:31   ` CToID
  2023-10-18 13:36     ` Basile Starynkevitch
  2023-10-18 14:43     ` Greg Troxel
  0 siblings, 2 replies; 19+ messages in thread
From: CToID @ 2023-10-18 13:31 UTC (permalink / raw)
  To: guile-user; +Cc: basile, olivier.dion, zelphirkaltstahl

Thanks for all of your kind and informative replies, I have just another 
question about Guile.

How do I distribute Guile programs to somebody who doesn't have Guile 
installed on their system?  It does not seem like Guile compiler is able 
to produce a standalone executable.




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

* Re: Is it possible to write program only in Guile?
  2023-10-18 13:10 ` Olivier Dion
@ 2023-10-18 13:32   ` Marc Chantreux
  2023-10-18 13:44     ` Olivier Dion
  0 siblings, 1 reply; 19+ messages in thread
From: Marc Chantreux @ 2023-10-18 13:32 UTC (permalink / raw)
  To: Olivier Dion; +Cc: CToID, guile-user

hi,

I don't get the difference between this

>  2. The program is written in Guile.  It can access C routines with the
>  foreign function interface (FFI). …

and this:

> There is a third way that I personally use.  I use the FFI to make
> bindings of the public interface of a low-level C library I work on.

i choose the strategy 2 using the shebang described here

https://www.gnu.org/software/guile/manual/html_node/Running-Guile-Scripts.html

the only annoyance I have occurs the first time a user runs the script:
he gets this message

	;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
	;;;       or pass the --no-auto-compile argument to disable.

would be nice to have a flag to handle it the other way

	#!/usr/local/bin/guile -s --silent-auto-compilation
	!#

Did I miss something?

regards,
marc






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

* Re: Is it possible to write program only in Guile?
  2023-10-18 13:31   ` CToID
@ 2023-10-18 13:36     ` Basile Starynkevitch
  2023-10-18 14:43     ` Greg Troxel
  1 sibling, 0 replies; 19+ messages in thread
From: Basile Starynkevitch @ 2023-10-18 13:36 UTC (permalink / raw)
  To: CToID, guile-user; +Cc: olivier.dion, zelphirkaltstahl


On 10/18/23 15:31, CToID wrote:
> Thanks for all of your kind and informative replies, I have just 
> another question about Guile.
>
> How do I distribute Guile programs to somebody who doesn't have Guile 
> installed on their system?  It does not seem like Guile compiler is 
> able to produce a standalone executable.


You currently cannot do that.


You could (if allowed) use some Scheme compiler to compile your R5RS 
Scheme code (and Guile has non-Scheme features). Consider, for that 
purpose, using Manuel Serrano's bigloo 
<https://github.com/manuel-serrano/bigloo> software.

-- 
Basile Starynkevitch
  <basile@starynkevitch.net>
(only mine opinions / les opinions sont miennes uniquement)
92340 Bourg-la-Reine, France
web page: starynkevitch.net/Basile/


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

* Re: Is it possible to write program only in Guile?
  2023-10-18 13:32   ` Marc Chantreux
@ 2023-10-18 13:44     ` Olivier Dion
  2023-10-18 18:49       ` wolf
  0 siblings, 1 reply; 19+ messages in thread
From: Olivier Dion @ 2023-10-18 13:44 UTC (permalink / raw)
  To: Marc Chantreux; +Cc: CToID, guile-user

On Wed, 18 Oct 2023, Marc Chantreux <mc@unistra.fr> wrote:
> hi,
>
> I don't get the difference between this
>
>>  2. The program is written in Guile.  It can access C routines with the
>>  foreign function interface (FFI). …
>
> and this:
>
>> There is a third way that I personally use.  I use the FFI to make
>> bindings of the public interface of a low-level C library I work on.

In my case, the library is written in C and I make bindings for it.  So
this is closer to the first model, like Gnu Makefile.  But it is not
meant for users scripting, but developers scripting.

> i choose the strategy 2 using the shebang described here
>
> https://www.gnu.org/software/guile/manual/html_node/Running-Guile-Scripts.html
>
> the only annoyance I have occurs the first time a user runs the script:
> he gets this message
>
> 	;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> 	;;;       or pass the --no-auto-compile argument to disable.
>
> would be nice to have a flag to handle it the other way
>
> 	#!/usr/local/bin/guile -s --silent-auto-compilation
> 	!#
>
> Did I miss something?

I always have this shebang now in my Guile scripts (might not work on
fedora because the guile binary is guile3):

#!/bin/sh
#-*-Scheme-*-
exec guile --no-auto-compile -e main -s "$0" "$@"
!#

-- 
Olivier Dion



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

* Re: Is it possible to write program only in Guile?
  2023-10-18 13:31   ` CToID
  2023-10-18 13:36     ` Basile Starynkevitch
@ 2023-10-18 14:43     ` Greg Troxel
  2023-10-18 15:06       ` CToID
  2023-10-19  4:52       ` tomas
  1 sibling, 2 replies; 19+ messages in thread
From: Greg Troxel @ 2023-10-18 14:43 UTC (permalink / raw)
  To: CToID; +Cc: guile-user, basile, olivier.dion, zelphirkaltstahl

CToID <funk443@yandex.com> writes:

> How do I distribute Guile programs to somebody who doesn't have Guile
> installed on their system?  It does not seem like Guile compiler is
> able to produce a standalone executable.

The same way you distribute Java programs, python programs and perl
programs.  You ask they they install the langauge environment as part of
your instructions



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

* Re: Is it possible to write program only in Guile?
  2023-10-18 14:43     ` Greg Troxel
@ 2023-10-18 15:06       ` CToID
  2023-10-18 15:50         ` Hans Åberg
  2023-10-18 16:11         ` Thompson, David
  2023-10-19  4:52       ` tomas
  1 sibling, 2 replies; 19+ messages in thread
From: CToID @ 2023-10-18 15:06 UTC (permalink / raw)
  To: Greg Troxel, guile-user

Greg Troxel <gdt@lexort.com> said:
> The same way you distribute Java programs, python programs and perl
> programs.  You ask they they install the langauge environment as part of
> your instructions


Is it possible to also ship guile itself with the application?




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

* Re: Is it possible to write program only in Guile?
  2023-10-18 15:06       ` CToID
@ 2023-10-18 15:50         ` Hans Åberg
  2023-10-18 20:24           ` Janneke Nieuwenhuizen
  2023-10-18 16:11         ` Thompson, David
  1 sibling, 1 reply; 19+ messages in thread
From: Hans Åberg @ 2023-10-18 15:50 UTC (permalink / raw)
  To: CToID; +Cc: guile-user


> On Oct 18, 2023, at 17:06, CToID <funk443@yandex.com> wrote:
> 
> Greg Troxel <gdt@lexort.com> said:
>> The same way you distribute Java programs, python programs and perl
>> programs.  You ask they they install the langauge environment as part of
>> your instructions
> 
> 
> Is it possible to also ship guile itself with the application?

LilyPond is doing that (link below), but another way is using Guile installed via a package manager, such as MacPorts (also on page below) on MacOS. In addition, LilyPond does not have a GUI, but there is a program for that, Frescobaldi, which then needs to know the location to use.

https://lilypond.org/download.html





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

* Re: Is it possible to write program only in Guile?
  2023-10-18 15:06       ` CToID
  2023-10-18 15:50         ` Hans Åberg
@ 2023-10-18 16:11         ` Thompson, David
  1 sibling, 0 replies; 19+ messages in thread
From: Thompson, David @ 2023-10-18 16:11 UTC (permalink / raw)
  To: CToID; +Cc: Greg Troxel, Guile User

I'm assuming that for whatever you're doing, traditional OS
distribution isn't what you want.  It's possible to bundle Guile + all
necessary shared libraries + all necessary Guile modules from the
standard library + a wrapper script to launch your application. Up to
you to figure out how you build such a bundle. There be dragons, but
it's doable.  I've had decent success doing so for Lisp Game Jam
submissions.  For example: https://davexunit.itch.io/super-bloom

Guix can also be used to create redistributable bundles.  The
resulting bundles are much larger than something hand-crafted but tend
to work well. This was done for another Lisp Game Jam submission:
https://cwebber.itch.io/fantasary

If you don't want to do that, just ask users to install Guile 3 or
something first. Lots of software for VM platforms has this
expectation.

It will be a long wait, but native compiled standalone executables is
something Guile should get... eventually. We're going to have
standalone WebAssembly modules first via Guile Hoot, which should
hopefully solve a lot of the same problems that need to be solved for
native compilation.

And to answer your original question: Yes, it's very possible to write
programs only in Guile. For example, Haunt, my static site generator,
is written in pure Guile. Guix is almost entirely written in Guile. I
will use the FFI to call C libraries from Guile, but never the other
way around. It used to be that Guile was for adding a "scripting
language" to C programs but it's a legacy use case, IMO. Write your
programs in Scheme and reach out to C libraries only when necessary.
Extend, rather than embed.

Hope this helps. Best of luck,

- Dave

On Wed, Oct 18, 2023 at 11:07 AM CToID <funk443@yandex.com> wrote:
>
> Greg Troxel <gdt@lexort.com> said:
> > The same way you distribute Java programs, python programs and perl
> > programs.  You ask they they install the langauge environment as part of
> > your instructions
>
>
> Is it possible to also ship guile itself with the application?
>
>



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

* Re: Is it possible to write program only in Guile?
  2023-10-18 13:44     ` Olivier Dion
@ 2023-10-18 18:49       ` wolf
  2023-10-18 19:14         ` Olivier Dion
  2023-10-20 10:19         ` Marc Chantreux
  0 siblings, 2 replies; 19+ messages in thread
From: wolf @ 2023-10-18 18:49 UTC (permalink / raw)
  To: Olivier Dion; +Cc: Marc Chantreux, CToID, guile-user

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

On 2023-10-18 09:44:35 -0400, Olivier Dion wrote:
> On Wed, 18 Oct 2023, Marc Chantreux <mc@unistra.fr> wrote:
> > hi,
> >
> > I don't get the difference between this
> >
> >>  2. The program is written in Guile.  It can access C routines with the
> >>  foreign function interface (FFI). …
> >
> > and this:
> >
> >> There is a third way that I personally use.  I use the FFI to make
> >> bindings of the public interface of a low-level C library I work on.
> 
> In my case, the library is written in C and I make bindings for it.  So
> this is closer to the first model, like Gnu Makefile.  But it is not
> meant for users scripting, but developers scripting.
> 
> > i choose the strategy 2 using the shebang described here
> >
> > https://www.gnu.org/software/guile/manual/html_node/Running-Guile-Scripts.html
> >
> > the only annoyance I have occurs the first time a user runs the script:
> > he gets this message
> >
> > 	;;; note: auto-compilation is enabled, set GUILE_AUTO_COMPILE=0
> > 	;;;       or pass the --no-auto-compile argument to disable.
> >
> > would be nice to have a flag to handle it the other way
> >
> > 	#!/usr/local/bin/guile -s --silent-auto-compilation
> > 	!#
> >
> > Did I miss something?
> 
> I always have this shebang now in my Guile scripts (might not work on
> fedora because the guile binary is guile3):
> 
> #!/bin/sh
> #-*-Scheme-*-
> exec guile --no-auto-compile -e main -s "$0" "$@"
> !#

The problem with --no-auto-compile is that without the compilation the error
messages (and stack traces) are... less than great.

But other than that I am using the same shebang.

> 
> -- 
> Olivier Dion
>

W.

-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

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

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

* Re: Is it possible to write program only in Guile?
  2023-10-18 18:49       ` wolf
@ 2023-10-18 19:14         ` Olivier Dion
  2023-10-20 10:19         ` Marc Chantreux
  1 sibling, 0 replies; 19+ messages in thread
From: Olivier Dion @ 2023-10-18 19:14 UTC (permalink / raw)
  To: wolf; +Cc: Marc Chantreux, CToID, guile-user

On Wed, 18 Oct 2023, wolf <wolf@wolfsden.cz> wrote:
[...]
>> #!/bin/sh
>> #-*-Scheme-*-
>> exec guile --no-auto-compile -e main -s "$0" "$@"
>> !#
>
> The problem with --no-auto-compile is that without the compilation the error
> messages (and stack traces) are... less than great.
>
> But other than that I am using the same shebang.

No auto-compile, but you still compile your file in your project!  I
just avoid the noisy warnings, although they are sometime useful.

-- 
Olivier Dion




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

* Re: Is it possible to write program only in Guile?
  2023-10-18 15:50         ` Hans Åberg
@ 2023-10-18 20:24           ` Janneke Nieuwenhuizen
  0 siblings, 0 replies; 19+ messages in thread
From: Janneke Nieuwenhuizen @ 2023-10-18 20:24 UTC (permalink / raw)
  To: CToID; +Cc: Hans Åberg, guile-user

Hans berg writes:

>> On Oct 18, 2023, at 17:06, CToID <funk443@yandex.com> wrote:
>> 
>> Greg Troxel <gdt@lexort.com> said:
>>> The same way you distribute Java programs, python programs and perl
>>> programs.  You ask they they install the langauge environment as part of
>>> your instructions
>> 
>> 
>> Is it possible to also ship guile itself with the application?
>
> LilyPond is doing that (link below)

Guix is also great for that; see guix pack:

<https://guix.gnu.org/manual/en/html_node/Invoking-guix-pack.html>.

Greetings,
Janneke

-- 
Janneke Nieuwenhuizen <janneke@gnu.org>  | GNU LilyPond https://LilyPond.org
Freelance IT https://www.JoyOfSource.com | Avatar® https://AvatarAcademy.com



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

* Re: Is it possible to write program only in Guile?
  2023-10-18 14:43     ` Greg Troxel
  2023-10-18 15:06       ` CToID
@ 2023-10-19  4:52       ` tomas
  2023-10-19 11:18         ` wolf
  1 sibling, 1 reply; 19+ messages in thread
From: tomas @ 2023-10-19  4:52 UTC (permalink / raw)
  To: guile-user

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

On Wed, Oct 18, 2023 at 10:43:25AM -0400, Greg Troxel wrote:
> CToID <funk443@yandex.com> writes:
> 
> > How do I distribute Guile programs to somebody who doesn't have Guile
> > installed on their system?  It does not seem like Guile compiler is
> > able to produce a standalone executable.
> 
> The same way you distribute Java programs, python programs and perl
> programs.  You ask they they install the langauge environment as part of
> your instructions

And -- at the end of the day -- C programs: libc (or equivalent) and
the runtime aren't trivial either. Unless you are doing embedded stuff.

In Linux, for example, a "C executable" (a binary compiled from C)
isn't that different from a shell script, if you squint. While in
a shell script you have that shebang line stating "I want to be
interpreted by /bin/foo", the executable says "I want to be loaded
by /lib/ld-linux.so" (the dynamic loader) or something similar.

Actually, AFAIK, the Guile compiler compiles down to dynamic objects
these days. But you need that pesky runtime...

It's turtles all the way down :-)

Cheers
-- 
t

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

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

* Re: Is it possible to write program only in Guile?
  2023-10-19  4:52       ` tomas
@ 2023-10-19 11:18         ` wolf
  2023-10-20  4:35           ` tomas
  0 siblings, 1 reply; 19+ messages in thread
From: wolf @ 2023-10-19 11:18 UTC (permalink / raw)
  To: tomas; +Cc: guile-user

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

On 2023-10-19 06:52:40 +0200, tomas@tuxteam.de wrote:
> On Wed, Oct 18, 2023 at 10:43:25AM -0400, Greg Troxel wrote:
> > CToID <funk443@yandex.com> writes:
> > 
> > > How do I distribute Guile programs to somebody who doesn't have Guile
> > > installed on their system?  It does not seem like Guile compiler is
> > > able to produce a standalone executable.
> > 
> > The same way you distribute Java programs, python programs and perl
> > programs.  You ask they they install the langauge environment as part of
> > your instructions
> 
> And -- at the end of the day -- C programs: libc (or equivalent) and
> the runtime aren't trivial either. Unless you are doing embedded stuff.
> 
> In Linux, for example, a "C executable" (a binary compiled from C)
> isn't that different from a shell script, if you squint. While in
> a shell script you have that shebang line stating "I want to be
> interpreted by /bin/foo", the executable says "I want to be loaded
> by /lib/ld-linux.so" (the dynamic loader) or something similar.

Most of the time you would do static binary with musl as a libc.  That way (and
utilizing static libraries) you can produce *very* portable native programs.
There of course are limitations, but often it works quite well.

> 
> Actually, AFAIK, the Guile compiler compiles down to dynamic objects
> these days. But you need that pesky runtime...
> 
> It's turtles all the way down :-)
> 
> Cheers
> -- 
> t



-- 
There are only two hard things in Computer Science:
cache invalidation, naming things and off-by-one errors.

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

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

* Re: Is it possible to write program only in Guile?
  2023-10-19 11:18         ` wolf
@ 2023-10-20  4:35           ` tomas
  0 siblings, 0 replies; 19+ messages in thread
From: tomas @ 2023-10-20  4:35 UTC (permalink / raw)
  To: guile-user

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

On Thu, Oct 19, 2023 at 01:18:14PM +0200, wolf wrote:
> On 2023-10-19 06:52:40 +0200, tomas@tuxteam.de wrote:

[...]

> > In Linux, for example, a "C executable" [...]
> > [...] says "I want to be loaded
> > by /lib/ld-linux.so" (the dynamic loader) or something similar.
> 
> Most of the time you would do static binary with musl as a libc.

Hm. I guess you mean: "most of the time when you build a static
executable", because the "normal" thning to do is to build a
dynamic executable these days, and for good reasons.

There are good reasons for making static executables as well, of
course.

> That way (and
> utilizing static libraries) you can produce *very* portable native programs.

The price your users pay is that they have to keep track of a huge
numbers of library versions (and perhaps build variations of those)
because each executable carries its own little world. In the Windows
world this phenomenon is known as "DLL hell".

My Debian laptop has ~2300 packages. Let's assume one fourth of
those depend on libc. All of them depend on the same instance.
Whenever a bug of libc becomes known, just installing that one
package (and restarting those binaries, if necessary) fixes the
problem.

Now imagine asking myself which one of those ~500 packages carries
which version of libc.

Another solution, of course, would be to have a "radical source
distro", the way Guix or NixOS do. They come with a price tag,
too :-)

Cheers
-- 
t

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

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

* Re: Is it possible to write program only in Guile?
  2023-10-18 18:49       ` wolf
  2023-10-18 19:14         ` Olivier Dion
@ 2023-10-20 10:19         ` Marc Chantreux
  1 sibling, 0 replies; 19+ messages in thread
From: Marc Chantreux @ 2023-10-20 10:19 UTC (permalink / raw)
  To: Olivier Dion, guile-user

Hi Olivier and thanks for your answer,

> > #!/bin/sh
> > #-*-Scheme-*-
> > exec guile --no-auto-compile -e main -s "$0" "$@"
> > !#

Well. I think it's a good idea to compile, just wanted it
to be done silently. I will probably find a way to ship the go with my
script.

The main thing is indead a good idea and I think it should
be proposed aside the one proposed in the official doc.

regards.
marc



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

end of thread, other threads:[~2023-10-20 10:19 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-10-18 10:23 Is it possible to write program only in Guile? CToID
2023-10-18 12:51 ` Basile Starynkevitch
2023-10-18 13:31   ` CToID
2023-10-18 13:36     ` Basile Starynkevitch
2023-10-18 14:43     ` Greg Troxel
2023-10-18 15:06       ` CToID
2023-10-18 15:50         ` Hans Åberg
2023-10-18 20:24           ` Janneke Nieuwenhuizen
2023-10-18 16:11         ` Thompson, David
2023-10-19  4:52       ` tomas
2023-10-19 11:18         ` wolf
2023-10-20  4:35           ` tomas
2023-10-18 13:10 ` Olivier Dion
2023-10-18 13:32   ` Marc Chantreux
2023-10-18 13:44     ` Olivier Dion
2023-10-18 18:49       ` wolf
2023-10-18 19:14         ` Olivier Dion
2023-10-20 10:19         ` Marc Chantreux
2023-10-18 13:12 ` Zelphir Kaltstahl

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).