alexkarle.com

Source for alexkarle.com
git clone git://git.alexkarle.com/alexkarle.com.git
Log | Files | Refs | README | LICENSE

commit 1cca3d778fd41e674dd8443a7ef0e01d2178b123 (patch)
parent ec85fe9042719475bc41a88a9c31ee77a99f9dc0
Author: Alex Karle <alex@alexkarle.com>
Date:   Sun, 17 Apr 2022 04:08:13 +0000

gopher: Add initial 6c exploration on plan-9

Turns out porting nihdoc(1) was ambitious for never
having written any plan9 C before!

Diffstat:
Mgopher/notes/all/plan9-journey.txt | 41+++++++++++++++++++++++++++++++++++++++++
1 file changed, 41 insertions(+), 0 deletions(-)

diff --git 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 <u.h> +#include <libc.h> + +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