[PATCH 0/5] gnu: cbqn: Update to 0.9.0.

  • Done
  • quality assurance status badge
Details
5 participants
  • aecepoglu
  • Andreas Enge
  • Cayetano Santos
  • Lee Thompson
  • Simon Tournier
Owner
unassigned
Submitted by
Lee Thompson
Severity
normal

Debbugs page

L
L
Lee Thompson wrote on 5 Apr 07:59 -0700
(address . guix-patches@gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250405150443.18510-1-lee.p.thomp@gmail.com
This series of patches aims to update CBQN to use the latest v0.9.0 release;
also achieved via this patch series is a full source bootstrap of CBQN without
using pre-compiled bytecode or building DBQN.

I have added both (dzaima's fork of) REPLXX and Singeli as pure sources so CBQN
can be compiled to make use of them. Some of this builds on work done in the
(as far as I can see uncompleted) bug#69023, though this patch series makes no
attempt to add Singeli as a standalone package. Regardless of Singeli's value
here I believe REPLXX adds valuable quality of life improvements to using CBQN
as an interactive interpreter.

`bqn-sources' has been updated to a recent patch. I couldn't get the updates
to `cbqn' to build properly without updating `bqn-sources', though the CBQN
repo makes no suggestions as to where in history to take `bqn-sources' from.
I first updated to a commit from the same time as CBQN v0.9.0, but why not
update to something more recent? In testing this produced no obvious bugs or
weird behaviour vs. CBQN v0.9.0-era checkout.

The `cbqn-bootstrap'->`cbqn' interaction has been rearranged to achieve what I
believe to be a reasonable full-source bootstrap without DBQN. New tests have
been added also.

I've added comments everywhere I feel appropriate; this might be too verbose
for some so I'm happy to remove any. `cbqn' has been linted and styled and
builds and works fine as far as I can see.

Lee Thompson (5):
gnu: bqn-sources: Update to 5880fa15.
gnu: Add replxx-sources.
gnu: Add singeli-sources.
gnu: cbqn-bootstrap: Update to 0.9.0.
gnu: cbqn: Update to 0.9.0.

gnu/packages/bqn.scm | 175 ++++++++++++++++++++++++++++---------------
1 file changed, 113 insertions(+), 62 deletions(-)

--
2.48.1
L
L
Lee Thompson wrote on 5 Apr 08:07 -0700
[PATCH 1/5] gnu: bqn-sources: Update to 5880fa15.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250405150733.18738-1-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (bqn-sources): Update to 5880fa15.

Change-Id: Ida46884232955c3090bca72928f0a6d4240ed45c
---
gnu/packages/bqn.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index fd090ad433..c9f719939c 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -111,7 +111,7 @@ (define bqn-sources
;; Aside from dbqn above, the main bqn repository is used by other
;; implementations as a "known good" set of sources. CBQN uses dbqn to
;; generate an intermediate bytecode for its own compilation.
- (let ((commit "71ce36141aaacfa714edca2e408ca522a3bc5554"))
+ (let ((commit "5880fa153bb3e3172afc59a711af7e471aeedcd3"))
(origin
(method git-fetch)
(uri (git-reference
@@ -119,7 +119,7 @@ (define bqn-sources
(commit commit)))
(file-name (git-file-name "bqn-sources" commit))
(sha256
- (base32 "060a3r5m7hynzxj4iz1av2kj5jf8w3j8yswzzx9wkx31rdrsiv2c")))))
+ (base32 "1cap927i0s8ly4mckppw33ahlc5xnp3l2shk1m79wndf362x3r7c")))))
(define cbqn-bootstrap
(let* ((revision "2")
--
2.48.1
L
L
Lee Thompson wrote on 5 Apr 08:07 -0700
[PATCH 2/5] gnu: Add replxx-sources.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250405150733.18738-2-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (replxx-sources): New variable.

Change-Id: I6ab4a714ec82165c7df9e5c67c26b43c40a5c625
---
gnu/packages/bqn.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)

Toggle diff (27 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index c9f719939c..5c69a2740c 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -121,6 +121,20 @@ (define bqn-sources
(sha256
(base32 "1cap927i0s8ly4mckppw33ahlc5xnp3l2shk1m79wndf362x3r7c")))))
+(define replxx-sources
+ ;; Dzaima's fork of REPLXX can be used to enhance the CBQN REPL experience
+ ;; with syntax highlighting, readline-like history/navigation, and a
+ ;; prefixed keymap similar to BQNPAD.
+ (let ((commit "13f7b60f4f79c2f14f352a76d94860bad0fc7ce9"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dzaima/replxx")
+ (commit commit)))
+ (file-name (git-file-name "replxx" commit))
+ (sha256
+ (base32 "0440xjvdkrbpxqjrd6nsrnaxki0mgyinsb0b1dcshjj3h3jr1yy4")))))
+
(define cbqn-bootstrap
(let* ((revision "2")
(commit "66584ce1491d300746963b8ed17170348b2a03e6"))
--
2.48.1
L
L
Lee Thompson wrote on 5 Apr 08:07 -0700
[PATCH 3/5] gnu: Add singeli-sources.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250405150733.18738-3-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (singeli-sources): New variable.

Change-Id: I9a96915a23adc786a3c92fd7ad34aaa5ee938ad6
---
gnu/packages/bqn.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)

Toggle diff (26 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 5c69a2740c..11a5a48b33 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -135,6 +135,19 @@ (define replxx-sources
(sha256
(base32 "0440xjvdkrbpxqjrd6nsrnaxki0mgyinsb0b1dcshjj3h3jr1yy4")))))
+(define singeli-sources
+ ;; Singeli can be used to more efficiently implement CBQN primitive
+ ;; operations. Used in this way only its source is required.
+ (let ((commit "53f42ce4331176d281fa577408ec5a652bdd9127"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mlochbaum/Singeli")
+ (commit commit)))
+ (file-name (git-file-name "singeli" commit))
+ (sha256
+ (base32 "1dzg4gk74lhy6pwvxzhk4zj1qinc83l7i6x6zpvdajdlz5vqvc1m")))))
+
(define cbqn-bootstrap
(let* ((revision "2")
(commit "66584ce1491d300746963b8ed17170348b2a03e6"))
--
2.48.1
L
L
Lee Thompson wrote on 5 Apr 08:07 -0700
[PATCH 4/5] gnu: cbqn-bootstrap: Update to 0.9.0.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250405150733.18738-4-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (cbqn-bootstrap): Update to 0.9.0. dbqn dependency
removed. Now runs `make for-bootstrap'.

Change-Id: I54c39dbcad7f485b539cf5fc3156829efec4f8c4
---
gnu/packages/bqn.scm | 77 ++++++++++++++++++++++----------------------
1 file changed, 38 insertions(+), 39 deletions(-)

Toggle diff (92 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 11a5a48b33..fb153696e6 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -149,47 +149,46 @@ (define singeli-sources
(base32 "1dzg4gk74lhy6pwvxzhk4zj1qinc83l7i6x6zpvdajdlz5vqvc1m")))))
(define cbqn-bootstrap
- (let* ((revision "2")
- (commit "66584ce1491d300746963b8ed17170348b2a03e6"))
- (package
- (name "cbqn-bootstrap")
- (version (git-version "0" revision commit))
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/dzaima/CBQN")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "13gg96aa56b8k08bjvv8i0f5nxrah2sij7g6pg7i21fdv08rd9iv"))))
- (build-system gnu-build-system)
- (arguments
- (list
- #:tests? #f ; skipping tests for bootstrap
- #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
- #:phases
- #~(modify-phases %standard-phases
- (delete 'configure)
- (add-before 'build 'generate-bytecode
- (lambda* (#:key inputs #:allow-other-keys)
- (system (string-append #+dbqn
- "/bin/dbqn ./genRuntime "
- #+bqn-sources))))
- (replace 'install
- (lambda* (#:key outputs #:allow-other-keys)
- (mkdir-p (string-append #$output "/bin"))
- (chmod "BQN" #o755)
- (rename-file "BQN" "bqn")
- (install-file "bqn" (string-append #$output "/bin")))))))
- (native-inputs (list dbqn bqn-sources))
- (inputs (list icedtea-8 libffi))
- (synopsis "BQN implementation in C")
- (description "This package provides the reference implementation of
+ (package
+ (name "cbqn-bootstrap")
+ (version "0.9.0")
+ (source (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dzaima/CBQN")
+ (commit (string-append "v" version))))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32
+ "0433hp9lgv6w6mhdz0k1kx2rmxia76yy9i0z7ps4qdk7snf2yr2q"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:tests? #f ; skipping tests for bootstrap
+ ;; `make for-bootstrap' implicitly disables REPLXX, Singeli
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+ ;; Default behaviour is to extract git hash to use for version
+ ;; string, here our version string is manually substituted in so
+ ;; git isn't required for building.
+ (string-append "version=" #$version)
+ "nogit=1"
+ "for-bootstrap")
+ #:phases
+ #~(modify-phases %standard-phases
+ (delete 'configure)
+ (replace 'install
+ (lambda* (#:key outputs #:allow-other-keys)
+ (mkdir-p (string-append #$output "/bin"))
+ (chmod "BQN" #o755)
+ (rename-file "BQN" "bqn")
+ (install-file "bqn" (string-append #$output "/bin")))))))
+ (inputs (list libffi))
+ (synopsis "BQN implementation in C")
+ (description "This package provides the reference implementation of
@uref{https://mlochbaum.github.io/BQN/, BQN}, a programming language inspired
by APL.")
- (home-page "https://mlochbaum.github.io/BQN/")
- (license license:gpl3))))
+ (home-page "https://mlochbaum.github.io/BQN/")
+ (license license:gpl3)))
(define-public cbqn
(package
--
2.48.1
L
L
Lee Thompson wrote on 5 Apr 08:07 -0700
[PATCH 5/5] gnu: cbqn: Update to 0.9.0.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250405150733.18738-5-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (cbqn): Update to 0.9.0. Source-only bootstrap phase to
generate bytecode added. Library dependencies on replxx-sources and
singeli-sources added. New tests added to list. Dependency on dbqn eliminated.

Change-Id: I97ba12dd9d67b944ef7be1d6d76a98f4f2d69e35
---
gnu/packages/bqn.scm | 67 ++++++++++++++++++++++++++++++--------------
1 file changed, 46 insertions(+), 21 deletions(-)

Toggle diff (92 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index fb153696e6..fa3c7bbddc 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -196,39 +196,64 @@ (define-public cbqn
(name "cbqn")
(outputs '("out" "lib"))
(arguments
- (substitute-keyword-arguments (strip-keyword-arguments
- (list #:tests?)
- (package-arguments cbqn-bootstrap))
- ((#:make-flags flags #~(list))
- #~(cons* "shared-o3" "o3" #$flags))
- ((#:phases phases #~%standard-phases)
+ (substitute-keyword-arguments (strip-keyword-arguments (list #:tests?)
+ (package-arguments
+ cbqn-bootstrap))
+ ((#:make-flags flags
+ #~(list))
+ #~(cons* "shared-o3" "o3"
+ #$flags))
+ ((#:phases phases
+ #~%standard-phases)
#~(modify-phases #$phases
+ ;; Symlinking local copies of REPLXX and Singeli is allowed
+ ;; instead of cloning submodules. `singeli-source' and
+ ;; `replxx-source' git hashes match the submodule hashes for this
+ ;; release of CBQN.
+ (add-before 'build 'link-local-replxx
+ (lambda* (#:key inputs #:allow-other-keys)
+ (symlink #+replxx-sources "build/replxxLocal")))
+ (add-before 'build 'link-local-singeli
+ (lambda* (#:key inputs #:allow-other-keys)
+ (symlink #+singeli-sources "build/singeliLocal")))
+ ;; The BQN built as part of `cbqn-bootstrap' is used here to
+ ;; generate bytecode rather than downloading pre-built bytecode.
+ (add-before 'build 'generate-bytecode
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p "build/bytecodeLocal/gen")
+ (system (string-append #+cbqn-bootstrap
+ "/bin/bqn build/bootstrap.bqn "
+ #+bqn-sources))))
(replace 'check
(lambda* (#:key inputs tests? #:allow-other-keys)
(when tests?
(system (string-append "./BQN -M 1000 \""
- #+bqn-sources
- "/test/this.bqn\""))
+ #+bqn-sources "/test/this.bqn\""))
(map (lambda (x)
- (system (string-append "./BQN ./test/" x
- ".bqn")))
- '("cmp" "equal" "copy" "random"))
+ (system (string-append "./BQN ./test/" x ".bqn")))
+ '("cmp" "equal"
+ "copy"
+ "bitcpy"
+ "bit"
+ "mut"
+ "hash"
+ "squeezeValid"
+ "squeezeExact"
+ "various"
+ "random"
+ "joinReuse"))
(system "make -C test/ffi"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
- (let* ((bin (string-append (assoc-ref outputs "out")
- "/bin"))
- (lib (string-append (assoc-ref outputs "lib")
- "/lib"))
+ (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
+ (lib (string-append (assoc-ref outputs "lib") "/lib"))
(include (string-append (assoc-ref outputs "lib")
- "/include")))
+ "/include")))
(mkdir-p bin)
(rename-file "BQN" "bqn")
(install-file "bqn" bin)
(install-file "libcbqn.so" lib)
(install-file "include/bqnffi.h" include))))))))
- (native-inputs (list dbqn
- bqn-sources
- libffi))
- (properties
- `((tunable? . #t)))))
+ (native-inputs (list bqn-sources cbqn-bootstrap replxx-sources
+ singeli-sources libffi))
+ (properties `((tunable? . #t)))))
--
2.48.1
C
C
Cayetano Santos wrote on 9 Apr 09:00 -0700
(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
87zfgpiaug.fsf@inventati.org
Please, use changelog format for changes in commit message.

See:


- (substitute-keyword-arguments (strip-keyword-arguments
- (list #:tests?)
- (package-arguments cbqn-bootstrap))
- ((#:make-flags flags #~(list))
- #~(cons* "shared-o3" "o3" #$flags))
- ((#:phases phases #~%standard-phases)
+ (substitute-keyword-arguments (strip-keyword-arguments (list #:tests?)
+ (package-arguments
+ cbqn-bootstrap))
+ ((#:make-flags flags
+ #~(list))
+ #~(cons* "shared-o3" "o3"
+ #$flags))
+ ((#:phases phases
+ #~%standard-phases)

Try to avoid unnecessary modifications in original code, this makes hard
to follow the contributions.

- #+bqn-sources
- "/test/this.bqn\""))
+ #+bqn-sources "/test/this.bqn\""))

Idem

- (let* ((bin (string-append (assoc-ref outputs "out")
- "/bin"))
- (lib (string-append (assoc-ref outputs "lib")
- "/lib"))
+ (let* ((bin (string-append (assoc-ref outputs "out") "/bin"))
+ (lib (string-append (assoc-ref outputs "lib") "/lib"))
(include (string-append (assoc-ref outputs "lib")
- "/include")))
+ "/include")))

Again. You get the idea.
-----BEGIN PGP SIGNATURE-----

iI0EARYKADUWIQTMuBhC+dcFjs1nN3q/XN9N9r9mggUCZ/aZlxccY3NhbnRvc2JA
aW52ZW50YXRpLm9yZwAKCRC/XN9N9r9mglMxAP4tdjKKNtZ2dwrwuha90JJDCGPW
PBWiAjxMk7uTjKnHOgEAxVzM0aph8s88ZoG8WQIkdYcjQR/ci/oZgbMO4kYScQ8=
=q+h5
-----END PGP SIGNATURE-----

C
C
Cayetano Santos wrote on 9 Apr 09:07 -0700
Re: [bug#77552] [PATCH 4/5] gnu: cbqn-bootstrap: Update to 0.9.0.
(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
874iyxiaig.fsf@inventati.org
+ ;; Default behaviour is to extract git hash to use for version
+ ;; string, here our version string is manually substituted in

You exceed maximum column here.

Use ‘./pre-inst-env guix lint PACKAGE’ before submitting to fix this
kind of errors.

+ (license license:gpl3)))

Have you checked "licenses" folder ?

Additionally, none of your sources include a license field. And yet, they are
used in cbqn/bootstrap.This is anomalous to me.
-----BEGIN PGP SIGNATURE-----

iI0EARYKADUWIQTMuBhC+dcFjs1nN3q/XN9N9r9mggUCZ/abRxccY3NhbnRvc2JA
aW52ZW50YXRpLm9yZwAKCRC/XN9N9r9mgg9JAP9sKvxTtWHo9Ucrvi5a4p8FX3lY
YmJWsFP2sqp82TN/VgD/bLQfRoepkFD2E1pY102Xps0vJbNd/uSf0Vqoe4fOWw0=
=XKb5
-----END PGP SIGNATURE-----

L
L
Lee Thompson wrote on 9 Apr 11:02 -0700
(name . Cayetano Santos)(address . csantosb@inventati.org)(address . 77552@debbugs.gnu.org)
87zfgpfc21.fsf@gmail.com
Cayetano Santos <csantosb@inventati.org> writes:

Toggle quote (4 lines)
> You exceed maximum column here.
>
> Use ‘./pre-inst-env guix lint PACKAGE’ before submitting to fix this
> kind of errors.
Okay this is my bad, though I am wondering if there's a more ergonomic
way to style/lint packages that aren't defined publicly like this one.
What I find myself doing is changing the `(define cbqn-bootstrap ...' to
`(define-public ...', running `./pre-inst-env guix style
cbqn-bootstrap', then swapping `define-public' back to `define'. Is
there something I'm missing with this?

Toggle quote (3 lines)
> + (license license:gpl3)))
>
> Have you checked "licenses" folder ?
This paragraph from upstream about licenses:
about the licensing situation for CBQN itself. It seems obvious to me to
list out lgpl3, gpl3 and mpl2, though do you think I'd be better off
listing all the licenses under `licenses' including Boost and Apache
etc?

Toggle quote (2 lines)
> Additionally, none of your sources include a license field. And yet, they are
> used in cbqn/bootstrap.This is anomalous to me.
Unless I'm mistaken I don't think there's a way to specify a license for
a plain `origin' like I've used for the `-sources' I've added. I chose
to add Singeli and REPLXX as just `origin's instead of full packages
taking inspiration from the existing `bqn-sources'. `bqn-sources'
currently doesn't mention its ISC license at all.

Despite this checking the build output it looks like all the following
still manage to end up in
/gnu/store/...-cbqn-0.9.0/share/doc/cbqn-0.9.0:
Toggle quote (1 lines)
> LICENSE-Apache2 LICENSE-Boost LICENSE-GPLv3 LICENSE-LGPLv3 LICENSE-MIT-sort LICENSE-MPL2
L
L
Lee Thompson wrote on 9 Apr 11:06 -0700
Re: [bug#77552] [PATCH 5/5] gnu: cbqn: Update to 0.9.0.
(name . Cayetano Santos)(address . csantosb@inventati.org)(address . 77552@debbugs.gnu.org)
87v7rdfbun.fsf@gmail.com
Cayetano Santos <csantosb@inventati.org> writes:

Toggle quote (2 lines)
> Try to avoid unnecessary modifications in original code, this makes hard
> to follow the contributions.
I'm following guidance to run `./pre-inst-env guix style PACKAGE' before
sending in a patch. What you see here is just the result of running
that. I agree though it makes reading diffs confusing.

Is there a way to only `guix style' what's been changed?
C
C
Cayetano Santos wrote on 10 Apr 00:27 -0700
(name . Lee Thompson)(address . lee.p.thomp@gmail.com)(address . 77552@debbugs.gnu.org)
87a58ofpca.fsf@inventati.org
Toggle quote (11 lines)
>Wed 09 Apr 2025 at 19:06, Lee Thompson <lee.p.thomp@gmail.com> wrote:

> Cayetano Santos <csantosb@inventati.org> writes:
>
>> Try to avoid unnecessary modifications in original code, this makes hard
>> to follow the contributions.

> I'm following guidance to run `./pre-inst-env guix style PACKAGE' before
> sending in a patch. What you see here is just the result of running
> that. I agree though it makes reading diffs confusing.

I see what you mean. Generally speaking, guix community privileges
avoiding unnecessary changes and readability, over strict styling (you
can verify in most packages).

Toggle quote (2 lines)
> Is there a way to only `guix style' what's been changed?

Not that I’m aware of, but would be useful !
C
C
Cayetano Santos wrote on 10 Apr 00:40 -0700
Re: [bug#77552] [PATCH 4/5] gnu: cbqn-bootstrap: Update to 0.9.0.
(name . Lee Thompson)(address . lee.p.thomp@gmail.com)(address . 77552@debbugs.gnu.org)
87h62wea6d.fsf@inventati.org
Toggle quote (16 lines)
>Wed 09 Apr 2025 at 19:02, Lee Thompson <lee.p.thomp@gmail.com> wrote:

> Cayetano Santos <csantosb@inventati.org> writes:
>
>> You exceed maximum column here.
>>
>> Use ‘./pre-inst-env guix lint PACKAGE’ before submitting to fix this
>> kind of errors.

> Okay this is my bad, though I am wondering if there's a more ergonomic
> way to style/lint packages that aren't defined publicly like this one.
> What I find myself doing is changing the `(define cbqn-bootstrap ...' to
> `(define-public ...', running `./pre-inst-env guix style
> cbqn-bootstrap', then swapping `define-public' back to `define'. Is
> there something I'm missing with this?

In my case, I usually do the same.


Toggle quote (11 lines)
>> + (license license:gpl3)))
>>
>> Have you checked "licenses" folder ?

> This paragraph from upstream about licenses:
> https://github.com/dzaima/CBQN?tab=readme-ov-file#licensing talks a bit
> about the licensing situation for CBQN itself. It seems obvious to me to
> list out lgpl3, gpl3 and mpl2, though do you think I'd be better off
> listing all the licenses under `licenses' including Boost and Apache
> etc?

I think so. You may get inspiration from iverilog and similar packages.

Toggle quote (9 lines)
>> Additionally, none of your sources include a license field. And yet, they are
>> used in cbqn/bootstrap.This is anomalous to me.

> Unless I'm mistaken I don't think there's a way to specify a license for
> a plain `origin' like I've used for the `-sources' I've added. I chose
> to add Singeli and REPLXX as just `origin's instead of full packages
> taking inspiration from the existing `bqn-sources'. `bqn-sources'
> currently doesn't mention its ISC license at all.

I guess that once the (non-license) source is included in a package, its
license must appear in the package itself.

Toggle quote (6 lines)
> Despite this checking the build output it looks like all the following
> still manage to end up in
> /gnu/store/...-cbqn-0.9.0/share/doc/cbqn-0.9.0:

>> LICENSE-Apache2 LICENSE-Boost LICENSE-GPLv3 LICENSE-LGPLv3 LICENSE-MIT-sort LICENSE-MPL2

Yes, the builder detects the licenses folder and assumes all of its
contents as licenses, so it takes them all; they still need to be
mentioned in the package.
L
L
Lee Thompson wrote on 10 Apr 06:38 -0700
[PATCH v2 1/5] gnu: bqn-sources: Update to 5880fa15.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250410133836.32326-1-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (bqn-sources): Update to 5880fa15.

Change-Id: Ida46884232955c3090bca72928f0a6d4240ed45c
---
gnu/packages/bqn.scm | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

Toggle diff (24 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index fd090ad433..c9f719939c 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -111,7 +111,7 @@ (define bqn-sources
;; Aside from dbqn above, the main bqn repository is used by other
;; implementations as a "known good" set of sources. CBQN uses dbqn to
;; generate an intermediate bytecode for its own compilation.
- (let ((commit "71ce36141aaacfa714edca2e408ca522a3bc5554"))
+ (let ((commit "5880fa153bb3e3172afc59a711af7e471aeedcd3"))
(origin
(method git-fetch)
(uri (git-reference
@@ -119,7 +119,7 @@ (define bqn-sources
(commit commit)))
(file-name (git-file-name "bqn-sources" commit))
(sha256
- (base32 "060a3r5m7hynzxj4iz1av2kj5jf8w3j8yswzzx9wkx31rdrsiv2c")))))
+ (base32 "1cap927i0s8ly4mckppw33ahlc5xnp3l2shk1m79wndf362x3r7c")))))
(define cbqn-bootstrap
(let* ((revision "2")
--
2.48.1
L
L
Lee Thompson wrote on 10 Apr 06:38 -0700
[PATCH v2 2/5] gnu: Add replxx-sources.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250410133836.32326-2-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (replxx-sources): New variable.

Change-Id: I6ab4a714ec82165c7df9e5c67c26b43c40a5c625
---
gnu/packages/bqn.scm | 14 ++++++++++++++
1 file changed, 14 insertions(+)

Toggle diff (27 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index c9f719939c..5c69a2740c 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -121,6 +121,20 @@ (define bqn-sources
(sha256
(base32 "1cap927i0s8ly4mckppw33ahlc5xnp3l2shk1m79wndf362x3r7c")))))
+(define replxx-sources
+ ;; Dzaima's fork of REPLXX can be used to enhance the CBQN REPL experience
+ ;; with syntax highlighting, readline-like history/navigation, and a
+ ;; prefixed keymap similar to BQNPAD.
+ (let ((commit "13f7b60f4f79c2f14f352a76d94860bad0fc7ce9"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dzaima/replxx")
+ (commit commit)))
+ (file-name (git-file-name "replxx" commit))
+ (sha256
+ (base32 "0440xjvdkrbpxqjrd6nsrnaxki0mgyinsb0b1dcshjj3h3jr1yy4")))))
+
(define cbqn-bootstrap
(let* ((revision "2")
(commit "66584ce1491d300746963b8ed17170348b2a03e6"))
--
2.48.1
L
L
Lee Thompson wrote on 10 Apr 06:38 -0700
[PATCH v2 3/5] gnu: Add singeli-sources.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250410133836.32326-3-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (singeli-sources): New variable.

Change-Id: I9a96915a23adc786a3c92fd7ad34aaa5ee938ad6
---
gnu/packages/bqn.scm | 13 +++++++++++++
1 file changed, 13 insertions(+)

Toggle diff (26 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 5c69a2740c..11a5a48b33 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -135,6 +135,19 @@ (define replxx-sources
(sha256
(base32 "0440xjvdkrbpxqjrd6nsrnaxki0mgyinsb0b1dcshjj3h3jr1yy4")))))
+(define singeli-sources
+ ;; Singeli can be used to more efficiently implement CBQN primitive
+ ;; operations. Used in this way only its source is required.
+ (let ((commit "53f42ce4331176d281fa577408ec5a652bdd9127"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mlochbaum/Singeli")
+ (commit commit)))
+ (file-name (git-file-name "singeli" commit))
+ (sha256
+ (base32 "1dzg4gk74lhy6pwvxzhk4zj1qinc83l7i6x6zpvdajdlz5vqvc1m")))))
+
(define cbqn-bootstrap
(let* ((revision "2")
(commit "66584ce1491d300746963b8ed17170348b2a03e6"))
--
2.48.1
L
L
Lee Thompson wrote on 10 Apr 06:38 -0700
[PATCH v2 4/5] gnu: cbqn-bootstrap: Update to 0.9.0.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250410133836.32326-4-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (cbqn-bootstrap): Update to 0.9.0.

[version]: Now 0.9.0 instead of assembled from git-version, revision, commit.
[source]: Commit swapped out for version, hash updated.
[arguments]<#:make-flags>: Manual version added, flag to disable git during
build, build type switched to "for-bootstrap".
<#:phases>: `generate-bytecode' deleted here, moved to `cbqn' package.
[native-inputs]: All deleted, bootstrap no longer needs `dbqn' or sources.
[inputs]: Deleted `icedtea-8'.
[license]: License list updated, covers CBQN code and exceptions.

Change-Id: I54c39dbcad7f485b539cf5fc3156829efec4f8c4
---
gnu/packages/bqn.scm | 36 +++++++++++++++++++++---------------
1 file changed, 21 insertions(+), 15 deletions(-)

Toggle diff (75 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 11a5a48b33..1caf6f3c8a 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -149,47 +149,53 @@ (define singeli-sources
(base32 "1dzg4gk74lhy6pwvxzhk4zj1qinc83l7i6x6zpvdajdlz5vqvc1m")))))
(define cbqn-bootstrap
- (let* ((revision "2")
- (commit "66584ce1491d300746963b8ed17170348b2a03e6"))
(package
(name "cbqn-bootstrap")
- (version (git-version "0" revision commit))
+ (version "0.9.0")
(source (origin
(method git-fetch)
(uri (git-reference
(url "https://github.com/dzaima/CBQN")
- (commit commit)))
+ (commit (string-append "v" version))))
(file-name (git-file-name name version))
(sha256
(base32
- "13gg96aa56b8k08bjvv8i0f5nxrah2sij7g6pg7i21fdv08rd9iv"))))
+ "0433hp9lgv6w6mhdz0k1kx2rmxia76yy9i0z7ps4qdk7snf2yr2q"))))
(build-system gnu-build-system)
(arguments
(list
- #:tests? #f ; skipping tests for bootstrap
- #:make-flags #~(list (string-append "CC=" #$(cc-for-target)))
+ #:tests? #f ;skipping tests for bootstrap
+ ;; `make for-bootstrap' implicitly disables REPLXX, Singeli
+ #:make-flags #~(list (string-append "CC=" #$(cc-for-target))
+ ;; Default behaviour is to extract git hash to
+ ;; use for version string, here our version
+ ;; string is manually substituted in so git isn't
+ ;; required for building.
+ (string-append "version="
+ #$version)
+ "nogit=1" "for-bootstrap")
#:phases
#~(modify-phases %standard-phases
(delete 'configure)
- (add-before 'build 'generate-bytecode
- (lambda* (#:key inputs #:allow-other-keys)
- (system (string-append #+dbqn
- "/bin/dbqn ./genRuntime "
- #+bqn-sources))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
(mkdir-p (string-append #$output "/bin"))
(chmod "BQN" #o755)
(rename-file "BQN" "bqn")
(install-file "bqn" (string-append #$output "/bin")))))))
- (native-inputs (list dbqn bqn-sources))
- (inputs (list icedtea-8 libffi))
+ (inputs (list libffi))
(synopsis "BQN implementation in C")
(description "This package provides the reference implementation of
@uref{https://mlochbaum.github.io/BQN/, BQN}, a programming language inspired
by APL.")
(home-page "https://mlochbaum.github.io/BQN/")
- (license license:gpl3))))
+ ;; Upstream explains licensing situation
+ (license (list license:asl2.0 ; src/utils/ryu*
+ license:boost1.0
+ license:expat ; src/builtins/sortTemplate.h
+ license:lgpl3 ; Everything else except the above
+ license:gpl3
+ license:mpl2.0))))
(define-public cbqn
(package
--
2.48.1
L
L
Lee Thompson wrote on 10 Apr 06:38 -0700
[PATCH v2 5/5] gnu: cbqn: Update to 0.9.0.
(address . 77552@debbugs.gnu.org)(name . Lee Thompson)(address . lee.p.thomp@gmail.com)
20250410133836.32326-5-lee.p.thomp@gmail.com
* gnu/packages/bqn.scm (cbqn): Update to 0.9.0.

[arguments]<#:phases>: Phases linking REPLXX and Singeli and to generate
bytecode are added before build, new tests are added to the replaced 'check.
[native-inputs]: Removed `dbqn', added `cbqn-bootstrap', `replxx-sources' and
`singeli-sources'.
[license]: Licenses for REPLXX and Singeli appended to those for just CBQN.

Change-Id: I97ba12dd9d67b944ef7be1d6d76a98f4f2d69e35
---
gnu/packages/bqn.scm | 41 ++++++++++++++++++++++++++++++++++++-----
1 file changed, 36 insertions(+), 5 deletions(-)

Toggle diff (66 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 1caf6f3c8a..a90007f593 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -210,6 +210,24 @@ (define-public cbqn
#~(cons* "shared-o3" "o3" #$flags))
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
+ ;; Symlinking local copies of REPLXX and Singeli is allowed
+ ;; instead of cloning submodules. `singeli-source' and
+ ;; `replxx-source' git hashes match the submodule hashes for this
+ ;; release of CBQN.
+ (add-before 'build 'link-local-replxx
+ (lambda* (#:key inputs #:allow-other-keys)
+ (symlink #+replxx-sources "build/replxxLocal")))
+ (add-before 'build 'link-local-singeli
+ (lambda* (#:key inputs #:allow-other-keys)
+ (symlink #+singeli-sources "build/singeliLocal")))
+ ;; The BQN built as part of `cbqn-bootstrap' is used here to
+ ;; generate bytecode rather than downloading pre-built bytecode.
+ (add-before 'build 'generate-bytecode
+ (lambda* (#:key inputs #:allow-other-keys)
+ (mkdir-p "build/bytecodeLocal/gen")
+ (system (string-append #+cbqn-bootstrap
+ "/bin/bqn build/bootstrap.bqn "
+ #+bqn-sources))))
(replace 'check
(lambda* (#:key inputs tests? #:allow-other-keys)
(when tests?
@@ -219,7 +237,17 @@ (define-public cbqn
(map (lambda (x)
(system (string-append "./BQN ./test/" x
".bqn")))
- '("cmp" "equal" "copy" "random"))
+ '("cmp" "equal"
+ "copy"
+ "bitcpy"
+ "bit"
+ "mut"
+ "hash"
+ "squeezeValid"
+ "squeezeExact"
+ "various"
+ "random"
+ "joinReuse"))
(system "make -C test/ffi"))))
(replace 'install
(lambda* (#:key outputs #:allow-other-keys)
@@ -234,8 +262,11 @@ (define-public cbqn
(install-file "bqn" bin)
(install-file "libcbqn.so" lib)
(install-file "include/bqnffi.h" include))))))))
- (native-inputs (list dbqn
- bqn-sources
- libffi))
+ (native-inputs (list bqn-sources cbqn-bootstrap replxx-sources
+ singeli-sources libffi))
(properties
- `((tunable? . #t)))))
+ `((tunable? . #t)))
+ (license (append (package-license cbqn-bootstrap)
+ (list license:isc ;Singeli module
+ license:bsd-3 ;REPLXX module
+ license:unicode)))))
--
2.48.1
A
A
aecepoglu wrote on 20 Jul 01:33 -0700
Thanks for picking this up again
(address . 77552@debbugs.gnu.org)
23cbb1e2-a5b5-40a7-8953-d0e6f0fa3345@app.fastmail.com
Thanks Lee Thompson for picking this up again. I had forgotten about #69023 and will suggest closing it in favour of this.

Also many thanks to Cayetano Santos for their assistance with the patch.

As for Singeli: Singeli as library: a package exposing source code will work. Conceptually though it is an interpreter/compiler and better served as an executable. That was an effort I didn't feel comfortable taking on at the time :)

As for REPLXX: Unlike libffi which is a functional feature, REPLXX is strictly a UX feature that I don't use and didn't want to spend time with but I appreciate you having done so.

Looking forward to the patch making it upstream.

- aecepoglu
S
S
Simon Tournier wrote on 22 Aug 05:25 -0700
Re: [bug#77552] [PATCH v2 1/5] gnu: bqn-sources: Update to 5880fa15.
87ldnbwnkb.fsf@gmail.com
Hi,

What about this series

[bug#77552] [PATCH v2 1/5] gnu: bqn-sources: Update to 5880fa15.
[bug#77552] [PATCH v2 2/5] gnu: Add replxx-sources.
[bug#77552] [PATCH v2 3/5] gnu: Add singeli-sources.
[bug#77552] [PATCH v2 4/5] gnu: cbqn-bootstrap: Update to 0.9.0.
[bug#77552] [PATCH v2 5/5] gnu: cbqn: Update to 0.9.0.

?

Well, I’m not an expert on this topic but it LTGM.


Cheers,
simon
L
L
Lee Thompson wrote on 27 Aug 04:31 -0700
(name . Simon Tournier)(address . zimon.toutoune@gmail.com)
87ms7l57bq.fsf@gmail.com
Hi Simon,

Toggle quote (10 lines)
> What about this series
>
> [bug#77552] [PATCH v2 1/5] gnu: bqn-sources: Update to 5880fa15.
> [bug#77552] [PATCH v2 2/5] gnu: Add replxx-sources.
> [bug#77552] [PATCH v2 3/5] gnu: Add singeli-sources.
> [bug#77552] [PATCH v2 4/5] gnu: cbqn-bootstrap: Update to 0.9.0.
> [bug#77552] [PATCH v2 5/5] gnu: cbqn: Update to 0.9.0.
>
> ?

Thanks for taking a look at this after so long. I've had a quick check
and it looks like there's been no more recent release of CBQN itself
since I made this patch set. The replxx and singeli source versions are
tied to CBQN also.

The BQN source used for the bootstrap has no real release and has seen
some minor updates since I posted this in, so that may be worth
updating.

I've been out of the loop on Guix since shortly after posting this patch
set in, and I see now things have shifted to Codeberg, so I'll have a
read of the news and docs and see if I need to duplicate this patch set
there (I'm assuming I will have to).

I've had a quick check and I can't see that this patch set has been
reproduced there, though some of my pre-Codeberg patches for APL and BQN
fonts have been reproduced.

Again thanks for taking the time to look this over,
Lee
A
Closed
?
Your comment

Commenting via the web interface is currently disabled.

To comment on this conversation send an email to 77552@patchwise.org

To respond to this issue using the mumi CLI, first switch to it
mumi current 77552
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