Hacker News new | ask | show | jobs
by alexisread 782 days ago
Looks nice, I have a couple of questions:

Does this use a single pass for the parser? Is there an EBNF spec? What sort of diagrams does it support?

Thanks

2 comments

The existing typescript implemetation builds a complete AST (Abstract Syntax Tree), over which middlewares are run in several passes. Yes, there are multiple passes over the tree. This is necessary, among other things, to build a table of contents (TOC). thank you
Might not work for my use case then. djot is single-pass so dovetails better with forth-style languages. I do like the blocks and mistake marking though :)
Interesting. Have you been using djot for anything substantial, like technical/academic publishing, large projects like entire books, or similar? How does it fare and what is your toolchain? Thanks in advance!
I'm trying to use it as part of a new forth-style language, hence the need for single-pass.

I've found it as easy to use as markdown, but more regular ie. Well defined, which suits a language spec.

The key parts for me are reference links for execution-thread documentation and ``` blocks to program literally, (and separate/scope comments // from documentation """)

The toolchain as such is just part of the language- the compiler needs to parse djot. I'm not fully there though.

This is a specification, it does not declare how implementations work.

At the moment only typescript implementation exists and here is PEG grammars from it: https://github.com/podlite/podlite/blob/main/packages/podlit...

At the moment it supports Mermaid diagrams:

https://pod6.in/#p=%3Dbegin+Mermaid++%3Acaption%28%27Caption...