Join GitHub today
GitHub is home to over 36 million developers working together to host and review code, manage projects, and build software together.
Sign upGHCJS? #337
Comments
This comment has been minimized.
This comment has been minimized.
|
Not yet, but I like the idea. Let's use this issue as a discussion point for it. |
snoyberg
added
the
type: discuss
label
Jun 17, 2015
snoyberg
added this to the
Later improvements milestone
Jun 17, 2015
This comment has been minimized.
This comment has been minimized.
|
Thanks for a quick reply. I already saw some calls for better distribution on the ghcjs github (ghcjs/ghcjs#231). I think if it would be just as painless to get ghcjs through stack as it is ghc (including getting ghcjs packages from stackage) it would greatly help with adoption. |
This comment has been minimized.
This comment has been minimized.
|
Just to show that there's interest: I'm interested :) |
This comment has been minimized.
This comment has been minimized.
|
This hinges in part on GHC 7.10 compatibility does it not? |
This comment has been minimized.
This comment has been minimized.
|
Nah, GHCJS works fine with 7.8.4. Infact I've found it more of a challenge to boot it with 7.10. I didn't realize there were compatibility issues with 7.10? (though further discussion of that should go in a different issue, if one doesn't already exist) Anyway, agreed that this would be a nice thing to have! It's particularly useful when sharing code between the client and server. Currently I need to remember to run my ghcjs build script, and otherwise the protocol types can go out of sync. |
This comment has been minimized.
This comment has been minimized.
|
Having an ez-pz way to get people going with GHCJS would be wonderful. |
This comment has been minimized.
This comment has been minimized.
GHCJS compatiblity? Granted that it's on a branch, but I am running on 7.10 fine (https://github.com/ghcjs/ghcjs/wiki/GHCJS-with-GHC-7.10) |
This comment has been minimized.
This comment has been minimized.
|
@jkozlowski I thought Stack was GHC 7.8 only and didn't know GHCJS worked with 7.8 |
This comment has been minimized.
This comment has been minimized.
|
So, would the first step be to get binary builds setup somewhere/somehow? I don't know if FP Complete already does that somehow, or it exists somewhere else (no official ones, according to my issue on ghcjs github). |
This comment has been minimized.
This comment has been minimized.
|
We do already have Docker images with ghcjs binaries. Another option is just automating the process of building ghcjs |
This comment has been minimized.
This comment has been minimized.
krisajenkins
commented
Jun 19, 2015
|
+1! Stack has now addressed every problem I have with Haskell adoption, save this one. I'm using Elm for frontend stuff, but I'm using it at its limits and would love to use GHCJS if you could work your supermagic on the install-process. :-) |
This comment has been minimized.
This comment has been minimized.
|
It'll be awesome to have full stack support for GHCJS in the future. However, for now stack's docker images do help a ton to make it easy to do development on GHCJS. Here's what I'm using for the new School of Haskell: Have something like this in your stack.yaml:
Then, you can do this to build and install ghcjs dependencies:
Why the |
This comment has been minimized.
This comment has been minimized.
luite
commented
Jun 19, 2015
|
How important is it to have 7.8 compatibility in GHCJS? I'm working on putting together a release, based on the The 7.10.2 release candidate works fine by the way, no workarounds needed anymore. |
This comment has been minimized.
This comment has been minimized.
krisajenkins
commented
Jun 19, 2015
|
Doesn't matter to me at all. I'd like to move everything to 7.10. #onevote |
This comment has been minimized.
This comment has been minimized.
|
@mgsloan You workflow sounds like a nice workaround, I'll give it a try this weekend if I find some time. I am currently just using a hand built ghcjs that was built into a sandbox. But also if it already is possible, maybe just automating those steps (with the caveats that it pulls in a massive docker image) would be already a step in the right direction. Just a thought/ |
This comment has been minimized.
This comment has been minimized.
|
@luite I'm definitely OK with the release with only 7.10.2 support. Want to touch base next week about figuring out a good release strategy that could give stack users easy access to GHCJS? |
This comment has been minimized.
This comment has been minimized.
luite
commented
Jun 19, 2015
|
Sure. I just returned from travels and I'm dedicating some time the coming weeks to finally sort out the long standing issues and get a release out of the door. |
This comment has been minimized.
This comment has been minimized.
cstrahan
commented
Jun 19, 2015
One option would be Nix :). Yes, Nix has it's own learning curve, but one can ignore most of it if all they want/need to do is get ghcjs installed. @ryantrinkle provides a script to automate the install of Nix and ghcjs, and uninstalling is as easy as |
This comment has been minimized.
This comment has been minimized.
krisajenkins
commented
Jun 24, 2015
|
FWIW, Nix (on OSX) defeated me. I'm still hoping for stack to nail it. Plus, I don't think I could recommend Nix to someone who just wants to get started with Haskell, the way I feel I could recommend stack. That alone is priceless. |
This comment has been minimized.
This comment has been minimized.
luite
commented
Jun 24, 2015
|
With GHC 7.10.2 (release candidate), installation from source should actually become doable for mere mortals (but packages may still be preferred due to the build time and setup of dependencies). I'm readying the And there's a script for Windows that builds everything from source on a clean Windows installation: https://github.com/ghcjs/ghcjs/blob/improved-base/utils/install.ps1 Ooh and and what's this? A REPL?
(See WIP in |
This comment has been minimized.
This comment has been minimized.
ghost
commented
Jun 24, 2015
|
@luite AHHH Must Have! Presently only able to build using the Nix script provided by @ryantrinkle and am eagerly awaiting a 'push button' install. |
This comment has been minimized.
This comment has been minimized.
mmaz
commented
Jun 24, 2015
|
@luite that branch is unbelievably exciting! If in the future, emacs-haskell-mode could plumb through to |
This comment has been minimized.
This comment has been minimized.
joelburget
commented
Jun 25, 2015
|
Big +1. Exciting stuff :) |
This comment has been minimized.
This comment has been minimized.
|
Something I'm interested in is having support for mixing ghcjs and ghc projects. For example, I often want to have something like:
Some way to have this just work with stack would be great. @luite GHCJSi is super exciting :D |
This comment has been minimized.
This comment has been minimized.
manyoo
commented
Jun 25, 2015
|
+1 ! I’m currently starting working on such a project. Before stack, I tried to use cabal sandbox, but when compiling ghcjs code, it can’t find the ghcjs packages like ghcjs-base installed in the global ghcjs package directory. Now, I’ve removed the cabal sandbox, and use stack for server side ghc code, and cabal with no sandbox for client side ghcjs code. If stack can make it easy to work in such setup, it would be really awesome! Eric Wong
|
This comment has been minimized.
This comment has been minimized.
|
+1 that would be perfect. |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@k-bx you need to upgrade |
This comment has been minimized.
This comment has been minimized.
|
Sorry, my bad, mis-read wiki. |
This comment has been minimized.
This comment has been minimized.
tinkyholloway
commented
Oct 15, 2015
|
I've been working to the instructions at Stack & GHCJS. I've found a problem with
|
This comment has been minimized.
This comment has been minimized.
luite
commented
Oct 15, 2015
|
Ok this is likely a problem with how Handling of these files is not quite complete yet, but something should probably change. I wonder if GHCJS should even attempt to support them, since it's really for getting information from the C compiler. |
This comment has been minimized.
This comment has been minimized.
tinkyholloway
commented
Oct 15, 2015
|
@luite said:
A ha! Adding |
jcmoore
referenced this issue
Oct 25, 2015
Closed
Feature Request: support for ghcjs --interactive #38
This comment has been minimized.
This comment has been minimized.
|
will we be seeing any GHCJS related doc on https://www.stackage.org at some point? |
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
This comment has been minimized.
|
@eallik Possibly! I don't think there's much to stackage itself related to GHCJS, though, so I imagine that this will be documented in stack / in tutorials elsewhere. @bitemyapp If you want to read the nitty-gritty of the decision making process on that, here's the issue related to adding support for using GHCJS with stackage snapshots: #1190 . So, essentially there is no need for a separate set of stackage snapshots, and ghcjs-only packages will probably get added to stackage. |
This comment has been minimized.
This comment has been minimized.
|
@mgsloan I had assumed there wouldn't be a separate compiler field, but rather that snapshots and compilers would be bolted together with a separate submission process for GHCJS. Much as GHCJS has done a great job with compatibility, I'm not sure it makes sense to elide the distinction in the snapshots when that distinction is made for major GHC versions. |
This comment has been minimized.
This comment has been minimized.
|
Yes, once there's a version of GHCJS on hackage, it would be good to get it and its associated libraries into stackage. I suppose when that happens, it'll be desireable to have just plain Until then, manually specifying the compiler is the best way I can think of for this to work. |
This comment has been minimized.
This comment has been minimized.
|
@mgsloan how about your own comment here 3 months ago? there seems to be quite a bit of information in this thread that solely applies to using stack with GHCJS? shouldn't that constitute the GHCJS specific portion of the doc? |
This comment has been minimized.
This comment has been minimized.
|
@eallik I didn't properly understand how GHCJS worked 3 months ago. Another relevant issue is here: fpco/stackage-curator#8 . Which doc do you think this stuff should be added to? |
This comment has been minimized.
This comment has been minimized.
|
I'm not sure; so one can just use stack/stackage with GHCJS without having to know about how stack works with GHCJS? |
This comment has been minimized.
This comment has been minimized.
|
@eallik It should be pretty straightforward, but the docs certainly deserved more polish. I've done that in the following commits: Another benefit of using the same stackage snapshots for GHCJS is that you can take existing stack projects intended for GHC and build them with GHCJS via |
This comment has been minimized.
This comment has been minimized.
|
Thank you! Exactly what I meant :) |
This comment has been minimized.
This comment has been minimized.
|
I updated @fizruk's build as of 2015-10-29
also had success setuping + building with
and |
This comment has been minimized.
This comment has been minimized.
emmanueltouzery
commented
Jan 25, 2016
|
I'm not really sure if this is the right place to ask, but... I have a working setup, there's just one little hitch: I'll probably handle this in a custom |
This comment has been minimized.
This comment has been minimized.
|
@emmanueltouzery Yeah, you should just use |
This comment has been minimized.
This comment has been minimized.
|
I've actually had use cases where copying the JavaScript files elsewhere On Mon, Jan 25, 2016, 10:41 PM Michael Sloan notifications@github.com
|
emmanueltouzery
referenced this issue
Jan 27, 2016
Closed
ghcjs: stack install doesn't copy the file. Does Setup.hs work? #1708
This comment has been minimized.
This comment has been minimized.
agocorona
commented
Oct 18, 2016
•
|
So finally there is first class install for ghcjs?. I would like to install it in remote servers with scarce resources. For example in free instances of Cloud9 to enable users to clone and run example code. I can not do an installation from source there. As a workaround, anyone know how to package and install the binaries manually? cloud9 workspaces are docker instances, so I can compile it in docker locally and translate the binaries. |
This comment has been minimized.
This comment has been minimized.
Stack has supported setting up GHCJS since v0.1.8, back in November of 2015
Perhaps use docker? You may need to figure out how to do a binary distribution of GHCJS, afaik no one has figured out how to do a binary distribution, other than mechanisms like docker. |
This comment has been minimized.
This comment has been minimized.
ryantrinkle
commented
Oct 18, 2016
|
@mgsloan Maybe we can get stack to use nix's binary package distribution infrastructure somehow? |
This comment has been minimized.
This comment has been minimized.
|
@ryantrinkle Perhaps so! Yes, nix is also a great approach, as demonstrated by your repo https://github.com/reflex-frp/reflex-platform |
This comment has been minimized.
This comment has been minimized.
geraldus
commented
Nov 7, 2016
|
Looks like Sample error message:
To resolve this I added |
This comment has been minimized.
This comment has been minimized.
haskellstudio
commented
Apr 8, 2018
|
hsc2hs: rawSystem: runInteractiveProcess: exec: does not exist (No such file or directory) i resolve this by :
because hsc2hs is in /Users/yourMacUserName/.stack/programs/x86_64-osx/ghc-8.0.1/bin |
jkozlowski commentedJun 17, 2015
Are there plans to support GHCJS in the same first class way as GHC (i.e. getting the binaries etc.)?