~alva/zig-bare

124838d0495d6bdac4a80ed2d532ed205b73192a — Alva a month ago 81525c7
Add build manifest
2 files changed, 11 insertions(+), 10 deletions(-)

A .build.yml
M README.md
A .build.yml => .build.yml +7 -0
@@ 0,0 1,7 @@
image: alpine/edge
packages:
  - zig
tasks:
  - test: |
      cd zig-bare
      zig build test

M README.md => README.md +4 -10
@@ 2,6 2,8 @@

[BARE Message Encoding](https://baremessages.org/) implementation in Zig.

Build status: [![builds.sr.ht status](https://builds.sr.ht/~alva/zig-bare.svg)](https://builds.sr.ht/~alva/zig-bare)

## Building

Requires Zig 0.6.0.


@@ 50,15 52,7 @@ warn("x: {}\ny: {}\n", .{ x, y });
```

Hash maps and slices require allocation;
call `deinit` on a `Reader` to free any memory that was allocated,
if hash maps or slices are used.

### A note on hash maps

Since `std.HashMap` returns a `struct`, compile-time duck-typing is used to
detect if a `struct` is a hash map.
If/when Zig gains support for some form of traits or interfaces,
those will be used instead.
call `deinit` on a `Reader` to free any memory that was allocated.

## BARE conformance



@@ 67,7 61,7 @@ as `[length]u8` and `[]u8`, and `string` is also the same as `[]u8`.

For `map[type A]type B`, `std.HashMap` is used.

All BARE invariants are enforced at compile-time.
When using `Writer`, all BARE invariants are enforced at compile-time.

## Code generation