diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..7ae5136 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,31 @@ +# Typed Hypertext Preprocessor + +The latest rewrite of the THP programming language. +Now in Zig! + +## TODO + +- [ ] Rewrite lexer +- [ ] Rewrite parser +- [ ] Rewrite semantic analyzer +- [ ] Rewrite type checker +- [ ] Rewrite code generator +- [ ] Rewrite CLI interface +- [ ] Rewrite REPL +- [ ] Rewrite tests +- [ ] Type definition generator +- [ ] Code formatter +- [ ] Language server +- [ ] stdlib +- [ ] Watch mode compilation +- [ ] Project mode compilation +- [ ] Docs generator + + +## v0.0.1 + +- [ ] + + + + diff --git a/src/main.zig b/src/main.zig index c8a3f67..6b004d0 100644 --- a/src/main.zig +++ b/src/main.zig @@ -1,19 +1,21 @@ const std = @import("std"); +const thp_version: []const u8 = "0.0.0"; pub fn main() !void { + try repl(); + // Prints to stderr (it's a shortcut based on `std.io.getStdErr()`) std.debug.print("All your {s} are belong to us.\n", .{"codebase"}); +} - // stdout is for the actual output of your application, for example if you - // are implementing gzip, then only the compressed bytes should be sent to - // stdout, not any debugging messages. +fn repl() !void { const stdout_file = std.io.getStdOut().writer(); var bw = std.io.bufferedWriter(stdout_file); const stdout = bw.writer(); + try stdout.print("The THP REPL, v{s}\n", .{thp_version}); + try stdout.print("Enter expressions to evaluate. Enter CTRL-D to exit.\n", .{}); - try stdout.print("Run `zig build test` to run the tests.\n", .{}); - - try bw.flush(); // don't forget to flush! + try bw.flush(); } test "simple test" {