Live data from Hacker News

Purely Functional Linux with NixOS [video]

begriffs.com

131–140 of 143 posts

Re: Purely Functional Linux with NixOS [video]

#131
post #13

Earlier quoted context omitted.

We run a fleet. Happy to answer questions here or shoot us a mail at team@wearewizards.io if it's sensitive.

How's the binary security on NixOS these days? The official information I find are... worrying. Specifically: a) security updates are the same as all the other updates and may take days to get to you, do runtime replacements manually yourself ( https://nixos.org/wiki/Security_Updates ) and b) next to no hardening during compilation ( https://nixos.org/wiki/Hardened_NixOS )

Both good points. In practice a) hasn't been an issue but for b) we had to apply a fair amount of patches ourselves.

Luckily b is almost fixed, and if combined with e.g. grsecurity I think nix has a good story.

Re: Purely Functional Linux with NixOS [video]

#132
post #125

Earlier quoted context omitted.

Can I just point out that pretty much all of these options, including guix, are things that were invented well _after_ nix was established as its own thing? (aside from Haskell and Scheme themselves, of course)

I don't think you need to worry, I'm sure that who's familiar with PureScript also knows it's more recent than Nix. Those PureScript records tho...

Purescript cannot type a record merge or join. Haskell with type families can, but the syntax would not be very pretty.

Re: Purely Functional Linux with NixOS [video]

#133

Earlier quoted context omitted.

Do you know what % of scheme is fairly functional? Most of it. There are ~19 functions in r5rs that mutate state, if you count IO related functions. I have used maybe half of them, and mostly the IO ones. The rest were for mutating variables, lists, vectors, and strings. Many of those are rarely used. I mean, really, when was the last time you used set-car! or set-string!?

Scheme has little to offer out-of-the-box as a basis for Nix. It has no convenient syntax or suitable implementation for extensible records, which is the core data type of Nix.

  '((extensible-records . being-key-value-maps?))
Alists are fast enough for this, and they ARE k/v maps. And support for them is in rnrs.

Re: Purely Functional Linux with NixOS [video]

#134

I really want to like NixOS, but there's a serious lack of examples of how to deploy common web infrastructure with it, and that's bitten me the few times I've tried to play with it. For example, our stack is nginx, uwsgi, django, elasticsearch, and postgres. Installing most of the pieces seemed relatively straightforward(though required a fair bit of searching through the nixpkgs source), but it's honestly pretty un…

You might be interested in checking out Habitat from Chef, which uses many similar ideas: habitat.sh

as nixos user i looked at habitat and the thing that i will never switch to habitat is that environments are not (build) reproducible. basically habitat is more like docker where it snapshots "successful" build and you use that input for further building.

what i loved about habitat is the supervisor part. i there is a way to use habitat's supervisor with nix. then you get best of both tools.

until then i'll just have to stick to python's supervisord.

Re: Purely Functional Linux with NixOS [video]

#135

Earlier quoted context omitted.

>Besides dynamic variables, there is also plain old variable mutation. Scheme macros are much more complex than what you described, because of hygiene. For the sake of making Scheme look better, I left macros out of my grammar. The Nix expression language has none of these things. Fair enough, but: >I should take a look at the guix APIs to craft a bigger subset. What? No. Those don't add any complexity to the languag…

> What? No. Those don't add any complexity to the language Oh, believe me, I'm all about the separation between language and library. I mean the smallest subset of Scheme necessary to use the api. For example, it might use string maps instead of association lists. > Most of the things you included in your scheme BNF syntax aren't syntax, they're special forms. This is just terminology. We have a hierarchy of language…

>Oh, believe me, I'm all about the separation between language and library. I mean the smallest subset of Scheme necessary to use the api. For example, it might use string maps instead of association lists.

Look, first off, in a scheme system, there's no reason to use string maps. Symbols or strings can be used for alist lookup, and alists are plenty fast for these purposes.

