andydude / zig2lisp

Convert Zig programming language to a Lisp representation of Zig

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

zig2lisp

Convert Zig programming language to a Lisp representation of Zig

Usage

pip install -e git+https://github.com/andydude/zig2lisp.git@main#egg=zig2lisp
zig2lisp t/hello_world.zig

Example Hello World

The following file can be found in t/hello_world.zig

const std = @import("std");

pub fn main() void {
  std.debug.print("Hello, World!\n", .{});
}

To convert it to a Lisp representation, just run the following

$ zig2lisp t/hello_world.zig
(zig:members
  (zig:const std (@import "std"))
  (zig:fn main #() void
    ((zig:dot std debug print)
      "Hello, World!\n"
      (zig:dot #()))))

About

Convert Zig programming language to a Lisp representation of Zig

License:Apache License 2.0


Languages

Language:Python 95.6%Language:ANTLR 4.0%Language:Zig 0.5%Language:Shell 0.0%