Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Server-Side javascript framework

I'm looking to replace PHP with something better (everybody seems to say that PHP is evil, right ?), and considering server-side JavaScript.

node.js seems very popular, but I'm afraid I'll go crazy with asynhronous stuff. Is it possible to write normal (synchronous) code under node ?

My whishlist: web and command-line scripting, good performance (on the The Computer Language
Benchmarks Game
, V8 seems to be an order of magnitude faster than PHP), preferably developed by some company or community so that it will not be just abandoned someday, user community with a decent modules library.

I don't consider various frameworks based on Rhino, as Rhino runs in Java, and I'm not into Java, aware of it's memory footprint, and the whole idea of compiling javascript to java makes no sense to me.

Spent some time googling, and found numerous projects: Myna, Meteor, GromJS, APE, GLUEscript, v8cgi, silkjs, wakanda, GPSEE, sorrowjs, ejscript, Persevere, PhantomJS.

Does somebody have any experience with those ? Any recommendation are welcome.

like image 868
Sandman4 Avatar asked Jul 14 '12 21:07

Sandman4


People also ask

Which framework is used for server-side JavaScript?

Node. js is a server-side JavaScript run-time environment, which works on cross platforms and is open-source. The framework is capable of driving asynchronous I/O with its event-driven architecture.

Can JavaScript run on server-side?

Server-side code can be written in any number of programming languages — examples of popular server-side web languages include PHP, Python, Ruby, C#, and JavaScript (NodeJS).

What is a server-side framework?

A server side framework typically uses a programming language with a compiler and runs on a Web server, such as Node, PHP and ASP.NET. The client-side framework is usually a JavaScript library and runs in a Web browser, such as React, Angular and Vue.

Is node js a server-side framework?

Introduction: Node. js is a platform designed to build network applications. It is a server-side, open-source environment that allows you to develop a scalable network application. It makes use of JavaScript for writing the code which can be run in the Node.


2 Answers

Well Node.JS is the way to go if you ask me. You can write synchronous code, BUT only do that in command line scripts. When writing a web servers you have to go the async route otherwise it will not perform because JavaScript is single threaded and everything comes to a halt.

The reason Node.js is so fast is because of asynchronous IO.

You will get used to callbacks and eventing and after a while you don't want to go back.

Node.js is a platform built on Chrome's JavaScript runtime for easily building fast, scalable network applications. Node.js uses an event-driven, non-blocking I/O model that makes it lightweight and efficient, perfect for data-intensive real-time applications that run across distributed devices.

like image 99
Split Your Infinity Avatar answered Sep 18 '22 06:09

Split Your Infinity


Meteor. Built on top of Node.js and growing very fast.

In Meteor, your server code runs in a single thread per request, not in the asynchronous callback style typical of Node. We find the linear execution model a better fit for the typical server code in a Meteor application.

UPDATE One year later - Why Meteor

like image 44
Dan Dascalescu Avatar answered Sep 19 '22 06:09

Dan Dascalescu