r/Protos • • 4d ago

Debugging a rare actor termination race in Protos, a programming language built on GraalVM and Truffle

1 Upvotes

One of the most interesting challenges in implementing an actor-based programming language is ensuring that suspended computations are correctly released when an actor terminates.

Protos, an experimental prototype-based language built on GraalVM and Truffle, recently encountered an intermittent initialization failure during parallel testing.

Instead of increasing timeouts or reducing concurrency, we created a controlled regression that reproduced the underlying scheduler race.

Two cleanup ordering issues were corrected using the existing runtime infrastructure.

  • No new production Java classes.
  • No additional scheduling mechanisms.
  • No changes to the execution hot path.
  • 145 focused tests passed, followed by the complete local test suite.

For developers working with Erlang, Elixir, Pony, Smalltalk, GraalPy or other Truffle languages: how do your runtimes handle termination while an initialization continuation is suspended?

Source and technical details:
https://github.com/guillermomolina/protos/issues/1243

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


r/Protos • • 4d ago

Protos, a prototype-based language on GraalVM/Truffle, now has a complete parser written in itself

1 Upvotes

Another milestone toward self-hosting: Protos now has both a lossless lexer and a complete language parser written in Protos itself.

Protos is an experimental classless, prototype-based language built around objects, delegation, messages, closures, Futures and Actors, running on GraalVM and Truffle.

The new parser provides:

  • Source-aware ASTs with Unicode scalar positions.
  • Optional lossless source retention.
  • Strict syntax diagnostics and structural resource limits.
  • No new production Java code.

Validation compared 1,301 inputs against the existing Java parser, including the parser's own sources and code extracted from Markdown documentation. All 34 required own-source inputs were accepted, and JVM/Native structural parity passed.

The production Java frontend remains unchanged for now. The next architectural challenge is bootstrapping the Protos-written lexer and parser without maintaining two permanent frontend implementations.

For anyone interested in Self, Smalltalk, GraalPy, GraalJS or language implementation: how would you approach this bootstrap problem on a Truffle-based runtime?

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


r/Protos • • 4d ago

Building a self-hosted parser exposed 11 discrepancies in the original Java parser of Protos

1 Upvotes

One interesting benefit of building a programming language parser in its own language is discovering inconsistencies in the original implementation.

While developing the Protos-written parser, differential testing revealed 11 structural discrepancies in the existing Java frontend.

The problem involved contextual keywords, reserved member names, mutation targets and significant newlines.

Instead of adapting the new parser to reproduce the original behavior, the existing frontend was corrected to follow the language specification.

The result:

  • All 11 discrepancies resolved.
  • 37 focused regression tests passing.
  • Integrated local tests passing.
  • No new Java classes or runtime infrastructure.

Projects such as CPython, GraalPy and GraalJS offer interesting perspectives on parser architecture and contextual syntax recognition.

Protos is taking incremental steps toward a self-hosted frontend while preserving its GraalVM and Truffle execution architecture.

What parsing strategy would you choose when moving a language toward self-hosting: handwritten recursive descent, PEG, or a generated parser?

https://github.com/guillermomolina/protos


r/Protos • • 4d ago

What if a timeout didn't cancel the underlying work? Protos adds explicit monotonic deadlines on GraalVM

1 Upvotes

Timeouts and cancellation are closely related in asynchronous programming, but they don't have to be the same operation.

Protos, a prototype-based language built on GraalVM and Truffle, now provides an explicitly authorized monotonic Timing capability.

deadline: timing.monotonicNanoseconds() + 1000000000
outcome: timing.observeUntil(work, deadline)

The observation returns an independent Future. If the original Future becomes terminal before the deadline, its outcome is preserved. Otherwise, the observation reports DeadlineExceeded, without cancelling the underlying work.

Some interesting design choices:

  • Exact Integer nanosecond coordinates.
  • One-shot timers represented by ordinary Futures.
  • Deadline ordering determined by the source's terminal transition, not callback execution.
  • Explicit authority and Actor isolation.
  • No implicit cancellation or generic Future race.

