21

PureScript looks very similar to Haskell. It seems to me that large parts, mostly the pure parts, of a PureScript program should be compilable as well by a Haskell compiler. Is that right?

This leads to a related questions: Would it be possible to share code between a Haskell server backend and a PureScript frontend, e.g. data structures, form validations?

Thomas Koch
  • 2,833
  • 2
  • 28
  • 36
  • 5
    From their website "PureScript is a small strongly, statically typed programming language with expressive types, written in and inspired by Haskell, and compiling to Javascript." I imagine there are plenty of differences, but the gist of the language is that they are very similar. A quick glance shows me that tuples aren't the same between Haskell and PureScript, and likely many other types. – bheklilr Oct 30 '14 at 20:55

2 Answers2

28

This is still a work in progress, but here are some of the differences for a start. We should have a new site soon that will make this kind of information easier to find!

cmaher
  • 5,100
  • 1
  • 22
  • 34
gb.
  • 4,629
  • 1
  • 20
  • 19
  • is there also a list of rationales/reasonings for the differences? while some things in PureScript are nicer than the counterparts in Haskell, some seem unpurposeful. – Erik Kaplun May 23 '15 at 20:24
  • No, sorry, not at the moment. There's still a TODO at the bottom of that article for listing pros and cons of the differences, and also to document things that are different just because we've not gotten around to implementing them yet. – gb. May 24 '15 at 13:36
0

Sharing code is good thing to have and it eliminate lot of redundancy, however, you might share type between ps and haskell using purescript bridge.

However, to gain more control of sharing code, I think you should use the same language on both the front end and backend and I think this is one of the main reason reflex was created.

If you are more into reactjs and flux architecture you can use react-flux and I heard that some people using it in production with good sucess.

Evgeny
  • 4,173
  • 2
  • 19
  • 39
khaled alomar
  • 673
  • 4
  • 25