Live data from Hacker News

A sliding puzzle, built with Elm

moroshko.github.io

11–20 of 23 posts

Re: A sliding puzzle, built with Elm

#11
post #9
post #7

Earlier quoted context omitted.

The game is solvable -- no tricks, just something you've overlooked. (Hint: Someone who doesn't know about parity might try scrambling the puzzle randomly, then find that they can reach the goal state about half of the time.)

Is the thing I've overlooked that there are two As?

Yes - easily solvable when you flip the A's

Re: A sliding puzzle, built with Elm

#12
post #3

It's a nice interface. I'm glad arrow keys, the first thing I tried, work. But you're not going to trick me into looking for a sequence of moves that change the parity of the underlying permutation.

I wanted to win, so I just changed the goal to P,L,A,Y,T,H,I,S,G,A,M,E,W,O,N, which is solvable ;)

It's a proof of concept I imagine

Re: A sliding puzzle, built with Elm

#13

Source code: https://github.com/moroshko/sliding-puzzle

That code is so -erm- pretty. And by popular accounts, Elm is a pleasure to develop with. I hope it catches on.

I'm pretty keen to play with Elm, but it gives me some pause that an app like this (or the demo at https://github.com/evancz/start-app) results in... 11k lines of Javascript. Nevertheless, these talks got me bulled up on Elm: https://www.youtube.com/watch?v=FV0DXNB94NE (Richard Feldman, collegially, on React -> Elm) / https://www.youtube.com/watch?v=oYk8CKH7OhE (Evan Czaplicki on the motivation for Elm)

Re: A sliding puzzle, built with Elm

#14

Earlier quoted context omitted.

That code is so -erm- pretty. And by popular accounts, Elm is a pleasure to develop with. I hope it catches on.

I'm pretty keen to play with Elm, but it gives me some pause that an app like this (or the demo at https://github.com/evancz/start-app ) results in... 11k lines of Javascript. Nevertheless, these talks got me bulled up on Elm: https://www.youtube.com/watch?v=FV0DXNB94NE (Richard Feldman, collegially, on React -> Elm) / https://www.youtube.com/watch?v=oYk8CKH7OhE (Evan Czaplicki on the motivation for Elm)

That's because the Elm compiler doesn't yet do much in the way of "dead code elimination" (DCE).

However, that will change in a future release of Elm, once Joey Eremondi's work has been fully integrated. My understanding is that integration is not slated for the 0.16 release (imminent) but will likely be part of the 0.17 release.

See: https://groups.google.com/forum/#!searchin/elm-dev/dead$20co...

Re: A sliding puzzle, built with Elm

#15
I'm so fascinated by Elm. What a great addition to the world of JS tooling. I wish had more time to spend on it, but the Haskell syntax, the strict typing, the Haskell compiler, and reactive JS model, the emphasis on graphic UI building as a native language feature, all just really great and relevant ideas.

Re: A sliding puzzle, built with Elm

#16

Earlier quoted context omitted.

I'm pretty keen to play with Elm, but it gives me some pause that an app like this (or the demo at https://github.com/evancz/start-app ) results in... 11k lines of Javascript. Nevertheless, these talks got me bulled up on Elm: https://www.youtube.com/watch?v=FV0DXNB94NE (Richard Feldman, collegially, on React -> Elm) / https://www.youtube.com/watch?v=oYk8CKH7OhE (Evan Czaplicki on the motivation for Elm)

That's because the Elm compiler doesn't yet do much in the way of "dead code elimination" (DCE). However, that will change in a future release of Elm, once Joey Eremondi's work has been fully integrated. My understanding is that integration is not slated for the 0.16 release (imminent) but will likely be part of the 0.17 release. See: https://groups.google.com/forum/#!searchin/elm-dev/dead$20co...

Are they planning to leverage the Google Closure compiler the way Clojurescript does? Un-optimized Clojurescript is also huge until it runs through Closure compilation.

Re: A sliding puzzle, built with Elm

#17

Earlier quoted context omitted.

That's because the Elm compiler doesn't yet do much in the way of "dead code elimination" (DCE). However, that will change in a future release of Elm, once Joey Eremondi's work has been fully integrated. My understanding is that integration is not slated for the 0.16 release (imminent) but will likely be part of the 0.17 release. See: https://groups.google.com/forum/#!searchin/elm-dev/dead$20co...

Are they planning to leverage the Google Closure compiler the way Clojurescript does? Un-optimized Clojurescript is also huge until it runs through Closure compilation.

I should have read that thread first; it appears the answer to my question is "yes".

Re: A sliding puzzle, built with Elm

#18

Earlier quoted context omitted.

That's because the Elm compiler doesn't yet do much in the way of "dead code elimination" (DCE). However, that will change in a future release of Elm, once Joey Eremondi's work has been fully integrated. My understanding is that integration is not slated for the 0.16 release (imminent) but will likely be part of the 0.17 release. See: https://groups.google.com/forum/#!searchin/elm-dev/dead$20co...

Are they planning to leverage the Google Closure compiler the way Clojurescript does? Un-optimized Clojurescript is also huge until it runs through Closure compilation.

No, I believe the DCE implementation (still in the works) is specific to the Elm compiler, as opposed to an implementation which organizes the source in such a way as to leverage Google's Closure compiler.

Re: A sliding puzzle, built with Elm

#19
Elm looks absolutely fascinating to me, but one of the things that strikes me is odd is the prevalence examples that eschew markup for the canvas. Not a bad thing per se, but definitely a departure from what most JS Frameworks and tool sets show off.

Re: A sliding puzzle, built with Elm

#20

I'm so fascinated by Elm. What a great addition to the world of JS tooling. I wish had more time to spend on it, but the Haskell syntax, the strict typing, the Haskell compiler, and reactive JS model, the emphasis on graphic UI building as a native language feature, all just really great and relevant ideas.

There's also PureScript, which is a little more "apples to apples" with Haskell. Both the Elm and PureScript compilers are written in Haskell.

http://www.purescript.org/

https://leanpub.com/purescript/read

Also, some of the ideas from Elm are having an influence in the PureScript ecosystem.

For example: https://github.com/bodil/purescript-signal

See also: https://github.com/slamdata/purescript-halogen

Post reply on HN