BlockML Documentation

Everything Is a Block

One root, one grammar

BlockML describes everything that belongs to its grammar as Blocks — there is one inheritance root, one parser, and one TypeRegistry bootstrap path, and branch-specific rules come from the baseType chain rather than from parallel ontologies. org.blockml.bml.core.Block is the sole inheritance root for every Block definition.

What counts as a Block

Composable domain types, ValueTypes, Languages, Definition meta-model types, and documentation blocks are all Blocks — none of them needs a separate grammar or a parallel type system. Every one of these extends org.blockml.bml.core.Block, directly or through a branch:

  • Composable domain types

    Domain-specific building blocks such as a Widget or a Basket.

  • ValueTypes

    Type definitions such as Integer or Decimal — Blocks that describe a value's nature, not the value itself.

  • Languages

    Implementation language bindings such as TypeScript or OpenSCAD.

  • Documentation blocks

    Narrative documentation, including this handbook's own pages, are Blocks like any other.

Authoring ontology versus compiler internals

In the authoring ontology a Block is a named, definable unit with an FQN and a baseType chain; internally the compiler is free to represent that information however is convenient, with no mandatory uniform runtime class hierarchy. ValueTypes never store data — Properties own all concrete values, while the type itself only describes nature.

A domain Block and a ValueType, side by side

A domain Block and a ValueType look different in what they describe, but identically in how they are declared — both are root Block documents with a name, a type, and a baseType.

<!-- A domain Block: identity only, its baseType is core:Block -->
<acme:Widget xmlns="http://blockml.org/bml"
  xmlns:acme="com.acme.example"
  xmlns:core="org.blockml.bml.core">

  <baseType>
    core:Block
  </baseType>
</acme:Widget>

<!-- A ValueType Block: same identity shape, its baseType is type:StructType -->
<acme:Point xmlns="http://blockml.org/bml"
  xmlns:acme="com.acme.example"
  xmlns:type="org.blockml.bml.type">

  <baseType>
    type:StructType
  </baseType>
</acme:Point>

Widget and Point are declared with the exact same skeleton — an element tag for name and type, and a baseType stating what each extends. Nothing in that identity shape tells them apart as domain Block versus ValueType; that distinction lives entirely in the baseType chain each one declares, not in a separate syntax.

What to carry into the next pages

After this page, readers should be able to explain why domain types, ValueTypes, Languages, and documentation blocks are all Blocks, and expect every later page's syntax to build on that one shared grammar.

Continue with defining a Block