This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| interface Value<T> { | |
| kind: "value"; | |
| value: T; | |
| } | |
| interface Error<T> { | |
| kind: "error"; | |
| error: T; | |
| } | |
| export type Result<T, E> = Value<T> | Error<E>; | |
| export type Optional<T> = T | undefined; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Builder = @import("std").build.Builder; | |
| pub fn build(b: *Builder) void { | |
| const mode = b.standardReleaseOptions(); | |
| const exe = b.addExecutable("main", "src/main.zig"); | |
| exe.setBuildMode(mode); | |
| exe.setTarget(.wasm32, .freestanding, .none); | |
| b.default_step.dependOn(&exe.step); | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| const Builder = @import("std").build.Builder; | |
| const builtin = @import("builtin"); | |
| const wasmLink : []const []const u8 = []const []const u8 {"wasm-ld", "./zig-cache/wasmtest.o", "-o", "./zig-cache/wasmtest.wasm", "-O2", "--no-entry", "--allow-undefined"}; | |
| pub fn build(b: *Builder) void { | |
| const mode = b.standardReleaseOptions(); | |
| const obj = b.addObject("wasmtest", "src/main.zig"); | |
| obj.setBuildMode(mode); | |
| obj.setTarget(builtin.Arch.wasm32, builtin.Os.freestanding, builtin.Environ.unknown); |