Skip to content

NPLFoshan/NPLRuntime

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build Status Build status Code docs Documentation Status

Welcome to the NPL Runtime!

NPL or Neural Parallel Language is an open source, high-performance, scripting language. Its syntax is 100%-compatible with lua. NPL runtime provides essential functionality for building 3D/2D/Server applications that runs on windows/linux/android/iOS.

Install Guide

git clone https://github.com/LiXizhi/NPLRuntime.git
./build_linux.sh

See Install Guide for details

Getting Started

Example code

-- this is from `helloworld.npl`
NPL.activate("(gl)helloworld.npl", {data="hello world!"})
this(msg){
   if(msg) then
      print(msg.data or "");
   end
}

Why a New Programming Language?

NPL prototype was designed in 2004, which was then called 'parallel oriented language'. 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, I want to have a language that is suitable for writing neural network algorithms, 3d simulation and visualization. Lua and C/C++ affinity was chosen from the beginning.

Usage

To run with GUI, use:

npl [filename] [parameters...]

To run in server mode, use:

npls [filename] [parameters...]

For example:

npls hello.npl
add_external_include("${${LIB_NAME_UPPER}_SOURCE_DIR}/src")
add_external_include("${LUABRIDGE_INCLUDE_DIR}")
add_external_lib("${LIB_NAME}")

Emscripten

  1. 编译boost 下载boost.1.81.0源码, 解压并进入源码目录, 执行如下指令编译 .\bootstrap.bat
    \b2 toolset=emscripten runtime-link=static --with-thread --with-date_time --with-filesystem --with-system --with-chrono --with-serialization --locale 进入生成的 stage/lib 目录, 对每个xxx.bc文件执行命令 emar -q xxx.a xxx.bc 将.bc转成.a文件
  2. 进入NPLRuntime根目录: emcmake cmake -S NPLRuntime -B build\emscripten -DEMSCRIPTEN=ON -DCURL_ENABLE_SSL=OFF -DBOOST_ROOT="boost根目录"
    cd build\emscripten emmake make boost 报[-Wc++11-narrowing]错误 为类型转换精度缩小不支持, 编辑相关报错文件, 进行强制类型转换修复

ParaEngineServer

  1. cmake -S NPLRuntime/ -B build -DNPLRUNTIME_SERVER=ON -DNPLRUNTIME_STATIC_LIB=ON
  2. cmake --build build

About

NPL - Neural Parallel Language

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • C 56.4%
  • C++ 33.2%
  • Makefile 1.8%
  • C# 1.5%
  • Lua 1.5%
  • M4 1.0%
  • Other 4.6%