Relative delays, retries and periodic policies can be composed in ordinary Protos code.

For developers familiar with Python asyncio, Rust Tokio, JavaScript Promises or Erlang's Actor model: should deadline observation and cancellation be separate operations, or should timeout APIs combine them?

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

Specification: https://github.com/guillermomolina/protos/blob/main/spec/io/TIMING.md


r/Protos • • 4d ago

Building a self-hosted test tool for Protos: one source of truth for library ownership

1 Upvotes

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

Its bundled Test Tool now derives progress groups directly from canonical Standard Library ownership, removing a separate, manually maintained classification system.

HTML, JSON, XML, TOML, Markdown and other libraries receive meaningful progress labels while preserving test identity, parallel execution and sharding.

The entire production change is implemented in Protos itself, without adding Java runtime code.

It's another small step towards keeping language tooling inside the language rather than accumulating host-language infrastructure.

How do other language projects organize their growing conformance suites without duplicating metadata across their tooling?

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

Project community: r/ProtosLang


r/Protos • • 4d ago

HTML without templates: building a structured HTML library entirely in a prototype-based programming language

1 Upvotes

Protos, a prototype-based programming language running on GraalVM, now includes a structured HTML generation library written entirely in Protos itself.

The approach is comparable to Python's Dominate, Haskell's Lucid and Swift HTML libraries: compose HTML using ordinary language constructs rather than a separate template language.

Html: import("std:html")

div: Html.div
h1: Html.h1
p: Html.p

Html.render(
    div(
        h1("Hello, Protos!"),
        p("HTML as ordinary data")
    )
)

The library provides:

  • 58 HTML tag constructors.
  • Reusable components through ordinary closures.
  • Automatic contextual escaping.
  • Deterministic serialization and resource limits.
  • Ordinary structured objects instead of a privileged HTML value type.
  • Zero new production Java code.

All 110 HTML conformance tests pass locally.

The interesting question is how much of a programming language's standard library can be implemented in the language itself without introducing additional runtime primitives.

For developers familiar with Python, Ruby, Haskell or Smalltalk: which approach to programmatic HTML generation do you prefer, and why?

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

More language development updates in r/ProtosLang.


r/Protos • • 4d ago

A programming language starts parsing itself: Protos now has a lexer written entirely in Protos

1 Upvotes

Protos, an experimental prototype-based programming language built on GraalVM and Truffle, has reached a new milestone toward self-hosting.

Its new lossless lexer and syntax-highlighting package are implemented entirely in Protos, without adding any production Java code.

The implementation includes:

  • Unicode 17 identifier recognition and NFC validation.
  • Lossless tokenization and exact source reconstruction.
  • Strict and recovering lexical analysis.
  • Independent syntax-highlighting classification.
  • 100,182 successful NFC conformance checks.
  • Differential validation against the existing Java lexer.
  • Successful JVM and Native Image validation.

Unlike languages that pursue self-hosting by replacing their entire compiler infrastructure, Protos is exploring an incremental approach while retaining the GraalVM and Truffle execution backend.

The next milestone is a parser written in Protos.

For developers interested in language implementation, compiler design, GraalVM, Python, Ruby and self-hosting: what bootstrap strategy would you choose for replacing the original frontend?

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

Project community: r/ProtosLang


r/Protos • • 5d ago

How Protos is improving developer feedback without sacrificing test coverage on GraalVM

1 Upvotes

As a programming language grows, its test suite can become a bottleneck for everyday development.

Protos, a programming language built on GraalVM and Truffle, now separates Java Core and Standard Library validation and introduces a dedicated smoke gate.

  • make test-smoke — 40 selected JUnit methods plus the complete Protos Core suite.
  • make test-java-core — complete Java Core validation.
  • make test-java-libs — 65 Standard Library test classes.
  • make test-java — the original complete Java suite.

The approach follows the philosophy of selective testing found in GraalPy, GraalJS and other Truffle-based languages.

No new Java classes, duplicated tests or testing frameworks. Full CI coverage remains unchanged.

