Neural parallel language

Neural parallel language (abbreviated NPL) is a general-purpose open-source programming language. Its syntax is fully compatible with Lua. NPL provides essential functionality for building 3D/2D/Web/Server applications. NPL provides a C/C++ API and native NPL libraries. NPL is a single language solution for advanced and interactive GUI, complex opengl/DirectX 3D graphics, scalable webserver and distributed software frameworks. It is cross-platform, high performance, extensible and debuggable. It is a language system initially designed to operate like the brain. Nodes and connections are ubiquitous; threading and networking logics are hidden from developers. NPL can mix user-mode preemptive and non-preemptive code. It reflects the concurrency of Erlang and speed of in the same dynamic and weakly typed language.
Facts About NPL
* NPL runtime is written in C/C++. It can utilize the luajit compiler, which dynamically compiles script/byte code into native machine code, thus it can approach native C/C++ performance with some caveats.
* NPL runtime native API is a rich collection of C/C++ functions that is callable from NPL script. It includes networking, graphics, io, audio, assets management, and core NPL/ParaEngine infrastructure.
* NPL libraries are pure NPL/lua script files, distributed open sourced or in a zip/pkg file. Over 1 million lines of fully documented NPL script code are available for use.
* NPL libraries are all written in <code>object oriented</code> fashion, code is organized in folders and table namespaces.
* Because NPL is written in C/C++, it is cross-platform, extensible and easy to integrate with other thirty-party tools. For examples, NPLRuntime is distributed with following built in plugins: bullet(a robust 3d physics engine), mono(C# scripting module with NPL API),mysql/sqlite(database engine), libcurl(a robust http://ssh client).
* There are two ways to use Lua, one is embedding, the other is extending it. NPL takes the former approach. For example, true preemptive programming would NOT be possible with the second approach. The embedding approach also allows NPL to expose all of its API and language features to other compiler, for example, each NPL runtime states can host Lua/Mono C#/C++ compiler states all together.
Background & History
NPL prototype was designed by Li Xizhi in 2004, which was then called 'parallel oriented language'. In 2005, it was implemented together with ParaEngine, a distributed 3d computer game engine. In 2016, its open source code base grows to over 1 million and distributed in several NPL packages, and powers dozens of client and server projects.
NPL is initially designed to write flexible algorithms that works in a multi-threaded, and distributed environment with many computers across the network. More specifically, it is designed to be a single language solution for writing high-performance network algorithms, 3d simulation and visualization. Lua and C/C++ affinity was chosen from the beginning.
Communicate Like The Brain
Although we are still unclear about our brain's exact computational model, however, following fact seems ubiquitous in our brain.
* The brain consists of neurons and connections.
* Data flows from one neuron to another: it is asynchronously, single-direction and without callback.
Communication in NPL is the same as above. Each file can become a neuron file to receive messages from other neuron files. They communicate asynchronously without callback. As a result, no lock is required in NPL because there is no shared data; making it both simple and fast to write and test distributed algorithms and deploy software in heterogeneous environment.
Concurrency Model in NPL
The mental picture of most computer languages is to execute programs in sequential order. Concurrency is a language feature about writing code that runs concurrently. Traditional way of doing it is via threads and locks, which is very troublesome to write. The Actor Model which was first proposed by Carl Hewitt in 1973, takes a different approach to concurrency, which avoids the problems caused by threading and locks.
There are many implementations of concurrency model in different languages, they differ both in performance under different use cases, and in the programmers' mental picture when writing concurrent code.
NPL uses a hybrid approach, which give programmers the ability to run tens of thousands of tasks in a single thread or across multiple threads. More importantly, programmers do not need to write code to spawn a virtual process or write error-prone message loops. In short, NPL is designed to be fast, scalable and giving programmers a mental picture that is close to neurons in the brain.
See also NPL Concurrency Model compared with erlang, , scala.
Software Projects Written In NPL Language
* Paracraft is a standalone 3d animation software for everyone.
* Wikicraft is a free personal web site builder on the cloud. The server side is written in NPL.
* Magic Haqi is a free/paid 3D MMORPG published by TaoMee (nasdaq:TAOM) in November, 2009, allowing kids to play, create and share 3d worlds. It has over 5 million registered users and tens of thousands of user created works in China.
* Kids Movie Creator is a shareware released in 2006, allowing kids to create 3d world and make movies.
* Paper Star is a sandbox game developed by TaoMee<ref name=":0" /> (nasdaq:TAOM) using NPL.
< Prev   Next >