HeadlinesBriefing favicon HeadlinesBriefing.com

Tiny: A Dynamic Language with Native Go Integration

Hacker News •
×

A new project called Tiny introduces a concurrent bytecode virtual machine written in Go. It blends the speed of dynamic typing with a multi-threaded runtime, allowing developers to write untyped code for prototypes or use optional static type hints for performance. The system compiles source files into compact .tbc bytecode instructions.

Performance comes from a multi-tiered execution model that uses an interpreter for general logic and a JIT compiler for hot paths. This JIT engine translates critical code into Web Assembly, utilizing region outlining and packed object arrays to bypass typical VM-to-native overhead. It supports OS-level parallel threading via the spawn keyword for true CPU core utilization.

Developers can write inline Go functions directly in source files, which the system compiles via Tiny Go. This allows seamless access to Go packages for complex logic like SHA256 hashing. The language also includes structural typing, pattern matching, and a built-in Language Server for a complete development experience.

Tiny provides a specialized toolset for high-performance concurrency that avoids the limitations of event-loop models. It manages shared state through mutexes and automatic lock blocks to prevent deadlocks.