Skip to content

artofcoding212/LuaPlusPlus

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Lua++ V1.0

"The C++ of Lua"

Created by artofcoding212 on Github.

Introduction

Lua++ is like the C++ of Roblox's Lua, it adds classes, ontop of some other things, to Roblox's Lua.

Installation

Compiling

To compile your Lua++ code in Roblox, first get the latest Roblox model of Lua++ and insert it into anywhere in your game, which usually is in "ReplicatedStorage". Then, you can simply require it and use the "Compile" method that returns a string which can be executed via "loadstring", or other alternatives if you're trying to execute Lua++ on the client.
Here's an example of a "Script" object that prints the value of 2 + 2:

--// Variables //--
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local LuaPlusPlus = require(ReplicatedStorage:WaitForChild("lua++"))
--// Main //--
loadstring(LuaPlusPlus.Compile([[
  class Math {
    func Add(x, y){
      return x+y;
    }
  }

  print(new Math().Add(2, 2));
]]))()

This prints 4!

VSCode Syntax Highlighting

As of now, the VSCode extension for Lua++'s syntax highlighting is not published, so you will manually have to put it into your VSCode files. To do this, first download the repository's main branch as a ".ZIP" file, and extract it. All you will need is the "highlighter" folder, so you may delete the rest of the contents of the extracted folder. Then, move your highlighter folder into the path "C:\Users\[USER]\.vscode\extensions" (change the "[USER]" field to the name of the desired user you want highlighting in). Then, you're done! Now you can freely create and write files ending with ".luapp" in VSCode, whilst getting syntax highlighting. There is no language server yet, so you won't get errors in your editor.

About

Lua++ is a unique language that is written in Roblox's Lua, and compiles to Roblox's Lua.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages