Has Typeclasses and RankNTypes
Ranked in these QuestionsQuestion Ranking
Pro Strongly typed, good tooling
That's Java, so it is strongly typed, and we can use fully the IDE: error detection, refactoring, auto-completion, etc.
Pro Familiar for Java developers
Perfect if you have a strong background in Java programming, and need to code for the client side.
Produced JS is highly optimized, can be separated in modules with lazy loading, can be internationalized while loading only the chosen language.
Pro Fantastic IDEs
Because Java is statically typed, integrated development environments (IDEs) for Java can provide a lot more feedback on errors you will encounter. Java IDEs can give you specific errors in the location where they occur without having to run the code every time. This makes is faster to debug and learn from your mistakes.
IDEs also have extensive auto complete capabilities that can help you learn the programming libraries you are using faster and tell you what functions are available.
Pro Most commonly used language in industry
Pro Consistent programming standards
Most Java code follows very standardized coding styles. This means that when you're starting out, there are fewer questions about how you should implement something as the programming styles and patterns are well established and consistent. This consistent style means that it's often easier to follow others' example code, and that it's more likely to meet at least a certain minimum standard of quality. This discipline with consistent stylistic standards also becomes useful later, when collaborating on projects with larger teams.
Pro Higher kinded types
Has Typeclasses and RankNTypes
Pro Modules can be compiled to CommonJS
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
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 Pure functional language
You cannot have side effects, unless a function is explicitly defined as so.
Pro Awesome web frameworks
Halogen (VDOM, similar to ELM)
And hit these up with Signals, Isolated/(Managed?) Components, powerful functions and FFI
Con Too verbose
- A Hello world needs package, class, static method and the actual
- Reading a line from input requires instatiating 5 objects in the right order.
- Exceptions are everywhere, particularly since all values are nullable.
- Java has a getter/setter culture, but without native syntax support.
- portable Java code lacks anonymous functions, and continues to lack good support for partial application, compensating instead with verbose design patterns, kludges like anonymous inner classes, or just inline code.
- It is statically typed without type inference, with a culture that promotes long class names.
- Poor support for sum-types and pattern matching leads to overuse of inheritance for dynamic dispatch and chains of nested conditionals
Especially for beginners, this can make reading Java code feel overwhelming; most Java courses tell students to simply copy, paste, and ignore a significant percentage of the code until they've learned enough to understand what it means.
For experienced programmers, this makes Java feel tedious, especially without an IDE, and actively discourages some solutions and some forms of abstraction.
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 Lack of good IDE/tooling support
Con Slow compilation
On large project, for example Halogen
Con Restrictive FFI