[PATCH 0/2] Add cyclone scheme

  • Open
  • quality assurance status badge
Details
3 participants
  • Juliana Sims
  • Christopher Baines
  • TakeV
Owner
unassigned
Submitted by
TakeV
Severity
normal
T
(address . guix-patches@gnu.org)(name . TakeV)(address . takev@disroot.org)
cover.1709580311.git.takev@disroot.org
I saw someone wished for cyclone scheme to be added to the guix package repo. It is a R7RS scheme which compiles to c. Seems pretty neat!

TakeV (2):
gnu: Add cyclone-bootstrap.
gnu: Add cyclone.

gnu/packages/scheme.scm | 57 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 57 insertions(+)


base-commit: ff3c592710120de2ac05972a85892cdf4b1db101
--
2.41.0
T
[PATCH 1/2] gnu: Add cyclone-bootstrap.
(address . 69552@debbugs.gnu.org)(name . TakeV)(address . takev@disroot.org)
2d510059d5d61a3cde755399cfc79b494090d25f.1709580311.git.takev@disroot.org
* gnu/packages/scheme.scm (cyclone-bootstrap): New variable.

Change-Id: I85d37ebc48882d4b830ef34851ae6d37ecf2e6e5
---
gnu/packages/scheme.scm | 34 ++++++++++++++++++++++++++++++++++
1 file changed, 34 insertions(+)

Toggle diff (58 lines)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index ad06d7db06..7931ac1cc1 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -23,6 +23,7 @@
;;; Copyright © 2023 Andrew Whatson <whatson@tailcall.au>
;;; Copyright © 2023 Juliana Sims <juli@incana.org>
;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2024 TakeV <takev@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -59,6 +60,7 @@ (define-module (gnu packages scheme)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bdw-gc)
+ #:use-module (gnu packages c)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages emacs)
@@ -1276,3 +1278,35 @@ (define-public stklos
Machine. STklos can also be compiled as a library and embedded in an
application.")
(license gpl2+)))
+
+;; cyclone is self-hosted. To build it, we require the bootstrapped compiler.
+(define cyclone-bootstrap
+ (package
+ (name "cyclone-bootstrap")
+ (version "0.36.0")
+ ;; TODO Use system's libtommath after
+ ;; https://github.com/justinethier/cyclone/issues/458 is resolved
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/justinethier/cyclone-bootstrap.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0fv0mnrn5shbx77383f4mbkvc4i9yyj1bjm3dfyhipnaqapbhqpi"))))
+ (inputs (list ck))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure))
+ #:test-target "test"
+ #:make-flags #~(list "CC=gcc"
+ (string-append "PREFIX="
+ #$output))))
+ (home-page "https://github.com/justinethier/cyclone-bootstrap")
+ (synopsis "Install Cyclone Scheme on your machine.")
+ (description "Bootstrap the generate the cyclone scheme compiler")
+ (license expat)))
+
--
2.41.0
T
[PATCH 2/2] gnu: Add cyclone.
(address . 69552@debbugs.gnu.org)(name . TakeV)(address . takev@disroot.org)
d5fdc31b60a312330fa23039ad8c9a4b153667f8.1709580311.git.takev@disroot.org
* gnu/packages/scheme.scm (cyclone): New variable.

Change-Id: Icf3890ded917b728177c2831231e87b52d996532
---
gnu/packages/scheme.scm | 23 +++++++++++++++++++++++
1 file changed, 23 insertions(+)

