Feat: Prevent too large data from transfer unless requested
enhancement
Context:
Some Wolfram expressions may, perhaps surprisingly, return large data - f.ex. VideoTrim and =. This makes evaluation slow, as we need to transfer and parse all this possibly undesirable data, and may lead up to OutOfMemory exception.
Action:
When the result seems to be too large, return instead `:wolframite/large-data`. Only allow returning results bigger than the threshold when explicitly requested via the `flags/allow-large-data` flag.
Notice this can only be done on Wolfram side, so we wrap expressions with a tiny piece of code (loaded in at startup) that we then use.
Also included:
* Fix: Ensure that when custom opts provided, we still respect the defaults (essential, as some config vals are there).
* Refactoring: Add internal-constants ns for better readability.
More details:
* Add `convert/wrapping-convert` as the top-level convert call, similarly with `parse/unwrapping-parse`
* Add `proto/failed?` to recognize the `$Failed` symbol
* Add `internal-constants` ns for some of the new stuff
* Replaced `proto/number?` with `proto/number-type?`
合并状态:已合并 合并于 2025-06-06 关闭于 2025-06-06 1 条评论