How do other programming language projects balance fast developer feedback with comprehensive compiler and runtime validation?

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

Community: r/ProtosLang


r/Protos • • 7d ago

When a language's test suite becomes the bottleneck: optimizing Protos on GraalVM and Truffle

1 Upvotes

One integration test in Protos was taking more than 555 seconds in CI.

The problem wasn't necessarily GraalVM performance. Much of the cost came from repeated corpus discovery, JVM initialization, Core bootstrap and redundant integration workloads.

The latest Protos changes address these costs without modifying production Java, increasing timeouts or skipping tests.

Some previous CI timings compared with current local results:

  • Repository scope integration: 504.9s vs 48.8s
  • Formatter bootstrap: 80.4s vs 21.5s
  • Logging facility: 67.7s vs 10.1s
  • Regex semantic transfer: 32.1s vs 9.7s

These aren't controlled benchmarks; comparable CI results are still pending.

The interesting part is how much redundant work can be removed while preserving actual integration coverage.

How do other language implementations, particularly GraalPy, GraalJS and other Truffle languages, manage expensive integration suites?

Technical details: https://github.com/guillermomolina/protos/issues/1227

Project: https://www.protoslang.com

More development updates at r/ProtosLang.


r/Protos • • 7d ago

Try Protos without building a compiler: a GraalVM-based prototype language in VS Code Dev Containers

1 Upvotes

The Protos development environment has been updated.

Protos is an experimental prototype-based programming language built on GraalVM and Truffle, exploring ideas familiar to Smalltalk, Self and Io developers, alongside modern features such as structural matching and native execution.

The ready-to-use VS Code Dev Container now includes:

  • Protos 0.4.252 Native.
  • GraalVM 25.6 and JDK 25.
  • VS Code language extension 0.2.5.
  • Language server, formatting and debugging integration.
  • Runnable examples of contextual matching, structural captures and customizable case selection.

No compiler build or Maven setup is required. Clone the repository, open it in VS Code and reopen it in the Dev Container.

Development environment:
https://github.com/guillermomolina/protos-devcontainer

Language implementation:
https://github.com/guillermomolina/protos

For developers interested in Smalltalk, Self, Io, Python or Rust, Protos offers a different approach to combining prototype-based objects, messages and pattern matching.

Language design discussions and development updates: r/ProtosLang

What would make you try an experimental programming language: an online playground or a fully configured local development environment?


r/Protos • • 7d ago

Protos: a prototype-based language on GraalVM with pattern matching and VS Code integration

1 Upvotes

Protos, an experimental prototype-based programming language built on GraalVM and Truffle, has released version 0.2.5 of its VS Code extension.

For developers familiar with Python's structural pattern matching, Rust's match expressions or Smalltalk's message-based programming, Protos explores a different approach: contextual matching expressed through ordinary messages, Maps and Closures.

The updated editor integration covers:

  • Structural matching and captures.
  • Go to Definition, Find References and Hover.
  • Language server diagnostics.
  • Format Document and format-on-save.
  • Native execution, breakpoints, stepping and local variables.

The extension delegates language intelligence to the Protos runtime instead of implementing another parser or formatter in TypeScript.

All 19 installed-extension acceptance scenarios passed against the official Protos 0.4.252 Native runtime before the extension version was finalized.

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

VS Code Marketplace: https://marketplace.visualstudio.com/items?itemName=guillermomolina.protos

Development updates and language design discussions: r/ProtosLang

How much of a programming language's control flow should be expressible through its ordinary object and message model rather than dedicated language constructs?


r/Protos • • 8d ago

Protos implements XML entirely in its own language, validated against Python, libxml2 and .NET

1 Upvotes

Protos, a prototype-based programming language powered by GraalVM and Truffle, now includes a namespace-aware XML library written entirely in Protos itself, without relying on a Java or native XML parser.

Validation results:

  • 1,983 passing W3C XML conformance cases under the supported profile.
  • 933 differential comparisons against Python's Expat, libxml2 and .NET.
  • 201 independent reference document structures.
  • 4,252 successful test executions across JVM and Native Image, with zero failures.
  • Exact consumer parity with NGINX/njs using a real GitHub Atom feed.

