Compiler Library
The compiler library is a library unique to Powerlang that allows you to interact with the compiler. Using this library you can inject raw code, and obtain the current version of Powerlang, as well as credits. You can check out all functions it offers by going to its documentation page: compiler
Inserting Visual Scripting Blocks
The compiler library has two functions to insert raw Visual Scripting blocks: InsertBlock
and InsertBlockConnectedLast
. The former creates a block that runs as its own statement, whereas the latter is connected to the last block generated by the compiler. It is possible to use InsertBlockConnectedLast
to create chains of Visual Scripting blocks. Below is a visual representation of both methods:

The syntax of both commands is the same and it's:
Output = compiler.InsertBlock(BlockName, BlockID, ...)
BlockName
is the friendly name of the block, it must be unique. BlockID
identifies the type of the block, e.g. the ID Addition
corresponds to the Addition block. Block IDs can be found in ProgrammingBlocksData.lua in the Powerlang source.
Here's an example of inserting an Addition block to add 60 and 9:
Result = compiler.InsertBlock("Add", "Addition", 60, 9)
Querying the Powerlang version and credits
It is helpful for shared scripts to know what version of Powerlang they're running on.
The Powerlang version can be obtained using compiler.version()
. It returns a string containing the version. So, doing print(compiler.version())
will output Beta 0.9
as of the time of writing this article.
The Powerlang credits can be obtained similarly using compiler.credits()
. Doing print(compiler.credits())
will result in the following output:
Powerlang - The Ultimate Programming Language
(c) vopwn55, 2024
Special thanks to:
NicePotato - Being a good friend
RJAI - Emotional Support
Both the Version and Credits are StringValues located in the root of the Powerlang source code folder.
Last updated