When comparing PHP vs PureScript, the Slant community recommends PureScript for most people. In the question“What are the best (productivity-enhancing, well-designed, and concise, rather than just popular or time-tested) programming languages?” PureScript is ranked 17th while PHP is ranked 59th. The most important reason people chose PureScript is:
Has Typeclasses and RankNTypes
Ranked in these QuestionsQuestion Ranking
Pro One of the most common languages
According to the 2015 Stack Overflow Developer Survey (26,086 people surveyed), PHP was the 5th most popular/used language at 29.7%.
Pro Lots of tutorials online
Pro Used by most common CMS platforms
Many clients are looking for an easy-to-update web site that's flexible and free. Drupal and Wordpress fill those needs very well.
Pro Most prominent language for web applications
Part of the de facto standard web application stack.
Pro Great third-party package manager
PHP standard library is somewhat subpar, but if you need plugins, language features, composer has them all( you can even puzzle together a custom framework from composer).
Since 7.x was released, PHP has become a pretty fast language.
Pro Lots of PHP frameworks available which help with development
PHP people love frameworks, and with frameworks such as Laravel, you can build a web app or API really fast (Facades, ORMs, scaffolding etc.)
Pro Great documentation
Pro Higher kinded types
Has Typeclasses and RankNTypes
Pro High performance FFI code
Pro Type safety
Compiling should be your first unit test. A tight type system (static and hopefully strong) will catch many logic errors that are often difficult to spot through debugging. In languages like PureScript, if it compiles, it often runs properly.
Pro Has row polymorphism and extensible effects
Pro Modules can be compiled to CommonJS
Pro Pure functional language
You cannot have side effects, unless a function is explicitly defined as so.
FFI system is quite good and easy to use. You can import functions curried or not curried. Records and arrays use native JS objects and arrays.
Pro Awesome web frameworks
Halogen (VDOM, similar to ELM)
And hit these up with Signals, Isolated/(Managed?) Components, powerful functions and FFI
Con Poorly designed language
Despite its widespread use, PHP is generally looked upon poorly from a design point of view. The consistency of function names and function argument order, lazily and borderline non-functional implementation of object oriented programming, can only receive requests via POST methods, slow version adoption (the PHP you learn right now may not work on every webserver you'll work on), and a focus on "hacking things together" rather than "doing it right". These are all very common complaints when it comes to working with PHP. While not a bad language to learn, PHP is not at all a good language to learn first, as it will probably teach bad habits.
Con Immense catalog of insecure frameworks
The most serious security problems in websites on the web today are almost universally found in popular PHP frameworks, CMS platforms, libraries and code samples, almost all stemming from poor language design, bad tutorials and awful resources.
Con Most tutorials are out of date
A lot of very bad tutorials are still widely circulated among beginners, and these tutorials teach very poor programming practices.
Con Most resources are poorly-written
Few resources exemplify the "correct" or secure use of features.
Con Interpreter being too permissive
If you forget the dollar sign, the variable name will be converted to a string.
Con Lack of good IDE/tooling support
Con Lots of dependencies needed to get started
Purescript is written in Haskell, but meant to be used with Node.js. As a result, to get started , users must install ghc, cabal, node.js, grunt, and bower. Purescript also has its own compiler, and different semantics form Haskell, and so even after installing, there's still some overhead to getting productive with Purescript.
Con Slow compilation
On large project, for example Halogen
Con Restrictive FFI