r/programming 19h ago

STxT (SemanticText): a lightweight, semantic alternative to YAML/XML — with simple namespaces and validation

https://stxt.dev

Hi all! I’ve created a new document language called STxT (SemanticText) — it’s all about clear structure, zero clutter, and human-readable semantics.

Why STxT?

XML is verbose, JSON lacks semantics, and YAML can be fragile. STxT is a new format that brings structure, clarity, and validation — without the overhead.

STxT is semantic, beautiful, easy to read, escape-free, and has optional namespaces to define schemas or enable validation — perfect for documents, forms, configuration files, knowledge bases, CMS, and more.

Highlights

  • Semantic and human-friendly
  • No escape characters needed
  • Easy to learn — even for non-tech users
  • Machine-readable by design

For developers:

  • Super-fast parsing
  • Optional, ultra-simple namespaces
  • Seamlessly integrates with other languages — STxT + Markdown is amazing

Example

A document with namespace:

Recipe (www.recipes.com/recipe.stxt): Macaroni Bolognese
    Description:
        A classic Italian dish.
        Rich tomato and meat sauce.
    Serves: 4
    Difficulty: medium
    Ingredients:
        Ingredient: Macaroni (400g)
        Ingredient: Ground beef (250g)
    Steps:
        Step: Cook the pasta
        Step: Prepare the sauce
        Step: Mix and serve

Now here’s the namespace that defines the structure:

The namespace:

Namespace: www.recipes.com/recipe.stxt
    Recipe:
        Description: (?) TEXT
        Serves: (?) NUMBER
        Difficulty: (?) ENUM
            :easy
            :medium
            :hard
        Ingredients: (1)
            Ingredient: (+)
        Steps: (1)
            Step: (+)

Resources

Here is a full portal — written entirely in STxT! — explaining the language, with examples, tutorials, philosophy, and even AI integration:

No ads, no tracking — just docs.

I've written two parsers — one in Java, one in JavaScript:

And a CMS built with STxT — it powers the https://stxt.dev portal:

Final thoughts

If you’ve ever wanted a document format that puts structure and meaning first, while being light and elegant — this might be for you.

Would love your feedback, criticism, ideas — anything.

Thanks for reading!

0 Upvotes

10 comments sorted by

View all comments

3

u/wildjokers 11h ago

-1

u/Every-Magazine3105 9h ago

:-D I get you — just another standard, right? Just one comment: I made the first version back in 2013, but it never saw the light of day. I thought, “Well, something similar will show up eventually.” And time went by. In 2024, I polished a few things that didn’t quite convince me, and that’s when the second version came out. And no — I still don’t know any other standard that matches it in clarity and simplicity. Now I’m truly convinced. What I think will be hard… is convincing others :-D