Skip to content

dgv/play.zig

Repository files navigation

play.zig

zig version zon deps build License: MIT

play.zig

play.zig is just another Zig playground, actually an adaptation wrapping Zig for compilation and format code from my old go-vim (Go Playground)...

Following considerations when you use it:

  • Running at last Zig stable version.
  • 5s timeout by default.
  • if firejail is installed the consumption of networking is sandboxed.
  • code snippets for sharing are stored using sqlite.

Motivation

During my learning I miss some place to run ziglings or share code quickly, so here we go. Another playgrounds implementations:

Related:

  • zigbin.io: another purpose but nice, run zig trunk version by default, can run and share local files there via curl, no fmt.
  • zig.run: nice, written in zig but offline, confused layout, no share option. give me the idea to add ziggy ;)

Run locally with docker

$ docker run --rm -p 8080:8080 dgvargas/play-zig

Run locally from the source

$ git clone https://github.com/dgv/play.zig; cd play.zig
$ zig build run

Env vars

ADDR Binding Address (default: 0.0.0.0)
PORT port binding number (defult: 8080)
AWS_ENDPOINT_URL_S3 endpoint of s3 to persist sqlite database (default: "")
AWS_BUCKET_NAME_S3 bucket name of s3 to persist sqlite database (default: "play-zig")

Note: regarding s3 persistence credentials variables (AWS_ACCESS_KEY_ID, AWS_ENDPOINT_URL_S3, AWS_REGION) must be set to work properly.