0.0.6 • Published 4 years ago

jlua v0.0.6

Weekly downloads
1
License
MIT
Repository
-
Last release
4 years ago

jlua

Yet another Lua implementation in pure JavaScript. It encapsulates:

  • Frontend infrastructure like Lexer and Parser to generate AST
  • Some subclasses of AstVisitors like YamlVisitor and Codegen generate YAML reflects the AST and bytecode for LuaVM, respectively
  • Particularly, JsCodegen translates Lua to JavaScript for running Lua on JavaScript runtime directly, more

Here is a demo naturally built with jlua and Vue.js, in other words we can use Lua within Single File Component, for example:

<template>
 <div>hi {{ lang }}</div>
</template>

<script lang="lua">
local m = {
 data = function () 
   return {
     lang = "Lua"
   }
 end
}
return m
</script>

here is the source of the demo.