Trending

World technology news

→
Archive photograph of a Wand-Board development board illustrating embedded software.
crates.ioIn-depth report

QuickJS Pure 0.10.0 packages an embeddable JavaScript engine written in Rust

The version record and separate documentation build are public. An embedding host still defines which native capabilities JavaScript can call.

·crates.io
Reading progress0%

The engine runs inside a host application

QuickJS Pure 0.10.0 was published to crates.io on November 29, with a separate versioned Docs.rs build. The package describes an embeddable JavaScript engine written in Rust, aiming for QuickJS compatibility. Imagine a desktop label editor that evaluates a short formatting script and receives text from a few fields. Running it in an embedded host does not automatically create a browser environment. The engine evaluates language constructs. The host decides which file, network, user interface or timer capabilities exist. List those capabilities in the fixture before interpreting compatibility results.

Record the inputs and output of a small rule

Start with a product name, a formatted price and an inventory state. Pass them from Rust as data and require the JavaScript rule to return a string. Try the same rule with a missing inventory value, a Unicode product name and a malformed price string. An exception is different from a successful rule that returns an empty string. The test exercises the engine and the host conversion boundary together. Include a correlation identifier on errors without repeating the entire input in logs. That distinguishes a broken conversion from a valid but unusual result.

Define compatibility feature by feature

Extract the language features an existing script actually uses. A short checklist might cover array operations, object spread and Unicode string handling. Run small examples with fixed expected outputs. If the script imports modules, the host’s resolver and path rules belong in that checklist as well. A documentation build is evidence about the published package and target. It does not establish that a particular desktop host exposes the same modules or native callbacks as another runtime. Feature-level results help assign mismatches to the engine or the embedding code.

Measure the host cost as well as execution time

A rule run for one label and a batch transformation for an entire catalogue have different costs. Use fixed sets of one hundred and one thousand products to measure engine startup, time per invocation and peak memory. Record whether the host reuses an engine context or creates one per call. Check how the application handles the next record after an exception. If users can supply scripts, the host must define what is exposed and how resource limits are enforced. Observe whether the UI remains responsive when a job stops making progress, alongside ordinary timing measurements.

Keep the embedding contract beside the version

Record the engine version, Rust target, invoked script function and returned data type with each test. In a label editor, decide what happens if the rule returns an object or array rather than text. Avoid relying on an accidental conversion made by one engine. The same fixture can exercise another engine later if the application changes its runtime. The cover is an archival development-board photograph illustrating embedded software. It is not evidence of a hardware compatibility test for the release.

Run the fixture through both entry points

Evaluate the same script from a command-line fixture and the desktop preview. The first can capture status and data type. The second can show what happens to the selected label after an exception. Identical inputs should exercise the same conversion contract in either host. Compare both outcomes with the same local inputs and record the runtime version beside each result.

Photo · Ordercrazy / Wikimedia Commons ↗ · CC0

Sources and verification
Be the first reader ✎ Write a comment

Reader discussion

Discussion prompt

What would you change first for maintainability and testing in your own project?

No comments yet. Be the first to contribute.

Write a comment

Comments are real visitor contributions. Repeated, link-heavy or abusive submissions may be limited.