Commit be041e87

be041e87636dMerged

Yukihiro "Matz" Matsumoto <[email protected]> · 6 months ago · 1 file · ~1 modified

Description

docs: add Portability section to README

Resolves the question raised in #9: which platforms does Spinel target, and is the generated C portable across them. The Windows / MinGW work landed via #16, #23, #39, #40 — every PR now runs gcc, clang, macOS-clang, and windows-mingw jobs end-to-end — so the README can finally answer "yes, with a CI matrix to back it." MSVC is the documented non-target; calling that out keeps the scope honest.

Closes #9

Co-Authored-By: Claude Opus 4.7 (1M context) [email protected]

Details

Commit
be041e87636d
Parent
ed57f56e9e9e

README.mdmodifiedView file

@@ -310,6 +310,41 @@
310310 CRuby is needed only for the initial bootstrap. After `make`, the
311311 entire pipeline runs without Ruby.
312312
313+## Portability
314+
315+Spinel can emit C without invoking the C compiler — useful when you
316+want to build the Ruby program on one machine and ship the generated
317+sources to another:
318+
319+```sh
320+spinel app.rb -c # writes app.c next to the source
321+spinel app.rb -c -o app.c # specify output path
322+spinel app.rb -S # print the C to stdout
323+```
324+
325+The output is one self-contained `.c` file that compiles against
326+`lib/sp_runtime.h`. The two together are everything a downstream
327+consumer needs — no link to `libspinel`.
328+
329+The runtime is POSIX-flavoured but covers every platform CI exercises:
330+
331+| Platform | Status | Compiler |
332+|---|---|---|
333+| Linux (x86-64, arm64) | Supported | gcc, clang |
334+| macOS (Intel, Apple Silicon) | Supported | clang |
335+| *BSD | Expected to work; not in CI | clang |
336+| Windows | Supported via [MSYS2](https://www.msys2.org/) / MinGW | gcc |
337+| Windows native (MSVC) | Not supported | -- |
338+
339+Every PR runs `ubuntu-latest / gcc`, `ubuntu-latest / clang`,
340+`macos-latest / clang`, and `windows-mingw` jobs end-to-end (parser
341+build, codegen build, fixed-point bootstrap, full test + benchmark
342+suites). MSVC isn't supported because the runtime relies on POSIX
343+assumptions (`<ucontext.h>` for `Fiber`, `<sys/mman.h>` for the
344+regexp engine's executable buffers, GCC's `__attribute__((cleanup))`
345+for the GC root stack); a port would either replace those or guard
346+them behind compile-time switches.
347+
313348 ## Limitations
314349
315350 - **No eval**: `eval`, `instance_eval`, `class_eval`