Tierless web framework with Javascript?

2019-03-27 08:44发布

问题:

Links is a lisp-like functional web programming language/framework that makes it easy to write a single piece of code that is compiled to server-side code, client-side JS and HTML, thus making it much easier to write web applications. Since there really is no distinction between the client and server side, they call it "tierless" programming. With the advent of Server-side JS, are there any comparable frameworks with JS? Note that I don't just mean writing server side and client side code in the same language, but writing server-side and client-side functions that can call each other and generate the HTML. Have a look at Links or HOP to get a better idea for what I am talking about. Is there a tierless web framework for JavaScript?

回答1:

I've read a little about Jaxer: http://jaxer.org



回答2:

I believe NowJS fulfills the criteria for a tierless JS web framework.



回答3:

You want node.js or bikechain.js @getify calls it the middle-end to have javascript executed on both the server side and client side for the same results. A good example of use is validation. Why write it in two languages when you can write it once in JS and have to run on both the client and the server.

See: http://blog.getify.com/2010/07/how-to-begin-your-middle-end/

And: http://blog.getify.com/2010/07/why-node-js-rocks-the-middle-end/



回答4:

Most of the languages mentioned here actually generate JavaScript for the client-side and some also for the server-side.

Meteor and NodeJS can be seen as tierless frameworks, but in my opinion they doe not 100% satisfy the definition of a tierless language. In a true tierless language one should not need to think in terms of client and server, but just in terms of a program. Most tierless languages nowadays require one to annotate pieces of code to mark the distribution, like in Links, Opa, ML5, Hop etc.