Hacker Newsnew | past | comments | ask | show | jobs | submit | vdijkbas's commentslogin

> This is why Nix is really just a front for bash. For all of its faults, at least bash is Turing-complete.

Nix is Turing-complete. This was even sometimes considered a problem because it makes the language too powerful:

https://nixos.org/~eelco/talks/guix-feb-2018.pdf


This is news to me, I admit. But if this is true, then people shouldn't say Nix is declarative.


This shouldn't really come as a surprise, any reasonably powerful language will end up Turing complete sooner or later, it's pretty difficult to avoid. Nix specifically doesn't even hide it, it has plain old function and recursion as primitives.

What makes it declarative is the lack of side effects and laziness.


What I'm trying to explain is that using the term "declarative" is confusing to a lot of developers who who not think of functional programming as declarative, but rather think of something like JSON.


I don't see it as confusing, it's a pretty accurate description. The Nix language is for most part a JSON-look-alike with a couple of additional features. You don't really program in it, you declare/return a data structure. The only programming you do in Nix is to make it a little easier to build that data structure. It's kind of like the old days when people would parse JSON with eval(), which would also grand you features that plain JSON wouldn't have.

Even NixOS itself doesn't do all that much actual programming in Nix, most of the code that does stuff is written in C++. The Nix language itself doesn't let you escape out of its sandbox.


Although it's debatable, it's very common for functional languages to be categorized as declarative.


Perhaps, but that categorization is going to confuse a lot of developers. It sure confused me until I said something wrong, and all of you Nix proponents descended on me.

This confusion is not good for Nix.


I wrote a PR[1] for NixOS that adds a postage service. Just add the following to your configuration.nix to enable a postage web server:

  {
   services.postage = {
     enable = true;
     connections = {
       "local" = "hostaddr=127.0.0.1 port=5432 dbname=postgres";
     };
   };
  }
BTW the postage devs were very helpful in fixing packaging issues.

[1] https://github.com/NixOS/nixpkgs/pull/27796


Haxl is a powerful abstraction with IMHO a beatifuly simple implementation.

However for our use case at LumiGuide (reading and writing registers of modbus devices) it wasn't simple enough. We just needed an abstraction for batching and did not need caching and the other features Haxl provides.

So I wrote monad-batcher which as the name implies only provides a batching abstraction (which can also be used to execute commands concurrently). All the other features can be build on top of monad-batcher as separate layers (separation of concerns).

The library is available on Hackage but needs a bit more documentation (a tutorial would be nice):

http://hackage.haskell.org/package/monad-batcher


The nice thing about having many cyclists is that there's a high demand for cycle parking spaces which means you can run a good business guiding cyclists to available space. This is what we do at LumiGuide. See: https://bicycledutch.wordpress.com/2015/06/09/bicycle-parkin...


At LumiGuide we use NixOS on our development machines as well as on all our production servers. I used ansible before but NixOS is on a whole different level.

See the following for a story about a system we just deployed which uses NixOS:

https://news.ycombinator.com/item?id=9690683


That's me and my laptop :-)

As I mentioned in the reddit comments we're using Haskell for most parts of the system (frontend via GHCJS, web application servers, protocol implementations). For dev-ops we use the Nix ecosystem: NixOS & nixops.


(I'm the CTO of LumiGuide who developed this system).

We're currently not using the system for video surveillance. Images from the cameras are only stored in memory for a short period of time while being processed by our CV algorithm.

However, since bicycle theft is a common theme in the Netherlands, there's strong interest from municipalities for using our system for video surveillance. So we're now researching how to extend our system for doing that.


All things considered, preventing theft via active physical structure, vs pursuing a thief AFTER the theft occurred seems to be preferable no?

Ask New Yorkers or Londoners how well video surveillance helps prevent or catch thieves..

[1] http://farm4.static.flickr.com/3024/5859909526_af35d1a4de_z....

[2] http://cdn.trendhunterstatic.com/thumbs/wave-by-joe-mattley....

[3] http://www.landscapeonline.com/products/images/prod_baa1e255...


Great! I hope you succeed.


Also see the slides of Simon's talk at ZuriHac 2014 last weekend:

http://www.haskell.org/haskellwiki/ZuriHac2014#Talk_by_Simon...


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: