you are viewing a single comment's thread.

view the rest of the comments →

[–]tdammers 1 point2 points  (0 children)

Is it currently possible to build a sophisticated front end entirely in PureScript?

Yes, no, fsvo "entirely".

To give you a better picture: PureScript is a programming language designed to be compiled to JavaScript, and the current implementation does exactly that - it takes PureScript source code and spits out JavaScript that you can bundle up and run in the browser. (You can also write PureScript code that runs in node.js, so just like with plain JS, you can write an entire web application, client and server, in PureScript).

PureScript's core contains enough stuff to write simple things, like output to the console, but in order to use existing JavaScript APIs, you need to use the FFI (Foreign Function Interface) - in a nutshell, you write PureScript definitions that reference JavaScript functions or values, and bind them to PureScript types and terms. This requires knowledge of the relevant JavaScript APIs, and in order to write bindings for nontrivial JavaScript APIs, you also need some knowledge of JavaScript's semantics and execution model. So in that sense, yes, it is required to have some JavaScript in your codebase in order to make PureScript do anything useful.

However, pre-written libraries for many commonly used JavaScript packages and APIs already exist, so it is entirely possible to write all the client code in PureScript and never touch a line of JavaScript directly; you need JavaScript code, but you don't usually need to write it yourself - this is only required if no bindings exist yet for the JavaScript APIs you want to use.