HNHacker News
TopNewBestAskShowJobs

purescript

96 karma · joined November 12, 2014

purescript.org
submissionscomments
purescript··on Haskell as a JavaScript MVC framework
s/minor/major
purescript··on Pure Script
/s/Pure Script/PureScript :)
purescript··on Why OCaml, why now? (2014)
Right now, the translation is very direct. My basic rule of thumb is - only perform those optimizations which the user opts into. Some things are standard though, like a few inlining rules and tail call elimination, but the plan is to provide a rewrite rules engine so that the developer can be as fine-grained as they like when it comes to optimizations.
purescript··on Why OCaml, why now? (2014)
I can't really comment on source maps in Elm, but the approach in PureScript has been to generate clean, readable JS which is debuggable directly. Source maps are on the roadmap, but not really a priority right now. I haven't heard any complaints about the ability to debug compiled PureScript yet.
purescript··on Why OCaml, why now? (2014)
I won't argue that Elm does anything other than an exemplary job at #3, but it is worth noting that there are some interesting efforts to build similar functionality in PureScript libraries:

https://github.com/paf31/purescript-thermite

https://github.com/kRITZCREEK/reactive-psc

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

https://github.com/michaelficarra/purescript-demo-mario

https://github.com/mechairoi/purescript-frp-rabbit

To me, this is the benefit of PureScript - yes, you have to do a little more work, because you don't get these things for free from the compiler and tools, but you gain complete control over your application structure. You're not forced to work in some ambient Signal category.

purescript··on Replace CoffeeScript with ES6
Maybe https://github.com/paf31/purescript-thermite ...
purescript··on Write You a Haskell: Building a modern functional compiler from first principles
I tried to change the whitespace rules in the PureScript parser to match Haskell recently (to support explicit braces), and it proved to be very difficult. The "L" function which is defined in the Haskell 98 Report depends heavily on an interaction between the lexer and parser, in which a failed parse causes the indenter to behave differently in the lexer. For this reason, I stayed with the simpler rules that we have now, and I plan to support explicit braces in the parser instead.
purescript··on Functional Programming Patterns
> There is purescript but its a large layer over javascript and even a simple hello world results in a 2000 LOC compilation of javascript.

This really depends on which compilation route you take. `psc-make` will include all of the Prelude and compile to CommonJS modules, which can result in quite a bit of code, but `psc` will trim out all unused functions, and should result in about 10 LOC for Hello World.

← PreviousPage 2 of 2