Toggle diff (33 lines)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index 7931ac1cc1..997906aa02 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -1310,3 +1310,26 @@ (define cyclone-bootstrap
(description "Bootstrap the generate the cyclone scheme compiler")
(license expat)))
+(define-public cyclone
+ (package
+ ;; the bootstrapped compiler and final compiler share most build reqs
+ (inherit cyclone-bootstrap)
+ (name "cyclone")
+ (version "0.36.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/justinethier/cyclone.git")
+ (commit "v0.36.0")))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0qz5sdcnqkvw78gx86k3g1f0di5aqagdxqvzc35j50h1q5kj67z6"))))
+ (native-inputs (list cyclone-bootstrap))
+ (home-page "http://justinethier.github.io/cyclone/")
+ (synopsis "Fast R7RS scheme which compiles to C")
+ (description
+ "A brand-new compiler that allows practical application
+development using R7RS Scheme. We provide modern features and a stable
+system capable of generating fast native binaries.")
+ (license expat)))
--
2.41.0
J
J
Juliana Sims wrote on 4 Mar 23:29 +0100
(address . takev@disroot.org)(address . 69552@debbugs.gnu.org)
T4HU9S.Y5TFIW6OJCGJ1@incana.org
Hello,

Thanks for this patch! It's always good to get more Scheme into Guix :)

From a purely technical perspective, there's nothing wrong with these
patches. They build fine, are reproducible, and seem well-enough-styled
for all practical purposes. Make sure to run `guix lint` over the
patches; I get a couple warnings when I do that locally.

As a sidenote, Cyclone fails to build on a supported architecture
(aarch64) because the `ck` package fails to build there. Interestingly,
it builds fine on 32-bit ARM (armhf). I note this merely for posterity
and anyone interested in fixing `ck`. Everything builds just fine on
x86(_64).

What follows is largely stylistic feedback.

First patch:

> ;; cyclone is self-hosted. To build it, we require the bootstrapped
compiler.

I would capitalize "Cyclone" here and elsewhere; it seems to be
capitalized in the project's prose about it. Also, this is the
"bootstrap" compiler -- the "bootstrapped" compiler would be the
compiler compiled with this one.

> (synopsis "Install Cyclone Scheme on your machine.")

This is inaccurate as this package does not install Cyclone Scheme on
the user's machine. Perhaps simply "Cyclone Scheme bootstrap compiler"
or "Bootstrap Cyclone Scheme" would work? Synopses are, notably, not
meant to be complete sentences and thus should not have final
punctuation.

