Hacker News new | past | comments | ask | show | jobs | submit login

> ngn/k is certainly a lot of fun to use. I just wish it also worked on OS X (& plan9).

To start on MacOS, can apply this patch then run `make k-libc` on OSX 12.0.1 (M1 processor):

    diff --git a/makefile b/makefile
    index 5b08dde..1ba3c32 100644
    --- a/makefile
    +++ b/makefile
    @@ -10,7 +10,7 @@ w:k o/w/fs.h o/w/k.wasm o/w/index.html $(patsubst w/x/%.k,o/w/x/%.k,$(wildcard w
     h:w o/w/http;cd o/w;./http
     
     k-dflt:; $(MAKE) a N=$@ R=k  O='-O3 -march=native -nostdlib -ffreestanding'                L=''
    -k-libc:; $(MAKE) a N=$@ R=k  O='-O3 -march=native -Dlibc'                                  L='-lm'                       STRIP=true
    +k-libc:; $(MAKE) a N=$@ R=k  O='-O3 -Dlibc'                                  L='-lm'                       STRIP=true
     k-obsd:; $(MAKE) a N=$@ R=k  O='-fPIC -Dlibc=1 -DSYS_getcwd=304 -Dstrchrnul=strchr'        L='--static -fno-pie -lm -lc' STRIP=true
     libk.so:;$(MAKE) a N=$@ R=$@ O='-O3 -march=native -nostdlib -ffreestanding -fPIC -Dshared' L='-shared'                   STRIP=true
     o/$N/%.o:%.c *.h;$M;$(CC) @opts $O -o $@ -c $<

However, Apple platforms are not officially supported (or to put it more bluntly, "officially not supported"), and there are bugs such as this one[1]. I suspect it has to do with libc differences on Mac versus Linux. If you have experience with the libc differences between Linux and Mac, I'd welcome your input! I'm not an ngn/k developer, just interested in adding support for MacOS.

[1]: https://codeberg.org/ngn/k/issues/30




I have tried something similar to this but its self tests still don't pass. Will give this a try. Thanks!




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: