Skip to content

Polyglot TPF applications ​

TPF is exploring how developers could author pipelines and business functions in TypeScript and Python while retaining compiler-owned semantics and Java-owned durable coordination. This is a proposed architecture, not supported Node.js or Python product functionality. Existing Java applications remain supported through their current runtimes.

The intended experience includes streaming, Connectors and durable Await. A small unary pipeline helps investigate the boundaries, but does not define the product's MVP. Implementation status, experiments, source audits and estimates live in the polyglot epic.

What a language runtime would own ​

A business function returns a value to TPF. Before invoking the next function, TPF applies the pipeline's execution rules: validate the result, handle failure or rejection, honour cancellation, preserve context and perform any configured framework operations.

Supporting another language therefore involves more than generating client stubs. For a pipeline to execute entirely within a Node or Python process, that process needs a TPF runtime capable of carrying out the supported rules. The compiler supplies the pipeline's meaning; the language runtime executes it.

The proposed division of responsibility is:

ComponentResponsibility
CompilerValidate DSL, canonical types, logical identity, composition, placement and execution requirements
Generated application APIExpose typed invocation and, where supported, durable admission and result access
Language runtimeInvoke functions and apply the declared execution policies in its process
Java coordinatorOwn durable admission, execution state, leases, transition retries, recovery and release pinning
Capability hostOwn authorised external access, Connector guarantees and hosted plugin behaviour

These boundaries are described in ADR-0080. They do not give each language a separate interpretation of the DSL.

LOCAL means one process ​

For A → B → C placed together in a Node application, LOCAL means that all three functions and their TPF execution runtime run in that Node process. A's result returns to the native runtime before B is invoked. No inter-step network call or Java executor is required for that pure LOCAL path.

A service on localhost is still a separate process. Calling it may be useful, but does not provide the same execution arrangement as an in-process LOCAL pipeline. Similarly, putting several handlers into one Lambda package does not provide pipeline execution by itself: the package also needs the runtime that applies the pipeline's rules.

In a distributed layout, generated bindings would connect different placements while co-located functions continue to use LOCAL calls. Business functions should retain their types and behaviour when placement changes. LOCAL, REST and gRPC are pipeline transports; COMPUTE and FUNCTION describe platform choices. QUEUE_ASYNC describes an execution mode.

The developer workflow ​

The target Node/Python workflow requires no local JVM, including regeneration after a DSL change. The Java compiler can remain the semantic authority behind a remote build service or another suitable tool boundary. The selected Node experiment uses a pinned GitHub Actions build: the developer commits the DSL and native bindings, requests generation for that revision, and retrieves verified TypeScript models and an application API. The build receipt identifies the inputs and generated bytes; it is not a Release Descriptor or proof of deployment authority. Remote generation does not imply offline regeneration.

ActivityIntended arrangement
Author and regenerateNative language tools and compiler-authoritative generation, without handwritten application Java or a local JVM
Run, test and debug a pure LOCAL pipelineBusiness functions and TPF runtime in one native process; no coordinator or Cloud account required
Exercise real QUEUE_ASYNCA remote durable coordinator and deployed development workers; the workstation submits work and retrieves results

A coordinator connection to a laptop worker is an optional debugging arrangement. It is not a prerequisite for either pure LOCAL development or testing deployed durable workers. TPF Cloud is a possible host for shared services, rather than a requirement for the language architecture.

The bounded Node experiment ​

The selected increment evaluates compiler-generated bindings with an explicitly imported experimental Node package. This section describes the candidate execution model; the epic tracks candidate availability and qualification. It is not a released runtime or a completed product acceptance gate. The candidate exercises three pure unary functions in one process, using distinct canonical boundary records with a required, non-null int32 value. The runtime validates the generated requirements before invoking any function, then owns local sequencing, admitted retries, cancellation and immutable invocation context. It does not interpret YAML or provide a coordinator, Connectors or plugin host.

After generation and dependency installation, running, testing and debugging this pure pipeline require only native tools. A business-function edit stays in the Node project; a DSL or binding edit requires a new compiler build. Unsupported authored features fail generation, and incompatible generated artefacts fail runtime admission.

This is opt-in evaluation, not supported-product status. Existing Java execution does not depend on the experimental package. Its package, generator integration and consumer proofs must remain removable without disrupting Java applications. Before expanding the profile, evaluate the editable developer journey and maintenance cost, then explicitly choose to continue, redesign or retire it. A successful unary run cannot waive streaming, Connector or durable Await requirements.

