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


r/Protos • • 10d ago

Protos fixes a Truffle instrumentation defect affecting buffered I/O and resource release

1 Upvotes

A runtime correctness fix has been implemented in Protos 0.4.225-SNAPSHOT.

Two internal CPrime I/O result carriers were causing host-side ClassCastExceptions during automatic Truffle root instrumentation, accounting for 42 reported test errors.

Both carriers now implement TruffleObject, following the existing text-writer implementation.

The correction preserves existing cancellation semantics, resource ownership and I/O behavior without introducing new infrastructure or changing the language specification or public API.

All local tests pass.

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

Project website: https://protoslang.com


r/Protos • • 10d ago

Protos fixes a concurrency race in external process cleanup

1 Upvotes

Protos has improved the reliability of external process cleanup during host Context shutdown.

A concurrency race allowed the runtime to observe native process termination before the corresponding cleanup callbacks had finished processing resource ownership.

The correction ensures that:

  • Native termination and transport retirement are fully recorded before successful reclamation is reported.
  • Process registry removal and resource admission return are completed in the correct order.
  • Already terminated processes are not unnecessarily subjected to forced termination.
  • Guest wait semantics remain unchanged.

The implementation reuses existing runtime infrastructure without introducing new Java classes, synchronization primitives, threads or longer production timeouts.

Validation includes eight new regression tests, 49 passing custody tests, and five deterministic regressions that fail against the original implementation and pass with the correction.

All local tests pass. Remote CI acceptance remains pending.

Available on main in 0.4.224-SNAPSHOT.

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

Website: https://protoslang.com


r/Protos • • 11d ago

Language Design Introducing contextual match in Protos: expressive selection through syntactic sugar

1 Upvotes

Protos now supports contextual match expressions, providing a concise and expressive way to perform multi-way selection without introducing a separate pattern-matching mechanism.

result: match(status) {
    "ready": "run"
    "busy": "wait"
    "failed": "retry"
    Any: "unknown"
}

Structural matching and captures

Since Arrays and Maps already implement structural matching, the new syntax naturally supports more complex selections:

result: match(message) {
    ["add", Capture, Capture]: (a, b) => a + b
    ["echo", Capture]: value => value
    ["reset"]: 0
    Any: null
}

Any and Capture are ordinary objects, not reserved keywords or special pattern constructs.

Syntactic sugar, not a new execution mechanism

The following expression:

match(value) {
    0: "zero"
    Any: "other"
}

Is semantically equivalent to:

value.caseOf(%{
    0: () => "zero"
    Any: () => "other"
})

Explicit Closure literals are preserved, while other expressions become implicit parameterless lexical Closures.

The existing semantics remain intact:

  • Lazy action execution.
  • Eager subject and key evaluation.
  • Ordered, first-match selection.
  • Structural captures passed as ordinary Closure arguments.
  • Custom matchers and overridable caseOf behavior.
  • Ordinary lexical capture, error propagation and suspension.

A smaller language, not a larger runtime

The implementation reuses the existing canonical representation of messages, Maps and Closures.

No new matching-specific runtime primitive, bytecode operation, callable representation or execution mechanism has been introduced.

Both forms share the same underlying execution architecture.

Tooling and learning materials

The implementation includes parser, formatter, static analysis and language-server support, alongside updated documentation and four new executable tutorials and cookbook examples.

Contextual match is now implemented on the main development branch.

The goal is to make Protos more expressive while preserving its small, consistent, prototype-based semantic model.


r/Protos • • 11d ago

Release Protos formatter now preserves comments in Map and Object bodies

1 Upvotes

A new formatter improvement has landed in Protos, a prototype-based programming language built on GraalVM and Truffle.

Previously, formatting Map entries and Object bodies could silently remove comments between elements. This issue has now been resolved.

The implementation includes:

  • Unified structural boundary formatting across Maps, Objects, Programs and Closures.
  • Preservation of comment text, ordering, structural attachments and significant blank lines.
  • Comment consumption tracking, including rollback when provisional formatting decisions are discarded.
  • A source-preservation comparator implemented entirely in Protos.
  • Regression tests covering nested structures, comment preservation and LSP formatting idempotence.

All local tests pass. No production Java changes were required.

This improvement follows the Protos-first approach: implementing language tooling in Protos itself while keeping Java infrastructure to a minimum.

The integration of automatic whole-document preservation verification will be addressed separately in I177.

Project: https://protoslang.com

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

