是否可以连接Lua和javascript? [英] Is it possible to connect Lua and javascript?

查看:83
本文介绍了是否可以连接Lua和javascript?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不确定问题是否存在,因为英语不是我的母语.是否可以将lua和javascript连接在一起?我还没有发现任何东西.

I'm not sure if the question is well-posed as english is not my mother tongue. Is it possible to connect lua and javascript together? I did not find anything about that yet.

或者有可能例如在html文件中使用

Or is it possible e.g. in a html-file to script with both languages like

<html>
<head>
</head>
<body>
    <script></script>
    <?lsp 
    ?>
</body>
</html>

也许在这些语言之间共享信息?!

and maybe to share information between those languages?!

还是可能在js中使用lua或在lua中使用js?喜欢

or ist it maybe possible to use lua in js or js in lua? like

<script><?lsp ?></script>
<?lsp 
<script></script>
?>

推荐答案

您可以在前端使用Lua的一些方法(这可能是您想要连接的目标)/用Lua替换JS ):

You have a few options for Lua usage on the front-end (this is probably what you're aiming for as you'd like to connect/replace JS with Lua):

作品中有一些有趣的WASM内容,例如:

There is some interesting WASM stuff in the works, like:

对于后端,还有更多选择.最引人注意的可能是:

For back-end there are even more options. Most noticeable are probably:

  • https://github.com/leafo/lapis
  • https://github.com/daurnimator/lua-http/
  • https://github.com/sailorproject/sailor
  • https://openresty.org/en/
  • https://github.com/sumory/lor
  • https://github.com/luvit/luvit

我只列出了一些.有很多.

I've listed just a few. There is a lot.

这篇关于是否可以连接Lua和javascript?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