Ada 2022 · experimental

Streaming JSON for Ada.

Flyology JSON parses arbitrary UTF-8 chunks into provisional events. Its writer stages a complete document before publication. The bounded core performs no heap allocation and preserves number lexemes exactly.

Version 0.1.0-dev is available from the Flyology Alire index.

arbitrary input chunksexact source offsets
{"name":"fl yolo\u 0067y","n":1e +12}
validated across chunks · no retained input reference
Document_Begin Object_Begin Name_Fragment String_Fragment Number_Fragment Object_End
events are provisionalDocument_Complete → accept
landing_samples.adb · parser
   --  The chunk is the complete input, so End_Of_Input is true. Drain can
   --  return several events through one public call.
   Parsing.Drain (Self => Parser, Input => Chunk, End_Of_Input => True, Events => Events, Result => Result);
landing_samples.adb · integer
   --  Numeric conversion is separate from parsing. Parse checks the exact
   --  lexeme and the target range without rounding or modular wraparound.
   Unsigned_64_JSON.Parse (Lexeme => Number, Result => Number_Result);
InputIncremental UTF-8 octets with arbitrary array bounds.
StorageCaller-selected depth, names, tokens, and destinations.
FailuresNonraising statuses and defined diagnostic coordinates.
DependenciesNo Flyology runtime, Type IR, Wire, or C.
Writer

Transactional publication

The writer sends ordinary compact JSON to a destination transaction. Only a successful commit publishes the document. Destination exhaustion, invalid grammar, invalid UTF-8, and invalid number spelling leave no partial document published.

Begin
Write spans
Commit
Abort on failure
Guide

Choose a public layer

Flyology JSON owns JSON syntax and octets. Your application owns input buffers, destination staging, selected token storage, and the candidate it commits after document acceptance.

Tokens and integers

Collect selected fragments into caller storage and run checked integer conversion.

Read the token guide →