A single incremental parsing kernel supports both event-based processing and document trees, alongside serialization, namespace-aware queries and configurable resource limits.

The library follows a deliberately DTD-free profile of XML 1.0 Fifth Edition and XML Namespaces 1.0.

One particularly interesting aspect of the validation was discovering differences between established XML parsers and resolving them against the specification rather than relying on majority agreement.

How much of a programming language's standard library should be implemented in the language itself rather than delegated to its underlying runtime?

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

Development updates: r/ProtosLang


r/Protos • • 8d ago

Protos moves to GraalVM 25.6.5.1 with validated JVM and Native Image support

1 Upvotes

Protos, an experimental prototype-based programming language built on Truffle, has adopted GraalVM Community and Truffle 25.6.5.1 with JDK 25.0.5.1.

The update includes:

  • Updated runtime dependencies and development environment.
  • Bytecode DSL compatibility reviewed against GraalPy.
  • Updated CI and distribution infrastructure.
  • Successful Native Image guest Tier-2 JIT validation.
  • Full local test suite and successful CI validation.

The migration preserves existing language semantics and compilerability checks without introducing new Java runtime infrastructure.

The new runtime baseline is already available on the main branch.

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

Follow the project at r/ProtosLang.


r/Protos • • 9d ago

Protos replaces its Java-based CommandLine Array builder with ordinary Protos code

1 Upvotes

Another step towards a Protos-first Standard Library.

The CommandLine parser now accumulates option and positional occurrences using ordinary Protos Arrays with geometric growth and exact-sized results.

The dedicated Java Array builder and its bootstrap registration have been removed. No new runtime primitives, Java infrastructure, or changes to Core Array semantics were needed.

The public API remains unchanged, and new regression tests cover accumulation boundaries, repeated options, argument provenance, result independence, and nested command scopes.

All local tests pass.

The goal is to implement as much of the Standard Library as possible in Protos itself, while retaining native runtime mechanisms where they are genuinely necessary.

https://github.com/guillermomolina/protos


r/Protos • • 9d ago

Protos now implements its logging floating-point decimal conversion in Protos itself, replacing Java code

1 Upvotes

Another step towards a Protos-first Standard Library.

The exact shortest-decimal algorithm for binary64 floating-point values has been moved from Java into a private Protos source component shared by the text and JSON logging formatters.

The previous Java implementation and its bootstrap facilities have been removed, while the existing public behavior is preserved.

The implementation is validated against an independent decimal oracle and a deterministic 20,000-iteration binary64 test corpus.

The goal is not to eliminate Java at any cost, but to implement library algorithms in Protos wherever it makes architectural sense.

All local tests pass.

https://github.com/guillermomolina/protos


r/Protos • • 9d ago

Protos: Modularizing seven Standard Library implementations in Protos itself

1 Upvotes

Another step forward for the Protos-first Standard Library.

I've reorganized seven library implementations into cohesive private Protos SOURCE components:

  • TOML
  • JSON
  • Regex
  • CommandLine
  • FFI
  • URI
  • Array

Their public APIs remain unchanged, while their internal implementations are now organized around clearer responsibilities.

JSON's tree and event parsers also share lexical and exact-number algorithms without losing their independent parsing behavior.

The goal is to keep library logic in Protos itself, rather than introducing unnecessary Java infrastructure, and make the Standard Library easier to maintain and evolve.

All local tests pass. The changes are now in main.

https://github.com/guillermomolina/protos


r/Protos • • 9d ago

Protos v0.4.252 — Protos-first Markdown, contextual match and expanded native FFI

1 Upvotes

Protos v0.4.252 is now available!

This prerelease introduces several improvements to the prototype-based programming language built on GraalVM and Truffle:

  • A Markdown parser written in Protos, supporting CommonMark 0.31.2 and selected GFM extensions.
  • Contextual match syntax with ordinary caseOf semantics.
  • Expanded native FFI, including typed pointers, native memory and aggregate-by-value calls.
  • Primitive storage for Bytes, Vector and Matrix.
  • Improved specialized execution paths for arithmetic, iteration and matching.
  • Better formatter source preservation and distributed test execution.
  • Resolved module references and improved HTTP composition.

