r/Protos • • 3h ago

When a temporary variable makes bytecode execution more efficient: fixing the underlying compiler path

Should these two expressions need different execution strategies?

body.add(source[index])

octet: source[index]
body.add(octet)

The latest Protos compiler update addresses unnecessary dispatch and primitive value materialization when specialized bytecode operations are composed.

Indexed reads and numeric expressions now compose directly with existing specialized unary calls. Standard Bytes reads also deliver unsigned octets directly as primitive long carriers.

The optimization preserves dynamic method selection, mutable slots, evaluation order and suspension without replay.

No new Java classes. No new Bytecode DSL operations. No application-specific shortcuts.

761 regression tests reported, with zero failures or errors.

An interesting compiler design question: how much intermediate value transport can be eliminated while preserving fully dynamic message semantics?

Website: https://protoslang.com

Source code: https://github.com/guillermomolina/protos

1 Upvotes

0 comments sorted by