> (description "Bootstrap the generate the cyclone scheme
compiler")

This description is a bit short. I would just combine the first two
paragraphs of the project README into one with minor edits to get the
following description string:

"Cyclone Scheme is a brand-new, R7RS Scheme-to-C compiler that uses a
variant of Cheney on the MTA to implement full tail recursion,
continuations, and generational garbage collection. This package uses
intermediate code generated by compiling the Scheme source files to
build and install Cyclone Scheme. The compiler is self-hosting and
cannot be built directly on a system without Cyclone binaries
installed."

Strictly speaking, "brand new" does not need a hyphen, but that's the
way the project writes it so I've left it as-is. You probably also want
to add a linebreak after `description` so the string starts on its own
line; imo this makes the line alignment more esthetically pleasing when
complying with the 80-column width limit.

Second patch:

> ;; the bootstrapped compiler and final compiler share most build
reqs

"bootstrapped" -> "bootstrap"

> (synopsis "Fast R7RS scheme which compiles to C")

Capitalize "Scheme." This could also just be "Fast R7RS Scheme-to-C
compiler" if you want.

> (description
> "A brand-new compiler that allows practical application
> development using R7RS Scheme. We provide modern features and a
stable
> system capable of generating fast native binaries.")

I would restore the README's full "Cyclone Scheme is a" at the
beginning of this; the description can refer to the package in the
third person. Also, first-person language should probably be avoided
here. "We" in a Guix package description would most directly imply the
Guix project; this is inaccurate. Perhaps replace "We provide" with
"Cyclone provides." It may also be fruitful to cut the second sentence
entirely and enumerate some of the compiler's said features. I would
try to modify the language of the second paragraph in the project's
README (replacing passive voice with active voice, for example), and/or
add a list highlighting some (all would be a bit too long I think) of
the "Features" section of the aforementioned README. They seem very
proud of the "Cheney on the MTA" algorithm so make sure to highlight it.

Other than those stylistic notes, this patch series looks good to me!

Thanks,
Juli
T
[PATCH vREVISION 1/2] gnu: Add cyclone-bootstrap.
(address . 69552@debbugs.gnu.org)(name . TakeV)(address . takev@disroot.org)
9e15650dea41ee388dbbb01bf09c59758a0e34f4.1709769419.git.takev@disroot.org
* gnu/packages/scheme.scm (cyclone-bootstrap): New variable.

Change-Id: I85d37ebc48882d4b830ef34851ae6d37ecf2e6e5
---
gnu/packages/scheme.scm | 41 +++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+)

Toggle diff (67 lines)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index ad06d7db06..e0151e954c 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -23,6 +23,7 @@
;;; Copyright © 2023 Andrew Whatson <whatson@tailcall.au>
;;; Copyright © 2023 Juliana Sims <juli@incana.org>
;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
+;;; Copyright © 2024 TakeV <takev@disroot.org>
;;;
;;; This file is part of GNU Guix.
;;;
@@ -59,6 +60,7 @@ (define-module (gnu packages scheme)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages bdw-gc)
+ #:use-module (gnu packages c)
#:use-module (gnu packages compression)
#:use-module (gnu packages databases)
#:use-module (gnu packages emacs)
@@ -1276,3 +1278,42 @@ (define-public stklos
Machine. STklos can also be compiled as a library and embedded in an
application.")
(license gpl2+)))
+
+;; Cyclone is self-hosted. To build it, we require the bootstrap compiler.
+(define cyclone-bootstrap
+ (package
+ (name "cyclone-bootstrap")
+ (version "0.36.0")
+ ;; TODO Use system's libtommath after
+ ;; https://github.com/justinethier/cyclone/issues/458 is resolved
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/justinethier/cyclone-bootstrap.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0fv0mnrn5shbx77383f4mbkvc4i9yyj1bjm3dfyhipnaqapbhqpi"))))
+ (inputs (list ck))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure))
+ #:test-target "test"
+ #:make-flags #~(list "CC=gcc"
+ (string-append "PREFIX="
+ #$output))))
+ (home-page "https://github.com/justinethier/cyclone-bootstrap")
+ (synopsis "Cyclone Scheme bootstrap compiler")
+ (description
+ "Cyclone Scheme is a brand-new, R7RS Scheme-to-C compiler that uses a
+variant of Cheney on the MTA to implement full tail recursion,
+continuations, and generational garbage collection. This package uses
+intermediate code generated by compiling the Scheme source files to
+build and install Cyclone Scheme. The compiler is self-hosting and
+cannot be built directly on a system without Cyclone binaries
+installed.")
+ (license expat)))
+

base-commit: 201f90f34f90242bb74baa5ca44bda6131b3a035
--
2.41.0
T
[PATCH vREVISION 2/2] gnu: Add cyclone.
(address . 69552@debbugs.gnu.org)(name . TakeV)(address . takev@disroot.org)
f236c0d637192da0d91a04886a5964f0f21f79d7.1709769419.git.takev@disroot.org
* gnu/packages/scheme.scm (cyclone): New variable.

Change-Id: Icf3890ded917b728177c2831231e87b52d996532
---
gnu/packages/scheme.scm | 27 +++++++++++++++++++++++++++
1 file changed, 27 insertions(+)