Native and portable JVM distributions are available. Core specification 0.1.519 remains experimental.

Release: https://github.com/guillermomolina/protos/releases/tag/v0.4.252

Website: https://protoslang.com/

Feedback and contributions are welcome!


r/Protos • • 9d ago

Protos: Separating language and standard library tests as the ecosystem grows

1 Upvotes

As the Protos standard library grows, running every library conformance test after each language implementation change is becoming increasingly expensive.

Protos now separates core language and tooling tests from standard library tests.

Developers can run the entire library suite, select an individual library such as Markdown or TOML, or request exhaustive validation.

CI uses change-aware selection and distributed test execution while preserving complete conformance coverage through scheduled, manual and release validation.

The ownership and early selection mechanisms are implemented in Protos itself, without adding production Java infrastructure.

The latest CI run completed all 20 jobs successfully:

  • Core language and tooling: 1,540 Cases.
  • Standard library: 5,461 Cases.
  • Total: 7,001 Cases, zero failures.

No existing conformance tests were removed.

https://github.com/guillermomolina/protos


r/Protos • • 9d ago

I added a CommonMark and GFM Markdown parser to Protos, written entirely in Protos itself

1 Upvotes

Protos now has its own Markdown parsing library, implemented in Protos itself rather than relying on an external parsing engine.

The new std:markdown module includes:

  • CommonMark 0.31.2.
  • GFM tables, task lists, strikethrough and extended autolinks.
  • Semantic trees with 22 node kinds.
  • Optional original-source positions.
  • Unicode 17.0.0 support.
  • Deterministic resource limits.

The implementation includes 2,804 official conformance cases, additional regression tests, and reproducible upstream data.

What I particularly like about this addition is that it required no new Java runtime code. It demonstrates how substantial, reusable libraries can be implemented directly in Protos.

Markdown parsing is also independent of HTML rendering, making the resulting semantic trees useful for editors, documentation tools and static analysis.

Available in Protos 0.4.250-SNAPSHOT.

https://github.com/guillermomolina/protos


r/Protos • • 9d ago

Optimizing pattern matching in a Truffle-based language: from 7,448 to 54 compiler graph nodes

1 Upvotes

I've just completed another major optimization in Protos, an experimental prototype-based programming language built on GraalVM and Truffle Bytecode DSL.

Eligible caseOf and match expressions now compile into guarded branches, with direct primitive comparisons and inlined actions.

In our pre-integration benchmark snapshot, the first primitive-switch workload went from 7,448 to 54 guest Tier-2 graph nodes after TruffleTier.

An interesting discovery was how much the compiler version itself affected the comparison. After aligning Protos and GraalPy on GraalVM 25.5.5.0.3, the integer-switch LowTier comparison became 345 versus 328 nodes.

These are structural measurements, not execution-time speedups.

The optimization preserves ordinary message semantics, custom matching behavior, method overrides and suspension.

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

Implementation history: https://github.com/guillermomolina/protos/issues/883


r/Protos • • 9d ago

Protos adds explicit TCP transport lifecycle control with Native Image coverage

1 Upvotes

Protos continues to improve its asynchronous I/O model with explicit TCP transport lifecycle control.

The new TcpConnection.abort() operation complements ordinary close(), preserving previously committed I/O results while allowing explicit resource retirement.

The implementation reuses the existing runtime infrastructure, maintains Actor isolation and preserves TLS and HTTP ownership semantics.

The public operation is implemented in Protos itself, keeping Java responsible for the underlying transport mechanisms.

All local tests pass, including Native Image regression tests and real TCP loopback conformance.

Implementation: 0.4.232-SNAPSHOT
Language specification: 0.1.518

https://github.com/guillermomolina/protos


r/Protos • • 9d ago

Protos adds explicit module references for reusable libraries, Actors and HTTP servers

1 Upvotes

