Every time I start a small frontend project or write plain scripts, I find myself stuck between two frustrating extremes:
-
Vanilla JavaScript still carries decades of quirks: confusing equality rules (
==vs===), multiple variable declarations, and verbose DOM APIs likedocument.querySelectorandaddEventListenerrepeated everywhere. -
TypeScript adds solid compile-time typing, but it brings heavy tooling friction:
tsconfig.jsonconfigurations, bundler setups, build plugins, and massivenode_modulesbefore you write a single line. And at runtime, you are still writing the exact same verbose DOM boilerplate.
I wanted something clean in between. So I built Oriented-Direct (.osp), a language that compiles to standard JavaScript with zero external dependencies.
What does it look like?
The syntax removes ambiguity and cuts down browser boilerplate:
val submitBtn = @find("#submit");
val statusText = @id("status");
@on(submitBtn, "click", async (e) => {
@css(submitBtn, { opacity: "0.6" });
@text(statusText, "Processing...");
val res = await fetch("/api/data");
@log("Done:", res);
});
Key differences from standard JS:
-
No variable confusion: Only
val(immutable) andmut(mutable). -
Strict equality:
==and!=always transpile to===and!==. No loose equality traps. -
Built-in DOM directives:
@find,@on,@css,@html,@text, and@emitdirectly in the grammar. - Zero-config toolchain: It comes with its own bundler, dev server with live reload, and Base64-VLQ source map generator in ~5K lines of pure JavaScript.
Because the syntax is so concise, it also cuts down token usage by ~33% when feeding code to AI agents and LLMs.
Try it out
You can run the dev server instantly with zero install:
npx @xvdxlinux/oriented-direct dev
Or install it globally:
npm install -g @xvdxlinux/oriented-direct
ospc dev
- GitHub Repo: https://github.com/xvdvlinux-coder/Oriented-Direct
- Wiki: https://github.com/xvdvlinux-coder/Oriented-Direct/wiki
- npm: https://www.npmjs.com/package/@xvdxlinux/oriented-direct
Would love to hear your feedback on the syntax design and approach!
Top comments (0)