Skip to content

Move shared request/response handling into toolkit-wolfram - #12

Merged
m-messer merged 4 commits into
mainfrom
refactor_to_toolkit
Aug 5, 2026
Merged

Move shared request/response handling into toolkit-wolfram#12
m-messer merged 4 commits into
mainfrom
refactor_to_toolkit

Conversation

@m-messer

@m-messer m-messer commented Aug 5, 2026

Copy link
Copy Markdown
Member

What changed

Previously, this repo contained its own copy of the communication code — the part that reads the incoming request, decides whether it's an eval or preview, calls your evaluate.m/preview.m, and writes the response.

This PR removes that code (evaluation_function.wl) and instead pulls it in from a shared library, toolkit-wolfram. Your actual evaluation logic in evaluate.m and preview.m is barely touched — a couple of small signature tweaks so they plug into the shared library correctly.

Alongside that:

  • The function now talks to the platform over TCP instead of writing to a file — this fixes the latency issue we were seeing, and shouldn't affect how you write evaluation logic.
  • The example request/response in the README changed slightly (type instead of comparisonType, no more "error": null in successful responses) — just reflects the new shared communication layer's format.
  • A new script, scripts/setup-toolkit.sh, fetches the shared library locally so you can still test with wolframscript on your own machine, the same way as before.

Why

This is currently the only Wolfram evaluation function, but more are planned. Moving the communication code into a shared library now means future Wolfram evaluation functions can reuse it instead of copy-pasting it, and any future bug fix or improvement only needs to happen in one place.

Feedback wanted

The main thing I'd like your take on is the new local development workflow: instead of everything living in this repo, you now run scripts/setup-toolkit.sh once to fetch the shared library, then run the evaluation function against it locally (details in the updated README). Does this feel reasonable day-to-day, or does having that extra dependency/step get in the way of how you normally work on the evaluation logic?

…valuation_function.wl` to support RPC-based function wiring through `ServeEvaluationFunction`.
…ration details, and simplified Dockerfile by excluding `evaluation_function.wl`.
…ram` version; updated README and `.gitignore` to reflect the new local development workflow.
…ed support for configurable worker start timeout.
@m-messer
m-messer merged commit 48bb420 into main Aug 5, 2026
8 checks passed
@m-messer
m-messer deleted the refactor_to_toolkit branch August 5, 2026 16:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant