-
Notifications
You must be signed in to change notification settings - Fork 93
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
The zig compiler is way behing on opensuse. I tried building zig from source but encountered many compile errors. I'll wait until opensuse is updated.
- Loading branch information
Showing
6 changed files
with
79 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
hello-zig | ||
assignment | ||
integers | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
.PHONY: all | ||
all: hello-world assignment integers | ||
|
||
hello-world: hello-world.zig | ||
zig build-exe -O Debug hello-world.zig | ||
|
||
assignment: assignment.zig | ||
zig build-exe -O Debug assignment.zig | ||
|
||
integers: integers.zig | ||
zig build-exe -O Debug integers.zig | ||
|
||
.PHONY: clean | ||
clean: | ||
rm -f *.o hello-world assignment integers | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
Examples are from here: | ||
|
||
https://zig-by-example.com/ | ||
|
||
Run Seer like this. The break-function is the name of the program and ".main". | ||
|
||
$ /usr/local/bin/seergdb -s --bf=hello-world.main ./hello-world | ||
|
||
Set the "Source" file configurations in Seer's config page. | ||
|
||
o Add "*.zig" for valid source files. | ||
o Add "/usr/lib/zig/" for "misc" files. | ||
|
||
Zig resources: | ||
|
||
https://github.com/ziglang/zig | ||
https://github.com/zigcc/awesome-zig | ||
|
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
const std = @import("std"); | ||
|
||
pub fn main() !void { | ||
|
||
const c: bool = true; | ||
|
||
var v: bool = false; | ||
v = true; | ||
|
||
const inferred = true; | ||
|
||
var u: bool = undefined; | ||
u = true; | ||
|
||
_ = c; | ||
_ = inferred; | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
const std = @import("std"); | ||
|
||
pub fn main() !void { | ||
std.debug.print("Hello, World!\n", .{}); | ||
} |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
const std = @import("std"); | ||
const print = std.debug.print; | ||
|
||
const a: u8 = 1; | ||
const b: u32 = 10; | ||
const c: i64 = 100; | ||
const d: isize = 1_000; | ||
|
||
const e: u21 = 10_000; | ||
const f: i42 = 100_000; | ||
|
||
const g: comptime_int = 1_000_000; | ||
const h = 10_000_000; | ||
const i = '💯'; | ||
|
||
pub fn main() !void { | ||
print("integer: {d}\n", .{i}); | ||
print("unicode: {u}\n", .{i}); | ||
} |