-
Notifications
You must be signed in to change notification settings - Fork 843
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
GHCJS? #337
Comments
Not yet, but I like the idea. Let's use this issue as a discussion point for it. |
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. |
Just to show that there's interest: I'm interested :) |
This hinges in part on GHC 7.10 compatibility does it not? |
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. |
Having an ez-pz way to get people going with GHCJS would be wonderful. |
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) |
@jkozlowski I thought Stack was GHC 7.8 only and didn't know GHCJS worked with 7.8 |
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). |
We do already have Docker images with ghcjs binaries. Another option is just automating the process of building ghcjs |
+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. :-) |
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 |
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. |
Doesn't matter to me at all. I'd like to move everything to 7.10. #onevote |
@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/ |
@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? |
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. |
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 |
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. |
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 |
@luite AHHH Must Have! Presently only able to build using the Nix script provided by @ryantrinkle and am eagerly awaiting a 'push button' install. |
@luite that branch is unbelievably exciting! If in the future, emacs-haskell-mode could plumb through to |
Big +1. Exciting stuff :) |
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 |
+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
|
+1 that would be perfect. |
@k-bx you need to upgrade |
Sorry, my bad, mis-read wiki. |
I've been working to the instructions at Stack & GHCJS. I've found a problem with
|
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. |
@luite said:
A ha! Adding |
will we be seeing any GHCJS related doc on https://www.stackage.org at some point? |
@eallik @snoyberg related to Stackage, being able to list available snapshots (LTS, nightly) would be nice. If that is possible, it was impossible to find via the website. Would a separate set of Stackage snapshots for what's "known good" w/ GHCJS be sensible? |
@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. |
@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. |
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. |
@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? |
@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? |
I'm not sure; so one can just use stack/stackage with GHCJS without having to know about how stack works with GHCJS? |
@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 |
Thank you! Exactly what I meant :) |
I updated @fizruk's build as of 2015-10-29
also had success setuping + building with
and |
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 |
@emmanueltouzery Yeah, you should just use |
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
|
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. |
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. |
@mgsloan Maybe we can get stack to use nix's binary package distribution infrastructure somehow? |
@ryantrinkle Perhaps so! Yes, nix is also a great approach, as demonstrated by your repo https://github.com/reflex-frp/reflex-platform |
Looks like Sample error message:
To resolve this I added |
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 |
Are there plans to support GHCJS in the same first class way as GHC (i.e. getting the binaries etc.)?
The text was updated successfully, but these errors were encountered: