-
Notifications
You must be signed in to change notification settings - Fork 563
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
Vision for getting started etc. #749
Comments
npm install purescript is more realistic because npm is cross-platform, whereas every OS / distro has its own family of package managers which are preferred by different segments of users. Something like: brew install node && npm install purescript is probably more attainable. -- On December 7, 2014 at 10:21:45 AM, Jason Kuhrt (notifications@github.com) wrote: I was chatting with joneshfon IRC about this and he suggested I bring it up with the project. The getting started story for psc is not ideal. It at least requires: install haskell $ brew install purescript && psc dev Maybe it would help if the ps community defined an ideal vision and then worked backwards from there to accomplish the engineering feats required. I think Meteor and Elm are exemplary in regards to their workflow stories. Maybe Clojure/Clojurescript too, I don't know. It does seem that right now the biggest challenge to working with ps is the space between: Wanting to try building a project with it If ps is not approachable then it really does not matter how good it is. People do not want to consult a reference on how to build a project, buffer that knowledge, then flush it at once, and repeat. They want short trial-and-error cycles with really quick and useful feedback. — |
@jdegoes Yeah fair enough. And actually I should clarify something. I see a lot of need for improvement in what happens after installation. Yes The emphasis on |
The We went with |
@garyb I believe the fragmented nature of
|
This is an important point to discuss. Starting with how we'd like to install the PureScript compiler and accompanying tools is a good idea. I'm interested in adopting PureScript at Plaid. Currently 90% of our code is JavaScript. JavaScript the language is far from ideal, but npm does a good job of managing dependencies. We only depend on node and npm being installed globally; everything else is installed locally in node_modules. My concern is that adopting PureScript will increase the number of global dependencies each developer must keep up to date. |
I'm happy this discussion is happening, by the way! There's some older discussion about some of these points on #631. |
@garyb Sorry for somewhat duplicating that issue. In order to avoid splintering the discussion I'm happy to close this or focus its intent. For me, the main difference I see, is that we can either work on this problem going forward or backwards. #631 seems to take the approach of going forward. As I've already stated I think another valid alternative is to work backwards. This actually has a name and methodology, https://flynn.io/docs#idealized-design
|
Some friction: This does not work: $ cat **/*.purs | psc --stdin --main=Chapter2 | node
Error in module Math
Cannot import unknown module 'Prelude' But this does: $ psc **/*.purs --main=Chapter2 | node
Of course, the later is better but the former was surprising. |
What's the error in the first case? There was a sort-of issue with |
@garyb I edited my comment to include the error, do you see it? Indeed it seems related to |
Ah ok, yep. It is still the case that when using |
Well the dependencies are only a problem if you use The proper way to distribute on npm should be to compile the code to a js file and externs when publishing. This way you don't have sources that need to be recompiled every time, you also are distributing js files, and you have types to go along with it. It becomes transparent that you are even using purescript as a language to someone from the js world. I think between those two choices, using npm is a viable option. |
Of course, those two changes are worthless unless we also depend on the compiler version in each library. Otherwise you will have some types you cannot use, functions will be missing, or other things. |
I think |
Well that's unfortunate, though maybe there's another way around that. |
Maybe the most useful thing that can come out of this is a succinct document that outlines how to get started, install packages, build, and deploy etc. written as though it were already done. Make it as simple and elegant as possible. And then put it in the back burner while steps to reach it are taken. Revise it in a few weeks. |
Here's a thought - what if took the Elm approach and developed tools which could be used in the browser - a PureScript IDE which came with support for standard libraries, running on our Linode box? It would be a big project, but in the spirit of identifying our ideal system up front, is this the sort of direction which we want to go in? Obviously we would still need to support the grunt/Bower/npm/etc. workflow. |
@paf31 Something that remains unclear for me is should/will server-side code via The impact, if nothing else, will come in the flavour of communication and API choices be it in actual functionality or terminology; generally just environmental detection and clear choices for output targets etc. |
@paf31 If I remember correctly there is discussion about getting PureScript to compile to other backends too? Like the JVM? Something else? Etc. If so, this would probably have a impact on the ideal workflow too! |
I assume you mean Right now, you can use PureScript on the server if you want to, and people have. The library support is not quite there yet, but it's not impossible, it's just a matter of putting in the work. There are bindings for things like As for other backends, I have always maintained that the compiler architecture should enable people to write backends if they want to, and as easily as possible, but my own focus will be on getting the JS target and associated tools as solid as possible. |
Another option could be a ps specific ecosystem. If we want to get serious about multiple backends, we're going to have to be able to distinguish between a library written specific for language A and another specific for language B. I mean, if you're targeting the browser, you can't use that library with a java or python backend. Whereas if you have an agnostic library (pure ps), then it doesn't matter who uses it. If we make these distinctions, then the distribution becomes something that is done on a per-library basis, rather than something we have to figure out for everyone. Register it to the ps ecosystem and others (npm, pypi, hackage, etc) if you want, but if you've got an ffi for python, you can't register to the ps ecosystem. |
I'm unclear what benefit this provides. What goals did you have in mind with this? |
@paf31 That's fine and well, but maybe not quite what I'm getting at. For instance with Clojure they have the purportedly excellent http://leiningen.org backing much of their workflow experience. I'm pretty sure they offer a tight experience optimized for developer happiness. Maybe the so-called |
For example Flow from Facebook is a server that runs in the background providing incremental analysis. |
-1 on IDE. Developers want to use whatever tools they are using -- not learn new ones. But yeah, getting, installing, and building needs to get a lot simpler. Still toying around ideas for a Purescript-�based build / dependency system: |
As far as the npm front, if each library publishes its compiled js and externs for all the things it uses then things should be fine right? Depending on more than one library would just mean that you'd have to remove the duplicates when you go to compile things. Either Though, this might cause us to be much more stringent with version changes. |
@jdegoes I don't have time to dive into this but for your own reference you may be interested to look at the research @sokra is doing into module builder system. Its easily the most advanced fundamentally well thought out system in JavaScript today. But of most interest is the work being done towards WebPack 2 via the Concord Spec https://github.com/webpack/concord. There may be some useful ideas there for you, not sure. |
Agreed, but I wouldn't rule-out tooling that provides services for IDEs to hook into. Every IDE shouldn't have to build PureScript integration from scratch. See my comments above. |
My own view would be that a build / dependency system should be as minimal as possible, basically supporting only data flow and optionally incremental processing of IO resources -- beyond that, you plug everything else in, e.g. There's still the bootstrapping problem: if you're build system requires you plug-in That still means you need npm before you can start cooking, but if the dependency could be kept to just npm, it wouldn't be the end of the world. |
Here are my thoughts (sorry if this comes off as abrupt, I'm short on time today):
|
Yeah, I think this is a point we miss. You just can't do this with ps as it is now. Mostly because it doesn't support nested modules, but also because it needs all the files at once to typecheck things and other issues. So you have to go out of your way to understand the way the compiler works before you can be proficient with it in the js ecosystem. For instance, it's prohibitively complex to write a transform for browserify, for the reasons above. Whereas You currently just have to be aware of what ps expects in order to function properly, rather than blindly assuming it's like coffescript or something. |
There seems to be a relative plethora of issues that should just be abstracted into a sane CLI. I don't particularly care where such a tool would live, especially right now, but I've made the issue on this repo because its the entry point into the project. I don't think throwing raw I don't think I've managed to make my point and I'm sorry about that. I realize that my POV, being communication and design focused, probably needs further explanation if the recipient is listening from a deep engineering position. |
I personally like this feature when it works. Lets
I think this is the point being discussed here. When starting out, needing to find/compile multiple tools just to make "hello world" is frustrating and sometimes off putting. When you're already entrenched in ps, the beauty of removable tools is apparent. I greatly appreciate that people can use make to compile ps, just as much as I appreciate that I can leave all this up to gulp. But I'm well deep into the ps ecosystem. |
Can you please tell me your objection to using I don't think "JS folks are used to |
@joneshf I feel like, even though I am obviously a very deep into the PS ecosystem as well right now, I also make for an interesting data point here. I have only worked with Node and |
I honestly don't think any of this is the purview of the compiler, except maybe (1) making the compiler available in a versioned dependency manager (such as npm or bower, TBD), and (2) having the compiler be as modular as possible (externs make it somewhat modular now but of course there's more we could do on that front). Everything else needs to live outside the compiler and in separate projects, though this may be as good place as any to discuss what sorts of tools the community needs to focus on. |
Going to wind down until I have more time to contribute real substance but just going to leave off with the fact that I can't be the only one feeling this: A project that touches on the surface of what I'm trying to get at, created by the very @bodil that presented |
@paf31 I think it's fair to say you're an outlier in this data set ;). But I agree with what you say. It's not hard to learn this stuff. It just takes effort. That effort is on top of the rest of the stuff though. Not everyone will have the dedication to get through it all. If there's just one tool to install that does it all, it's easier for everyone. It's why I use yeoman, because I cba to set up a whole project each time. Also, I don't think the original intent of this issue was that the compiler needs to take on more responsibility. I think we're still not used to the google group existing, and this is the most visible place for a discussion. |
@jasonkuhrt Yes, I think Bear in mind that |
OK, as I'm being mentioned and all, you're about to get a dump of my opinions as a consequence: I like Bower. I'm surprised to find myself liking Bower, as I've used it before for JS projects and found it an unappealing experience. However, given the nature of PS packages, and how they differ structurally from CommonJS, which What I'm trying to achieve with Pulp is a lot like what Leiningen does for Clojure (in fact, Pulp is heavily inspired by Leiningen, UX wise). Basically, to get up and running with Clojure, you install the JVM, you download the Leiningen shell script, and you're good to go. Ideally, with Pulp, you'd install Node, you'd go I'm also trying to keep Pulp simple - it shouldn't be more than a wrapper around Pulp might benefit from a plugin system like Leiningen's, but I'm a bit worried that might turn it into a Grunt style task runner rather than a user friendly wrapper for the basic build tools. Leiningen seems to have managed, though. I've found that having a simple packaged IDE can be great as a teaching tool, and just to help people get a taste of the language. I did something similar for Clojure in a previous life, which worked out very well: https://github.com/bodil/catnip Obviously, these things aren't suited for serious development, but they're great for adoption and training, and shouldn't be discounted just because Emacs (or your favourite pretender to the editor throne) is obviously the superior choice. Speaking of editors, please look to Idris: one of its core pieces of tooling is a lightweight API for IDE-ish features that can be easily plugged into any editor. Even something like ghc-mod and hlint would be a really good start. The PS editor experience right now is rather uninspiring next to Haskell and Idris, and even JS. |
@bodil Thanks for your thoughts! |
Bower's indeed the best dependency management system I've run across, allowing one to cleanly state: I depend on this version of this project from this URI. Couldn't be simpler than that. It's the the combination of tools that throws off people new to the ecosystem, and that's where a tool like pulp can really shine. |
-- edit |
Hey so, @garyb suggested I mentioned some issues I've ran into with my first 24 hours in Purescript over here. First off I realise the language is still being actively developed so some of the stuff I guess should be expected. I got past installing the compiler, but I already had cabal installed & I knew how to use sandboxes, and all that node stuff. Anyways the main struggle I had was getting libraries to work, the most confusing one for me was What would have gone along way for me to build this project would have being told to use something like I also tried a bunch of different libraries each with their own struggles
I really just wanted to build a UI of some sorts, so I tried a bunch of different libraries for it and still don't really know if there's a go to suggested library for this kind of thing. Edit: One last thing, I will say so far people have been pretty helpful with responding to issues (so thanks for that), and I think the fact this language exists is awesome |
You might like to look at |
Thanks I'll be sure to check that out
|
@paf31 do you think it might be worth revising the book to use Also the point in there about only making binaries for major versions isn't quite true anymore either, certainly not since the 0.6.x release cycle. |
Echo's my feelings a bit http://blog.jenkster.com/2015/02/a-brief-and-partial-review-of-haskell-in-the-browser.html
|
I went with @garyb purescript.org's download page should have a Package Manager section below Binaries, for |
Totally agree, it's even their mantra.
You should submit a PR around here: https://github.com/purescript/purescript.github.io/blob/master/download/index.html#L41 There are two packages in the AUR that i'm aware of: https://aur.archlinux.org/packages/?O=0&K=purescript. Nix has it. You can search for it here: https://nixos.org/nixos/packages.html. I don't really follow the other distros though. |
purescript/purescript.github.io#18 merged. A maintainer should upload the Windows binary to chocolatey. As for a getting started vision, purescript.org probably needs a Packages tab with text similar to purescript/purescript.github.io#17 and a link to Pursuit |
I think |
One way to "solve" this might be to do what elm does... that is, make "elm" just a catchall command for all sub-commands,... and if bower is just an alias - ie the subcommand for "ps-package", all good :) |
I was chatting with @joneshf on IRC about this and he suggested I bring it up with the project.
The getting started story for
psc
is not ideal. It at least requires:grunt
andpsc
,psc-make
, etc.It seems like it should be more along these lines:
Maybe it would help if the
ps
community defined an ideal vision and then worked backwards from there to accomplish the engineering feats required. I thinkMeteor
andElm
are exemplary in regards to their workflow stories. MaybeClojure
/Clojurescript
too, I don't know. It does seem that right now the biggest challenge to working withps
is the space between:Ideally, the gap should be almost invisible to the user.
If
ps
is not approachable then it really does not matter how good it is. People do not want to consult a reference on how to build a project, buffer that knowledge, then flush it at once, and repeat. They want short trial-and-error cycles with really quick and useful feedback.The text was updated successfully, but these errors were encountered: