[PATCH 0/5] gnu: package: Update cbqn.

  • Open
  • quality assurance status badge
Details
2 participants
  • aecepoglu
  • Liliana Marie Prikler
Owner
unassigned
Submitted by
aecepoglu
Severity
normal
A
A
aecepoglu wrote on 11 Feb 00:23 +0100
(address . guix-patches@gnu.org)(name . aecepoglu)(address . aecepoglu@fastmail.fm)
cover.1707607099.git.aecepoglu@fastmail.fm
Add new dependency (Singeli).
Update dependency versions.
Update bytecode generation scripts.
Make cbqn bootstrap itself.

aecepoglu (5):
gnu: bqn: Add singeli.
gnu: bqn: Update dbqn.
gnu: bqn: Update bqn-sources.
gnu: bqn: Update cbqn-bootstrap.
gnu: bqn: Update cbqn.

gnu/packages/bqn.scm | 198 ++++++++++++++++++++++++++-----------------
1 file changed, 118 insertions(+), 80 deletions(-)


base-commit: b64862e5cb8209c92aa2eff4cec0be328e38c45d
--
2.43.0
A
A
aecepoglu wrote on 11 Feb 00:28 +0100
[PATCH 1/5] gnu: bqn: Add singeli.
(address . 69023@debbugs.gnu.org)(name . aecepoglu)(address . aecepoglu@fastmail.fm)
75533bd75ddccc62b5041e1532d6161f074ef93a.1707607099.git.aecepoglu@fastmail.fm
Newer versions of BQN use Singeli

* gnu/packages/bqn.scm: Add singeli

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

