3 ms·
I thought Guix reimplemented nix the purely functional language in scheme.
by agumonkey 10y ago
I thought Guix reimplemented nix the purely functional language in scheme.
- rekado 10y agoNo, Guix uses a DSL for packages that's embedded in Guile. Pretty much everything else is also written in Guile with the current exception of the Nix daemon (C++). The DSL is mostly declarative. Here's an example: (define metal (package (name "metal") (version "2011-03-25") (source (origin (method url-fetch) (uri (string-append "http://csg.sph.umich.edu/abecasis/Metal/" "download/generic-metal-" version ".tar.gz")) (sha256 (base32 "1bk00hc0xagmq0mabmbb8bykl75qd4kfyirba869h4x6hmn4a0f3")))) (build-system gnu-build-system) (arguments `(#:tests? #f #:make-flags (list (string-append "INSTALLDIR=" (assoc-ref %outputs "out") "/bin") "all") #:phases (modify-phases %standard-phases (delete 'configure)))) (inputs `(("zlib" ,zlib))) (home-page "http://csg.sph.umich.edu/abecasis/Metal") (synopsis "Facilitate meta-analysis of large datasets") (description "METAL is a tool for meta-analysis genomewide association scans. ...") (license license:bsd-3))) The stuff that's in the "arguments" field is a quoted expression, which is evaluated on the builder's side, at build time. We make use of code staging in several places, which seems like a perfect fit for Scheme. Note that the `,zlib` thing means that the value bound to the variable name "zlib" is injected as is. All package expressions are "live" values in Scheme and can be inspected in a REPL.