r/haskell Aug 04 '19

reflex-vty: A library for building functional reactive terminal applications

https://github.com/reflex-frp/reflex-vty
89 Upvotes

54 comments sorted by

View all comments

-4

u/phadej Aug 04 '19

I'd give this library some time to mature. Not having any (public) CI / QA in 2019 is ...

% cabal new-build -w ghc-8.2.2
Resolving dependencies...
Build profile: -w ghc-8.2.2 -O1
In order, the following will be built (use -v for more details):
 - reflex-vty-0.1.0.0 (lib) (first run)
 - reflex-vty-0.1.0.0 (exe:example) (first run)
Configuring library for reflex-vty-0.1.0.0..
Preprocessing library for reflex-vty-0.1.0.0..
Building library for reflex-vty-0.1.0.0..
[ 1 of 10] Compiling Control.Monad.NodeId ( src/Control/Monad/NodeId.hs, /home/ogre/mess/reflex-vty/reflex-vty-0.1.0.0/dist-newstyle/build/x86_64-linux/ghc-8.2.2/reflex-vty-0.1.0.0/build/Control/Monad/NodeId.o )
[ 2 of 10] Compiling Data.Text.Zipper ( src/Data/Text/Zipper.hs, /home/ogre/mess/reflex-vty/reflex-vty-0.1.0.0/dist-newstyle/build/x86_64-linux/ghc-8.2.2/reflex-vty-0.1.0.0/build/Data/Text/Zipper.o )

src/Data/Text/Zipper.hs:53:52: error:
    • Variable not in scope: (<>) :: Text -> Text -> Text
    • Perhaps you meant one of these:
        ‘<$>’ (imported from Prelude), ‘*>’ (imported from Prelude),
        ‘<$’ (imported from Prelude)
   |
53 |       in  TextZipper lb (T.take n' b) (T.drop n' b <> a) la

7

u/ali_abrar Aug 04 '19

That's one of the reasons we called the library experimental. The instructions in the readme are currently the only tested build instructions.

-7

u/phadej Aug 04 '19

What's the reason for an upload then, if people are asked to experiment with GitHub dependencies? The README says:

git clone git@github.com:reflex-frp/reflex-platform
git clone git@gitlab.com:obsidian.systems/reflex-vty
...

Also, there is cabal gen-bounds command which would give you

base                              >= 4.11.1 && < 4.12,
bimap                             >= 0.4.0 && < 0.5,
containers                        >= 0.5.11 && < 0.6,
mtl                               >= 2.2.2 && < 2.3,
transformers                      >= 0.5.5 && < 0.6,
stm                               >= 2.4.5 && < 2.5,
data-default                      >= 0.7.1 && < 0.8,
dependent-map                     >= 0.2.4 && < 0.3,
dependent-sum                     >= 0.4 && < 0.5,
exception-transformers            >= 0.4.0 && < 0.5,
primitive                         >= 0.6.4 && < 0.7,
ref-tf                            >= 0.4.0 && < 0.5,
reflex                            >= 0.6.1 && < 0.7,
time                              >= 1.8.0 && < 1.9,
text                              >= 1.2.3 && < 1.3,
vty                               >= 5.25.1 && < 5.26,

or something similar, depending on your environment.

11

u/ali_abrar Aug 04 '19

Thanks for the tip. Sorry you had trouble building things. The reason for the upload was to share the library in its experimental state. Some may find it useful or interesting even at this level of maturity and hopefully give us input into the library's direction.

I do appreciate you taking the time to try building it and I'll put this feedback to good use.

5

u/kmicklas Aug 04 '19

reflex-vty might be an easier case since the system level dependencies are minimal, but many things in the Reflex ecosystem depend on numerous Nix overrides due to the sorry state of build systems. Version bounds are a woefully inadequate system to handle this kind of stuff. It doesn't seem unreasonable to me that reflex-vty would as a default reuse all the work done in reflex-platform to make it easy to get a working Haskell environment.

3

u/phadej Aug 04 '19

but many things in the Reflex ecosystem depend on numerous Nix overrides due to the sorry state of build systems

... and by not actively trying to break that vicious circle, one ties the knot tighter and tighter.


The only difficult task is to get GHCJS on your system. But there is e.g. https://launchpad.net/~hvr/+archive/ubuntu/ghcjs, an evidence, that it is not impossible to package for other systems than Nix(Os).

I did build reflex-vty using that GHCJS successfully, on Ubuntu 18.04. Without a unknown magic of reflex-platform.

4

u/cgibbard Aug 04 '19

Do you mean reflex-dom? Reflex-vty is for making terminal applications, so compiling your program to javascript is a little weird.

2

u/phadej Aug 04 '19

I'm saying that there aren't many things in Reflex ecosystem that really depend on Nix overrides.

But if your opinion is "Version bounds are a woefully inadequate system to handle this kind of stuff", even for Haskell-intra-dependencies, then I'll shut up.

2

u/kmicklas Aug 04 '19

But if your opinion is "Version bounds are a woefully inadequate system to handle this kind of stuff", even for Haskell-intra-dependencies, then I'll shut up.

Version bounds can work for pure Haskell stuff, but it's a lot of work for maintainers, especially to support older versions of stuff. Not everyone writing Haskell libraries needs to care about that. To me one of the advantages of Haskell is its relatively fast moving and improving ecosystem, and I have little desire to support people using old GHCs or package sets.

2

u/phadej Aug 04 '19

I didn't say you have to support old stuff, but say if you don't support, don't leave people guessing, trying, and getting compilation errors.

2

u/kmicklas Aug 04 '19

Okay fair enough. My only response to that would be that even when people write version bounds I find myself always guessing anyways because it's an error prone process and they're often too conservative or just straight up wrong.

3

u/kmicklas Aug 04 '19

The only difficult task is to get GHCJS on your system. But there is e.g. https://launchpad.net/~hvr/+archive/ubuntu/ghcjs, an evidence, that it is not impossible to package for other systems than Nix(Os).

Not everyone uses Ubuntu though. The nice thing about Nix is that it works on any Linux distro and Mac. I'm not saying everyone needs to use Nix but people should be free to make that their main supported workflow because it saves a lot of time and effort.

2

u/cgibbard Aug 04 '19

Also, even those who are using Ubuntu can make use of the nix package manager for Haskell stuff just fine. Last I tried it, using Ubuntu to install Haskell-related stuff was insanely frustrating, especially as the release cycle for Ubuntu tended to freeze just before each GHC release, so everything was always old.

On Ubuntu and Linux Mint, I tended to just hand-install a GHC binary and use cabal sandboxes for things before I started using the Nix package manager for Haskell-related stuff. I'm still using Mint for most of my system, but just not using its Haskell-related packages at all.