elm / elm-lang.org

Server and client code for the Elm website.
http://elm-lang.org/
BSD 3-Clause "New" or "Revised" License
1.99k stars 365 forks source link

Document that it only works in the browser #562

Closed rattrayalex closed 8 years ago

rattrayalex commented 8 years ago

I expected to be able to run elm code in Node. It seems this isn't possible; would be awesome if you could document the answer prominently.

evancz commented 8 years ago

Why did you expect it? Where on the website would you suggest this information goes such that you will see it?

rattrayalex commented 8 years ago

I expected that a language that compiles to JavaScript would just output JavaScript, which should be able to run anywhere that JavaScript runs. I also expected to be able to import npm modules, and export code that could be imported from npm modules.

When trying to get started, I tried writing a small program to follow along with the "language syntax" guide, since I don't enjoy using REPL's when learning. I was unable to run this program.

I'm not sure where it should go; certainly in the guide, possibly elsewhere as well.

Sidenote: it was also unclear that (or if?) main must be a Program, and what that is. Would also be nice to document main, Program, etc in the guide. I don't have a problem with The Elm Architecture, but when learning a language I'd like to be able to learn just the code.

I hope this is helpful. It looks like a promising language and a clean architecture; it seems the applicable use-cases and documentation might be a bit too limited for me at this time.

rattrayalex commented 8 years ago

Sorry, to be more clear: it appears that Elm is a single-purpose programming language: it builds web UI's in HTML/SVG. If true, this should be more explicit.

evancz commented 8 years ago

I get what you are saying. I am not able to support this parallel learning path that you prefer at the moment. It is better to just have one path and hope that most people are okay with that.

I do think the home page makes it pretty clear with things like "the best of functional programming in your browser" and the prominent example of HTML. If there are specific places where additional notes would be helpful, we can talk about those specific places.

Ultimately, I can't revamp the guide for your perspective, but it will be improving on stuff like main as I finish it up!

rattrayalex commented 8 years ago

Makes sense.

As a reader, "in your browser" sounded more like a feature than a limitation. All I'm asking for is a sentence in the docs to reaffirm that it doesn't work outside of the browser.

manonthemat commented 7 years ago

I just noticed, that browsers like lynx are not capable of using elm (while wanting to look up something in the documentation). To be fare, I also just noticed that a page of mine using react doesn't render in that browser.