Toggle diff (37 lines)
diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
index e0151e954c..29b8623310 100644
--- a/gnu/packages/scheme.scm
+++ b/gnu/packages/scheme.scm
@@ -1317,3 +1317,30 @@ (define cyclone-bootstrap
installed.")
(license expat)))
+(define-public cyclone
+ (package
+ ;; the bootstrap compiler and final compiler share most build reqs
+ (inherit cyclone-bootstrap)
+ (name "cyclone")
+ (version "0.36.0")
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/justinethier/cyclone.git")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0qz5sdcnqkvw78gx86k3g1f0di5aqagdxqvzc35j50h1q5kj67z6"))))
+ (native-inputs (list cyclone-bootstrap))
+ (home-page "http://justinethier.github.io/cyclone/")
+ (synopsis "Fast R7RS Scheme-to-C compiler")
+ (description
+ "Cyclone Scheme is a brand-new compiler that allows real-world application
+development using the R7RS Scheme Language standard.
+
+Cyclone's runtime uses Cheney on the MTA to implement full tail recursion,
+continuations, multiple native threads, and generational garbage collection.
+The on-the-fly garbage collector manages the second-generation heap and
+performs major collections without 'stopping the world'.")
+ (license expat)))
--
2.41.0
J
J
Juliana Sims wrote on 7 Mar 23:20 +0100
(address . takev@disroot.org)(address . 69552@debbugs.gnu.org)
UP00AS.HIEK1VVRH5PH1@incana.org
LGTM!
C
C
Christopher Baines wrote on 13 Mar 13:12 +0100
Re: [bug#69552] [PATCH vREVISION 1/2] gnu: Add cyclone-bootstrap.
(name . TakeV)(address . takev@disroot.org)
87y1amuxtc.fsf@cbaines.net
tags 69552 + moreinfo
user guix
usertag 69552 - reviewed-looks-good
quit

TakeV via Guix-patches via <guix-patches@gnu.org> writes:

Toggle quote (49 lines)
> * gnu/packages/scheme.scm (cyclone-bootstrap): New variable.
>
> Change-Id: I85d37ebc48882d4b830ef34851ae6d37ecf2e6e5
> ---
> gnu/packages/scheme.scm | 41 +++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 41 insertions(+)
>
> diff --git a/gnu/packages/scheme.scm b/gnu/packages/scheme.scm
> index ad06d7db06..e0151e954c 100644
> --- a/gnu/packages/scheme.scm
> +++ b/gnu/packages/scheme.scm
> @@ -23,6 +23,7 @@
> ;;; Copyright © 2023 Andrew Whatson <whatson@tailcall.au>
> ;;; Copyright © 2023 Juliana Sims <juli@incana.org>
> ;;; Copyright © 2023 Maxim Cournoyer <maxim.cournoyer@gmail.com>
> +;;; Copyright © 2024 TakeV <takev@disroot.org>
> ;;;
> ;;; This file is part of GNU Guix.
> ;;;
> @@ -59,6 +60,7 @@ (define-module (gnu packages scheme)
> #:use-module (gnu packages base)
> #:use-module (gnu packages bash)
> #:use-module (gnu packages bdw-gc)
> + #:use-module (gnu packages c)
> #:use-module (gnu packages compression)
> #:use-module (gnu packages databases)
> #:use-module (gnu packages emacs)
> @@ -1276,3 +1278,42 @@ (define-public stklos
> Machine. STklos can also be compiled as a library and embedded in an
> application.")
> (license gpl2+)))
> +
> +;; Cyclone is self-hosted. To build it, we require the bootstrap compiler.
> +(define cyclone-bootstrap
> + (package
> + (name "cyclone-bootstrap")
> + (version "0.36.0")
> + ;; TODO Use system's libtommath after
> + ;; https://github.com/justinethier/cyclone/issues/458 is resolved
> + (source
> + (origin
> + (method git-fetch)
> + (uri (git-reference
> + (url "https://github.com/justinethier/cyclone-bootstrap.git")
> + (commit (string-append "v" version))))
> + (file-name (git-file-name name version))
> + (sha256
> + (base32 "0fv0mnrn5shbx77383f4mbkvc4i9yyj1bjm3dfyhipnaqapbhqpi"))))

I've had a look at this and I'm concerned about the bootstrapping
approach. If you look at cyclone.c, I'm pretty sure that's not the
preferred form for editing and it doesn't look like that from the
commits.

Maybe there are things already in Guix that are similarly bad, but I
don't think that alone is sufficient to include more.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmXxmk9fFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XdlDg/+MiL15oCLFkJJwU4ToY1hwf0xzbUL363D
5TJK+Uz3n/V2Le5PImLKy1Z8sRJxl/z6UpDmeE9Q6bi7wzLGGTV8deUtzrZ+OJVU
jgwahi+dRMpkk87jVNsN+v+OV8UZQh6oTBjWbRL+RQadsDyrf775iUPrrRwopDgE
Z5FJfGMl5EuxpIW/oSThO9TegbYWzBkJfZpPQ6Y7viH4kAN1cQeJQ1f+lDxNSRih
wObQiv1dmlal+Npfx4cjlN5LGq6+XprqcpQ140ZMujf+TFsX+eifscdITa7UHJu8
70EpKzJH2Xd8swAnVwB36YNaM5Xq6SCsnHrl9KLIFl9TUMI7meJ6y31XuW5zeP5B
XosN945MzOVbwM269hAI7CZXIyke3LukyrmYdc/AEgeyYg8B4D4W+FCFCkj2tfF3
gd0lleGK+vgXS4+mWYvMBDMNAPv7Ii+WOpfG2cai4VzMAycg+p02xRTYtQktQP2B
V1ozBBGQ4V9shOaCIVy06jWqYztjo1J0sDClW5Ryr2NQ/xBn8HxN8ho63qGo4RH4
NuM4Ajwt+7kJbS2e4oGAEFjHGYzWH3AQ4RJvLHmVUKMpduHEkKOrui+CogHbxJvW
waHdzqsLj7rDhXwphWkI77qKagHYR6Bs0OoD/LyxQvfbR7haNgVifTOcjwfHUWhu
hwrLPGkigo0=
=Yjzw
-----END PGP SIGNATURE-----

T
(name . Christopher Baines)(address . mail@cbaines.net)
4a24d3eb-86f3-f1c7-f7ea-e9826bf7a0eb@disroot.org
On 3/13/24 08:12, Christopher Baines wrote:
Toggle quote (13 lines)
> tags 69552 + moreinfo
> user guix
> usertag 69552 - reviewed-looks-good
> quit
>
> TakeV via Guix-patches via <guix-patches@gnu.org> writes:
> I've had a look at this and I'm concerned about the bootstrapping
> approach. If you look at cyclone.c, I'm pretty sure that's not the
> preferred form for editing and it doesn't look like that from the
> commits.
>
> Maybe there are things already in Guix that are similarly bad, but I
> don't think that alone is sufficient to include more.
Do you mean the package is wrong, or cyclone itself is not going about
it the correct way? The instructions for building from source specify
that this is the intended way of handling it.
Attachment: OpenPGP_signature
C
C
Christopher Baines wrote on 13 Mar 13:45 +0100
(name . TakeV)(address . takev@disroot.org)
87le6muwik.fsf@cbaines.net
TakeV <takev@disroot.org> writes:

Toggle quote (20 lines)
> On 3/13/24 08:12, Christopher Baines wrote:
>
>> tags 69552 + moreinfo
>> user guix
>> usertag 69552 - reviewed-looks-good
>> quit
>>
>> TakeV via Guix-patches via <guix-patches@gnu.org> writes:
>> I've had a look at this and I'm concerned about the bootstrapping
>> approach. If you look at cyclone.c, I'm pretty sure that's not the
>> preferred form for editing and it doesn't look like that from the
>> commits.
>>
>> Maybe there are things already in Guix that are similarly bad, but I
>> don't think that alone is sufficient to include more.
>
> Do you mean the package is wrong, or cyclone itself is not going about
> it the correct way? The instructions for building from source specify
> that this is the intended way of handling it.

It's not that cyclone is going about it in an incorrect way, just that
the approach used doesn't match up with Guix's requirement to build from
source (which is the prefered form for modification) in all but
exceptional cases.

Contrast this with Guile for example [1], rather than using some
generated C file for bootstrapping, it uses a Scheme interpreter
implemented in C.

-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmXxoONfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9XfsoBAAimn8ee5E4NeG8pjNg1qTOjTwgIOiaEnn
T7GDDWHGGROd2z/1EXuQWBmLdh/PsxQLaNIjLoQxd6oVJ2Rs/V1yK3ZekFagKzx6
oJwp/AxMBzMfNCZHoasZ/lnMq5GgluBPBQ/B5f8JqZklRGTxPFoyYX5OXpBZ5YfR
t4TCzB14qCr9fIfAJv/Dm1qhUJccqyNiPMqZMFJtokC4W75HKYhGePE0pSe3CjGQ
fIkw9NdUiMgHQESH78w6YtjB3SD4BNwpUMoN1EiPs/4Ly10aX2DTeewAg2KWnfkl
mgNxbPsbNHnXPyIp/dDe304/INO5AfcN7w+FrLcrnZs1gllUTM/BSM37SdBRodjB
WqnOOGxpwIlcQNrQabLRprOCC9rALVf7M6sEYSWtLIwYSDv+tuOYWfPAkCxCg9hm
4wvFv3X21cfNsSRuew3t4iSqRBBRsvhBNeVZ7PymqPLqZPcYdmmVyGv/7ARCR8NP
A6bl5wmDG2ml7lIRNkI/TlkJ1fghrudCIqX9KF5zxXAnOh6HY8HcI51S2YXRsJul
IRsBnQCxhJQ4aX+YHFXSeRuboLfFsY71rhZz4z5xLyIiMjxe8dHmSSAopuQUY+4B
6yS3Qg/0mirqiN1hZ8dmpPfxEY4ZF4fwsQm/q/vRAqNXEtIm+ejKtVBAXZAaTtwp
U7SKOQ2U7to=
=YB6W
-----END PGP SIGNATURE-----

T
(name . Christopher Baines)(address . mail@cbaines.net)
F14EF034-DF0E-449D-B5C8-0C318AE34922@disroot.org
I think I am a bit confused. Are you saying that we need to be able to generate the file ourselves from scratch, rather than using the upstream source code?

Or do you mean that we package the first version of the bootstrap compiler which is not automatically generated, then use the result to generate the cyclone binary, then use that to generate the bootstrap compiler, and so forth until we are at the latest version?

Mostly uncertain because the self-hosted compiler does generate the bootstrap compiler's source, but it is not needed to build the bootstrap compiler itself, and thus seems to be the same approach as guile aside from how the source code being written by a person vs a computer.



-------- Original Message --------
From: Christopher Baines <mail@cbaines.net>
Sent: March 13, 2024 8:45:03 AM EDT
To: TakeV <takev@disroot.org>
Cc: 69552@debbugs.gnu.org, guix-patches@gnu.org
Subject: Re: [bug#69552] [PATCH vREVISION 1/2] gnu: Add cyclone-bootstrap.


TakeV <takev@disroot.org> writes:

Toggle quote (20 lines)
> On 3/13/24 08:12, Christopher Baines wrote:
>
>> tags 69552 + moreinfo
>> user guix
>> usertag 69552 - reviewed-looks-good
>> quit
>>
>> TakeV via Guix-patches via <guix-patches@gnu.org> writes:
>> I've had a look at this and I'm concerned about the bootstrapping
>> approach. If you look at cyclone.c, I'm pretty sure that's not the
>> preferred form for editing and it doesn't look like that from the
>> commits.
>>
>> Maybe there are things already in Guix that are similarly bad, but I
>> don't think that alone is sufficient to include more.
>
> Do you mean the package is wrong, or cyclone itself is not going about
> it the correct way? The instructions for building from source specify
> that this is the intended way of handling it.

It's not that cyclone is going about it in an incorrect way, just that
the approach used doesn't match up with Guix's requirement to build from
source (which is the prefered form for modification) in all but
exceptional cases.

Contrast this with Guile for example [1], rather than using some
generated C file for bootstrapping, it uses a Scheme interpreter
implemented in C.

C
C
Christopher Baines wrote on 13 Mar 15:42 +0100
(name . TakeV)(address . takev@disroot.org)
87edcetcjd.fsf@cbaines.net
TakeV <takev@disroot.org> writes:

Toggle quote (9 lines)
> I think I am a bit confused. Are you saying that we need to be able to
> generate the file ourselves from scratch, rather than using the
> upstream source code?
>
> Or do you mean that we package the first version of the bootstrap
> compiler which is not automatically generated, then use the result to
> generate the cyclone binary, then use that to generate the bootstrap
> compiler, and so forth until we are at the latest version?

I don't have a solution to suggest unfortunately, I'm just raising this
as a problem.

Either of the approaches you suggest above would work.

Toggle quote (6 lines)
> Mostly uncertain because the self-hosted compiler does generate the
> bootstrap compiler's source, but it is not needed to build the
> bootstrap compiler itself, and thus seems to be the same approach as
> guile aside from how the source code being written by a person vs a
> computer.

It's the "how the source code being written by a person vs a computer"
bit that's key, source code generated by a computer isn't the preferred
form for editing, so building from it is not building from source, even
though it's source code.
-----BEGIN PGP SIGNATURE-----

iQKlBAEBCgCPFiEEPonu50WOcg2XVOCyXiijOwuE9XcFAmXxvEZfFIAAAAAALgAo
aXNzdWVyLWZwckBub3RhdGlvbnMub3BlbnBncC5maWZ0aGhvcnNlbWFuLm5ldDNF
ODlFRUU3NDU4RTcyMEQ5NzU0RTBCMjVFMjhBMzNCMEI4NEY1NzcRHG1haWxAY2Jh
aW5lcy5uZXQACgkQXiijOwuE9Xd79Q//ZBrqa1riGvygwM2Y/GPQ23SnGbENHEEe
JuSqWTwiqK1dsAjsY2u6RDqQK58mVenT55ygcrUVWzQaTtTytVUaXOZNk0PcZadv
kXZ6O89baiN5V2Zk+2GgB6HSuw/74+TAM9mqPSsNjsMDiYRNLZxnPUeSaD9XUJxZ
gyzox3vhDdzB4C3abaF9U2q3rSt2eU6iekBFo3ldQqgTD02u+3nAmIcboKMhs19Y
p7x9Mv/b1NKlHvHtfyLKAw3zq7CI74hfewrITO7F54zXjUpQUJ2s68mgb1Ne4kge
k8FofirV9iZJIsrw16jcNCNeTNMNrp4Rf4/RWC6AfdKk4dFA/6YJdbWBrkibLKlp
scfvVyrtnaLo1tQVbSGc7kX7HmctLP5KyZIzc23sfDuSL5YwFq0OQAXzkFPpAFMV
Ep+kfz+G7hxL7mFt4N5Edlk6j4aos0dnne990TJHlbaFytAMcWGEjcP5rVXwKuC6
Bj0mX4T8X8xZ2BXQweY4zOLcxQOetZy6j0O4eK6TCWK33uI75LW3zyKNTtTF4J6X
RSVDAnzd3sihPcJ0UdMilpZxlG1MF7pC1HTRY2IZxAQv/tHss8rcc7XdDxwxPuGn
gtFhyE/itHrQCqEdqhzlh4F7WwTieHrgpPy5aYH+mMUO1cDfRlljxKtc2Ni5uOJn
gZCUap1SkOQ=
=NS8D
-----END PGP SIGNATURE-----

?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 69552@debbugs.gnu.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 69552
Then, you may apply the latest patchset in this issue (with sign off)
mumi am -- -s
Or, compose a reply to this issue
mumi compose
Or, send patches to this issue
mumi send-email *.patch