r/Protos • • 2h ago

Compile callbacks ahead of time or on first use? A measurable runtime trade-off

1 Upvotes

Moving callback compilation out of runtime execution changes an interesting performance trade-off.

Selected callback execution plans are now prepared during compilation, while Closure creation and captured bindings remain deferred until needed.

A targeted JVM benchmark with 128 samples per scenario showed:

  • 28.4% lower first-execution latency for custom callback receivers.
  • 8.0% lower first-execution latency for canonical Boolean receivers.
  • Higher retained memory when prepared callback code remains unused.

Specialized inline execution paths remain intact, and all local regression tests pass.

The interesting question is where to draw the line between eager code preparation, lazy materialization and memory retention.

Website: https://protoslang.com

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


r/Protos • • 3h ago

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

1 Upvotes

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


r/Protos • • 4h ago

Optimizing byte-level method dispatch: faster HTTP and TLS without sacrificing dynamic behavior

1 Upvotes

Sometimes the biggest networking bottleneck isn't the network itself, but the language runtime.

The Protos website migration exposed expensive method selection during byte-oriented processing. Earlier diagnostic runs observed a 1.4 MB HTTPS exchange dropping from 6.76 seconds to 2.26 seconds, although these were not controlled benchmark runs.

The latest development snapshot introduces specialized Bytes method-selection caches while preserving dynamic method redefinition, prototype delegation and receiver isolation.

No HTTP-specific shortcuts. No API changes. All local tests pass.

The next optimization target is the composition of specialized bytecode operations and primitive-value transport.

How much networking performance can be recovered by optimizing the language runtime rather than the networking library?

Website: https://protoslang.com

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


r/Protos • • 7h ago

Pass-by-value without copying every element: 115× faster isolated array transfers

1 Upvotes

Does pass-by-value really require physically copying every element?

The latest Protos runtime optimization separates logical isolation from physical storage using protected primitive backing arrays and copy-on-write.

For round trips involving 65,536 integers, the measured improvements are:

  • Actor transfers: 44.22x faster on JVM and 103.75x on Native Image.
  • Isolated parallel execution: 55.94x and 115.29x, respectively.
  • Even when the destination immediately modifies the array, transfers remain up to 23x faster.

Large binary payloads also benefit from eliminating redundant copies, with improvements of up to 2.80x.

No new ownership API. No shared mutable guest state. Existing snapshot semantics remain intact.

These are workload-specific before/after benchmarks, not general runtime speedups.

How much of the cost of isolated concurrency comes from unnecessary physical copying rather than isolation itself?

Website: https://protoslang.com

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


r/Protos • • 8h ago

Cutting JSON parsing time by 36.2% without changing the runtime

1 Upvotes

A real website workload exposed an expensive JSON parsing path: 21.567 seconds to process a 1.42 MB repository tree.

The parser has now been redesigned around indexed token scanning, replacing per-byte dispatch, redundant numeric traversals and recursive array accumulation.

Measured on the same host, Native executable and input:

  • JSON parsing: 21.567 → 13.769 seconds
  • Parsing throughput: 1.57x
  • Total measured catalog processing time: 29.5% lower
  • All 106 JSON conformance tests passing
  • No runtime implementation changes

Exact decimal arithmetic, Unicode handling, ordered object members and deeply nested structures remain supported.

The remaining parsing cost is still substantial. The interesting question is how much further a standard library parser can be optimized without moving its implementation into the runtime.

Website: https://www.protoslang.com/

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


r/Protos • • 9h ago

Protos adds 25 filesystem and Path operations: a capability-oriented approach to I/O

1 Upvotes

The Protos Standard Library gains 25 new operations across std:io/files and std:io/paths.

  • Portable path manipulation.
  • Directory creation and metadata inspection.
  • Bounded streaming file and tree copying.
  • Recursive traversal and glob matching.
  • Temporary files and directories.
  • Exact nanosecond timestamps.

The implementation separates filesystem authority from path representation, keeps most algorithms in Protos itself, and introduces no new public Core operations.

Validated on both JVM and GraalVM Native Image.

One interesting design question: should a filesystem API make access authority explicit, rather than treating a path as sufficient permission?

Documentation and examples: https://protoslang.com


r/Protos • • 10h ago

How Protos cut its GraalVM Native Image CI job by 44% without sacrificing test coverage

