luci


Ⅰ. 插件描述

Another dynamically-typed, lightweight programming language

Ⅱ. 基本信息

创建日期:  2012-08-29
使用用户:  1
Github星:  9
插件作者:  Joseph Naegele

Ⅲ. 安装方法

使用Vundle管理器安装

在你的.vimrc下添加:
Plugin 'naegelejd/luci'
… 然后在Vim中运行以下命令:
:source %
:PluginInstall

对于Vundle版本 < 0.10.2,请用上面的Bundle替换Plugin。

使用NeoBundle管理器安装

在你的.vimrc下添加:
NeoBundle 'naegelejd/luci'
… 然后在Vim中运行以下命令:
:source %
:NeoBundleInstall

使用VimPlug管理器安装

在你的.vimrc下添加:
Plug 'naegelejd/luci'
… 然后在Vim中运行以下命令:
:source %
:PlugInstall

使用Pathogen管理器安装

在终端中运行以下命令:
cd ~/.vim/bundle
git clone https://github.com/naegelejd/luci

Ⅳ. 文档说明

Luci

Luci is a procedural, dynamically-typed toy scripting language, implemented in C.

Luci's syntax is similar to that of C and Lua.

The Luci command-line interpreter includes a crude interactive mode, which allows for quick exploration of the language and its runtime facilities.

Luci is missing an incredible number of features, many of which are listed under TODO.

Luci's builtin types and functions are described in LANGUAGE.

Sample programs written in Luci are provided in the samples/ directory.

Build

To generate the necessary scanner and parser, you'll need
flex (lex) and
bison (yacc)

Both flex and bison are available via:

You'll also need cmake to generate the build system for your OS (Makefiles, VS Studio project, etc.)

Unix/MinGW build example:

mkdir build
cd build
cmake ..
make
make test

This generates the binary luci in build/bin.

The included tests can be executed using make test, which utilizes Cmake's CTest framework.

To generate the included source documentation, obtain doxygen 1.8.3, then run make doc.

Implementation

Luci code is parsed to form an abstract syntax tree, which is then compiled to Luci's bytecode representation, then executed by the virtual machine.

All types in Luci are implemented using a base LuciObject struct, which contains a pointer to a virtual method table.
Each type implements its own static virtual method table.

LuciObject s are prevalent throughout Luci's implementation.
The LuciList is probably the most widely used, as it is essentially a dynamically expandable list of pointers.
Luci's virtual machine uses a LuciList for its internal stack.

Luci uses a crude, stop-the-world, mark-and-sweep garbage collector to allocate and manage memory.
This allows for simpler implementation code (less memory management) as well as the ability to finalize objects.

References

添加新评论