19 ms·
But the bespoke language has some benefits. It’s concise and specifically designed for the problem. Also Nix has more contributors and that is very important to
by svd4anything 7y ago
But the bespoke language has some benefits. It’s concise and specifically designed for the problem. Also Nix has more contributors and that is very important to have a large collection of recipes to start from.
- Koshkin 7y agoScheme, being a Lisp, is exceptionally well-suited to serve as a base for DSLs.
- svd4anything 7y agoOk I’ll give another reason. Nix community is more relaxed and doesn’t downvote just because they don’t like some comment or somebody disagrees with them.
- celticmusic 7y agoI bet you the irony of your downvotes is lost on the people downvoting.
- svd4anything 7y agoFor sure they are pilling on ... for what I don’t get. Relax people.
- kragen 7y agoYes, Scheme is a bit verbose for my taste.
- catalogia 7y agoThere are obviously some differences between the two, but I'm not really perceiving any real verbosity gap between the two, one way or the other. Here is a guix package declaration for tmux: [Edit: fixed indentation] (define-module (gnu packages tmux) #:use-module ((guix licenses) #:prefix license:) #:use-module (guix packages) #:use-module (guix download) #:use-module (guix git-download) #:use-module (guix build-system gnu) #:use-module (guix build-system trivial) #:use-module (gnu packages) #:use-module (gnu packages bash) #:use-module (gnu packages libevent) #:use-module (gnu packages ncurses)) (define-public tmux (package (name "tmux") (version "3.0a") (source (origin (method url-fetch) (uri (string-append "https://github.com/tmux/tmux/releases/download/" version "/tmux-" version ".tar.gz")) (sha256 (base32 "1fcdbw77nz918f7gqc1ga7zlkp1g112in1h8kkjnkadgnhldzlaa")))) (build-system gnu-build-system) (inputs `(("libevent" ,libevent) ("ncurses" ,ncurses))) (home-page "https://tmux.github.io/") (synopsis "Terminal multiplexer") (description "tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached.") (license license:isc))) Here is (roughtly) the equivalent in Nix: { stdenv, fetchFromGitHub, autoreconfHook, ncurses, libevent, pkgconfig, makeWrapper }: let bashCompletion = fetchFromGitHub { owner = "imomaliev"; repo = "tmux-bash-completion"; rev = "fcda450d452f07d36d2f9f27e7e863ba5241200d"; sha256 = "092jpkhggjqspmknw7h3icm0154rg21mkhbc71j5bxfmfjdxmya8"; }; in stdenv.mkDerivation rec { pname = "tmux"; version = "2.9a"; outputs = [ "out" "man" ]; src = fetchFromGitHub { owner = pname; repo = pname; rev = version; sha256 = "040plbgxlz14q5p0p3wapr576jbirwripmsjyq3g1nxh76jh1ipg"; }; nativeBuildInputs = [ pkgconfig autoreconfHook ]; buildInputs = [ ncurses libevent makeWrapper ]; configureFlags = [ "--sysconfdir=/etc" "--localstatedir=/var" ]; postInstall = '' mkdir -p $out/share/bash-completion/completions cp -v ${bashCompletion}/completions/tmux $out/share/bash-completion/completions/tmux ''; meta = { homepage = http://tmux.github.io/; description = "Terminal multiplexer"; longDescription = '' tmux is intended to be a modern, BSD-licensed alternative to programs such as GNU screen. Major features include: * A powerful, consistent, well-documented and easily scriptable command interface. * A window may be split horizontally and vertically into panes. * Panes can be freely moved and resized, or arranged into preset layouts. * Support for UTF-8 and 256-colour terminals. * Copy and paste with multiple buffers. * Interactive menus to select windows, sessions or clients. * Change the current window by searching for text in the target. * Terminal locking, manually or after a timeout. * A clean, easily extended, BSD-licensed codebase, under active development. ''; license = stdenv.lib.licenses.bsd3; platforms = stdenv.lib.platforms.unix; maintainers = with stdenv.lib.maintainers; [ thammers fpletz ]; }; }
- lilyball 7y agoThose two package descriptions don't appear equivalent. The Nix one includes tmux-bash-completion and some extra build configuration compared to the Guix one, as well as a much more verbose description.
- kragen 7y agoI think the differences are small.
- lilyball 7y agoAfter deleting the bash completion stuff and replacing the verbose description with Guix's, it cut the package from 63 lines down to 36. Deleting the blank lines cut it down to a further 27. For comparison the Guix package (which had no blank lines to begin with) is 35 lines. Here's the trimmed Nix derivation: { stdenv, fetchFromGitHub, autoreconfHook, ncurses, libevent, pkgconfig, makeWrapper }: stdenv.mkDerivation rec { pname = "tmux"; version = "2.9a"; outputs = [ "out" "man" ]; src = fetchFromGitHub { owner = pname; repo = pname; rev = version; sha256 = "040plbgxlz14q5p0p3wapr576jbirwripmsjyq3g1nxh76jh1ipg"; }; nativeBuildInputs = [ pkgconfig autoreconfHook ]; buildInputs = [ ncurses libevent makeWrapper ]; meta = { homepage = http://tmux.github.io/; description = "Terminal multiplexer"; longDescription = '' tmux is a terminal multiplexer: it enables a number of terminals (or windows), each running a separate program, to be created, accessed, and controlled from a single screen. tmux may be detached from a screen and continue running in the background, then later reattached. ''; license = stdenv.lib.licenses.bsd3; platforms = stdenv.lib.platforms.unix; maintainers = with stdenv.lib.maintainers; [ thammers fpletz ]; }; }
- kragen 7y agoNice! I find this a lot more readable than the Scheme, and it certainly contains many fewer tokens; what do you think?
- geofft 7y agoDo Nix and Guix expressions not interoperate? Is that a fundamental limitation of the system (at lest as fundamental as, say, dpkg and rpm) or could one write a source-level translator?
- kragen 7y agoIt's a good question. They don't interoperate now.