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.
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.
Four seemingly unrelated use cases illustrate what GoMeta can be used for — but they are not GoMeta: Extensions serve them.
find_by_label.jl answers: which pieces of which files carry this label.And, in the words of GoMeta’s creator: “This is not just for programmers any more.”
altValues_evals — and the Extensions act on it.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.
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.
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.
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.
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.
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.