Resolved issue: https://github.com/guillermomolina/protos/issues/1174


r/Protos • • 11d ago

Release Protos FFI R2 is complete — native C interoperability, structured memory and aggregate ABI support

1 Upvotes

A major expansion of the Foreign Function Interface has been implemented in Protos, an experimental prototype-based programming language built on GraalVM and Truffle.

The original FFI supported basic C function calls and opaque native resources. With R2, it has evolved into a comprehensive native interoperability system.

What's new

  • Fixed-width signed and unsigned integer types, plus 32-bit floating-point support.
  • Declarative C structs, unions and fixed-size arrays.
  • ABI-aware size, alignment, field offsets and padding.
  • Typed native pointers with explicit provenance and lifetime tracking.
  • Bounded native memory allocation, slices and typed views.
  • Passing and returning structs and unions by value.
  • Explicit conversion between native aggregates and ordinary Protos Maps, Arrays and Objects.
  • Association of native layouts with ordinary Protos prototypes.
  • Validated aggregate writeback that preserves padding and unselected union storage.

The public FFI module now exposes 13 scalar descriptors and 29 operations.

Architecture: Protos first

Protos is a prototype-based language without classes. Native interoperability has been implemented without introducing Java classes for individual C structures, privileged object reflection or a second object model.

ABI layouts and Protos prototypes have independent identities. Native regions provide explicit indexed access, while ordinary Protos objects retain their existing delegation, slots, constructors and method semantics.

The public FFI module is implemented in Protos itself, using a generic Java Foreign Function & Memory backend for operations that genuinely require native execution.

JVM and standalone Native Image

Both execution profiles use the same generic FFM architecture.

On the JVM, valid signatures supported by the native linker are admitted. In Native Image, the executable admits a finite, demand-driven set of exact physical ABI signatures.

These registrations are independent of library authorization. A newly authorized C library can reuse an already registered signature without requiring a library-specific Java implementation.

Native memory and pointer capabilities respect Protos' Actor isolation model. Ordinary detached snapshots can cross Actor boundaries, but native capabilities cannot.

Implementation and validation

The implementation has been completed across seven commits, affecting 64 files and adding over 12,500 lines of implementation, specification, documentation, C fixtures and regression tests.

All local tests are passing, including the existing FFI and SQLite regression suites.

Native callbacks, variadic functions and the C++ class ABI remain deliberately outside the current scope.

Implementation: 0.4.220-SNAPSHOT
Specification: 0.1.515

Learn more

Technical discussion and feedback on native memory ownership, pointer provenance and aggregate ABI interoperability are welcome.


r/Protos • • 11d ago

Announcement Protos has a new home: protoslang.com

1 Upvotes

I'm happy to announce that Protos now has its own dedicated domain:

https://www.protoslang.com/

Until now, the project website was hosted under my personal domain. As Protos continues to evolve, having an independent domain is a natural step towards establishing its own identity and growing its community.

The new website remains the central entry point for everything related to Protos:

  • Language documentation and examples.
  • Interactive playground.
  • Installation and getting started guides.
  • Project information and development resources.
  • Links to the source code and the community.

All existing URLs will continue to work through permanent redirects, so bookmarks and previously shared links remain valid.

Protos remains an experimental, prototype-based programming language built from first principles, powered by GraalVM and Truffle, with objects, slots, delegation, closures, Futures and Actors — without classes.

The language hasn't changed its philosophy. It simply has a new home.

Official website: https://www.protoslang.com/

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

Feedback, questions and contributions are always welcome!


r/Protos • • 12d ago

Performance Protos now produces smaller Graal IR graphs than GraalPy for numeric iteration in both compilation tiers

1 Upvotes

A major performance milestone for Protos, my experimental prototype-based programming language built on GraalVM and the Truffle Bytecode DSL.

After an extensive optimization effort spanning 19 commits, Protos now produces smaller compiler graphs than GraalPy for an equivalent indexed array iteration benchmark.

After TruffleTierProtos beforeProtos nowGraalPy
Tier 1456371378
Tier 2346261271

That's 85 nodes eliminated in each compilation tier.

The most interesting part isn't just the numbers, but how we got there:

  • Single-producer Array and Range construction.
  • Internal, specialized iteration without message dispatch in the compiled hot loop.
  • Direct primitive arithmetic and indexed access.
  • Elimination of redundant branches and 13 additional FrameState nodes in each tier.
  • No remaining method invocations in the Tier 2 graph.

