Brifing

Ohnrscript: Systems Programming with JavaScript Syntax

A new language bringing web-native syntax to low-level coding.

Hacker News: Show HN1 min

1Introduction

Ohnrscript is a new programming language that enables systems-level coding using JavaScript syntax. The same source code can be compiled to both LLVM IR and optimized JavaScript. This feature allows web developers to write low-level code with familiar syntax structures they're accustomed to.

2Ohn-Kernel

To demonstrate the language's capabilities, developers created Ohn-Kernel, a 24KB HTTP unikernel. Written entirely in Ohnrscript, this kernel boots in under 1 millisecond in QEMU or Firecracker. It can manage VirtIO network cards in Ring 0 and handle HTTP requests with zero OS dependencies.

3Performance Advantages

Ohnrscript is built on 32-bit integers and fixed memory buffers. This architecture delivers C-level performance with JavaScript-like syntax while maintaining zero runtime overhead. The absence of garbage collection pauses makes it particularly suitable for real-time systems.

4Compilation Process

The language operates through ahead-of-time (AOT) compilation. The same source code can be transformed into both LLVM IR and V8-optimized JavaScript. This dual-compilation feature provides developers the flexibility to build both web and system-level applications from a single codebase.

5Ease of Use

Ohnrscript supports familiar JavaScript constructs like const, let, function, and class. Basic operations such as array indexing work the same way. This significantly lowers the barrier for web developers transitioning to low-level programming.

6Future Potential

Ohnrscript has the potential to bridge the gap between web and systems programming. It offers significant advantages for microservices, edge computing, and high-performance web applications. Being testable in Docker within 30 seconds also makes it suitable for rapid prototyping.

Original article: Hacker News: Show HN — Ohnrscript: JavaScript Sözdizimiyle Sistem Programlama