Toggle diff (39 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 4d03385d21..acac2d45cc 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -34,6 +34,32 @@ (define-module (gnu packages bqn)
#:use-module (gnu packages java)
#:use-module (gnu packages compression))
+(define-public singeli
+ (let ((commit "5f9cbd46c265491ff167a5d9377d1462539dbdd8")
+ (revision "1"))
+ (package
+ (name "singeli")
+ (version (git-version "0.1.1" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mlochbaum/Singeli.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "13mfxkb29n4phpqxiwfcd43mcg8773n03nml8d9rhbdb6s5jrixb"))))
+ (build-system copy-build-system)
+ (arguments
+ '(#:install-plan '(("." "lib"))))
+ (synopsis "Language to generate performant C codes with")
+ (description
+ "Singeli is a domain-specific language for building high-performance
+algorithms with abstractions over code that corresponds to individual instructions.
+It's implemented in BQN, with a frontend that emits IR and a backend that converts it to C.")
+ (home-page "https://github.com/mlochbaum/Singeli")
+ (license license:isc))))
+
(define-public dbqn
(let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
(revision "1"))
--
2.43.0
A
A
aecepoglu wrote on 11 Feb 00:28 +0100
[PATCH 2/5] gnu: bqn: Update dbqn.
(address . 69023@debbugs.gnu.org)(name . aecepoglu)(address . aecepoglu@fastmail.fm)
99918da32e5bdc454b624c69ff5f7c283b2ad6ab.1707607099.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm (dbqn): Update dbqn version.

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

Toggle diff (45 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index acac2d45cc..b4d141fc7a 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -61,25 +61,25 @@ (define-public singeli
(license license:isc))))
(define-public dbqn
- (let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
- (revision "1"))
+ (let ((commit "ba14bcf1e1d0f90fe90906a6dd7b921460f070f6")
+ (revision "2"))
(package
(name "dbqn")
(version (git-version "0.2.1" revision commit))
- (source (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/dzaima/BQN")
- (commit commit)))
- (file-name (git-file-name name version))
- (sha256
- (base32
- "06mzvv7kmandhgwb6jwz3rivsj4ic549sy8afnb5zr6mfn5isyg5"))))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/dzaima/BQN")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "0p09fb7h9c6qvhyfamak0dv9dzqyifkqps6ywcyrybv34xkgckfy"))))
(build-system gnu-build-system)
(arguments
(list
- #:imported-modules `(,@%gnu-build-system-modules
- (guix build ant-build-system))
+ #:imported-modules `(,@%gnu-build-system-modules (guix build
+ ant-build-system))
#:modules `((guix build gnu-build-system)
((guix build ant-build-system)
#:prefix ant:)
--
2.43.0
A
A
aecepoglu wrote on 11 Feb 00:28 +0100
[PATCH 3/5] gnu: bqn: Update bqn-sources.
(address . 69023@debbugs.gnu.org)(name . aecepoglu)(address . aecepoglu@fastmail.fm)
377d37ff0dd5b4611eab77533d3417735c10264c.1707607099.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm (bqn-sources): Update bqn-sources version.

Change-Id: Ia17dfbc3d6d73fdf3203c99a229eccc6634eca2a
---
gnu/packages/bqn.scm | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index b4d141fc7a..9623fd5b57 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -135,17 +135,16 @@ (define-public dbqn
(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"))
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mlochbaum/BQN")
- (commit commit)))
- (file-name (git-file-name "bqn-sources" commit))
- (sha256
- (base32 "060a3r5m7hynzxj4iz1av2kj5jf8w3j8yswzzx9wkx31rdrsiv2c")))))
+ ;; implementations as a "known good" set of sources.
+ ;; CBQN initially uses dbqn to bootstrap itself.
+ ;; We use cbqn-bootstrap to build BQN for the end-users
+ (let ((commit "6f651be3e09f0628c7d47ddb7ce819a1755529ca"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference (url "https://github.com/mlochbaum/BQN")
+ (commit commit)))
+ (file-name (git-file-name "bqn-sources" commit))
+ (sha256 (base32 "0jhrazwp4s1a0pzrzyxi7szpchp4avqsvpmslfsgk3c88wf57q6b")))))
(define cbqn-bootstrap
(let* ((revision "2")
--
2.43.0
A
A
aecepoglu wrote on 11 Feb 00:28 +0100
[PATCH 4/5] gnu: bqn: Update cbqn-bootstrap.
(address . 69023@debbugs.gnu.org)(name . aecepoglu)(address . aecepoglu@fastmail.fm)
8f847b0c66450efeb6f958bd19258b95240eaf4f.1707607099.git.aecepoglu@fastmail.fm
gnu/packages/bqn.scm (cbqn-bootstrap): Update cbqn-bootstrap version.
Pass make flags to disable git submodules, disable REPLXX dependency.
Update system invocation to generate bytecode.
Add 'install phase (carried over from cbqn) so other packages can use
cbqn-bootstrap to generate bytecode.

Change-Id: I115737006ef56a90e643c00009155b02a22bf0b1
---
gnu/packages/bqn.scm | 88 ++++++++++++++++++++++++--------------------
1 file changed, 49 insertions(+), 39 deletions(-)

Toggle diff (103 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 9623fd5b57..6d3ec43a0f 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -147,47 +147,57 @@ (define bqn-sources
(sha256 (base32 "0jhrazwp4s1a0pzrzyxi7szpchp4avqsvpmslfsgk3c88wf57q6b")))))
(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.6.0")
+ (outputs '("out"))
+ (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 "1qh5hv76bj55ajna8smwniqfa1nmnyqahk40in5bzjsx3vvikpw5"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:tests? #f
+ #:make-flags #~(list (string-append "version="
+ #$version)
+ (string-append "CC="
+ #$(cc-for-target)) "REPLXX=0"
+ "nogit=1" "notui=1")
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'generate-bytecode
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p (string-append "./build/bytecodeLocal/gen"))
+ (system (string-append #+dbqn
+ "/bin/dbqn ./build/genRuntime "
+ #+bqn-sources " " "./build/bytecodeLocal")))))
+ (add-after 'generate-bytecode 'symlink-singeli
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (symlink (string-append (assoc-ref inputs "singeli")
+ "/lib") "build/singeliLocal")))
+ (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 singeli dbqn bqn-sources))
+ (inputs (list icedtea-8 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.43.0
A
A
aecepoglu wrote on 11 Feb 00:28 +0100
[PATCH 5/5] gnu: bqn: Update cbqn.
(address . 69023@debbugs.gnu.org)(name . aecepoglu)(address . aecepoglu@fastmail.fm)
49846553277b9a80f952daf89c4059ddfa5a0d49.1707607099.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm (cbqn): Update cbqn.
Update version.
Override 'generate-bytecode to rely on cbqn-bootstrap instead of dbqn.

Change-Id: I1660d218960e7395f4c10983d840e3fa4b451d14
---
gnu/packages/bqn.scm | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)

Toggle diff (62 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 6d3ec43a0f..66c70a8516 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -209,9 +209,16 @@ (define-public cbqn
(list #:tests?)
(package-arguments cbqn-bootstrap))
((#:make-flags flags #~(list))
- #~(cons* "shared-o3" "o3" #$flags))
+ #~(append #$flags '("shared-o3" "o3")))
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
+ (replace 'generate-bytecode
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p (string-append "./build/bytecodeLocal/gen"))
+ (system (string-append #+cbqn-bootstrap
+ "/bin/bqn ./build/genRuntime "
+ #+bqn-sources " ./build/bytecodeLocal")))))
(replace 'check
(lambda* (#:key inputs tests? #:allow-other-keys)
(when tests?
@@ -219,25 +226,21 @@ (define-public cbqn
#+bqn-sources
"/test/this.bqn\""))
(map (lambda (x)
- (system (string-append "./BQN ./test/" x
- ".bqn")))
+ (system (string-append "./BQN ./test/" x ".bqn")))
'("cmp" "equal" "copy" "random"))
(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"))
- (include (string-append (assoc-ref outputs "lib")
- "/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
+ (add-after 'install 'install-lib-stuff
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((lib (string-append (assoc-ref outputs "lib")
+ "/lib"))
+ (include (string-append (assoc-ref outputs "lib")
+ "/include")))
+ (install-file "libcbqn.so" lib)
+ (install-file "include/bqnffi.h" include))))))))
+ (native-inputs (list cbqn-bootstrap
+ singeli
bqn-sources
libffi))
+ (inputs (list libffi))
(properties
`((tunable? . #t)))))
--
2.43.0
A
A
aecepoglu wrote on 31 Mar 06:22 +0200
(address . 69023@debbugs.gnu.org)
d6637c12-44f0-462d-8138-96f162497351@app.fastmail.com
Can we get this reviewed please? The extra FFI capabilities it brings is critical in developing more libraries in BQN.

On Sat, 10 Feb 2024, at 11:28 PM, aecepoglu wrote:
Toggle quote (71 lines)
> * gnu/packages/bqn.scm (cbqn): Update cbqn.
> Update version.
> Override 'generate-bytecode to rely on cbqn-bootstrap instead of dbqn.
>
> Change-Id: I1660d218960e7395f4c10983d840e3fa4b451d14
> ---
> gnu/packages/bqn.scm | 37 ++++++++++++++++++++-----------------
> 1 file changed, 20 insertions(+), 17 deletions(-)
>
> diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
> index 6d3ec43a0f..66c70a8516 100644
> --- a/gnu/packages/bqn.scm
> +++ b/gnu/packages/bqn.scm
> @@ -209,9 +209,16 @@ (define-public cbqn
> (list #:tests?)
> (package-arguments cbqn-bootstrap))
> ((#:make-flags flags #~(list))
> - #~(cons* "shared-o3" "o3" #$flags))
> + #~(append #$flags '("shared-o3" "o3")))
> ((#:phases phases #~%standard-phases)
> #~(modify-phases #$phases
> + (replace 'generate-bytecode
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let ((out (assoc-ref outputs "out")))
> + (mkdir-p (string-append "./build/bytecodeLocal/gen"))
> + (system (string-append #+cbqn-bootstrap
> + "/bin/bqn ./build/genRuntime "
> + #+bqn-sources " ./build/bytecodeLocal")))))
> (replace 'check
> (lambda* (#:key inputs tests? #:allow-other-keys)
> (when tests?
> @@ -219,25 +226,21 @@ (define-public cbqn
> #+bqn-sources
> "/test/this.bqn\""))
> (map (lambda (x)
> - (system (string-append "./BQN ./test/" x
> - ".bqn")))
> + (system (string-append "./BQN ./test/" x ".bqn")))
> '("cmp" "equal" "copy" "random"))
> (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"))
> - (include (string-append (assoc-ref outputs "lib")
> - "/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
> + (add-after 'install 'install-lib-stuff
> + (lambda* (#:key outputs #:allow-other-keys)
> + (let* ((lib (string-append (assoc-ref outputs "lib")
> + "/lib"))
> + (include (string-append (assoc-ref outputs "lib")
> + "/include")))
> + (install-file "libcbqn.so" lib)
> + (install-file "include/bqnffi.h" include))))))))
> + (native-inputs (list cbqn-bootstrap
> + singeli
> bqn-sources
> libffi))
> + (inputs (list libffi))
> (properties
> `((tunable? . #t)))))
> --
> 2.43.0
A
A
aecepoglu wrote on 14 Apr 10:26 +0200
Re: bug#69023: Acknowledgement ([PATCH 0/5] gnu: package: Update cbqn.)
(address . 69023@debbugs.gnu.org)(address . guix-patches@gnu.org)
67f1f8a1-b664-4953-b09d-6d6457d5c485@app.fastmail.com
It has been 2 months. Can someone look at this please?

Thank you.

On Sat, 10 Feb 2024, at 11:21 PM, GNU bug Tracking System wrote:
Toggle quote (21 lines)
> Thank you for filing a new bug report with debbugs.gnu.org.
>
> This is an automatically generated reply to let you know your message
> has been received.
>
> Your message is being forwarded to the package maintainers and other
> interested parties for their attention; they will reply in due course.
>
> Your message has been sent to the package maintainer(s):
> guix-patches@gnu.org
>
> If you wish to submit further information on this problem, please
> send it to 69023@debbugs.gnu.org.
>
> Please do not send mail to help-debbugs@gnu.org unless you wish
> to report a problem with the Bug-tracking system.
>
> --
> 69023: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69023
> GNU Bug Tracking System
> Contact help-debbugs@gnu.org with problems
A
A
aecepoglu wrote on 14 Apr 10:47 +0200
(address . 69023@debbugs.gnu.org)
949b2bd4-5677-4859-be6a-641b78d3ad77@app.fastmail.com
cc'ing a prior reviewer

On Sun, 14 Apr 2024, at 9:26 AM, aecepoglu wrote:
Toggle quote (26 lines)
> It has been 2 months. Can someone look at this please?
>
> Thank you.
>
> On Sat, 10 Feb 2024, at 11:21 PM, GNU bug Tracking System wrote:
>> Thank you for filing a new bug report with debbugs.gnu.org.
>>
>> This is an automatically generated reply to let you know your message
>> has been received.
>>
>> Your message is being forwarded to the package maintainers and other
>> interested parties for their attention; they will reply in due course.
>>
>> Your message has been sent to the package maintainer(s):
>> guix-patches@gnu.org
>>
>> If you wish to submit further information on this problem, please
>> send it to 69023@debbugs.gnu.org.
>>
>> Please do not send mail to help-debbugs@gnu.org unless you wish
>> to report a problem with the Bug-tracking system.
>>
>> --
>> 69023: https://debbugs.gnu.org/cgi/bugreport.cgi?bug=69023
>> GNU Bug Tracking System
>> Contact help-debbugs@gnu.org with problems
L
L
Liliana Marie Prikler wrote on 19 Apr 20:44 +0200
Re: [PATCH 1/5] gnu: bqn: Add singeli.
ba59dfa8c9fdbc4d1aabe385cc37b44399363f59.camel@gmail.com
Am Samstag, dem 10.02.2024 um 23:28 +0000 schrieb aecepoglu:
Toggle quote (1 lines)
> Newer versions of BQN use Singeli
This comment is kinda gratuitous, but if you need it, please make it a
full sentence.

Toggle quote (1 lines)
> * gnu/packages/bqn.scm: Add singeli
Missing final dot.

Toggle quote (32 lines)
> Change-Id: I5a2ce84a2b96cdad0617af46978f44ef1a86047f
> ---
>  gnu/packages/bqn.scm | 26 ++++++++++++++++++++++++++
>  1 file changed, 26 insertions(+)
>
> diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
> index 4d03385d21..acac2d45cc 100644
> --- a/gnu/packages/bqn.scm
> +++ b/gnu/packages/bqn.scm
> @@ -34,6 +34,32 @@ (define-module (gnu packages bqn)
>    #:use-module (gnu packages java)
>    #:use-module (gnu packages compression))
>  
> +(define-public singeli
> +  (let ((commit "5f9cbd46c265491ff167a5d9377d1462539dbdd8")
> +        (revision "1"))
> +    (package
> +      (name "singeli")
> +      (version (git-version "0.1.1" revision commit))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/mlochbaum/Singeli.git")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32
> "13mfxkb29n4phpqxiwfcd43mcg8773n03nml8d9rhbdb6s5jrixb"))))
> +      (build-system copy-build-system)
> +      (arguments
> +       '(#:install-plan '(("." "lib"))))
This… looks weird. Particularly given that the layout of Singeli looks
like a source tree with all kinds of things.
Toggle quote (1 lines)
> +      (synopsis "Language to generate performant C codes with")
I'd prefer "Domain-specific language for high-performance algorithms".
WDYT?
Toggle quote (14 lines)
> +      (description
> +       "Singeli is a domain-specific language for building high-
> performance
> +algorithms with abstractions over code that corresponds to
> individual instructions.
> +It's implemented in BQN, with a frontend that emits IR and a backend
> that converts it to C.")
> +      (home-page "https://github.com/mlochbaum/Singeli")
> +      (license license:isc))))
> +
>  (define-public dbqn
>    (let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
>          (revision "1"))

Cheers
L
L
Liliana Marie Prikler wrote on 19 Apr 20:44 +0200
Re: [PATCH 2/5] gnu: bqn: Update dbqn.
4ec9eacac91e7fafea0c297e326035097b6430ef.camel@gmail.com
Am Samstag, dem 10.02.2024 um 23:28 +0000 schrieb aecepoglu:
Toggle quote (53 lines)
> * gnu/packages/bqn.scm (dbqn): Update dbqn version.
>
> Change-Id: Ia538f6b4b6f21e99121d5b65c3da11fd24c1a2c2
> ---
>  gnu/packages/bqn.scm | 26 +++++++++++++-------------
>  1 file changed, 13 insertions(+), 13 deletions(-)
>
> diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
> index acac2d45cc..b4d141fc7a 100644
> --- a/gnu/packages/bqn.scm
> +++ b/gnu/packages/bqn.scm
> @@ -61,25 +61,25 @@ (define-public singeli
>        (license license:isc))))
>  
>  (define-public dbqn
> -  (let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
> -        (revision "1"))
> +  (let ((commit "ba14bcf1e1d0f90fe90906a6dd7b921460f070f6")
> +        (revision "2"))
>      (package
>        (name "dbqn")
>        (version (git-version "0.2.1" revision commit))
> -      (source (origin
> -                (method git-fetch)
> -                (uri (git-reference
> -                      (url "https://github.com/dzaima/BQN")
> -                      (commit commit)))
> -                (file-name (git-file-name name version))
> -                (sha256
> -                 (base32
> -                 
> "06mzvv7kmandhgwb6jwz3rivsj4ic549sy8afnb5zr6mfn5isyg5"))))
> +      (source
> +       (origin
> +         (method git-fetch)
> +         (uri (git-reference
> +               (url "https://github.com/dzaima/BQN")
> +               (commit commit)))
> +         (file-name (git-file-name name version))
> +         (sha256
> +          (base32
> "0p09fb7h9c6qvhyfamak0dv9dzqyifkqps6ywcyrybv34xkgckfy"))))
>        (build-system gnu-build-system)
>        (arguments
>         (list
> -        #:imported-modules `(,@%gnu-build-system-modules
> -                             (guix build ant-build-system))
> +        #:imported-modules `(,@%gnu-build-system-modules (guix build
> +                                                          ant-build-
> system))
>          #:modules `((guix build gnu-build-system)
>                      ((guix build ant-build-system)
>                       #:prefix ant:)
The reformatter did you dirty. Just update the version and the hash :)
L
L
Liliana Marie Prikler wrote on 19 Apr 20:47 +0200
Re: [PATCH 5/5] gnu: bqn: Update cbqn.
24c1ef9de1e1f30f320f3aa81854d8243aea2d50.camel@gmail.com
Am Samstag, dem 10.02.2024 um 23:28 +0000 schrieb aecepoglu:
Toggle quote (6 lines)
> * gnu/packages/bqn.scm (cbqn): Update cbqn.
> Update version.
> Override 'generate-bytecode to rely on cbqn-bootstrap instead of
> dbqn.
>
> Change-Id: I1660d218960e7395f4c10983d840e3fa4b451d14
Due to inheritance, I think this change might be merged with the one
before.

I don't see anything grossly weird atm, but I only glanced over this
patch, given that the rest of the series also needs some help.

Cheers
A
A
aecepoglu wrote on 30 Apr 02:50 +0200
[PATCH v2 0/5] gnu: bqn: Update cbqn.
(address . 69023@debbugs.gnu.org)
cover.1714438234.git.aecepoglu@fastmail.fm
Applied feedback received.

I am not sure on how to package Singeli differently. It's a directory tree of BQN code that the author would like to think is a library. I think it functions better as an executable, one that relies on BQN itself.
Is this an issue we can revisit later?

Let me know how to proceed.

aecepoglu (5):
gnu: bqn: Add singeli.
gnu: bqn: Update dbqn.
gnu: bqn: Update bqn-sources.
gnu: bqn: Update cbqn-bootstrap.
gnu: bqn: Update cbqn.

gnu/packages/bqn.scm | 176 ++++++++++++++++++++++++++-----------------
1 file changed, 107 insertions(+), 69 deletions(-)


base-commit: b64862e5cb8209c92aa2eff4cec0be328e38c45d
--
2.44.0
A
A
aecepoglu wrote on 30 Apr 02:50 +0200
[PATCH v2 1/5] gnu: bqn: Add singeli.
(address . 69023@debbugs.gnu.org)
1cd65dab7904e4f5fe8ba24ed1822d254f93ef3d.1714438234.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm: Add singeli.

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

Toggle diff (39 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 4d03385d21..eb5e3af6d9 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -34,6 +34,32 @@ (define-module (gnu packages bqn)
#:use-module (gnu packages java)
#:use-module (gnu packages compression))
+(define-public singeli
+ (let ((commit "5f9cbd46c265491ff167a5d9377d1462539dbdd8")
+ (revision "1"))
+ (package
+ (name "singeli")
+ (version (git-version "0.1.1" revision commit))
+ (source
+ (origin
+ (method git-fetch)
+ (uri (git-reference
+ (url "https://github.com/mlochbaum/Singeli.git")
+ (commit commit)))
+ (file-name (git-file-name name version))
+ (sha256
+ (base32 "13mfxkb29n4phpqxiwfcd43mcg8773n03nml8d9rhbdb6s5jrixb"))))
+ (build-system copy-build-system)
+ (arguments
+ '(#:install-plan '(("." "lib"))))
+ (synopsis "Domain-specific language for high-performance algorithms")
+ (description
+ "Singeli is a domain-specific language for building high-performance
+algorithms with abstractions over code that corresponds to individual instructions.
+It's implemented in BQN, with a frontend that emits IR and a backend that converts it to C.")
+ (home-page "https://github.com/mlochbaum/Singeli")
+ (license license:isc))))
+
(define-public dbqn
(let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
(revision "1"))
--
2.44.0
A
A
aecepoglu wrote on 30 Apr 02:50 +0200
[PATCH v2 2/5] gnu: bqn: Update dbqn.
(address . 69023@debbugs.gnu.org)
62da4cb7b8778db78ed3e62b0dd6332b5e195344.1714438234.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm (dbqn): Update dbqn version.

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

Toggle diff (17 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index eb5e3af6d9..4252f9508e 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -61,8 +61,8 @@ (define-public singeli
(license license:isc))))
(define-public dbqn
- (let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
- (revision "1"))
+ (let ((commit "ba14bcf1e1d0f90fe90906a6dd7b921460f070f6")
+ (revision "2"))
(package
(name "dbqn")
(version (git-version "0.2.1" revision commit))
--
2.44.0
A
A
aecepoglu wrote on 30 Apr 02:50 +0200
[PATCH v2 3/5] gnu: bqn: Update bqn-sources.
(address . 69023@debbugs.gnu.org)
f04ed4db626f4cb1ac29f73020881266336f5bdb.1714438234.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm (bqn-sources): Update bqn-sources version.

Change-Id: Ia17dfbc3d6d73fdf3203c99a229eccc6634eca2a
---
gnu/packages/bqn.scm | 21 ++++++++++-----------
1 file changed, 10 insertions(+), 11 deletions(-)

Toggle diff (34 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index 4252f9508e..e6cc2aeef1 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -135,17 +135,16 @@ (define-public dbqn
(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"))
- (origin
- (method git-fetch)
- (uri (git-reference
- (url "https://github.com/mlochbaum/BQN")
- (commit commit)))
- (file-name (git-file-name "bqn-sources" commit))
- (sha256
- (base32 "060a3r5m7hynzxj4iz1av2kj5jf8w3j8yswzzx9wkx31rdrsiv2c")))))
+ ;; implementations as a "known good" set of sources.
+ ;; CBQN initially uses dbqn to bootstrap itself.
+ ;; We use cbqn-bootstrap to build BQN for the end-users
+ (let ((commit "6f651be3e09f0628c7d47ddb7ce819a1755529ca"))
+ (origin
+ (method git-fetch)
+ (uri (git-reference (url "https://github.com/mlochbaum/BQN")
+ (commit commit)))
+ (file-name (git-file-name "bqn-sources" commit))
+ (sha256 (base32 "0jhrazwp4s1a0pzrzyxi7szpchp4avqsvpmslfsgk3c88wf57q6b")))))
(define cbqn-bootstrap
(let* ((revision "2")
--
2.44.0
A
A
aecepoglu wrote on 30 Apr 02:50 +0200
[PATCH v2 4/5] gnu: bqn: Update cbqn-bootstrap.
(address . 69023@debbugs.gnu.org)
545260d7b2cb951fd566cabb7666a7870e6f4b31.1714438234.git.aecepoglu@fastmail.fm
gnu/packages/bqn.scm (cbqn-bootstrap): Update cbqn-bootstrap version.
Pass make flags to disable git submodules, disable REPLXX dependency.
Update system invocation to generate bytecode.
Add 'install phase (carried over from cbqn) so other packages can use
cbqn-bootstrap to generate bytecode.

Change-Id: I115737006ef56a90e643c00009155b02a22bf0b1
---
gnu/packages/bqn.scm | 88 ++++++++++++++++++++++++--------------------
1 file changed, 49 insertions(+), 39 deletions(-)

Toggle diff (103 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index e6cc2aeef1..aca30f38b7 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -147,47 +147,57 @@ (define bqn-sources
(sha256 (base32 "0jhrazwp4s1a0pzrzyxi7szpchp4avqsvpmslfsgk3c88wf57q6b")))))
(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.6.0")
+ (outputs '("out"))
+ (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 "1qh5hv76bj55ajna8smwniqfa1nmnyqahk40in5bzjsx3vvikpw5"))))
+ (build-system gnu-build-system)
+ (arguments
+ (list
+ #:tests? #f
+ #:make-flags #~(list (string-append "version="
+ #$version)
+ (string-append "CC="
+ #$(cc-for-target)) "REPLXX=0"
+ "nogit=1" "notui=1")
+ #:phases #~(modify-phases %standard-phases
+ (delete 'configure)
+ (add-before 'build 'generate-bytecode
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p (string-append "./build/bytecodeLocal/gen"))
+ (system (string-append #+dbqn
+ "/bin/dbqn ./build/genRuntime "
+ #+bqn-sources " " "./build/bytecodeLocal")))))
+ (add-after 'generate-bytecode 'symlink-singeli
+ (lambda* (#:key inputs outputs #:allow-other-keys)
+ (symlink (string-append (assoc-ref inputs "singeli")
+ "/lib") "build/singeliLocal")))
+ (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 singeli dbqn bqn-sources))
+ (inputs (list icedtea-8 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.44.0
A
A
aecepoglu wrote on 30 Apr 02:50 +0200
[PATCH v2 5/5] gnu: bqn: Update cbqn.
(address . 69023@debbugs.gnu.org)
b500ac391c492c2d507710c7cc94c3bb12a841eb.1714438234.git.aecepoglu@fastmail.fm
* gnu/packages/bqn.scm (cbqn): Update cbqn.
Update version.
Override 'generate-bytecode to rely on cbqn-bootstrap instead of dbqn.

Change-Id: I1660d218960e7395f4c10983d840e3fa4b451d14
---
gnu/packages/bqn.scm | 37 ++++++++++++++++++++-----------------
1 file changed, 20 insertions(+), 17 deletions(-)

Toggle diff (62 lines)
diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
index aca30f38b7..23c5253046 100644
--- a/gnu/packages/bqn.scm
+++ b/gnu/packages/bqn.scm
@@ -209,9 +209,16 @@ (define-public cbqn
(list #:tests?)
(package-arguments cbqn-bootstrap))
((#:make-flags flags #~(list))
- #~(cons* "shared-o3" "o3" #$flags))
+ #~(append #$flags '("shared-o3" "o3")))
((#:phases phases #~%standard-phases)
#~(modify-phases #$phases
+ (replace 'generate-bytecode
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let ((out (assoc-ref outputs "out")))
+ (mkdir-p (string-append "./build/bytecodeLocal/gen"))
+ (system (string-append #+cbqn-bootstrap
+ "/bin/bqn ./build/genRuntime "
+ #+bqn-sources " ./build/bytecodeLocal")))))
(replace 'check
(lambda* (#:key inputs tests? #:allow-other-keys)
(when tests?
@@ -219,25 +226,21 @@ (define-public cbqn
#+bqn-sources
"/test/this.bqn\""))
(map (lambda (x)
- (system (string-append "./BQN ./test/" x
- ".bqn")))
+ (system (string-append "./BQN ./test/" x ".bqn")))
'("cmp" "equal" "copy" "random"))
(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"))
- (include (string-append (assoc-ref outputs "lib")
- "/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
+ (add-after 'install 'install-lib-stuff
+ (lambda* (#:key outputs #:allow-other-keys)
+ (let* ((lib (string-append (assoc-ref outputs "lib")
+ "/lib"))
+ (include (string-append (assoc-ref outputs "lib")
+ "/include")))
+ (install-file "libcbqn.so" lib)
+ (install-file "include/bqnffi.h" include))))))))
+ (native-inputs (list cbqn-bootstrap
+ singeli
bqn-sources
libffi))
+ (inputs (list libffi))
(properties
`((tunable? . #t)))))
--
2.44.0
L
L
Liliana Marie Prikler wrote on 30 Apr 06:55 +0200
Re: [PATCH v2 0/5] gnu: bqn: Update cbqn.
a176fc497f8d7f1d01c0825c7c7fea9c428bfbec.camel@gmail.com
Am Dienstag, dem 30.04.2024 um 01:50 +0100 schrieb aecepoglu:
Toggle quote (7 lines)
> Applied feedback received.
>
> I am not sure on how to package Singeli differently. It's a directory
> tree of BQN code that the author would like to think is a library. I
> think it functions better as an executable, one that relies on BQN
> itself.
> Is this an issue we can revisit later?
I would also like to have it as an executable relying on BQN. There's
a few things you can do if you need them for bootstrapping. You could
for example take (package-source singeli) as an input where only the
sources are required.

For packaging singeli itself; assuming you don't need to AOT-compile,
I'd suggest you go with a plan along the lines of

singeli → bin (don't forget to wrap-program)
include → include/singeli
doc → doc/singeli
data → share/singeli
*.bqn → lib/bqn

The singeli bin is possibly somewhat special, as you need to also
supply bqn. Not sure what the smartest move here is; I'd personally
try to use $(which bqn) with a fallback to a known good one.

Cheers
L
L
Liliana Marie Prikler wrote on 30 Apr 07:55 +0200
Re: [PATCH v2 2/5] gnu: bqn: Update dbqn.
6fd88be32ebce0d9da16ec42a17d62b71a89083f.camel@gmail.com
Am Dienstag, dem 30.04.2024 um 01:50 +0100 schrieb aecepoglu:
Toggle quote (22 lines)
> * gnu/packages/bqn.scm (dbqn): Update dbqn version.
>
> Change-Id: Ia538f6b4b6f21e99121d5b65c3da11fd24c1a2c2
> ---
>  gnu/packages/bqn.scm | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/gnu/packages/bqn.scm b/gnu/packages/bqn.scm
> index eb5e3af6d9..4252f9508e 100644
> --- a/gnu/packages/bqn.scm
> +++ b/gnu/packages/bqn.scm
> @@ -61,8 +61,8 @@ (define-public singeli
>        (license license:isc))))
>  
>  (define-public dbqn
> -  (let ((commit "88f2b43966a75cc2c382421218eb30003bb16f4a")
> -        (revision "1"))
> +  (let ((commit "ba14bcf1e1d0f90fe90906a6dd7b921460f070f6")
> +        (revision "2"))
>      (package
>        (name "dbqn")
>        (version (git-version "0.2.1" revision commit))
Hash where?
?
Your comment

Commenting via the web interface is currently disabled.

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

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