Autolang
A statically-typed scripting language and VM for sandboxed execution of AI-generated code. Wrap your existing functions as bindings, and let the AI call only what you allow — nothing more.
Why Autolang?
General-purpose runtimes expose too much surface area for AI-generated code — file I/O, network access, arbitrary imports. Restricting them after the fact is complex. Docker and MicroVM isolation work, but carry real overhead per instance.
Autolang takes a different approach: a minimal VM where scripts can only call explicitly registered functions. Static analysis catches type errors before execution. Opcode limits terminate runaway scripts without crashing the host.
Static typing
Opcode limiting
Null safety
?? operator. AI scripts can be restricted from using nullable types or lateinit entirely.Per-library permissions
Native bindings
@native. No need to rewrite existing code — just expose what the AI is allowed to call.Low overhead
Language Syntax
Autolang uses Kotlin-inspired syntax so AI models can write it without learning an unfamiliar language. Every syntax decision is made to assist the AI — explicit where clarity is needed, concise where context is sufficient.
Null safety
class User(var name: String?)
var user: User? = null
println(user?.name ?? "Anonymous")
user = User(null)
println(user?.name?.size() ?? 0)Collections
Explicit type declaration on creation prevents data-type mismatches. Once the type is inferred, the shorthand form is sufficient.
val scores = <Int>[10, 20, 30]
scores.insert(0, 5)
val filtered = scores.filter {|v: Int| v > 10}
println(filtered)Classes and inheritance
class GAnimal {
func sound() = "..."
}
class GCat extends GAnimal {
constructor() { super() }
@override
func sound() = "Meow"
}
val pet: GAnimal = GCat()
println(pet.sound())Under the hood
- Engine: Custom C++ VM designed for single-threaded throughput.
- Memory: Reference counting + hot restart — memory resets to a clean state after each execution instead of relying on garbage collection.
- Safety: Per-run opcode limiting and strict memory boundary checks.
- Portability: Compiles to native binaries or Wasm for Node.js and browser environments.
- Host environments: Node.js (npm) and C++ currently supported. Python bindings are planned.
Performance
Windows 11, i5 12th Gen, 16GB RAM
Contributing
Autolang is open source. Bug reports and pull requests are welcome, especially for npm wrappers and embedding APIs.
