LuaD:从D编程语言到Lua的桥梁

  • v2_533091
    了解作者
  • 340KB
    文件大小
  • zip
    文件格式
  • 0
    收藏次数
  • VIP专享
    资源类型
  • 0
    下载次数
  • 2022-05-18 04:23
    上传日期
LuaD-用于D编程语言的Lua import luad.all; void main () { auto lua = new LuaState; lua.openLibs(); auto print = lua. get ! LuaFunction( " print " ); print( " hello, world! " ); } LuaD是D和Lua编程语言之间的桥梁。 与基于Lua C API构建的许多其他库不同,LuaD不会公开Lua堆栈-相反,它具有用于引用Lua对象的包装器,并支持无缝地直接将任何D类型转换为Lua类型,反之亦然。 这使得它非常易于使用,并鼓励了一种不那么容易出错的编程风格,并且通过大量的命令提高了生产率。 由于D具有强大的通用编程功能,因此性能仍与使用C API时的性能相同。 LuaD还包括Lua C API的绑定。 要使用它,请导入模块lu
LuaD-master.zip
  • LuaD-master
  • extlib
  • x86_32-linux-gnu
  • liblua.a
    241.9KB
  • x86_64-linux-gnu
  • liblua.a
    327.6KB
  • README.md
    1.3KB
  • lua5.1.lib
    151KB
  • COPYRIGHT
    1.5KB
  • dmc.mak
    476B
  • visuald
  • examples
  • phonebook.visualdproj
    5.3KB
  • hello.visualdproj
    5.3KB
  • LuaD_examples10.sln
    4KB
  • dmodule.visualdproj
    5.1KB
  • LuaD_examples.sln
    1.3KB
  • precompiled.visualdproj
    5.3KB
  • .gitignore
    23B
  • LuaD.visualdproj
    8.5KB
  • LuaD10.sln
    1KB
  • LuaD.sln
    1KB
  • luad
  • c
  • lualib.d
    1.8KB
  • all.d
    357B
  • lauxlib.d
    9.9KB
  • tostring.d
    601B
  • luaconf.d
    23.7KB
  • lua.d
    19.5KB
  • conversions
  • arrays.d
    2KB
  • assocarrays.d
    1.5KB
  • structs.d
    2.8KB
  • classes.d
    5.6KB
  • variant.d
    2.3KB
  • functions.d
    14.2KB
  • all.d
    309B
  • table.d
    7.4KB
  • dynamic.d
    4.3KB
  • state.d
    12KB
  • base.d
    4.4KB
  • error.d
    692B
  • lmodule.d
    2KB
  • testing.d
    666B
  • stack.d
    15.3KB
  • lfunction.d
    4.5KB
  • example
  • hello
  • hello.d
    147B
  • dub.json
    312B
  • phonebook
  • phonebook.d
    521B
  • contacts.lua
    213B
  • dub.json
    377B
  • dmodule
  • dllmain.d
    598B
  • module.lua
    234B
  • dmodule.d
    612B
  • dub.json
    367B
  • precompiled
  • precompiled.d
    496B
  • dub.json
    330B
  • bin
  • contacts.lua
    213B
  • .gitignore
    117B
  • module.lua
    234B
  • README.md
    948B
  • Makefile
    895B
  • luad.gdb
    882B
  • README.md
    5.6KB
  • .gitignore
    97B
  • LICENSE.txt
    1.2KB
  • push-ddoc.sh
    743B
  • .travis.yml
    618B
  • Makefile
    2KB
  • dub.json
    587B
