. 2 min read

Ever wanted better formatting as you code?

Tired of boring syntax highlighting not changing your font size as you type?

If you are one of the exactly zero people who asked me to make this a thing, boy are you in for a treat!

Snarkdown is a thoroughly useless program that compiles visually appealing text into fully executable JavaScript. And to make it even more intersting, the output JS is formatted like C# (that's what language agnostic means, right?).

Let's face it, JavaScript sucks. It's fun to golf and play around with in your free time, but absolute hell to collaborate on due to its weak typing system and overall threatening aura. Sure you can use JSDoc to specify types (ew), or force your team to use TypeScript and hope they don't disable strict mode (they will), but in the end it's nothing more than an exercise in compromise. TypeScript types are imaginary and cannot be utilized at runtime, meaning you have to double-define your types for both TS and JS to recognize them. Have fun teaching your junior devs why typeof thinks arrays are objects, or why typeof doesn't work on advanced types, or why get the point. TS types != JS types.

Snarkdown is designed from the ground up to first and foremost be easily readable, taking a more natural (but lengthy) approach to syntax. Snarkdown types also carry over to the compiled JavaScript, so when you typecast variable x to an int, the SD compiler wraps that statement in a parseInt expression to keep you honest. My longterm goal is to implement a typing system that is fully language agnostic, so you can check for advanced union types during runtime and have it just work, regardless of the target language.

Snarkdown is still in the very early stages of development and as of yet barely has enough functionality to squeeze out the basic demo I put together Saturday:



As you can see, this is in fact code.

GitHub - airgap/snarkdown: Markdown but it’s a programming language
Markdown but it’s a programming language. Contribute to airgap/snarkdown development by creating an account on GitHub.