Coder Social home page Coder Social logo

Comments (11)

ryantrinkle avatar ryantrinkle commented on May 19, 2024 5

Nix is a general package manager, which can be used to manage Haskell packages as well as system-level packages (and even the entire OS, in the case of NixOS). It's used here because it was the best way I could find to distribute binaries for everything you need to use Reflex (ghcjs, etc.).

I use Nix because it gives me reproducible builds for everything, locking down the version of everything - system libraries, database software, etc. Since Nix already handles all my package management needs, I don't use stack, cabal-install, or other tools like that to do it. This repo is where I put any useful tools I've built relating to using Nix and reflex together.

If you're working on a serious project with Reflex and you prefer not to use Nix, reflex-platform may not be too useful to you as it currently stands. However, if there are cross-package-manager support features I can add, I'll be happy to do so.

I'm closing this issue because I don't think there's an immediate action to be taken, but please feel free to continue the discussion.

from reflex-platform.

BartAdv avatar BartAdv commented on May 19, 2024 1

But reflex-starter-app boils down to stack.yaml file set up to build reflex and ghcjs with stack instead of nix....

from reflex-platform.

vyp avatar vyp commented on May 19, 2024

Nix existed before stack! ;)

Here's a blog post that talks about nix, stack and haskell: http://www.tweag.io/blog/stack-nix-portable-reproducible-builds
HTH!

from reflex-platform.

saurabhnanda avatar saurabhnanda commented on May 19, 2024

If I understood this correctly, Nix is for handling the stuff that Stack doesn't handle. Nix will delegate Haskell related dependencies to Stack itself. However, why is try-reflex compiling every single Haskell package all over again (I already have them as part of some other Haskell project via Stack).

from reflex-platform.

BartAdv avatar BartAdv commented on May 19, 2024

There is some effort to use stack, don't know if it's up-to-date though:
https://github.com/yamafaktory/reflex-starter

Other references:
#35
https://github.com/luigy/try-stack-reflex
https://github.com/reinh/reflex-dom-stack-demo

from reflex-platform.

saurabhnanda avatar saurabhnanda commented on May 19, 2024

So, right now it's not using stack at all?

from reflex-platform.

cgibbard avatar cgibbard commented on May 19, 2024

We don't also use Stack on top of Nix, though one might. The point of
Nix is that it's kind of like Stack, but taken to an extreme where
every system dependency is appropriately hashed and versioned. You
might have built some Haskell packages before outside of the Nix
environment, but they probably wouldn't be byte-for-byte identical to
the ones Nix is building (and it doesn't know about them anyway) and
so it doesn't matter.

Nix can be a bit of a pain with respect to how long things can take to
build when some basic dependency changes in a mostly-inconsequential
way, but in exchange, you get a rather extreme level of
reproducibility, which makes it nice in production as well as when
debugging (you can know that the thing you're running on your machine
is identical to the thing running in production and against which bugs
were reported).

Another thing which this hashing enables is that if the exact
packages you want have already been built by someone else, then you
can get them from a cache server and be quite assured that what you're
getting from the cache is exactly what would have been built if you
did it yourself.

On 12/08/2016, Saurabh Nanda [email protected] wrote:

If I understood this correctly, Nix is for handling the stuff that Stack
doesn't handle. Nix will delegate Haskell related dependencies to Stack
itself. However, why is try-reflex compiling every single Haskell package
all over again (I already have them as part of some other Haskell project
via Stack).

You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
#69 (comment)

from reflex-platform.

saurabhnanda avatar saurabhnanda commented on May 19, 2024

Well, then this brings me back to my original question. Without stack, how do I use this with an existing stack-ified project? With Intero as my editor?

from reflex-platform.

BartAdv avatar BartAdv commented on May 19, 2024

First of all, have you tried the starter reflex app I've linked to?

Anyway, there are probably few options, I remember, once (before intero,
but that doesn't matter), I was having a nix build open that was using
ghcjs to produce real output and stack setup that was using "normal" ghc to
feed me with typechecking errors. In this way, you could even have
stack-with-ghc for intero while producing JS output separately...but that
just seems a bit crazy, doesn't it :)

On Fri, Aug 12, 2016 at 3:53 PM, Saurabh Nanda [email protected]
wrote:

Well, then this brings me back to my original question. Without stack, how
do I use this with an existing stack-ified project? With Intero as my
editor?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub
#69 (comment),
or mute the thread
https://github.com/notifications/unsubscribe-auth/AAsGhJ-bWfALTIEcZuuGhSsRV_FLVvu7ks5qfHr1gaJpZM4JjAbp
.

from reflex-platform.

saurabhnanda avatar saurabhnanda commented on May 19, 2024

@BartAdv not tried your links. Want to stick with the most supported/mainstream repo.

from reflex-platform.

CMCDragonkai avatar CMCDragonkai commented on May 19, 2024

It's not clear from the nix documentation when you're on a NixOS platform whether to use stack to run nix, or to use nix to run stack. Most thing seem to think that you're not on NixOS, so nix is just another tool, and that stack is in your profile PATH and you would use stack to run nix. But actually with NixOS, most times one should be using nix-shell to create "mutable" dev environments. So then stack can be brought into that environment. When you're already inside a nix-shell environment that has all the system (non-haskell) dependencies imported, why would you need stack's nix integration? It becomes irrelevant, stack can just be used without knowledge of the fact that it's in a nix environment. Then the whole software project would still be usable by your co-devs who are not using nix.

I wrote the above not really in relation to reflex, but in general regarding the usage of stack and nix.

from reflex-platform.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.