GithubHelp home page GithubHelp logo

3f / lunari Goto Github PK

View Code? Open in Web Editor NEW
49.0 9.0 9.0 247 KB

๐Ÿ—ฆ๐ŸŒ” Lua for .NET :: Lua 5.4, 5.3, 5.2, 5.1, ...

License: MIT License

C# 85.72% Batchfile 14.28%
lua lunaroad conari lua51 lua52 lua53 lua54 lunari

lunari's Introduction

๐Ÿ—ฆ๐ŸŒ” LuNari is Lua for .NET on Conari engine

All actual Lua versions, like: Lua 5.4, 5.3, 5.2, 5.1, ...

Build status release-src NuGet package License

Build history

Why LuNari ?

Most popular features that will be adapted to your needs on the fly.

๐Ÿ” Easy to start:

using(var l = new Lua<ILua53>("Lua.dll")) { // ILua51, ILua52, ILua53, ...
    // ...
}

๐Ÿš€ Awesome speed:

Based on the fast versions of Conari engine with caching of 0x29 opcodes (Calli). [?]

๐Ÿ”จ Its amazing dynamic features:

using(dynamic l = new LuaD("Lua.dll"))
{
    // Lua now is yours ~
    IntPtr L = l.luaL_newstate<LuaState>();
    var num  = l.lua_tonumber<LuaNumber>(L, 1);
}

๐Ÿฑ Damn customizable:

var l = new Lua<ILua52>("Lua52.dll");

    l.API.pushcclosure(L, onProc, 0);
    l.bind<Action<LuaState, LuaCFunction, int>>("pushcclosure")(L, onProc, 0);
    l.v<ILua53>().pushcclosure(L, onProc, 0);
    ...

๐Ÿ”– Modern .NET Core

LuNari is ready for .NET Core starting from 1.6. Its awesome dynamic features are also available even for .NET Standard 2.0.

๐ŸŒš Unlimited extensible features:

Since this works through Conari, you can access to all newest features of the Lua immediately after introducing this in draft. Just use it without waiting for release.

๐Ÿ—ธ License

The MIT License (MIT)

Copyright (c) 2016,2017,2019  Denis Kuzmin < [email protected] > GitHub/3F

[ โ˜• Donate ]

LuNari contributors: https://github.com/3F/LuNari/graphs/contributors

We're waiting for your awesome contributions!

Take a look closer

There are several ways to use LuNari: API-layer and binding at runtime (DLR, Lambda expressions)

Dynamic features /DLR

This does not require neither our API(see below) nor something other from you at all. We will generate all your needs automatically at runtime!

This is possible because of Conari. Thus, do whatever you want:

// all this will be generated at runtime, i.e. you can use all of what you need from Lua as you like:
d.pushcclosure(L, onProc, 0);
d.setglobal(L, "onKeyDown");
...
LuaNumber num = d.tonumber<LuaNumber>(L, 7);

Lambda expressions

You also can use your custom binding for what you need:

using(ILua l = new Lua("Lua52.dll"))
{
    l.bind<Action<LuaState, LuaCFunction, int>>("pushcclosure")(L, onProc, 0);
    l.bind<Action<LuaState, string>>("setglobal")(L, "onKeyDown");
    //or any exported function like: bindFunc<...>("_full_name_")
    ...
    LuaNumber num = l.bind<Func<LuaState, int, LuaNumber>>("tonumber")(L, 7);
}

API Layer

Standardized way that covers an original Lua features. 5.3, 5.2, 5.1, ...

using(var l = new Lua<ILua53>("Lua53.dll"))
{
    l.API.pushcclosure(L, onProc, 0); // ILua53 lua = l.API
    l.API.setglobal(L, "onKeyDown");
}

Unified API level between different versions:

Lua<ILua53> l;
...
// to avoid ambiguity if exists: l.U as ILua51 ~
l.U.arith(L, LUA_OPSUB);
l.U.pop(L, 1);

Other lightweight access to specific:

// any direction, for example: v5.2 <-> v5.1
l.v<ILua51>().pushcclosure(L, onProc, 0);

// from the higher version to the lower, for example: v5.2 -> v5.1
((ILua51)l.API).pushcclosure(L, onProc, 0);

Something else

Powerful work with several libraries:

using(var lSpec = new Lua("SpecLua.dll"))
{
    using(ILua l = new Lua<ILua52>("Lua52.dll"))
    {
        // ...
    }
}

Additional types:

size_t len;
CharPtr name = lua.tolstring(L, 1, out len);
...
string myName += name; // (IntPtr)name; .Raw; .Ansi; .Utf8; ...
...
LuaNumber mv = lua.tonumber(L, 2);

Lazy loading:

using(var l = new Lua<ILua51>(
                    new LuaConfig("Lua51.dll") {
                        LazyLoading = true
                    }))
{
    ...
}

and more!

How to Get LuNari

Roadmap

LuNari already provides flexible binding at runime. That is, as you can see above, you already can do anything between different versions via lambda-functions and DLR features. However, an important goal of this project is also to provide a fully compatible API layer for more comfortable work with any popular Lua versions like: Lua 5.1, 5.2, 5.3 ...

Contribute

Extend our API layer or improve all of what you want. It's completely transparent with our flexible architecture.

Here's how to extend API: in a few steps (Wiki). Please use Pull Requests if you ready to contribute.

The Application Program Interface of Lua:

How to Build LuNari

Our build was based on vssbe scripts.

You don't need to do anything else, just navigate to root directory of this project, and:

.\build Debug

Or please use v1.14+ plugin for Visual Studio

lunari's People

Contributors

3f avatar dependabot-preview[bot] avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

lunari's Issues

Unit-Tests & appveyor. Command exited with code -1073740940

Starting test execution, please wait...
Command exited with code -1073740940

https://ci.appveyor.com/project/3Fs/lunaroad/build/build-22 - e0765285 - Failed
https://ci.appveyor.com/project/3Fs/lunaroad/build/build-23 - e0765285 - Failed
https://ci.appveyor.com/project/3Fs/lunaroad/build/build-24 - e0765285 - ok
etc.

However I remembered one crash on my pc for current unit-tests, so it can be related for this. But currently I can't reproduce it.

Rebranding. LunaRoad -> LuNari

LunaRoad starts process of changing its project name.

Since modern versions was fully based on Conari engine, the new name is quite more logical and easier to pronounce:

  • Lua for .NET via Conari
    • Lu (Lua) + N (.NET) + ari (via Conari)

Meet the LuNari

Moreover, LuNari is more related exactly to Lunar phase (fasi Lunari in Italian).

Remind you: Lua means the moon in Portuguese.

The lunar phase is the shape of the directly sunlit portion of the Moon as viewed from Earth [?]

e.g.: ~

           Lua [5.1] [5.2] [5.3] [5.4]
~LuNari~ _ _ _ _ _ _ _ _ _ _ ^ _ _ _ _ 
                             v
                             
                      โ—ฆยฐหš\(*โ›โ€ฟโ›)/หšยฐโ—ฆ 

Status

Dependabot couldn't find the branch depb

Dependabot was set up to create pull requests against the branch depb, but couldn't find it.

If the branch has been permanently deleted you can update Dependabot's target branch from your dashboard.

You can mention @dependabot in the comments below to contact the Dependabot team.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.