jetc: rename --shared build output convention from .so to .jtc

Purely a naming-convention change per user request, not a format
change - the output is still a real ELF shared object (-shared -fPIC),
still dlopen()-able exactly as before. .jtc ("jet compiled") marks it as
an APIServer-loadable content module rather than a generic library.

build-shared.sh: usage text and STEM derivation
(basename "$OUTPUT" .so -> .jtc) both updated - the STEM change is the
one functional piece here, everything else in this commit is comments/
usage strings. Doc comments in jetc.cpp/JetCodegen.h/host_test.cpp/
api_test.cpp updated to match.

Verified live: rebuilt jetc and all five demo*.jtc modules, reran
api_test/host_test against demo3.jtc (still resolves jetc_api_demo3/
jetc_render_demo3 and renders correctly) - the extension is purely
cosmetic to dlopen(), as expected.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
Brad ArantandClaude Sonnet 5 committed 2026-08-25 11:41:44 -07:00
1 parent 3f273b0a95
commit 9bbb95cc57
6 files changed
+28 -22

No files matched your search

+10 -8
View File
@@ -1,12 +1,14 @@
#!/bin/bash
# Compiles a .jet file into a shared object exporting a stable, dlsym()-able
# render entry point - `jetc_render_<basename>(jet::Global &global,
# coreutils::MString &out)` - for a long-running server to load and call
# directly instead of spawning a jet-2.0 process per request.
# Compiles a .jet file into a shared object (conventionally named .jtc -
# "jet compiled" - to mark it as an APIServer-loadable content module, not
# a generic .so) exporting a stable, dlsym()-able render entry point -
# `jetc_render_<basename>(jet::Global &global, coreutils::MString &out)`
# - for a long-running server to load and call directly instead of
# spawning a jet-2.0 process per request.
#
# Usage: ./build-shared.sh <input.jet> <output.so>
# Usage: ./build-shared.sh <input.jet> <output.jtc>
#
# The host server links/dlopen()s the .so and calls the exported symbol
# The host server links/dlopen()s the .jtc and calls the exported symbol
# (see the "entry symbol:" line jetc prints) with its own jet::Global -
# this script does not decide that lifecycle, only builds the module.
# coreutils::Exception propagates out of the call uncaught; the host
@@ -18,13 +20,13 @@ CU="$JC/../CoreUtils"
HERE="$JC/jetc"
if [ $# -ne 2 ]; then
echo "usage: $0 <input.jet> <output.so>"
echo "usage: $0 <input.jet> <output.jtc>"
exit 1
fi
INPUT="$1"
OUTPUT="$2"
STEM="$(basename "$OUTPUT" .so)"
STEM="$(basename "$OUTPUT" .jtc)"
if [ ! -x "$HERE/jetc" ]; then
echo "Building jetc..."