Jevko

simple syntax

Jevko (/ˈd͡ʒef.kəʊ/) is a versatile minimal syntax for encoding tree-structured information as human-friendly text.

It can be used as a building block for simple formats, languages, and notations across a variety of domains.

Jevko Data And Markup Language (JDAML) is an XML-like format built on Jevko that works equally well for data interchange, configuration, and text markup.

For users: JDAML

Check out JDAML you are interested in a ready-made minimal and simple unified format that can be a complement or an alternative to formats such as HTML, XML, JSON, YAML, TOML, etc.

For hackers: Jevko

Check out plain Jevko if you are a hacker, minimalist, language or format designer, or are looking for an extremely minimal and simple text-based representation for trees.

Jevko Data And Markup Language

[#data] [#config] [#markup]

JDAML (Jevko Data And Markup Language) is an experimental XML-like format built on top of Jevko, designed to map equally well to markup-oriented formats (such as HTML or XML) and data-oriented formats (such as JSON or YAML).

It can serve as a unified, lean, flexible, and human-friendly representation of these formats, can be mixed with them, or can be used alone.

Below are a few examples of mapping JDAML to and from formats in various domains.

Data interchange1

[see the example live]

JDAML:JSON

JSON:JDAML

[see the example live]

JDAML:XML

XML:JDAML

Configuration2

[see the example live]

JDAML:JSON

JSON:JDAML

Text markup3

[see the example live]

JDAML:HTML

HTML:JDAML

Features of JDAML

Same basic primitives as XML/HTML

JDAML uses the same basic primitives as XML or HTML:

  1. Text nodes.
  2. Elements.
  3. Attributes.

Attributes are more flexible

Like in XML/HTML, attributes in JDAML are semantically unique and unordered.

However, they are much more flexible than in XML/HTML:

This gives JDAML the ability to represent unordered sets of name-value pairs distinctly from ordered collections of values. So for example we can have a clear mapping between JDAML and JSON objects and arrays.

This design makes the format truly extensible. Changing a value of an attribute from simple text to a complex structure is not only possible (unlike in HTML/XML), but natural and easy.

Also, changing an attribute into an element and vice versa is extremely easy (unlike in HTML/XML).

Whitespace is always preserved

JDAML always preserves whitespace in the syntax tree without any change.

Status of JDAML

Currently JDAML is experimental and only has a Proof of Concept implementation to test. Feedback welcome!


Plain Jevko

Here is how Jevko compares to the most popular syntaxes often used for representing trees as text.

4

This Jevko...
 

[#jevko]

...is similar
to this XML...

[#like-xml]

...or to this
S-expression...

[#like-s-expr]

...or
to this JSON1.

[#like-json]

Features of Jevko

Just text and [square brackets]

Plain Jevko is just Unicode text in which nested square brackets create a hierarchical tree structure. In addition, there is syntax to escape the brackets, so they can also be part of text, and some syntax sugar useful when we don’t want to worry about escaping. That’s basically it.

Jevko simply captures the concept of a generic tree of text in the most minimal reasonable way. The only significant characters in Jevko are two square brackets and one escape character.

Square brackets in text

To treat square brackets as text, they can be escaped.

Alternatively text can be fenced, like in Markdown, in which case no escaping is needed at all.

Whitespace-agnostic

Jevko is completely whitespace-agnostic: it treats whitespace as any other character. It doesn’t ignore it or use it as a separator or anything like that. All whitespace is preserved in the tree verbatim.

Good for all kinds of formats

Due to its simplicity and generic nature, Jevko is the perfect building block for formats that work well not only for representing data, but also for text markup. We can even do both in one format, as Jevko Data And Markup Language demonstrates.

Jevko is like…

…simplified XML/HTML

Jevko can be thought of as a very stripped down XML where we only have:

  1. Text nodes.
  2. Anonymous, tagless elements without attributes.
  3. A more flexible and convenient CDATA in the form of fenced text.

All in an extremely lean syntax.

In Jevko the root element is implicit.

…simplified S-expressions

Jevko can be thought of as a minimal version of S-expressions where we only have:

  1. Strings.
  2. Lists.

However:

  1. Jevko strings (text nodes) can span multiple lines and are not quoted (but can be fenced like in Markdown to include square brackets without having to escape them).

  2. Instead of round brackets Jevko uses square brackets to delimit the lists (subjevkos).

…simplified JSON

Jevko can be thought of as simplified JSON where we only have:

  1. Strings.
  2. Arrays.

However Jevko strings (text nodes) can span multiple lines and are not quoted (but can be fenced like in Markdown to include square brackets without having to escape them).

Status of Jevko

Jevko is thoroughly battle-tested, has a stable formal specification (it can be implemented in any programming language), and a reference implementation in JavaScript (it can be used in any JavaScript runtime).

Implementing Jevko

Formal specification

The Jevko Syntax: Standard Grammar Specification is a stable formal specification of the basic syntax. No breaking changes shall be introduced to this specification.

Interactive railroad diagrams

The Jevko interactive railroad diagrams complement the specification, together providing a convenient reference for implementing parsers and other Jevko processors.

Extensions specification

The Jevko Syntax: Extensions Specification is a formal specification of two backwards-compatible extensions to Jevko. These extensions introduce fenced text a’la Markdown and tagged text a’la heredocs.

Reference implementation

jevko.js is the official reference implementation of Jevko in JavaScript.

More Jevko resources

Community implementations and examples

jevko/community on GitHub lists several implementations of Jevko in various programming languages by different authors. It also contains examples of what some users did with Jevko. jevko/examples contains a few more simple examples.

Jevko for prototyping programming lanugages

Designing a programming language with Jevko by manually translating 600+ pages of code snippets from the book “Structure and Interpretation of Computer Programs”.

Writing about Jevko

jevko/writing on GitHub has some articles about Jevko and other topics.

Old software

There are:

Syntax highlighting

Integration with tools, editors, IDEs

Command Line Interface

News, social media, other

You can follow Jevko on Mastodon or subscribe to the RSS channel for latest news.

You can also follow the official Jevko organizations on GitHub and Codeberg to track the latest developments.

There is also an official /r/jevko subreddit.

Jevko-related resources can also be found at the official Jevko profile on archive.org and the official Jevko YouTube channel.

Etymology and pronunciation

The name Jevko /ˈd͡ʒef.kəʊ/ is derived from Polish drzewko /ˈdʐɛf.kɔ/, meaning small tree.

License

Jevko is intended as a universal syntax, to be used without restriction in any software, for any purpose. It is open and free, along with any syntaxes, formats, and standards based upon it.

For legal purposes, if not specified otherwise, Jevko and related projects are under the MIT License.

Copyright (c) 2021-2024 Jevko.org

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.

Thank you for visiting.


Jevko is a part of TAO, a project to cultivate simplicity in software.


Google Translate jevko.org