Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

lisp-modules: Add coalton #319688

Merged
merged 4 commits into from
Jun 15, 2024
Merged

lisp-modules: Add coalton #319688

merged 4 commits into from
Jun 15, 2024

Conversation

Michal-Atlas
Copy link
Contributor

@Michal-Atlas Michal-Atlas commented Jun 14, 2024

Description of changes

Add the coalton functional typesystem library for Common Lisp.

Happens to also need fset, so #318943 gets solved I think?
And fset needed a newer misc-extensions, since the one from QuickLisp didn't provide the constant symbol in GMap which fset uses.

FSet is probably a big breaking update: https://github.com/slburson/fset/releases/tag/v1.4.0
With misc-extensions I'm not sure, they don't seem to have a comprehensive list anywhere, but it doesn't look like there's anything being taken out.

Sorry for the ping, I didn't realize nyxt references self and so would be affected by the fset update.
I moved the rev in cl-gobject-introspection to the commit that explicitly fixed the change in SBCL, this should've probably been another pull request, but I wanted to make sure none of these changes broke nyxt in the end, so it now compiles and runs.

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
    • I ran it and about 11 packages failed, all of which were already failing so I guess that's fine, the rest build.
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 24.11 Release Notes (or backporting 23.11 and 24.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

Add a 👍 reaction to pull requests you find important.

@NixOSInfra NixOSInfra added the 12. first-time contribution This PR is the author's first one; please be gentle! label Jun 14, 2024
@ofborg ofborg bot added the 8.has: package (new) This PR adds a new package label Jun 14, 2024
@ofborg ofborg bot requested review from 7c6f434c, Uthar, nagy, lukego and hraban June 14, 2024 01:41
@Michal-Atlas Michal-Atlas marked this pull request as draft June 14, 2024 02:15
Upstream explicitly fixes compatibility with the newest SBCL
@Michal-Atlas Michal-Atlas marked this pull request as ready for review June 14, 2024 02:46
@nagy
Copy link
Member

nagy commented Jun 15, 2024

Thank you very much for doing this. I wanted to look at coalton for a long time and this makes it easier. But I do get stuck on testing this:

$ nix-shell -I nixpkgs=https://github.com/NixOS/nixpkgs/archive/pull/319688/head.tar.gz -p 'sbcl.withPackages (ps: [ps.coalton])' --run "sbcl --eval '(require :asdf)' --eval '(require :coalton)'"
...
* (in-package :coalton-user)
#<COMMON-LISP:PACKAGE "COALTON-USER">
* (coalton (EConst 1))

debugger invoked on a COALTON-IMPL/TYPECHECKER/BASE:TC-ERROR in thread
#<THREAD tid=114149 "main thread" RUNNING {10003E0143}>:
  error: Unknown variable
  --> COALTON (NIL):1:10
   |
 1 |  (COALTON (ECONST 1))
   |            ^^^^^^ unknown variable


Type HELP for debugger help, or (SB-EXT:EXIT) to exit from SBCL.

restarts (invokable by number or by possibly-abbreviated name):
  0: [ABORT] Exit debugger, returning to top level.

(COALTON-IMPL/TYPECHECKER/TC-ENV:TC-ENV-LOOKUP-VALUE #S(COALTON-IMPL/TYPECHECKER/TC-ENV:TC-ENV :ENV #<COALTON-IMPL/TYPECHECKER/ENVIRONMENT:ENVIRONMENT {100BAA5463}> :TY-TABLE #<COMMON-LISP:HASH-TABLE :TEST COMMON-LISP:EQ :COUNT 0 {100BB25503}>) #S(COALTON-IMPL/PARSER/EXPRESSION:NODE-VARIABLE :SOURCE (10 . 16) :NAME ECONST) #S(COALTON-IMPL/ERROR:COALTON-FILE :STREAM #<SB-IMPL::STRING-INPUT-STREAM {7FB9B428F833}> :NAME "COALTON (NIL)"))
   error finding frame source: Package PARSER does not exist.

                                 Stream: #<SB-SYS:FD-STREAM for "file /nix/store/zx2l81lw8hqrg6rh4f0my6rw7h4aj5ax-source/src/typechecker/tc-env.lisp" {100BB39C63}>
   source: COMMON-LISP:NIL
0]

Any idea what I am doing wrong ?

@Michal-Atlas
Copy link
Contributor Author

Michal-Atlas commented Jun 15, 2024

@nagy EConst isn't part of the language itself, it's an example from a snippet just above the block where I presume you took it from, if you load in that code then the example works as it should.

* (load "expr.lisp")
* (in-package #:coalton-user)
* (coalton-toplevel (define (square x) (E* x x)))

* (coalton (dt (E+ (square (EVar t)) (Econst 1))))

#.(E+ #.(E+ #.(E* #.(ECONST 1) #.(EVAR :|t|)) #.(E* #.(EVAR :|t|) #.(ECONST 1))) #.(ECONST 0))
* (type-of 'square)

∀ :A. ((EXPR :A) → (EXPR :A))

Thanks for checking it out, the Package PARSER does not exist. isn't exactly calming.
Just checked that the Guix package also does this, I guess it's upstream, or something, luckily doesn't seem to actually be a problem.

Copy link
Member

@nagy nagy left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great, that has worked thanks. We just have to keep an eye on these overrides, that once we update the quicklisp distributions, that they do not cause problems. But otherwise it looks great. Thanks again for the package.

@Michal-Atlas
Copy link
Contributor Author

You're welcome, cheers, thanks for the aproove.
Btw, I noticed #197694 just now which can probably be closed, strange I didn't notice it earlier.

@7c6f434c
Copy link
Member

@ofborg build nyxt

@7c6f434c 7c6f434c merged commit 56e6aaa into NixOS:master Jun 15, 2024
34 of 36 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants