Repository navigation
9.2: the shared glue — python_glue<Host>, for tap.python and tap.python~ - #47
Merged
Merged
Conversation
… for tap.python too (9.2) The attribute, message and trampoline headers fold into tap.python_glue.h, beside the object: python_attr<Host>, python_message<Host> and python_members<Host> (the attributes and messages made for a class, their reconciliation on reload, attribute access, and the guard), with the C trampolines instantiated per host type through Host::self(). Starting the runtime, the file watch, atom conversion, found_method()/not_found_method() and the console hooks move there from the object; reserved_messages() takes the audio names as a parameter (audio_messages()). The file watcher and package headers lose their _tilde (tap.python_filewatch.h, tap.python_package.h), as both objects use them. A pure move: tap.python~'s list of reserved names is the same 53 in the same order, its messages and errors read the same, and its glue test is unchanged but for two call sites, plus a scenario pinning what an audio object reserves beyond every object's. The guard's comment now says what 9.0 found: an attribute answers its name, a message added with object_addmethod() does not. style.yml's clang-tidy header filter widens to the glue headers. Verified: the glue test (10 cases), clang-format, clang-tidy-18, no CPython data imports, and every runtime test in Max 9.1.5 on macOS. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rVV9SkjkWmiBXFMT4whkz
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_019rVV9SkjkWmiBXFMT4whkz
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Plan item 9.2 (docs/TAP-PYTHON-PLAN.md): what
tap.python~does on the Max side thattap.python(9.3) needs too now lives in one place, templated on the host object.What moved
tap.python_glue.h(new, beside the object) holds:python_attr<Host>,python_message<Host>andpython_members<Host>. Together they cover the attributes and messages made for a class, keeping them in step across reloads, attribute get/set, and the guard (answered_by_max).python_glue<Host>. Each one finds its object throughHost::self().start_runtime(),watch_source(),to_values(),found_method()/not_found_method(), and the console hooks.reserved_messages(audio), which now takes the audio names as a parameter (audio_messages()).tap.python_tilde_{attribute,message,cglue}.hare folded into it and deleted.tap.python_tilde_{filewatch,package}.hare renamed totap.python_{filewatch,package}.h, since both objects use them.tap.python_tilde.cpploses its hand-written trampolines.Why it's a pure move
tap.python~reserves the same 53 names in the same order (checked againstmain). Its errors and console text are the same strings.found_method,not_found_method). One new scenario pins what an audio object reserves beyond what every object reserves.object_addmethod()does not.style.yml's clang-tidy header filter now coverstap.python_tilde/tap.python*, so the glue headers stay in scope.For 9.3
reserved_messages(false)still includesanything, which comes from 8.2's list. The plan saystap.pythonexposes a class'sanything, so 9.3 needs to take it out of that object's list and adddumpout.Verified (macOS 15, Max 9.1.5)
nm: no CPython data importsruntime-tests/run.py: every runtime test passes in Max, including attributes-and-messages (22 assertions), which goes through the new trampolines🤖 Generated with Claude Code
https://claude.ai/code/session_019rVV9SkjkWmiBXFMT4whkz