From 1cca3d778fd41e674dd8443a7ef0e01d2178b123 Mon Sep 17 00:00:00 2001 From: Alex Karle Date: Sun, 17 Apr 2022 04:08:13 +0000 Subject: [PATCH] gopher: Add initial 6c exploration on plan-9 Turns out porting nihdoc(1) was ambitious for never having written any plan9 C before! --- gopher/notes/all/plan9-journey.txt | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/gopher/notes/all/plan9-journey.txt b/gopher/notes/all/plan9-journey.txt index 090e787..2a368b8 100644 --- a/gopher/notes/all/plan9-journey.txt +++ b/gopher/notes/all/plan9-journey.txt @@ -215,3 +215,44 @@ search around the community spaces. It's been a real fun "can you boot it" challenge, and I've already been inspired by some of the design philosophy, but I'm clearly very green at getting anything working. + + +[Sat Apr 16 23:14:18 EDT 2022] + +Another night, another challenge. Let's try to figure out how +to get my alexkarle.com site to build on 9front. This should +be interesting because we have: + +1. A C markdown-like compiler (nihdoc) to port +2. A makefile to port + +Hopefully it's a chance to learn both 6c(1) and mk(1)! + +Let's start with hello world in plan9-C, as discussed in +"C Programming in Plan 9", from cat-v [1] + +#include +#include + +void +main() +{ + print("hello, world\n"); + exits("wat"); +} + +Compile and marvel at string exit messages: + +term% 6c hello.c +term% 6l hello.6 +term% 6.out +hello, world +term% echo $status +6.out 1480: wat + +Aaaand at this point in the night I'm realizing that porting +anything substantial is gonna be a mess. So here's to just +writing plaintext for gopher and git/push-ing that into the +void! For now, at least. + +[1]: http://doc.cat-v.org/plan_9/programming/c_programming_in_plan_9 -- libgit2 1.1.1