Skip to content

GoMeta

α status
GoMeta mark — two notebooks spelling /#/~GoMeta mark — two notebooks spelling /#/~
THE key distinguishing feature
GoMeta can be embedded in all kinds of other
programming languages as well as
in Word documents or be
attached to files themselves.
This allows GoMeta to
connect content of one
programming language,
one file format
with that of another.
GoMeta works
in between them,
behind them,
within them.
That is the reason why it is called 'GoMeta'.
What other language can do that ?

The core idea of GoMeta is to embed formalized meaning within all kinds of comments and provide Extensions with its interpretations so they can act on them.

So on the one hand, GoMeta is a domain-specific language for metadata and on the other a framework with facilities which Extensions can build on.

What is GoMeta?

GoMeta.jl is an interpretable-metadata engine, written in Julia, designed to work between, behind and within your data: in any programming language and any file format.

A file carries its ordinary content plus #~ metaLines — comment lines with machine-interpretable metadata (e.g. labels, visibility actions, conditions, etc.) sitting right beside the content they describe. Language-agnostic, since the metadata remains “hidden” within the comments — the host file stays an ordinary file, and the host language sees nothing but a comment.

GoMeta evaluates the metadata — more precisely, the GoMeta Engine evaluates it — but does not act on those evaluations: that is the Extensions’ role; they receive the evaluations through GoMeta’s interface, altValues_evals.

What is GoMeta? →

Why use GoMeta?

Four seemingly unrelated use cases illustrate what GoMeta can be used for — but they are not GoMeta: Extensions serve them.

  • Find it again — adding meaning to content can change the game; the shipped demo find_by_label.jl answers: which pieces of which files carry this label.
  • Webs of atomic data units — link fragments across files, put things into context. This one requires not only an Extension but also a database as a back end.
  • One source file, all kinds of output formats — shipped today: one notebook and its executed twin, and two manual pages, from one marked file.
  • Share on your terms — marking private passages would allow automated removal before sharing; GoMeta’s own source has been processed this way.

And, in the words of GoMeta’s creator: “This is not just for programmers any more.”

Why use GoMeta? →

How does GoMeta work?
  • BLS parses the file into the BLS Component tree — Block, Line, Segment, in three flavors: Meta, Text, Code. One record is crucial: is a Component attached to a metaComponent or not? That is crucial when deciding whether a metaStatement gets applied to it.
  • The heart: GoMeta absorbs the metadata — parses and interprets it — evaluates the altValues (Alterant values), and makes them available to whatever Extension the user calls for.
  • Alterants: as a Julia Type declares a kind of value, an Alterant declares a kind of metadata with its actions and rules. Visib, labels, id and heading ship built in.
  • Extensions act: one run delivers one object carrying both main products — the BLS Component tree and the evaluated values, altValues_evals — and the Extensions act on it.

How does GoMeta work? →

Start here

Any line starting with #~ is a metaLine — it will be processed as metadata. Contiguous metaLines constitute a metaBlock; positioned just above a block of code or text, it gets attached — similar to how docstrings get associated with Julia structures following them.

#~ hide ## A first 'metaLine'.
# This first line is 'Text'.
## This is a 'comment' of 'Text'.

#~2 :label1
a = 1 ## A 'Block' of 'Code'.
b = 2 #~ discard{ :label1 }

Getting started →
Examples →
The full reference →

Merci🌷
#~ 1 · parse

BLS reads the file

Before GoMeta can absorb & evaluate the metadata, BLS reads the file, extracts features of interest and records them in a tree-like structure. Blocks, Lines and Segments are all Components at different levels in the hierarchy, in three Component flavors — Meta, Text, Code. And one record is crucial: is a Component attached to a metaComponent or not? That is crucial when deciding whether a metaStatement gets applied to it.

#~ 2 · absorb

The heart: absorb & evaluate

Once the BLS parsing has been conducted, we reach the heart of the GoMeta process: absorb the GoMeta data — i.e.: parse and interpret it — evaluate the altValues (Alterant values), and make them available to whatever Extension the user calls for.

#~ 3 · extend

Extensions act

GoMeta passes its evaluations on to Extensions, which act on them. Like languages, GoMeta by itself does not produce anything — it provides the means, the metadata-Blocks, to build something. Speedily retrieving a long-forgotten snippet, linking fragments across files, one source file for all kinds of output formats, automated removal of private passages before sharing: illustrations of what GoMeta can be used for — but they are not GoMeta. A web of atomic data units, for one, requires not only an Extension but also a database as a back end.

#~ 4 · alterants

Registered kinds of metadata

As a Julia Type declares a kind of value, an Alterant declares a kind of metadata — with its actions and rules. Visib, labels, id and heading ship built in. What GoMeta evaluates per Component are their values: the altValues.

#~ 5 · syntax

There is a GoMeta syntax

It is essential to GoMeta. Any line starting with #~ is a metaLine — it will be processed as metadata. Contiguous metaLines constitute a metaBlock; positioned just above a block of code or text, the metaBlock gets attached — similar to how docstrings get associated with Julia structures following them. The same principles are easily extended to other programming languages or project data in general.

Status: alpha. GoMeta.jl 0.4.5 implements the v0 subset of the GoMeta language — a working, tested engine: the sixteen committed example pairs render byte for byte, pinned by the shipped test suite. It’s alpha — the surface may still move before 1.0. GoMeta evaluates the metadata — more precisely, the GoMeta Engine evaluates it — but does not act on those evaluations: that is the Extensions’ role.

GoMeta is Fair Source — licensed under the Functional Source License, Version 1.1, MIT Future License (FSL-1.1-MIT; source-available, not OSI-approved open source): free for everyone’s own use — at work, at university, in the public sector. Not licensed: offering GoMeta to others in a commercial product or service that competes with it or with the Licensor’s own GoMeta-based offerings that exist when the version is made available. On the second anniversary of a version’s release, that version becomes available under the MIT license — irrevocably. See the repository for the license and details.