Node JS:
Compiled to native code, single-threaded, lots of libraries
(JS can open multiple webworkers but these webworkers run on raw code, no libs)

Some_Object = {
  Property1:"value-1",
  Property2:["value-2","value-3"]
};

Python:
Not compiled to native code, multi-threaded, lots of libraries

Some_Dict = {
  "Property1":"value-1",
  "Property2":["value-2","value-3"]
}

PHP:
Not compiled to native code, multi-threaded, lots of libraries
(PHP can run as stand-alone web server without Apache: http://php.net/manual/en/features.commandline.webserver.php)

Some_Array = array(
  "Property1" => "value-1",
  "Property2" => array("value-2","value-3")
);

C++11 (and above):
Compiled to native code, multi-threaded, lots of libraries
(C++ can not have mixed types in vectors or maps, this is not so flexible. Thus boost::any can be used to make it flexible and values can be specified inline with types next to them)

using namespace std;
using namespace boost;

map<string,any> Any_Map = {
  {"Property1", "value-1"},
  {"Property2", (vector<any>){"value-2","value-3"}}
};

C# (C-Sharp):
Not compiled to native code, multi-threaded, lots of libraries

var Some_Object = new {
  Property1 = "value-1",
  Property2 = new object[]{"value-2","value-3"}
};

Perl (also Perl6):
Not compiled to native code, multi-threaded, lots of libraries

%Hash_Object = (
  "Property1","value-1",
  "Property2",["value-2","value-3"]
);

Other Languages:
Most of other popular languages including Java can’t put JSON or JSON-like literally in code.

Performance:
This is a sad true but Python is very slow!

C++ = 10 times C# = 10 times Node JS = 100 times Python = 100 times PHP = 100 times Perl

Advertisements