Skip to content

Languages

What Comline supports in each target language. Every language has its own page, with what its code generator emits and what its runtime speaks on the wire. The matrices below compare the languages side by side.

Nothing here is written by hand. Each entry comes from a conformance suite, which checks the claim against what the generator actually does, so a language page can't claim something that isn't true.

What the states mean

State Generating a schema that uses the feature
✅ supported Works.
🟡 partial Works, with the limit the note states.
⚪ ignored Succeeds, but the output is what it would be without the feature: the types are right, the feature has no effect. comline generate warns, and so does the editor.
❌ unsupported Is refused, with an error naming every use. The editor warns at each use.

A runtime's claims use the same words, about the wire:

State The runtime, for that wire feature
✅ supported Reproduces every example in the wire corpus, and decodes each back.
🟡 partial Does the same, except for the examples the note lists, which it's known to get wrong.
❌ unsupported Doesn't implement it. A peer must agree on something else at the handshake.

How a claim is proven

Each generator states its support in a SUPPORT table in its own crate. The conformance suite in ComlineProject/generation runs every generator over a corpus of schemas and checks each claim against what the generator actually does:

  • supported or partial: a schema in the corpus uses the feature, generates, and matches its checked-in output. Where the feature can be taken out of the schema, the output must change without it; otherwise the feature is really being ignored.
  • ignored: the output is identical with the feature taken out, apart from the IR hash, which names the schema.
  • unsupported: every schema using the feature is refused, with an error naming the feature.

A claim that no schema in the corpus can back fails the suite. So a new feature, or a generator that gains one, comes with a schema that proves it. The proving schemas are named in each cell below.

Runtimes are proven against a shared wire corpus in ComlineProject/runtime: for each wire feature, examples of exact bytes and the input that produces them, plus bytes that must be refused. The Rust runtime is the reference that the examples are taken from; every other runtime vendors them at a pinned commit. A runtime's suite runs every example against it:

  • supported: every example encodes to its bytes and decodes back, and every malformed one is refused. JSON compares as JSON, with numbers exact, so 1 and 1.0 are equal but a rounded large integer isn't.
  • partial: as for supported, except for the listed examples, which must still fail. When one starts passing, the suite fails until the claim is upgraded.
  • unsupported: the runtime reports every example as not implemented.

Code generation, side by side

Feature rust 1.85.0 typescript 5.0
structs
structs
✅ supported ✅ supported
enums
enums
✅ supported ✅ supported
optional fields
optional-fields
✅ supported ✅ supported
arrays
arrays
✅ supported ✅ supported
fixed-length arrays
fixed-arrays
✅ supported 🟡 partial: rendered as T[]: the length isn't part of the type
fixed arrays over 32 elements, nested
large-fixed-arrays-nested
❌ unsupported: a fixed array over 32 elements renders only as a struct or error field's own, non-optional type (serde's derive stops at 32) 🟡 partial: rendered as T[]: the length isn't part of the type
unions
unions
❌ unsupported: Rust has no anonymous sum type to render one as ✅ supported
type aliases
type-aliases
✅ supported ✅ supported
constants
constants
✅ supported ✅ supported
protocols
protocols
✅ supported ✅ supported
errors
errors
✅ supported ✅ supported
functions that throw
throws
✅ supported ✅ supported
validators
validators
✅ supported ⚪ ignored: the types are generated; the checks aren't run yet (core#96)
imports between schemas
imports
✅ supported ✅ supported
nested namespaces
nested-namespaces
✅ supported ✅ supported
lib mode
lib-mode
✅ supported ✅ supported
external_std
external-std
✅ supported ✅ supported
validate_on_decode
validate-on-decode
✅ supported ⚪ ignored: no checks are generated to run on decode yet (core#96)
JSON-RPC framing
framing-jsonrpc
✅ supported ✅ supported
no handshake
handshake-none
✅ supported ✅ supported
connections
connections
✅ supported ✅ supported
async
async
✅ supported ⚪ ignored: handlers and senders always return Promises: the output is async either way
the packed@1 format
format-packed
✅ supported ✅ supported
the json@1 format
format-json
✅ supported ✅ supported
the msgpack@1 format
format-msgpack
✅ supported ❌ unsupported: @comline/runtime has no MessagePack codec yet

Runtimes, side by side

Feature rust typescript
name hash
name-hash
✅ supported ✅ supported
handshake
handshake
✅ supported ✅ supported
envelope
envelope
✅ supported ✅ supported
datagram framing
framing-datagram
✅ supported ✅ supported
datagram@2 framing
framing-datagram2
✅ supported ✅ supported
stream framing
stream
✅ supported ❌ unsupported: no length-prefixed framing or frame limit yet: the transports are message-oriented (comline-typescript#80)
JSON-RPC framing
framing-jsonrpc
✅ supported ✅ supported
JSON wire format
format-json
✅ supported 🟡 partial: decoding doesn't check enum variants or integer ranges (comline-typescript#57)
MessagePack wire format
format-msgpack
✅ supported ❌ unsupported: JSON and packed@1 ship
packed wire format
format-packed
✅ supported ✅ supported

Elsewhere

  • comline targets --features prints the code generation support for the generators your comline was built with, and --json prints it as JSON (see the CLI).
  • In the editor, a schema using a feature that a language declared in config.idp can't generate gets a warning at the use. Hovering the language in config.idp shows what its generator supports.
  • Each generator's repository README carries its own table: comline-rust, comline-typescript.