内容介绍
[![Build Status](https://travis-ci.org/JakobOvrum/LuaD.svg?branch=master)](https://travis-ci.org/JakobOvrum/LuaD) LuaD - Lua for the D Programming Language ============================================ -------------------------------------------- ```D import luad.all; void main() { auto lua = new LuaState; lua.openLibs(); auto print = lua.get!LuaFunction("print"); print("hello, world!"); } ``` LuaD is a bridge between the D and Lua programming languages. Unlike many other libraries built on the Lua C API, LuaD doesn't expose the Lua stack - instead, it has wrappers for references to Lua objects, and supports seamlessly and directly converting any D type into a Lua type and vice versa. This makes it very easy to use and encourages a much less error-prone style of programming, as well as boosting productivity by a substantial order. Due to D's powerful generic programming capabilities, performance remains the same as the equivalent using the C API. LuaD also includes bindings for the Lua C API. To use it, import the module `luad.c.all` or selectively import the modules in the `luad.c` package. Usage is identical to that of working with the Lua C API. Documentation for the C API can be found [here](http://www.lua.org/manual/5.1/manual.html). (LuaD currently supports Lua version 5.1) Goals ============================================ Current progress noted in parentheses: * Run Lua code from D, and D code from Lua (_Yes_) * Support automatic conversions between any D type and its Lua equivalent (_Yes_) * Support automatic conversions between D classes and Lua userdata (_Partial_) * Provide access to the entire underlying Lua C API (_Yes_) * Support Lua 5.2 (_Not yet_) Directory Structure ============================================ * `luad` - the LuaD package. * `visuald` - [VisualD](http://www.dsource.org/projects/visuald) project files. * `test` - unittest executable (when built). * `lib` - LuaD library files (when built). * `example` - LuaD examples. Usage ============================================ The recommended way of using LuaD is with [dub](https://github.com/rejectedsoftware/dub). See [LuaD on the package repository](http://code.dlang.org/packages/luad) for instructions. The examples can be tested by running `dub run` in the example's directory ([see also the examples' readme](/example/README.md)). Apart from dub, there are [makefiles](#build-with-make) as well as [VisualD project files](#build-with-visualdwindows) for both the library and the examples. [Documentation](http://jakobovrum.github.com/LuaD/) ============================================ You can find automatically generated documentation on the [gh-pages branch](http://github.com/JakobOvrum/LuaD/tree/gh-pages/), or you can [browse it online](http://jakobovrum.github.com/LuaD/). ### [Tutorial](https://github.com/JakobOvrum/LuaD/wiki/Tutorial) A tutorial can be found on the project's Wiki. Manual Usage ============================================ Import the `luad.all` module in your project, and compile all the files in the `luad`, `luad.c` and `luad.conversions` packages. You can also compile the LuaD packages to a static libary, but you still need the full LuaD sources available at compile-time due to heavy use of templates. You must also link Lua version 5.1; on Unix-like systems, the library is typically called `liblua5.1.a` or similar. On Windows, you need a `lua51.lib` in OMF format to be linkable with DMD. Check out the [binaries branch](http://github.com/JakobOvrum/LuaD/tree/binaries) for a `lua51.lib` import library and download instructions for a DMD-compatible library for Unix-like systems. Since the provided `lua51.lib` is only an import library, you also need the Lua DLLs at runtime (which can be found [here](http://sourceforge.net/projects/luabinaries/files/5.1.4/Executables/lua5_1_4_Win32_bin.zip/download)). **Please report bugs and issues to the [Github issue tracker](https://github.com/JakobOvrum/LuaD/issues). Thanks!** Build with Make ============================================ The `MODEL` variable should be either `32` or `64` depending on whether you want to make a 32 bit or 64 bit build. It defaults to `64`. The `BUILD` variable controls the build configuration; it can be `debug`, `release` or `test`. `debug` and `release` will build `lib/libluad.a` in debug and release mode respectively. The `test` configuration will build `test/luad_unittest` and then run it with `gdb`. Additionally, code coverage files (*.lst) are generated. The `BUILD` variable defaults to `debug`. For example, if you want to build and run the unit tests on a 32 bit machine, the command would be: make MODEL=32 BUILD=test Build with VisualD/Windows ============================================ [VisualD](http://www.dsource.org/projects/visuald) project files are included in the `visuald` subdirectory. The Release and Debug configurations produce `lib/luad.lib` and `lib/luad-d.lib` respectively. The Unittest configuration produces `test/luad_unittest.exe`. Project files for the examples can be found in `visuald/examples` and produce binaries in the `example/bin` directory. The location of `lua51.lib` needs to be configured for the LuaD Unittest configuration as well as for the examples. The projects are pre-configured to `%LUA_OMFLIB%/lua51.lib`; either add the `LUA_OMFLIB` environment variable, or edit the linker settings manually. `lua51.lib` in OMF format can be found on the [binaries branch](https://github.com/JakobOvrum/LuaD/tree/binaries). License ============================================ LuaD is licensed under the terms of the MIT license (see the [LICENSE file](/LICENSE.txt) for details).
评论
    相关推荐
    • Lua 编程语言 中文教程
      2004年的GDC,全世界的游戏开发者都在争论Lua和Python哪个更好。没多久《魔兽世界》出来了,此后就再也没人争论过了。《魔兽世界》影响了全世界的玩家,LUA自然影响了全世界的游戏开发者。
    • LUA语言脚本编程资料
      里面有2份lua语言脚本的资料,有兴趣的下载看看!
    • cpp-Ravi编程语言Lua53的一个衍生有限的可选静态类型
      Ravi 编程语言Lua 5.3 的一个衍生,有限的可选静态类型,基于 LLVM 和 libgccjit 的 JIT 编译器。 Ravi 的名字来自梵语的太阳。
    • luarocks:LuaRocks是Lua编程语言的程序包管理器
      luarocks:LuaRocks是Lua编程语言的程序包管理器
    • jester:用Lua编程语言编写的FreeSWITCH脚本工具包
      Jester是使用编程语言编写的脚本工具包。 它是由FreeSWITCH和Lua经验丰富的开发人员构建和测试的库和便利功能的集合。 Jester的目标是通过提供一种简单,统一的方法来实现通常需要复杂的自定义脚本的更复杂功能,...
    • probabilistic-lua:将 lua 变成概率编程语言
      lua 变成一种概率编程语言。 这需要对 lua 调试库进行一些小的更改才能工作。 幸运的是,lua interpeter 非常轻量级; 我已经包含了一个经过必要修改的版本。 确保代码通过 LUA_PATH 环境变量可见。 例如,...
    • hope编程语言
      Hope是一个早期的函数式编程语言,有助于学习函数式编程和λ演算 Hope is a small functional programming language developed in the 1970s at the University of Edinburgh. It predates Miranda and Haskell and ...
    • lua:Lua编程语言
      a Lua编程语言
    • lua:基于 CMake 构建的 Lua 编程语言
      Lua 是一种功能强大、轻量级的编程语言,专为扩展应用程序而设计。 Lua 也经常用作通用的、独立的语言。 Lua 是免费软件。 有关完整信息,请访问 Lua 的网站 。 有关执行摘要,请参阅 。 Lua 已被用于世界各地的...
    • GaussDB_100_1.0.1-DATABASE-REDHAT-64bit.tar.gz
      guassdb100在redhat上安装包,单机部署的包,安装步骤请看我的文中介绍,经过大量实验搭建总结出来的文档