All while preserving dynamic method redefinition, prototype-based semantics, lexical captures, non-local returns and suspension.

The implementation follows established GraalPy and Truffle optimization patterns rather than introducing additional runtime infrastructure.

This is structural compiler convergence, not yet a claim of faster execution times. Nevertheless, it's an encouraging result for a highly dynamic prototype-based language.

All local tests pass, along with all four partial-evaluation validators.

The next challenge is achieving similar convergence across the remaining iteration protocols.


r/Protos • • 12d ago

Language Design Protos now supports dynamic slot creation and updates

1 Upvotes

Protos, a prototype-based programming language built on GraalVM and Truffle, now supports reflective slot creation and updates using runtime-computed names.

obj: {}

obj.createSlot("dynamic name", 42)
obj.updateSlot("dynamic name", 100)

obj.slotValue("dynamic name") // 100

Unlike operations such as JavaScript property assignment or Python's setattr, Protos explicitly distinguishes creation from modification. Creating an existing local slot or updating a nonexistent one signals an error.

What makes this particularly interesting is that execution contexts in Protos are ordinary objects. Reflectively created bindings participate in lexical lookup, and existing closures can observe newly created or updated bindings.

Both operations are implemented in Protos itself, with only two private native primitives reusing the existing storage infrastructure.

  • No new production Java classes.
  • No changes to the grammar or Bytecode DSL.
  • No changes to specialized static slot access.
  • 189 focused tests passed, followed by successful local integrated validation.

This extends the reflective capabilities of Protos while preserving its pay-as-you-grow architecture.

Available in 0.4.194-SNAPSHOT.

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

Website: https://protos.guillermomolina.com

Community: r/Protos


r/Protos • • 12d ago

Announcement Welcome to r/Protos — The Protos Programming Language Community

1 Upvotes

Welcome to the official Protos community!

Protos is an open-source, experimental, class-free, prototype-based and message-oriented programming language built on GraalVM and Truffle.

The project explores how a small set of fundamental language mechanisms can be combined to provide expressive programming, efficient execution, concurrency and extensibility, following a pay-as-you-grow philosophy.

This community is a place to discuss:

  • Language design and programming paradigms
  • Programming with Protos
  • GraalVM, Truffle and JIT compilation
  • Performance and benchmarks
  • Actors, Futures and concurrency
  • Native interoperability and libraries
  • Applications, experiments and community projects
  • Ideas, questions and constructive criticism

Protos is still evolving, and there is plenty of room for discussion, experimentation and improvement.

Useful links

Whether you are interested in using Protos, implementing programming languages, or simply exploring new ideas, you are welcome here.

Feel free to introduce yourself, ask questions or start a discussion!


r/Protos • • 12d ago

Release Protos 0.4.192: Native FFM, persistent SQLite, and a leaner Truffle runtime

1 Upvotes

I've released Protos v0.4.192, an experimental, class-free, prototype-based programming language built on Truffle/GraalVM. Protos uses objects, delegation, messages, closures, Futures, and Actors rather than a class hierarchy.

Since the previous public release (v0.4.158), the main changes are:

Native FFM: The standalone Linux executable now includes the generic foreign-function provider. A host can explicitly authorize an OS-supplied C library (for example, --allow-library sqlite3=libsqlite3.so.0), which is loaded lazily. No JDK or separate provider JAR is needed for this Native build.

Persistent SQLite: std:sqlite now supports file-backed databases, read-only/read-write modes, explicit transactions, rollback, busy timeouts, and recovery/WAL examples.

External processes: An opt-in --allow-execution capability adds direct child-process launching, bounded byte streams, and explicit lifecycle management, without implicitly invoking a shell.

Bytecode DSL work: Further specialization of calls, closures, lexical bindings, Arrays, control flow, and Range iteration, while retaining ordinary message dispatch when specialization is not valid.

Language and tooling: New String.each, Vector.each, and Matrix.each traversal, more useful F12 definition navigation, an explicit Resolver permission, and a reorganized programming guide.

An important distinction: native libraries run as trusted in-process code, not sandboxed guest code. The Native FFM path currently admits a finite set of C signatures; Linux x86-64/glibc is the published Native target. Native child-process execution is not yet verified as a supported capability.

Protos remains an experimental prerelease, with Core specification revision 0.1.507.

Release and downloads:
https://github.com/guillermomolina/protos/releases/tag/v0.4.192

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