Skip to main content

Introduction to Varjus

Varjus is an open source dynamically typed scripting language designed for integration with C++. It features a syntax similar to JavaScript but enforces strict rules to ensure predictable behavior and efficiency. Despite its strict nature, the language remains highly flexible.

⚠️ Optimization is currently not a feature. If you enjoy watching your code execute at a leisurely pace, you're in for a treat!

Key Features

  • C++ Integration: Like Lua, Varjus can be embedded into C++ applications, allowing direct interaction with native code.
  • JavaScript-Like Syntax: The language adopts JavaScript's familiar syntax while enforcing stricter constraints for better safety and performance.
  • Module System: Supports modular programming, enabling clean and organized code structure.
  • Flexible Built-in Types: Strings, arrays, and objects provide a wide variety of methods to handle common problems, making them highly adaptable and easy to work with.
  • No Object-Oriented Programming (OOP): The language does not include traditional OOP concepts like classes and inheritance, focusing instead on simpler and more flexible paradigms.
  • Strict Type Coercion: Implicit conversions follow a well-defined priority, and any invalid conversion results in a runtime error.
  • Predictable Exception Handling: Only user-defined exceptions can be caught, preventing unintended suppression of critical errors.

Integration with C++

Varjus is designed to work alongside C++, allowing developers to:

  • Call C++ functions from your scripts.
  • Create your own global objects.

This makes it an ideal choice for game development, scripting engines, and high-performance applications where dynamic behavior is required—just don't expect it to run fast (yet).

Hello, world!

fn main()
{
console.log("Hello, world!");
}