Skip to content

Pebloop/LuaDardo-async

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

LuaDardo-async

logo


A Lua virtual machine written in Dart, which implements Lua5.3 version. This is a fork that implements async functions wrappers.

Disclaimer

Modules like math.random() do not work. as a temporary fix you can use them out of their module like math.random() -> random().

Original : LuaDardo

Example:

dependencies:
  lua_dardo_async: ^0.0.1
import 'package:lua_dardo_async/lua.dart';

Future<void> main(List<String> arguments) async {
  LuaState state = LuaState.newState();
  await state.openLibs();

  state.registerAsync("wait", (ls) => Future.delayed(Duration(seconds: 1), () => 0));

  state.loadString(r'''
   print("before the wait")
   wait()
   print("after the wait")
''');
  state.call(0, 0);
  print("end of the script");
}

About

A Lua virtual machine written in Dart

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dart 99.9%
  • Lua 0.1%