NekoVM
Original authorNicolas Cannasse
Developers
Initial release2005; 21 years ago (2005)
Stable release
2.3.0 / October 24, 2019; 6 years ago (2019-10-24)
Written inC
Operating systemWindows, macOS, Linux
PlatformIA-32, x86-64
LicenseMIT
Websitenekovm.org/doc/vm
Repository

NekoVM is a virtual machine developed by Nicolas Cannasse as part of research and development (R&D) efforts at two independent video game developers in Bordeaux, France: first at Motion Twin and then at Shiro Games. NekoVM's native language is the bytecode for a high-level dynamically typed programming language called Neko. This pairing allows Neko to be used directly as an embedded scripting language, or to target NekoVM by compiling another language (such as Haxe) to NekoVM bytecode.

Concept

edit

Neko has a compiler and a virtual machine (VM) with garbage collection. The compiler converts a source .neko file into a bytecode .n file that can be executed with the VM. Since Neko is dynamically typed with no fixed classes, a developer only needs to find the proper runtime mapping (in contrast to data type mapping) so that code executes correctly. As the Neko FAQ puts it: "...it is easier to write a new or existing language on the NekoVM than it is for the CLR / JVM, since you don’t have to deal with a highlevel type system. Also, this means that languages can interoperate more easily since they only need to share the same data structures and not always the same types."[1]

Neko requires compiling before executing, like other scripting languages such as Apache Groovy. Since Neko need not be interpreted at runtime, it executes faster. The Haxe language can compile to Neko code, among other targets.

Virtual machine

edit

The Neko virtual machine is used to execute a Neko bytecode file, the VM also has the option to convert a bytecode file into an executable file (output changes depending on the target operating system).

Language

edit
Neko
NekoVM logo
ParadigmMulti-paradigm: object-oriented, structured, prototype-based, scripting
Designed byNicolas Cannasse
Developer
First appeared2005; 21 years ago (2005)
Stable release
2.3.0 / October 24, 2019; 6 years ago (2019-10-24)
Typing disciplineDynamic
Implementation languageOCaml
PlatformNekoVM
OSWindows, macOS, Linux
LicenseMIT
Filename extensions.neko .n
Websitenekovm.org/specs/syntax

Hello World

edit
$print("Hello World!");

Type conversions

edit
$int("67.87"); // Converts string "67.87" to integer 67
$float(12345); // Converts integer 12345 to float 12345.0000
$string($array(1,2,3)); // Converts array [1,2,3] to string "[1,2,3]"

Objects

edit
o = $new(null); // new empty object
o2 = $new(o); // makes a copy of o
o2 = $new(33); // if parameter is not an object, throw an exception
o.field = value; //sets field to value
o.field; // returns "field" value of object o

Methods

edit
foo = function() {
	$print(this.x);
}
o = $new(null);
o.x = 3;
o.bar = function() {
	foo();
};
o.bar(); // prints 3

Function scope

edit
var x = 3;
f = function() {
	$print(x);
}
x = 4;
f(); // print 3

Prototypes

edit
var proto = $new(null);
proto.foo = function() {
  $print(this.msg)
}

var o = $new(null);
o.msg = "hello";
$objsetproto(o,proto);
o.foo(); // print "hello"

$objsetproto(o,null); // remove proto
o.foo(); // exception

Web functionality

edit

Neko includes Apache server modules mod_neko for Neko language and mod_tora for hosting the NekoVM application server tora. As such, it can process user input using GET and POST requests:

get_params = $loader.loadprim("mod_neko@get_params",0);
$print("PARAMS = "+get_params());

See also

edit

References

edit
  1. ^ "How is Neko different from .Net's CLR or the Java's JVM ?". FAQ. NekoVM. Retrieved 2021-03-28.
edit

📚 Artikel Terkait di Wikipedia

List of programming languages

Mohol Mojo MOO Mortran Mouse MPD MSL MUMPS MuPAD Mystic Programming Language (MPL) Napier88 NASM Neko NELIAC Nemerle NESL Net.Data NetLogo NetRexx NewLISP

Neko (software)

com/suzannem/neko/ - A Neko kitty collection (and download) Neko in Golang - A cross-platform open-source version write in Go (programming language).

Neko Case

Neko Richelle Case (/ˈniːkoʊ ˈkeɪs/ NEE-koh KAYSS; born September 8, 1970) is an American singer-songwriter and member of the Canadian indie rock group

List of C-family programming languages

Notable programming sources use terms like C-style, C-like, a dialect of C, having C-like syntax. The term curly bracket programming language denotes

Prototype-based programming

Prototype-based programming is a style of object-oriented programming in which behavior reuse (known as inheritance) is performed via a process of reusing

Haxe

Haxe is a high-level cross-platform programming language and compiler that can produce applications and source code for many different computing platforms

Neko Saito

stage name Neko Saito (斎藤ネコ, Saitō Neko), is a Japanese violinist, conductor, composer and music arranger. Saito is the leader of the Saito Neko Quartet

The Wonderful World of Puss 'n Boots

Nagagutsu o Haita Neko: Hachijū Nichi-kan Sekaiisshū; "Puss 'n Boots: Around the World in 80 Days") was licensed by Turner Program Services. In the dub