Protos now separates module resolution from module initialization through explicit resolved module references.

Previously, passing a context-dependent module name to a reusable library could cause it to be resolved in the library's environment instead of the application's environment.

The new API makes that distinction explicit:

ref: import.resolve("self:Handler")
module: import(ref)

Resolution does not execute the module. The reference retains the selected canonical target, while each Actor initializes its own module instance.

This also makes HTTP server composition much simpler:

Host: import("std:http/host").Host
ref: import.resolve("self:Handler")
host: Host.owning(listener, ref, "handle", workers: 4)

Both direct handlers and handler factories are supported, including private application modules.

The design preserves package authority, Actor isolation, existing String imports and explicit capability delegation. References can cross the same-Process Actor creation boundary, but not ordinary Actor messages or isolated parallel transfers.

The implementation remains Protos-first, reusing the existing module loader and Actor transfer machinery without introducing a separate HTTP resolver or compiler execution path.

All local tests are reported passing. Available in Protos 0.4.231-SNAPSHOT.

https://github.com/guillermomolina/protos


r/Protos • • 10d ago

Announcement Protos restores and redesigns its CI infrastructure: 15 validation jobs and nearly 11,000 passing tests

1 Upvotes

The Protos continuous integration infrastructure has been restored and redesigned across two major phases.

The new infrastructure includes:

  • Automatic GitHub Actions validation for pushes and pull requests.
  • Deterministic distributed Java test execution.
  • Distributed Protos test execution using its own Test Tool sharding.
  • Reliable Maven cache restoration and storage.
  • Independent diagnostic workflows.
  • Revision-bound test coverage reconciliation and fail-closed aggregation.
  • Mandatory compilerability, foreign-provider, Native Image and guest JIT validation.

The complete distributed CI workflow passed on its first validation run in 11 minutes and 4 seconds, with 15 successful jobs, 6,941 passing Java tests, 4,034 passing Protos test cases and zero failures.

All mandatory validation remains intact, while local test execution remains unsharded by default.

The implementation is available on main.

https://protoslang.com/

https://github.com/guillermomolina/protos


r/Protos • • 10d ago

Protos Test Tool now streams large JSON Case listings without changing runtime I/O limits

1 Upvotes

The Protos Test Tool has been updated to serialize Case listings incrementally using its existing JSON event writer.

The complete repository test plan now produces a single valid JSON document containing 4,034 Cases and 1,442,281 bytes.

Validation confirms:

  • Exact Case identities, display values and ordering.
  • Complete, disjoint coverage across four deterministic shards.
  • Correct Unicode handling and JSON escaping.
  • Ordered output completion and error propagation.
  • All local tests passing.

The production correction is implemented entirely in Protos itself, without Java runtime changes, increased I/O limits or new language semantics.

This also removes a prerequisite blocker for distributed test execution in CI.

Issue: https://github.com/guillermomolina/protos/issues/1189

Website: https://protoslang.com


r/Protos • • 10d ago

Protos now supports deterministic distributed test sharding, implemented entirely in Protos

1 Upvotes

Deterministic distributed test sharding has been implemented in Protos, entirely in the language itself, with zero Java runtime changes.

Independent runners can now execute different partitions of the same test suite:

protos test --shard-count 4 --shard-run 2

Distributed sharding and local parallelism are independent:

protos test --shard-count 4 --shard-run 2 --jobs 8

The implementation provides:

  • Global round-robin partitioning of logical test cases.
  • Deterministic, disjoint partitions with complete coverage of the same selected plan.
  • Compatibility with file, directory and exact CaseRef selection.
  • Successful empty shards.
  • Preservation of test identities, execution isolation and discovery signatures.
  • Unchanged default unsharded behavior.

Assigned cases can also be inspected without executing their bodies using --list-cases.

All 54 focused tests passed, together with the complete local validation, compilerability checks and Native Image tests.

The next step is integrating this functionality into the distributed GitHub Actions test matrix.

Available on main in 0.4.227-SNAPSHOT.

https://protoslang.com

https://github.com/guillermomolina/protos/issues/1185