Durable execution and Await ​

A native runtime would execute an admitted range of pipeline operations and return an outcome to the Java coordinator. It would not take over the coordinator's stores, lease ownership or recovery decisions. Synchronous execution does not inherently need this coordinator hop.

A worker's response and the coordinator's durable settlement are separate events. A lost response can lead to another execution attempt; the architecture does not promise exactly-once business-function invocation.

Durable Await must survive the application process disappearing. The continuation needs to be represented by persisted canonical data, correlation and pinned code identity, so that a fresh compatible worker can resume it. A live JavaScript Promise, Python coroutine or interpreter handle cannot serve as that durable continuation. Language-level async/await and TPF Await solve different problems.

Connectors and plugins ​

Keeping existing Connectors and plugins in Quarkus avoids requiring a second provider ecosystem. It does not make their semantics available to another runtime automatically. A remote capability boundary must preserve what the operation means, as well as its input and output types.

A Query needs authorised access, stable capture identity and replay without repeating the provider call. A Command additionally needs effect authority, idempotency, confirmation and a way to handle ambiguous outcomes. Plugin hooks need defined ordering, acknowledgement and failure handling. These responsibilities cannot be replaced by a generic function call or hidden inside application business logic.

The proposed native runtime would receive only the context and logical capability references it needs. Provider credentials, resolved clients and coordinator-store access stay with their owning host. Invoking a capability and implementing a Connector Provider are separate extension surfaces; a public native Provider SPI has not been selected.

A shared contract prevents semantic drift ​

A language runtime needs an explicit description of the types, cardinalities and policies it supports. The compiler and runtime must reject unsupported requirements rather than silently omit them. Adding a capability means extending a shared contract and checking every language that claims to support it.

Compatibility includes more than a successful return value. It covers field presence, nullability, numeric precision, identity, retry ownership, rejection, cancellation, context, stream ordering and backpressure. Empty completion and failure must remain distinguishable. Canonical identities must not depend on Java class names or a language's incidental JSON formatting.

ADR-0088 defines the adopted unary qualification mappings: explicit retry classification, distinct value/empty/failure outcomes, cancellation ordered at the execution boundary, and an explicit invocation context. Existing Java behaviour is not automatically equivalent; a binding must reject incompatible policy ownership before running business code.

The qualification decisions and their evidence are recorded in contracts #52. These bounded decisions do not select a production runtime or reduce the streaming, Connector and durable Await requirements.

A remote worker also needs qualification for the exact release artefact it runs. Reuse TPF's trusted Release Descriptor and verify both the runnable artefact and its named Compiled Truth carrier before binding the projection and execution profile to an authorised deployment target. Those artefacts may be separate. A worker's capability advertisement is a compatibility claim, not proof of that qualification. The paired HTTPS check also compares the host's loaded projection digest with the coordinator's verified Compiled Truth. This prevents separately prepared components from silently using different bindings under the same logical Contract. The outer worker envelope and the application payload have separate encoding identities. The bounded native worker binding decision proposes explicit logical-type checks for payloads and compiler-owned Contract metadata. Neither decoding a value nor matching metadata authorises execution on its own.

Portable failures need an explicitly selected result representation. Java exception class names cannot stand in for shared failure classifications. The worker reports its classified outcome; the coordinator validates the associated attempt and retains retry, DLQ and recovery authority. An invalid response does not prove that the worker stopped. The first qualification binding uses a closed, failure-only result profile selected by trusted deployment configuration and pinned to the dispatch attempt. It deliberately reuses the released success representation. There is no response-driven negotiation or legacy fallback. A future deployed binding must use authenticated HTTPS to its configured, verified worker endpoint and retain the original dispatch context when accepting a result. It must not silently redirect, retry or fail over after an uncertain response.

These are contract choices, not evidence of a deployed native receiver. Existing Java failure handling is unchanged; both peers need an explicitly profile-aware binding before using the new failed-result representation. The selected finite unary/LOCAL research baseline is not a product MVP. Streaming, Connector guarantees and durable Await remain required. The Node experiment qualifies changed-project generation and direct LOCAL execution separately from deployed recovery.

Java-ecosystem isolation and experimental killswitch ​

