Live data from Hacker News

Purely Functional Linux with NixOS [video]

begriffs.com

101–110 of 143 posts

Re: Purely Functional Linux with NixOS [video]

#101

Earlier quoted context omitted.

Haskell is honestly a larger language, and is a pain in the butt to write. If you're just writing configuration or a very simple package, Nix is basically "JSON with colons, multiline strings, and function calls". Haskell doesn't have a reasonable built-in syntax for dictionaries/maps/whatever you want to call them, which is 95% of Nix.

A third naïve question: why not just use a functional subset of Scheme? It's got a well-defined syntax for key/value mappings, which is fast enough , funcalls, and you can use lazy evaluation if you use a pure subset of the language. And in any rnrs complient Scheme, it's fairly trivial to make a strict functional dialect. And in Guile or Racket, it's even easier. Unfortunately, Guix doesn't do this. Which meant Guix…

A purely functional subset of Scheme, honestly, is different enough from most lisps that it's a new language on its own. If you're learning a new language, a new syntax isn't very hard. And there's not a terrible amount of people who think S-expressions are an inherently good syntax.

Re: Purely Functional Linux with NixOS [video]

#102

Earlier quoted context omitted.

Haskell is honestly a larger language, and is a pain in the butt to write. If you're just writing configuration or a very simple package, Nix is basically "JSON with colons, multiline strings, and function calls". Haskell doesn't have a reasonable built-in syntax for dictionaries/maps/whatever you want to call them, which is 95% of Nix.

Well, you would use records, but records are a weak point of the Haskell language. I've discussed "why not Haskell" with some Nix people and they specifically mentioned the lack of row polymorphism.

Purescript?

Re: Purely Functional Linux with NixOS [video]

#103

Earlier quoted context omitted.

Checksums!

You're missing the point.

Well, yes, but I read some newer comments, and I get what you mean. I don't necesarily agree with your decision, but I understand it.

  M-x passive-agressive-mode
And now, I'll go upgrade my NVIDIA drivers, and load up Psychonauts on Steam.

Re: Purely Functional Linux with NixOS [video]

#104
post #100
post #65

Earlier quoted context omitted.

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.

But that is not a packaging system. You can put binaries in zip files in Linux systems too. And I don't understand what kind of software you used with that pre-filter. You cannot even install drivers then.

"Pre filter" is kind of like a rule of thumb. There are exceptions for stuff like drivers and for big corporate programs that just don't come in other ways.

But a lot of smaller programs are available in the zip form, or have alternatives that are.

In short, i prefer portable programs - https://en.wikipedia.org/wiki/Portable_application

Re: Purely Functional Linux with NixOS [video]

#105
post #56

Anyone using NixOS as a server in production? We're on FreeBSD now but I think Linux in our stack is inevitable (many servers, like Aerospike, are Linux only). There's always Ubuntu, but this looks lovely. I've had my eye on it for a personal Linux workstation but haven't heard anything about it as a server.

If you're a non-trivial shop you'll need to harden it, you're better off with CentOS/RHEL than Ubuntu.

NixOS recently got a big update to its Grsecurity module and will probably merge a large set of patches in the next month or so for compiler hardening. There is a lot of work being done on this front.

Re: Purely Functional Linux with NixOS [video]

#106
post #60
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.

Do you have a blog post about it or something? I don't have specific questions, I'd just love to see how Nix looks in production.

No high level overview, just a fairly specific (and sadly slightly out of date) one here: https://blog.wearewizards.io/how-to-use-nixops-in-a-team

It's still Linux but a lot of common problems go away. E.g. if you remove a user from your config then it's removed on the server (as opposed to Ansible).

Or: Because you have a dependency DAG all services that need restarting after a change are known (no more Chef notifies :restart).

Or: No more apt-get dist-upgrade. You can have a single package depend on an entirely new version of your OS and keep the old OS in place (except for the kernel version of course).

Re: Purely Functional Linux with NixOS [video]

#107

My Linux experience so far has been limited to ls, cd and vi. From the outside, package management has always seemed to me like a huge mess. But, I've been starting to learn Nix recently and I really like it. I can add, remove, test, screw up, change my mind, whatever without stress.

"I can add, remove, test, screw up, change my mind, whatever without stress"

I love Nix and completely agree with that, and I do have lots of experience with several package managers (deb, rpm, rubygems, ...)

Re: Purely Functional Linux with NixOS [video]

#108
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 unclear how to install our actual django app.

Currently we just clone the repo to the server and point uwsgi to the relevant uwsgi.py file, but it doesn't seem like there's a good way to do that in NixOS.

I'd love to hear that I'm wrong here, but again, the lack of decent example documentation is really the single biggest issue I have with NixOS. The rest of the documentation seems to be improving slowly but steadily.

Re: Purely Functional Linux with NixOS [video]

#109

Earlier quoted context omitted.

I greatly respect scheme, and yet I like the nix expression language too. Scheme's claim is you shouldn't be using x more bloated language than it, but the nix expression language is smaller and simpler than Scheme; it beats it at its own game! More practically, I can't think of anything that I wanted that Scheme offers but the nix expression language doesn't.

>the nix expression language is smaller and simpler than Scheme; it beats it at its own game! It may have a smaller stdlib than scheme (but I doubt it). But it's very hard to be simpler than scheme semantically. As for what I want from scheme that nix doesn't provide, a simple, regular, syntax that I already know is what I want. I understand that that doesn't apply to everybody.

> It may have a smaller stdlib than scheme (but I doubt it). But it's very hard to be simpler than scheme semantically.

Yes, I mean the semantics of the language. Scheme is indisputably more complex. There isn't really much a standard library for the Nix Expression Language either.

> As for what I want from scheme that nix doesn't provide, a simple, regular, syntax that I already know is what I want. I understand that that doesn't apply to everybody.

off the top of my head:

  Scheme-Simplified ::= *
  Items ::= (define (*) )
         |  (define  )
  Expr ::= ( *)
        |  (set!  )
        |  (lambda (*) )

  Nix-Expr ::=  : 
            |  with ; 
            |  { * }
            |  let * in 
            |    
            |  .
            |  .
            |   ? 
            |   ?  or 

  Nix-Item ::=  = ;
            |   = ;
            |  inherit ;
            |  inherit () ;

Re: Purely Functional Linux with NixOS [video]

#110

Earlier quoted context omitted.

A third naïve question: why not just use a functional subset of Scheme? It's got a well-defined syntax for key/value mappings, which is fast enough , funcalls, and you can use lazy evaluation if you use a pure subset of the language. And in any rnrs complient Scheme, it's fairly trivial to make a strict functional dialect. And in Guile or Racket, it's even easier. Unfortunately, Guix doesn't do this. Which meant Guix…

A purely functional subset of Scheme, honestly, is different enough from most lisps that it's a new language on its own. If you're learning a new language, a new syntax isn't very hard. And there's not a terrible amount of people who think S-expressions are an inherently good syntax.

>A purely functional subset of Scheme, honestly, is different enough from most lisps that it's a new language on its own.

No, it's not. It's a cut-down Scheme: Most of your scheme knowledge would apply directly, or indirectly.

Besides, even if it was a different language, it's a pre-existing one: DSSSL is pretty much this.

>If you're learning a new language, a new syntax isn't very hard.

Yes, but for me, the choice is learning a new language that has no other applications, save package managment, and using a subset of a language I already know.

>And there's not a terrible amount of people who think S-expressions are an inherently good syntax

I said from my perspective. I'm a schemer, so I'm already on board with sexprs.

Post reply on HN