Yet another Lua implementation in pure JavaScript. It encapsulates:
- Frontend infrastructure like
Lexer
andParser
to generate AST - Some subclasses of
AstVisitors
likeYamlVisitor
andCodegen
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.