• Stars
    star
    140
  • Rank 252,540 (Top 6 %)
  • Language
    Zig
  • License
    BSD Zero Clause L...
  • Created over 4 years ago
  • Updated about 2 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

An implementation of Lua 5.1 in Zig, for learning purposes

Zua

An attempt at a Lua 5.1 implementation in Zig.

Goals, in order of priority:

  1. Learn more about Lua internals
  2. Learn more about Zig
  3. Anything else

Status

  • Lexer (llex.c/.h) -> lex.zig
  • String parsing (in Lua this was done at lex-time) -> parse_literal.zig (see 4324bd0 for more details)
  • Number parsing (in Lua this was done at lex-time) -> parse_literal.zig
    • Basic number parsing
    • Proper strtod-compatible number parsing implementation
  • Parser (lparser.c/.h) (in Lua this was done as one step with no AST intermediate)
    • Parsing tokens into an AST -> parse.zig (mostly done, needs some more testing/cleanup)
    • Compiling the AST into bytecode -> compiler.zig
  • ...

Why Lua 5.1?

It's what I'm most familiar with, and I'm also assuming that 5.1 is simpler internally than more recent Lua versions.

Building / running

  • zig build to build zua.exe
  • zig build test to build & run the main test suite
  • zig build run to build & run zua.exe (does nothing right now)
  • zig build lua51_tests to run tests on the PUC Lua 5.1 test files (currently it just tests parsing them)
  • zig build fuzzed_lex to run lexer tests on a large set of inputs/outputs generated by fuzzing-lua
  • zig build bench_lex to run a benchmark of the lexer (this benchmark needs improvement)
  • zig build fuzzed_strings to run string parsing tests on a set of inputs/outputs generated by fuzzing-lua

More Repositories

1

AppleSkin

Food-related HUD improvements for Minecraft (AppleCore without the core)
Java
292
star
2

resinator

Cross-platform Windows resource-definition script (.rc) to resource file (.res) compiler
Zig
73
star
3

Squake

Minecraft mod that adds Quake-style, Fortress Forever inspired movement to the game
Java
63
star
4

AppleCore

An API for modifying the food and hunger mechanics of Minecraft
Java
57
star
5

Minimap-HUD

Don't Starve mod that adds a minimap to the HUD
Lua
46
star
6

VeganOption

A Minecraft mod that seeks to add vegan alternatives to all Minecraft mob/animal products
Java
45
star
7

zig-std-lib-fuzzing

A set of fuzzers for fuzzing various parts of the Zig standard library
Zig
40
star
8

d2itemreader

C library for parsing items in Diablo II character/stash files
C
37
star
9

audiometa

An audio metadata/tag reading library written in Zig
Zig
36
star
10

considerveganism.com

The source files of considerveganism.com
HTML
33
star
11

SpiceOfLife

A Minecraft mod that encourages dietary variety through diminishing returns
Java
24
star
12

ASMHelper

Helper classes for ASM transformations in Minecraft mods
JavaScript
23
star
13

watchedoverlay

Windows shell extension to mark arbitrary files as 'watched'
Zig
20
star
14

d2info

Tool for viewing/outputting various information about a running Diablo II game
Lua
18
star
15

obs-txt-trigger

OBS script to use a text file as a trigger for making sources temporarily visible
Lua
18
star
16

WailaHarvestability

Minecraft mod that adds required harvest level and the effective tool to Waila tooltips of harvestable blocks
Java
18
star
17

grindcov

Code coverage for compiled binaries using Callgrind, mostly geared towards Zig code
Zig
15
star
18

micro-zigfmt

micro editor plugin that provides zig fmt integration
Lua
13
star
19

heroku-buildpack-luvit

Heroku buildpack for Luvit 2.0
Shell
12
star
20

Squeedometer

A speedometer for Minecraft
Java
12
star
21

luver

Bare-bones luvit-loader runtime (aka Luvit without any dependencies/libraries included)
Lua
12
star
22

zig-fuzzing-example

An example of fuzzing Zig code with AFL++
Zig
12
star
23

bunnyhop-webgl

Quake/Half-Life style bunnyhopping in WebGL/BabylonJS
JavaScript
10
star
24

Better-Console

Don't Starve mod: Better Console
Lua
9
star
25

TiC-Tooltips

Minecraft mod that adds tooltips to Tinkers' Construct tool parts
Java
9
star
26

d2-map-investigation

Tool for finding correlations between how different areas generate in Diablo II
C
8
star
27

fuzzing-lua

Fuzz testing for various parts of the Lua interpreter, mostly for use as a test-case generator for alternate Lua implementations
C
8
star
28

zigescape

A tool for converting between binary data and Zig string literals
Zig
7
star
29

coro-http-luv

coro-http from Lit converted to work with plain Lua + Luv
Lua
7
star
30

get-known-folder-path

A Zig implementation of SHGetKnownFolderPath
Zig
6
star
31

named-character-references

Purpose-built DAFSA for named character reference matching during HTML tokenization
Zig
5
star
32

sleep

Bare-bones Lua module that exposes a millisecond-precision sleep function
CMake
5
star
33

CreativeBlocks

A Minecraft mod that allows specified blocks to be placed as if the player was in creative mode
Java
4
star
34

HungerInPeace

Minecraft mod that enables normal hunger/health regen in Peaceful mode
Java
4
star
35

zig-hash-map-bench

Benchmarks for Zig's std.HashMap
Zig
3
star
36

memreader

Lua module for reading the memory of Windows processes
C
3
star
37

bsp-to-mesh

Extremely hacky attempt at converting a Source engine BSP file into something usable by Babylon.JS
Go
2
star
38

luvit-irc-activity-bot

An IRC bot written for luvit that announces Github activity
Lua
2
star
39

HarvestCraftWaila

A Minecraft mod that fixes some of Pam's HarvestCraft issues with Waila tooltips
Java
2
star
40

lua-taskbarflash

Lua module for Windows that can flash the taskbar icon and/or window of the current console
C
2
star
41

BWAPI-Lua

Lua bindings for the Brood War API (BWAPI)
C++
2
star
42

lua-arbitrary-binary-string

Convert arbitrary binary data into a Lua string literal (to be embedded in .lua files)
Lua
2
star
43

HungerPersistence

Minecraft mod that makes hunger persist across deaths
Java
2
star
44

d2grailcheck

Tool for checking/outputting the status of a Diablo II holy grail challenge
Lua
2
star
45

win32-libuv

Example integration of the Libuv event loop with the Win32 message loop
C
1
star
46

EarliestOfGames

A ModJam4 mod targeting the extremely early game stage of Minecraft
Java
1
star
47

ryanliptak.com

source files for ryanliptak.com
Lua
1
star
48

luvit-oauth2

OAuth2 client for Luvit
Lua
1
star
49

BnBTweaks

A Minecraft mod that makes various modifications to the game and/or other mods for the Blood N' Bones modpack
Java
1
star
50

zig-unidecode

Very approximate UTF-8 to ASCII transliterator (a Zig implementation of the Text::Unidecode Perl module)
Zig
1
star