21
votes

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?

2
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

2 Answers

28
votes

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!

0
votes

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.