Giter Site home page Giter Site logo

utoecat / miniluau Goto Github PK

View Code? Open in Web Editor NEW
4.0 1.0 0.0 3.27 MB

LuaU sources packaged into two files for easy embedding (just copy+paste them into your project).

License: MIT License

CMake 0.09% C 3.45% Lua 1.98% Shell 0.02% Makefile 0.04% C++ 94.42%
github-actions-enabled headeronly luau packed embedded-language cplusplus-17

miniluau's Introduction

MiniLuau

This repository implements the PACK.lua lua script for packing official Luau sources (only compiler, native code generation and vm at the moment) into TWO FILES: luau.hpp and luau.cpp, which you can simply drag and drop into your C++ project.

Building

Note: luau.h and luau.c are ALREADY AUTOMATICLY packed in this repository! Do manual packaging only if you really want to change this process in some way or speed up getting the latest version of Luau. If you want to package sources manually, you need to install Lua 5.4, git.

First clone this repository with this command:

 $ git clone --recursive https://github.com/UtoECat/miniLuau

Then cd to the luau submodule directory and run

$ lua5.4 ../PACK.lua

During the build process, you will see errors about <string.h> or <vector> not found, this is normal. At the end you will get your packaged luau sources :)

Usage

  • Put packed files in your project, compile as any other source file
  • Add -lm to your linker flags (if not done yet)
  • Modify definitions at the top of luau.hpp file (disable compiler or native code generation)
  • include luau.hpp everywhere you need to work with lua.

Dependencies

Luau uses C++ as its implementation language. The runtime requires C++11, whereas the compiler and analysis components require C++17. It should build without issues using Microsoft Visual Studio 2017 or later, or gcc-7 or clang-7 or later.

Other than the STL/CRT, Luau library components don't have external dependencies.

License

Luau implementation is distributed under the terms of MIT License. It is based on Lua 5.x implementation that is MIT licensed as well.

When Luau is integrated into external projects, we ask to honor the license agreement and include Luau attribution into the user-facing product documentation. The attribution using Luau logo is also encouraged.

Pack.lua is also under the MIT license.

Luau

Luau (lowercase u, /ˈlu.aʊ/) is a fast, small, safe, gradually typed embeddable scripting language derived from Lua.

This is not the original Luau repository. Visit Original Luau repository for more information about LuaU.

The documentation portion for Luau language can be viewed at Luau-Lang website

Baselib documentation

Is here (click)

miniluau's People

Contributors

dependabot[bot] avatar utoecat avatar

Stargazers

 avatar  avatar  avatar  avatar

Watchers

 avatar

miniluau's Issues

unable to amalgamate codegen anymore

The new version of luau has added some static functions. Their names are in the same namespaces in different files.

CodeGen.cpp:40588:13: «void Luau::CodeGen::onCloseState(lua_State*)»
CodeGenContext.cpp:40403:13: «void Luau::CodeGen::onCloseState(lua_State*)» 
CodeGen.cpp:40593:13:  «void Luau::CodeGen::onDestroyFunction(lua_State*, Proto*)»
CodeGenContext.cpp:40408:13:  «void Luau::CodeGen::onDestroyFunction(lua_State*, Proto*)» 
CodeGen.cpp:40600:12: о «int Luau::CodeGen::onEnter(lua_State*, Proto*)»
CodeGenContext.cpp:40415:12:  «int Luau::CodeGen::onEnter(lua_State*, Proto*)» 
CodeGen.cpp:40637:15:  «size_t Luau::CodeGen::getMemorySize(lua_State*, Proto*)»
CodeGenContext.cpp:40424:15: «size_t Luau::CodeGen::getMemorySize(lua_State*, Proto*)» 

In addition, there is a new problem related to the strange combination of external and static storage qualifiers:

CodeGen.cpp:40486:14: «Luau::CodeGen::gPerfLogContext»
CodeGenContext.cpp:40318:14:  «Luau::CodeGen::gPerfLogContext»
CodeGen.cpp:40487:18 «Luau::CodeGen::gPerfLogFn» 
CodeGenContext.cpp:40319:18: «Luau::CodeGen::gPerfLogFn»

The first problem can probably be solved quite easily with the magic of macros. But I'm not sure about the last one.
I'm a little busy at the moment, I'll try to fix this issue in the coming weeks.

The current amalgamated source code at the root of the repository compiles, but it is an old version of luau and does not contain recent fixes, so you have been warned. If you need the latest fixes, remove LUAU_COMPILE_CODEGEN in the file luau.hpp after running PACK.lua
image

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.