1 Upvotes

Building a programming language on GraalVM and Truffle is an interesting challenge, especially when the language and its Standard Library keep growing.

Protos, a prototype-based language inspired by Self and Smalltalk, has just consolidated its Native Image validation pipeline.

The results:

  • Native Image validation: 16m 19s → 9m 02s.
  • Combined native validation runner time reduced by 32%.
  • One redundant analysis build eliminated.
  • All 38 native TLS tests preserved.
  • All 20 CI jobs passing.

The production executable still uses O2, while the dedicated native JUnit image uses GraalVM's quick-build optimization.

Interestingly, the overall CI still takes around 20 minutes. The bottleneck has shifted to Standard Library testing.

I'm curious how other language implementations, particularly GraalPy, TruffleRuby and other Truffle-based projects, approach this problem as their test suites grow.

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

Website: https://protoslang.com


r/Protos • • 12h ago

Can a dynamic language keep message semantics without paying for every message? Protos compiler update on GraalVM

1 Upvotes

One of the most interesting challenges in implementing a dynamic programming language is preserving its semantics without paying the runtime cost of every abstraction.

Protos, a prototype-based language built on GraalVM Truffle, has just improved its compiler in two areas:

  • Nested control flow and indexed reads can execute inside the enclosing method without unnecessary closure activations.
  • Standard Integer and Float negation now uses a specialized Bytecode DSL operation.

Dynamic dispatch, custom behavior, lexical captures, exact integer arithmetic and suspension semantics remain intact.

The implementation draws on techniques used in GraalPy while addressing Protos's own execution model.

25 new regression tests pass, and the final Protos validation reported 1,564 passing tests.

For developers interested in Smalltalk, Self, Io, Python, GraalVM or dynamic language implementation: how would you approach eliminating these abstraction costs while preserving observable behavior?

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

Website: https://protoslang.com


r/Protos • • 13h ago

What if Unix-style pipelines were implemented entirely in the programming language itself? Protos takes that approach

1 Upvotes

I've been developing Protos, an experimental prototype-based programming language running on GraalVM and Truffle.

The latest milestone is a Standard Library for external commands and streaming byte pipelines, implemented entirely in Protos using its existing execution capabilities, objects, closures, Tasks and Futures.

No new production Java code was needed.

The library supports:

  • Immutable, reusable command descriptions.
  • Bounded binary streaming with backpressure.
  • Independent stderr streams.
  • Structured cancellation and resource cleanup.
  • Explicit execution capabilities.
  • Detailed per-stage results.

Python's subprocess, Rust's std::process, Go's os/exec and Unix shells were interesting reference points when designing this library.

I'm particularly interested in how far a language can go toward implementing its own system-programming abstractions before introducing dedicated runtime machinery or syntax.

This is also a foundation for exploring a more expressive alternative to traditional shell programming.

What would you like to see in a modern programming language designed for both system scripting and general-purpose programming?

Website: https://protoslang.com

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


r/Protos • • 12h ago

Announcement What happens when a programming language grows enough to build its own website? Protos 0.4.272

0 Upvotes

Building a programming language is one thing. Making it capable of building its own ecosystem is another.

Protos is an experimental prototype-based language built on GraalVM and Truffle, exploring ideas familiar to users of Self, Smalltalk and Io.

For the past few releases, I've been working toward a concrete goal: replacing the Node.js, Astro/Starlight and NGINX/njs application stack behind the official Protos website with Protos itself.

That goal has pushed the language considerably further than isolated examples and benchmarks.

With Protos 0.4.272, the building blocks are now available in a single public release:

  • HTTP hosting, networking and TLS.
  • Structured HTML and social metadata.
  • Markdown and XML processing.
  • Monotonic timing and asynchronous deadlines.
  • A lexer, syntax highlighter and parser written in Protos itself.
  • SHA-256 compression implemented in Protos.
  • Native execution without an external JVM.

The new website implementation has already passed local technical acceptance. Production migration is the next milestone.

It's an interesting stage in language development: instead of inventing features in isolation, a real application is driving the evolution of the language and its Standard Library.

For those working with GraalVM, Smalltalk, Self, Io or experimental programming languages: how would you approach building a language's ecosystem using the language itself?

Source and downloads:

https://github.com/guillermomolina/protos/releases/tag/v0.4.272

https://protoslang.com/