So where is PureScript positioned related to this? Let's say I'm writing a backend in Ruby or Python and not Haskell, why PureScript instead of CoffeScript or sweet.js?
(I'm actually interested in this, not intended as a put-down.)
Of course, one of the best things about AltJS is the interoperability with other languages. PureScript won't be the best tool for every case, but it has a simple FFI. It's possible to write complete front-ends in PureScript, but I'd love to see more examples where PureScript is used alongside something else (I've used TypeScript with PureScript successfully, for example).
Personally, it surprises me that with all the years of extensions to ECMAScript, nobody has added 1) sized integer types like word32, word64, and so on, and 2) transparent bignums, similar to int/long in Python.
I mean there are several compilers from langs with strong type systems, such as F#->JS with FunScript, and in those, usually the source lang has integers...
For the cases you mention the checks would simply be: integer * integer = integer, integer + integer = integer. Problems only arise when real/floating point numbers are introduced and how to handle integer division.
If your claim is that no compiler in existence can make these kinds of checks at compile time, that's not true. Any dependently-typed language can do this (Idris, Coq, Agda, ATS). In fact, even a language with refinement types can do this, like Liquid Haskell.
And a number of languages do these checks at runtime: Ada and Nimrod are two that come to mind.
The reason I have been against the idea so far is that an integer type is easily accomplished using the FFI and user code. Here is one example (not quite what you're asking for, but hopefully instructive): https://github.com/darinmorrison/purescript-int64
It sounds like there are adapters to few popular frameworks, like React [2] and Angular [3].
[1] https://leanpub.com/purescript/read#leanpub-auto-the-eff-mon... [2] https://github.com/purescript-contrib/purescript-react [3] https://github.com/purescript-contrib/purescript-angular
I'm guessing a JS-controlled framework, like React or Mithril, would be a better fit if you choose to use PureScript as a core piece of your app, as they are function-based, like PureScript.
If you prefer dynamically-typed languages, use them directly (JS, CoffeeScript, etc.)
If you prefer statically-typed languages, you must care about a dynamically-typed language, since every statically-typed language can be thought of as a dynamically-typed language + a machine-checkable safety net. For example, Haskell/ML/etc. are built on Lambda Calculus, C/FORTRAN/etc. are built on machine code. If you're programming for the Web, why not use JS as the dynamic part of your language (the "computational content")?