Skip to content

htogta/moonbeam

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

= moonbeam

Moonbeam is a (rather sketchy) way of compiling a single Lua script into a 
single executable.

== compiling from source

First, clone the repository and its submodules with:

```
git clone --recurse-submodules <repo-url>
```

Then, navigate to the repository folder. To build your own copy, you can run 
`just bootstrap` to bootstrap a copy of the moonbeam executable.

== usage

```
moonbeam script.lua
```

This creates a standalone executable file called `script` that you can run that 
does exactly the same thing that `script.lua` does.

```
moonbeam -c script.lua
```

This outputs a C program (`script.c`) that contains the source code of 
`script.lua` inside it, stored in a heap-allocated string. The C program (which
includes the Lua interpreter) then interprets this string as Lua source code,
which you can compile as a standalone executable by compiling with `cc` and 
linking with Lua. See `template.c` for an example of what this output might
look like.

Run `moonbeam -h` for more information

About

A silly way of compiling a lua script into a single executable

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published