yr: DSL meant to reduce boilerplate

Hello, everyone. In 2021 I had a household accident and broke my humerus, and the recovery took a long time. I had a few clients, and they kept coming from the same niche, so I ended up with a lot of boilerplate. Since I'm full-stack, that meant code in bash, HTML, JS, and so on. To cut down on rewriting or copy-pasting the same code (this was well before AI), I decided to build yr. I've been using it ever since, in its official IDE, Yrkit (a work in progress, but already in production). It works like this: I write code in sections marked by specific symbols, e.g. ## for CSS and @@ for frontend JS. At the end, my parser generates all the artifacts, either as JSON or by writing straight to disk. A Hello World in yr looks like this: >> title Hello World >< .hw-container ## .hw-container { background: red; color: white; } @@ document.querySelector('.hw-container').textContent = 'Hello world!'; That's just for illustration. There's a lot more, like macros, devops (actions), backend, React, etc. I'm putting together public repos to show the language in use with real, complete systems. If you can take a look at the docs, I'd appreciate it: yr-lang: yr-lang.org (goals, motivation, and how to use it, though I'll admit I've implemented a few things that aren't documented yet) IDE (you can start writing right away): yrkit.site Small editor in my portfolio: mwtheus.github.io Example landing pages repo: github.com/yr-lang/yrweb Language on npm: npmjs.com/package/@yr-lang/yr CLI: npmjs.com/package/@yr-lang/yr-cli Web-only CDN: cdn.yr-lang.org/yr.js I built this to solve specific needs I had, but I'm happy to share the idea with the world. Maybe someone else would like to code this way too.

参与讨论