But...Why?
I wanted full control over the markdown spec since I'm making some changes for my school notes. Also an excuse to learn more about parsing :)Basically:- I don't want to write my blog in HTML
- Markdown is good but I can do better (I can't)
- It’s really fun
moth "features"
There's already a few differences between the commonmark spec and moth (ignoring the bugs).Here are a few already there and that I plan on adding.- newlines
For once, in commonmark, if there is only one newline, both lines will merge into one. Separating them usually involves adding two spaces at the end.In moth, this is reversed. By default, every newline is an actual newline. You can however specify you want to continue the line by adding a backslash at the end of it.note: as I am writing this, I feel like re-reversing it but keeping the backslash to separate lines might be better
- highlighting
With moth, highlighting (will) be pretty easy. I don't have a set syntax yet but something not much more complicated than bold or italic is probably what I'm aiming for.
- tab indenting & list item body
I know this is a quite controversial topic, but in moth you use tabs to indent list item bodies.But what are list item bodies? Well when you write a list item, you can put text after the dash like normal markdown specs. However, if you add a tab on the next line, you start the body.The body of a list item can span multiple lines, skip across empty lines and be easy to read:
This whole "moth features" list has been transpiled using this.- **here is the list "title"** and here is the list body which can span multiple lines and even continue across empty lines
Speed
How fast is moth?Well that's kind of a weird question.Firstly, moth has a lot less features than other markdown parsers. For examples, moth does not have tables, blockquotes and many other little things that might never be added.Secondly, it will depend a lot on the hardware and the contents of the moth file. A file might get served very fast until you add , which can sometimes easily double the waiting time.Ok, but double what exactly? Well, on my Framework 13 - 5 7640U, this file takes about 300µs-600µs to transpile (in serve mode), depending on whether I include the single use of katex in the paragraph above.I'm not going to try comparing it with other parsers. Mainly because, as I said, a lot of features are missing in moth. There is also the fact that this is mainly to learn and to slighly change the commonmark specification, the speed is just a nice after thought.But why write a blog?
Three main things come up to mind:- I want to write some of my ideas and thoughts down.
This is a kind of experiment with myself. As someone with an ADHD, I usually get a ton of ideas. Writing down the ones I like the most would help to have a better understanding about them.I also forget details of ideas pretty easily. This would help storing them so I can read them back if I forgot about some specificities.
- I want to better write things
I have never been a good writer, and with the rise of LLMs not helping the matter, I wanted to try having a place to materialize my ideas in a clearer way.I guess my goal for this would be to have an easier time finding the words to express my ideas.
- I want to show my ideas to others
As I said before, I am someone with a lot of ideas. Sometimes they might be dumb, sometimes not, but I have quite a few I think are worth sharing.If you don't know me, I am currently studying quantum computing. I'm in the privacy and open source communities. I love everything related to standards, cryptography and communication protocols. So my blog will mostly be about some of these things.