The polyglot experiment lives inside the existing pipelineframework-compiler and pipelineframework-runtime artefacts rather than splitting per-language compiler modules prematurely. Keeping the experiment removable and isolated from ordinary Java applications therefore relies on explicit structural boundaries and a default-disabled runtime killswitch.

SurfaceIsolation boundaryImpact on ordinary Java usersRemoval or disable path
Compiler (pipelineframework-compiler)Standalone CLI entrypoints under org.pipelineframework.compiler.{node,python,polyglot}; never registered with JSR-269 or invoked by PipelineStepProcessorZero change to javac annotation processing or Maven builds; zero new transitive Maven dependenciesDelete the node, python and polyglot packages and standalone generation scripts
Runtime coordinator (pipelineframework-runtime)Two-layer opt-in: default-disabled boolean killswitch pipeline.orchestrator.experimental.native-worker.enabled (false) plus an explicit deployment-owned NativeWorkerReleaseBinding CDI bean (no default bean exists in the runtime)Ordinary Java admissions and executions never enter the paired native path; untrusted JSON cannot deserialise the runtime-owned AdmittedInput markerSet pipeline.orchestrator.experimental.native-worker.enabled=false (or omit it) to suppress paired native binding resolution immediately
Native runtimes (experimental/node-local/, experimental/python-local/)Packaged strictly under experimental/ outside the Maven JAR closureNever bundled into Java Maven artefacts or POM dependenciesDelete experimental/node-local/ and experimental/python-local/
Examples and CI (research/native-local-projection/, compatibility sets)Lives outside the canonical Java Maven reactor; omitted from singleton and nightly policy.yml suitesOrdinary Java verify and release trains never build or run native worker proofsRemove the research directory and coordinated-set suite hook

When pipeline.orchestrator.experimental.native-worker.enabled is false (its default), NativeWorkerReleaseBinding.configured(...) always returns empty even if a deployment leaves a NativeWorkerReleaseBinding CDI bean on the classpath:

  • Hosted admission does not admit new paired native executions.
  • Any already-admitted native execution carrying AdmittedInput fails safely before dispatch intent under the pre-intent failure oracle rather than falling back to the generic Java transition executor.
  • Existing Java pipelines, receipts and recovery behaviour remain unaffected.

Alternatives and trade-offs ​

ApproachBenefitTrade-off
Native Node/Python runtimesSame-process LOCAL execution and native developer toolsTPF must maintain equivalent execution behaviour across languages
Java execution with remote business services or OperatorsReuses Java execution and existing language-neutral service boundariesThe whole foreign-language pipeline does not execute in one native process
A TPF daemon or serviceCentralises durable and hosted capability responsibilitiesNeeds explicit remote contracts; a local Java requirement would change the intended SDLC
Embedded languages through DetroitCould retain Java execution while hosting foreign business functions in the same processRequires engine integration and a different packaging, dependency and debugging arrangement

Spring and Micronaut are Java frameworks, so they can reuse Java contracts and execution code. Framework integration still has to preserve lifecycle behaviour. Their runners and adapters are useful existing work; polyglot exploration does not make them disposable or establish full framework parity.

Detroit and the developer experience ​

Detroit is an investigated alternative, not a selected TPF runtime. An embedded engine could keep the Java policy shell around JavaScript or Python business functions. This could reduce duplicated execution code, while introducing language bridges, canonical conversions and engine-specific packaging.

Embedding JavaScript does not by itself establish Node.js ecosystem compatibility. The same distinction applies between embedding Python and supporting an ordinary Python project's dependencies and tooling. A required local JVM would need an explicit revision to the intended developer workflow.

Three questions determine whether this alternative fits TPF:

  1. Streaming: can asynchronous functions, producers and consumers preserve demand, ordering, cancellation, cleanup, bounded memory and failure signals?
  2. Await recovery: can a fresh interpreter resume from durable TPF data after the worker has stopped, including duplicate completions and lost acknowledgements?
  3. Developer experience: can a real project regenerate types, use representative dependencies, test, debug and reload code without handwritten application Java?

The epic's investigation record contains the engine-specific findings and limitations. Native Node is selected for the bounded evaluation above; production-runtime selection and support promotion remain separate decisions. Detroit remains an alternative, and its implementation is unscheduled.

Investigation records ​

The epic owns source audits, experiment results, estimates and progress history. The contract decision issue records the accepted bounded compatibility choices and their limitations. Further implementation gates remain with the epic. Older investigation-section links lead here.

Diagram