Secondly, this is how a scheme experession is run, AFAIK.

  (define foo (map odd? '(1 2 3 4)))
First off, in a scheme that has it, the readtable is run, transforming shortcuts like ' into (quote ). Then the expression is parsed into a memory representation of a sexpr. This could be a series of cons cells, but a lot of schemes use something else. What happens next is pretty implementation dependant, but in an interpreter, the resultant expression is evaluated. The evaluator sees the define - note this, in your model, the parser would catch this - dectects that it is a special form, and passes the expr to the code handing define. That code then evaluates the cddr of the expr, and binds the result to the symbol in the cadr. In some implementations, the cadr can be a list, but this isn't standard.

Note that all the parser did was translate some syntactic sugar, and give the interpreter the datastructure representing the sexpr. Because that, AFAIK, is all the parser does.

I could be wrong, but tell me if I am, don't just go on as if I'd said nothing.

>I was doing a grammar for scheme programs, not anything else on that list. Macros invocation requires its own non-terminals because its arguments are arbitrary sexprs, not merely unevaluated expressions.

...An unevaled expression IS an arbitrary sexpr. What else can it be?

Re: Purely Functional Linux with NixOS [video]

#136

Earlier quoted context omitted.

What I really worry about is my nonfree wireless driver and Nvidia driver, which doesn't seem to be available on Guix.

Well, you can specify extra packages using $GUIX_PACKAGE_PATH, and I've seen a few custom repos, such as this: https://github.com/genenetwork/guix-bioinformatics and https://github.com/Ecogenomics/ace-guix I'm not sure how easy it is to maintain a system with extra packages like this, but it'd be nice to be able to use an "overlay" repo as you can in Gentoo for personal/custom packages. Would love to ping davexunit t…

There's no such thing as a repository in Guix. Using GUIX_PACKAGE_PATH is the closest thing, conceptually.

Re: Purely Functional Linux with NixOS [video]

#137

Earlier quoted context omitted.

Scheme has little to offer out-of-the-box as a basis for Nix. It has no convenient syntax or suitable implementation for extensible records, which is the core data type of Nix.

'((extensible-records . being-key-value-maps?)) Alists are fast enough for this, and they ARE k/v maps. And support for them is in rnrs.

They kind of suck syntax-wise though. There's no visual difference between them and any other list.

Re: Purely Functional Linux with NixOS [video]

#138
post #65

Earlier quoted context omitted.

Perhaps for the newer Windows platforms (e.g. UWP) but Win32 installers have definitely been known to put things all over your system.

Yeah, that's the reason why i have a "got installer? not worth using" pre-filter for Windows software. Not sure how things are these days, but i'm talking about the Win 9x to Win 7 days.

I'd have opposite filter. Did you correct permissions for folder where you unzipped/placed executables so that it couldn't overwrite itself? Correctly installed software in program files folder would be protected from being overwritten without administrator privileges.

Re: Purely Functional Linux with NixOS [video]

#139

Earlier quoted context omitted.

Well, you can specify extra packages using $GUIX_PACKAGE_PATH, and I've seen a few custom repos, such as this: https://github.com/genenetwork/guix-bioinformatics and https://github.com/Ecogenomics/ace-guix I'm not sure how easy it is to maintain a system with extra packages like this, but it'd be nice to be able to use an "overlay" repo as you can in Gentoo for personal/custom packages. Would love to ping davexunit t…

There's no such thing as a repository in Guix. Using GUIX_PACKAGE_PATH is the closest thing, conceptually.

Ahh, well, then it appears I have to manage a directory of packages myself, as well as any dependencies outside of the Guix store, right? Would be nice to just have a secondary source, as I do with MELPA for Emacs, or overlays for Gentoo.

Is something similar/comparable planned to be added?

Orrr should someone step forward and volunteer to add it as a feature...?

Re: Purely Functional Linux with NixOS [video]

#140

Earlier quoted context omitted.

'((extensible-records . being-key-value-maps?)) Alists are fast enough for this, and they ARE k/v maps. And support for them is in rnrs.

They kind of suck syntax-wise though. There's no visual difference between them and any other list.

  '(this is a list)
  '((this . is) (an . alist))
Looks pretty distinct to me.
Post reply on HN