elm-guides / elm-for-js

Community driven Elm guide for JS people
229 stars 21 forks source link

Consideration: call out when Haskell bleeds through #7

Open netaisllc opened 9 years ago

netaisllc commented 9 years ago

Coming strictly from a JS background, it can be quite problematic to distinguish between Elm specifics and Haskell concepts that have been borrowed, extended or used.


Case in point: Today I was puzzled over a particular use of Just in StartApp.simple.

My learned process:

  1. Scour Elm docs === nothing specific
  2. Search elm-discuss === quite difficult to isolate 'Just' from casual uses of the word; no help
  3. Assume it's actually part of Haskell, and find this helpful snippet on SO.

The point being there are (n) cases of this that will stumble up the garden-variety JSer who, like me, knows only that Haskell is another language. (You can see this frequently in elm-discuss.)

Now there is no problem with this, given what Elm is and purports to be, but if a catalog can be started, it would be a huge help.

Or at the very least an admission somehow, somewhere 'upfront' that Elm borrows from Haskell and the learner should be ready to seek some answers outside the Elm world he/she has entered.

mgold commented 9 years ago

I disagree that the problem is "you need to seek answers from Haskell". I think the problem is that the Elm docs are not sufficiently visible.

In particular, searching for Just in the core package search doesn't turn up anything. It probably should. Since going to the docs was your first inclination, we need to make that fruitful. I've filed elm-lang/package.elm-lang.org#92 to that effect.

jamischarles commented 9 years ago

I agree that long term you shouldn't have to even know that Haskell exists. For the time being Haskell docs are more mature (simply due to being around longer).

I found myself going through tryhaskell.org to understand Elm better (but was confused once or twice).

I think the solution here is better Elm docs, and more approachable to JS people who don't even know that Haskell exists.

I really really want a tryelm.org that is just like tryhaskell.org.

mgold commented 9 years ago

Have you seen elm-lang.org/try? Granted it's a file-like document, not a repl.

Haskell docs are more mature, but they're also more confusing, both because they reference language features Elm doesn't have (like type classes) and because the people who wrote them have PhDs in math.

jamischarles commented 9 years ago

and because the people who wrote them have PhDs in math

Lol.

I've tried the link above. It's great for seeing a simple program.

What it's lacking is a tutorial that teaches you syntax as you go

jamischarles commented 9 years ago

Most languages have a very simple "try" page that teaches you the syntax. I've used it for Haskell, Clojure and Erlang. It's super fun and is the easiest way I have seen to significantly lower the barrier to entry.

netaisllc commented 9 years ago

@mgold. I agree with your disagreement. My point is that the current state of the Elm docs leaves someone new to Elm and Haskell no choice but to look outside the Elm world.

@mgold, @jamischarles As far as Elm-try goes, it's awesome. But the examples - though very worthwhile - "leave a lot of value on the table" because they mostly lack any comments or explanation. They are very useful to show how but not helpful about the why.

As far as a dedicated entry-point to the Elm for people coming from the traditional webapp stack (if there is such a thing...), I thinking is: it is absolutely needed. Part of the challenged Elm faces is that it is/could be attractive to a wide range of devs with a wide variety of backgrounds.

Having a "this is for you" type of entry point is a proven technique to get people of that "ilk" engaged.

I'd be one to contribute to that effort.

mgold commented 9 years ago

I agree with what you're saying. If you want to improve the examples, have at it and send a PR. Many times an example fails to generalize: "okay, I get how this works, but why is it not any one of these other things? How would I do something slightly different?". Comments can help with this.