• Stars
    star
    165
  • Rank 228,906 (Top 5 %)
  • Language
    Zig
  • License
    BSD Zero Clause L...
  • Created about 5 years ago
  • Updated 9 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
336
star
2

resinator

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

Squake

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

AppleCore

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

Minimap-HUD

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

zig-std-lib-fuzzing

A set of fuzzers for fuzzing various parts of the Zig standard library
Zig
46
star
7

VeganOption

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

d2itemreader

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

audiometa

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

considerveganism.com

The source files of considerveganism.com
HTML
34
star
11

ASMHelper

Helper classes for ASM transformations in Minecraft mods
JavaScript
24
star
12

SpiceOfLife

A Minecraft mod that encourages dietary variety through diminishing returns
Java
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
17
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

zig-fuzzing-example

An example of fuzzing Zig code with AFL++
Zig
13
star
20

heroku-buildpack-luvit

Heroku buildpack for Luvit 2.0
Shell
12
star
21

luver

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

Squeedometer

A speedometer for Minecraft
Java
12
star
23

bunnyhop-webgl

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

d2-map-investigation

Tool for finding correlations between how different areas generate in Diablo II
C
9
star
25

Better-Console

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

TiC-Tooltips

Minecraft mod that adds tooltips to Tinkers' Construct tool parts
Java
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

syscallogist

An experiment in determining/cataloging the range of possible syscall behavior through empirical testing
Zig
8
star
29

coro-http-luv

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

zigescape

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

get-known-folder-path

A Zig implementation of SHGetKnownFolderPath
Zig
5
star
32

named-character-references

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

sleep

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

CreativeBlocks

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

HungerInPeace

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

zig-hash-map-bench

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

memreader

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

ryanliptak.com

source files for ryanliptak.com
Lua
3
star
39

bsp-to-mesh

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

luvit-irc-activity-bot

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

lua-taskbarflash

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

win32-samples-rc-tests

Test suite for .rc compilers using Windows-classic-samples as the test corpus
PowerShell
2
star
43

BWAPI-Lua

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

lua-arbitrary-binary-string

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

HarvestCraftWaila

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

d2grailcheck

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

win32-resource-tests

Test programs for various Windows resources, mostly to explore how edge cases are handled/their ramifications
C
1
star
48

win32-libuv

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

EarliestOfGames

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

luvit-oauth2

OAuth2 client for Luvit
Lua
1
star
51

HungerPersistence

Minecraft mod that makes hunger persist across deaths
Java
1
star
52

BnBTweaks

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

zig-unidecode

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