All Projects → mingodad → ljs

mingodad / ljs

Licence: MIT license
Lua with C/C++/Java/Javascript syntax

Programming Languages

c
50402 projects - #5 most used programming language
LilyPond
23 projects
Makefile
30231 projects

Labels

Projects that are alternatives of or similar to ljs

Lua Resty Redis Connector
Connection utilities for lua-resty-redis
Stars: ✭ 186 (+44.19%)
Mutual labels:  luajit
nginx-lua
Nginx 1.19+ with LUA support based on Alpine Linux, Amazon Linux, Debian, Fedora and Ubuntu.
Stars: ✭ 112 (-13.18%)
Mutual labels:  luajit
FWK
💎 3D game framework in C, with Luajit bindings now.
Stars: ✭ 423 (+227.91%)
Mutual labels:  luajit
Lua Openssl
Openssl binding for Lua
Stars: ✭ 206 (+59.69%)
Mutual labels:  luajit
Libmoon
libmoon is a library for fast and flexible packet processing with DPDK and LuaJIT.
Stars: ✭ 250 (+93.8%)
Mutual labels:  luajit
strict
Check for use of undeclared variables
Stars: ✭ 32 (-75.19%)
Mutual labels:  luajit
Mlua
High level Lua 5.4/5.3/5.2/5.1 (including LuaJIT) bindings to Rust with async/await support
Stars: ✭ 176 (+36.43%)
Mutual labels:  luajit
code runner.nvim
Neovim plugin.The best code runner you could have, it is like the one in vscode but with super powers, it manages projects like in intellij but without being slow
Stars: ✭ 234 (+81.4%)
Mutual labels:  luajit
tinycoffee
tiny coffee is a framework to develop simple 2d games with opengl 3
Stars: ✭ 61 (-52.71%)
Mutual labels:  luajit
lcurses
Lua bindings for Curses
Stars: ✭ 60 (-53.49%)
Mutual labels:  luajit
Luvi
A project in-between luv and luvit.
Stars: ✭ 215 (+66.67%)
Mutual labels:  luajit
Sol2
Sol3 (sol2 v3.0) - a C++ <-> Lua API wrapper with advanced features and top notch performance - is here, and it's great! Documentation:
Stars: ✭ 2,791 (+2063.57%)
Mutual labels:  luajit
lua sort
Lua pure sort algorithm based on lib_table.c (from LuaJIT 2.1.0)
Stars: ✭ 21 (-83.72%)
Mutual labels:  luajit
Luject
🍹A static injector of dynamic library for application (android, iphoneos, macOS, windows, linux)
Stars: ✭ 203 (+57.36%)
Mutual labels:  luajit
aspect
Aspect is a compiling template engine for Lua and LuaJIT
Stars: ✭ 17 (-86.82%)
Mutual labels:  luajit
Luaver
Lua Version Manager - Managing and switching between different versions of Lua, LuaJIT and Luarocks made easy
Stars: ✭ 179 (+38.76%)
Mutual labels:  luajit
luacc
Lua Code Combine
Stars: ✭ 36 (-72.09%)
Mutual labels:  luajit
sqlite.lua
SQLite LuaJIT binding with a very simple api.
Stars: ✭ 291 (+125.58%)
Mutual labels:  luajit
moonblob
Binary serialization for moonscript + LuaJIT
Stars: ✭ 22 (-82.95%)
Mutual labels:  luajit
raylua
Cross-Platform, Modern, And updated LuaJIT bindings for raylib library.
Stars: ✭ 77 (-40.31%)
Mutual labels:  luajit

ljs

Lua with C/C++/Java/Javascript syntax

Here is some code to see how it's like:

/* Limited json style table declaration */
var json = {"name": "bob"};
var A = {t: {f: 7}, n: 3}
var ary = [1,2,3,4]; //Array style declaration, syntax sugar for {}
var num = 5;

if(json.name == "bob") print("Hello Bob !"); // if/ese like in C/C++/Java/Javascript 
else if(json.name == "mary") print("A pretty woman !");
else print("Nice to meet you !");

for(i=1, 10) print(i);
for(k,v in pairs(json)) print(k,v);

for(k,v in pairs(A)) { // blocks are curly braces delimited
	if(k == "one") continue;
	print(k, type(k), v);
}

while(num > 0) --num; //pre inc/dec operators
num += 5; // compound operators
while(num > 0) {
	print(num--);
}
num += 5;
do { //conventional do/while
	if(num == 3) goto update;
	//inline boolean expression
	print(num == 2 ? "it's a two" : "it's a " .. num);
update:
	--num;
} while(num > 0);

function doIt(p : string) : string { // functions and variables can have an anotation
	return "Done " .. p;
}

print(doIt("car"));

function doAgain(p) {
	if(p == null) return "I don't know what to do !"; // uses "null" instead of "nil"
	return "Done " .. p;
}

print(doAgain("car"));

var Engine = {
	speed : 0
};

function Engine::speedTo(v : integer) { //synatx sugar for function member with "this"
	this.speed = v; // use "this" instead of "self"
}

print(Engine.speed);
Engine->speedTo(12); //syntax sugar for method call with implicity "this"
print(Engine.speed);

I took code and ideas from :

https://github.com/ex/Killa

https://github.com/sajonoso/jual

The default extension is ".ljs".

On folder lua2ljs there is a program to convert lua sources to ljs.

lua2ljs afile.lua > afile.ljs

This is based on Lua 5.3.5, released on 26 Jun 2018.

For installation instructions, license details, and further information about Lua, see doc/readme.html.

There is also the following port from lua to ljs:

ljsjit at https://github.com/mingodad/ljsjit

ljs-5.1 at https://github.com/mingodad/ljs-5.1

ZeroBraneStudio port at https://github.com/mingodad/ZeroBraneStudioLJS

raptorjit-ljs at https://github.com/mingodad/raptorjit-ljs

snabb-ljs at https://github.com/mingodad/snabb-ljs

premake5-ljs at https://github.com/mingodad/premake-core/tree/ljs

CorsixTH-0.62-ljs at https://github.com/mingodad/CorsixTH-ljs

The tool lua2ljs does the convertion on almost all Lua code, except dynamic Lua code inside strings, C/C++ code, auxiliar scripts and makefiles, LJS also flag as warning/error duplicate variable declarations and a revision is needed mainly using "ljsc -p -l ljsSource.ljs > /dev/null" to only compile and emit the warnings/error to stderr, then several text scans to search and replace "nil", ".lua" and Lua code inside strings, ...

Finally run the tests if available to check that it's working properly (at least with the tests).

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].