Philosophy & Vision
GitHub RepositoryAutolang is a scripting language designed for AI to write code safely, quickly, and at low cost while reusing existing functions.
1. Why Autolang Exists
In the era of AI Agents, an issue has become increasingly apparent: the vast majority of current tools are designed for humans, not for AI.
This creates a paradox. Humans require flexible, feature-rich environments where they can do anything. But AI Agents do not need all that power. When we let AI directly use tools like Python, JavaScript, or other general-purpose runtimes, we hand it an ecosystem that is far too broad: the ability to read, write, and delete files, make network calls, manipulate the system, and perform unintended actions. That flexibility is excellent for humans, but it represents a real risk for AI.
To mitigate this risk, developers typically apply language restrictions, permission blocking, sandboxing, or environment isolation via virtualization. However, these methods all share common weaknesses: they are complex, hard to fully control, and strong isolation comes at the heavy cost of system resources — specifically RAM, CPU, and operational overhead.
Autolang was born to solve this exact problem.
Autolang is not meant to replace Python or JavaScript. It is an orchestration layer that sits on top of or alongside those languages, allowing you to wrap existing functions from Python, JavaScript, C++, and other ecosystems into a unified, safe, and controlled execution environment.
Autolang does not require rewriting tools that already work. Instead, you wrap existing functions — from npm, C++, or any other ecosystem — and expose them to the AI through Autolang bindings. The AI calls only what you register. Nothing else is accessible.
In other words, Autolang doesn't try to be a language that can do everything. Autolang acts as a manager.
2. What is Autolang in an AI Agent System?
With Autolang, AI is no longer free to directly invoke functions outside its controlled scope. Every action the AI takes must pass through Autolang's static compiler and the rules established by the system.
🧩
This creates a very clear model:
- The AI writes high-level logic.
- Autolang verifies, restricts, and validates that logic.
- The actual underlying execution functions can come from Python, JavaScript, C++, or existing libraries.
- The AI is only permitted to operate within the scope defined by Autolang.
This approach significantly reduces the risks associated with AI-generated code, while preserving the ability to reuse existing software ecosystems.
3. Characteristics of AI-Generated Code
Autolang was designed based on the real-world characteristics of code written by AI. Snippets generated by AI typically share the following traits:
- They are short, usually under 100 lines.
- They do not require extreme, deep performance optimization.
- They cannot be fully trusted in terms of safety.
- They are prone to logical errors such as infinite loops, incorrect data types, null pointer accesses, or wrong API calls.
That is the exact class of problems Autolang focuses on solving. Autolang is not optimized for massive, heavy programs. It is optimized for small, frequently-run code snippets that demand safety, strict control, and low total execution time.
This also informs the bet Autolang is making: AI doesn't need to write entire monolithic systems, but it can write small fragments of logic reliably — provided the syntax is clear, the semantics are strict, the environment is safe, and the ability to call external functions is tightly controlled. These are exactly the conditions Autolang is built to provide.
4. Performance Mindset: Total Time over Runtime
When discussing performance, Autolang doesn't solely focus on runtime. Instead, Autolang prioritizes total time:
compile time + runtime
The reason is that AI scripts rarely need to run so fast that it justifies a heavy compile-time penalty. If compiling takes a whole second just to deeply optimize a short script, the overall user experience degrades.
Therefore, Autolang is designed to strike a balance between compilation speed, compiler intelligence, and execution cost. The goal is to optimize just enough — without unnecessary deep optimizations that add compile cost but benefit long-running programs Autolang is not designed for.
According to internal benchmarks in the GitHub src/tests folder, Autolang executes roughly 900 lines of code in ~25ms on Windows 11 with a 12th-gen i5 processor and 16GB RAM. RAM usage for a single compiler instance is approximately 5.1MB (peak ~7MB). Cold start is ~18ms on a warm system; first-run times on Windows may be higher due to OS-level file scanning.
5. Safety Mindset: Don't Trust AI Like You Trust Humans
One of the biggest issues with letting AI write code is that AI cannot guarantee absolute safety.
⚠️
AI is prone to generating:
- infinite loops,
- out-of-context function calls,
- null data accesses,
- incorrect data types,
- and abuse of dangerous APIs.
Autolang mitigates this by allowing users to set a strict maximum opcode execution limit. If a script exceeds that threshold, it is immediately terminated — without crashing the host process.
Because AI-generated code is rarely compute-intensive, limiting opcodes is a highly effective way to prevent endlessly running code, faulty loop logic, or an agent getting stuck in an infinite cycle.
The objective isn't to trust that the AI will always write correct code, but to engineer a system where even if the AI writes bad code, it cannot bring down the entire environment.
6. Data Types and Reliability Mindset
A single misaccessed null value is enough to crash a program. With AI-generated code, this is a persistent risk.
Autolang solves this by providing explicit per-library control over which libraries are permitted to use lateinit and nullable types. This means:
- System libraries can maintain flexibility.
- AI-generated code must adhere to stricter constraints.
- Nullable values are forced to be handled explicitly with the
??operator. - Crashing the VM via null pointers becomes exceedingly difficult.
Autolang also utilizes static analysis to force the AI to write type-safe code from the start — a significant departure from highly dynamic languages like JavaScript or Python.
In an AI system, "easy to write" is far less important than "hard to write wrong".
7. Syntax Mindset: Concise but Unambiguous
Autolang uses Kotlin-inspired syntax, with data structures that carry the spirit of TypeScript. The reasoning is straightforward: Autolang wants to leverage the prior knowledge AI models already have from these popular languages, rather than forcing them to learn an entirely alien syntax.
However, every syntax decision must serve the goal of assisting the AI — not just mimicking familiar languages. Take lists, for example:
<Int>[]
[]
- During declaration (e.g.,
val list = <Int>[]), the AI is forced to explicitly declare the type, preventing mismatched data types later on. - Once the type can be clearly inferred,
[]is sufficient — saving tokens and reducing unnecessary complexity.
Explicit when clarity is needed.
Concise when there is enough context.
8. Structured Control, Not Infinite Freedom
Languages like JavaScript or Python are highly dynamic and flexible. For humans, this is an advantage. For AI, it is often a liability.
Autolang takes the opposite approach: less freedom, but more safety. Instead of letting the AI freely infer everything, Autolang relies on static analysis to enforce data types, limit access permissions, control the scope of function calls, and ensure the code is strictly valid before it ever runs.
In an AI system, ambiguity is a heavy cost. Autolang was created to eliminate that cost.
9. When to Use (and When Not to Use) Autolang
Autolang is not a mandatory choice for every scenario.
✅
Autolang is a good fit if:
- You are building a system where an LLM generates and executes code at runtime, and you need to control what it can access.
- You are running many concurrent AI agents and the RAM overhead of full runtime isolation is becoming a cost problem.
- You want to expose existing JS or C++ functions to AI in a controlled way, without rewriting them.
- Your AI-generated scripts are short (under ~100 lines) and run frequently.
A rough threshold: if you are running 5+ concurrent agents and memory or cold-start latency matters, the tradeoff starts making sense.
⚠️
Autolang is probably not the right fit if:
- You only have a small number of agents and runtime isolation overhead is not a concern.
- Your AI needs to write long, complex programs — Autolang is optimized for short scripts, not large applications.
- You need OS-level security guarantees — Autolang is a language-level sandbox and does not replace process isolation.
- You need Python bindings — they are not available yet.
10. Autolang and Wasm
Wasm is a highly effective solution for modern sandboxing. But to use Wasm properly, you still have to manage the build process, function invocations, data passing, runtime error handling, and environment orchestration.
In other words, Wasm solves part of the problem, but it does not automatically serve as a coordination layer for AI.
Autolang aims to fill that role: instead of forcing you to manage multiple config files, JSONs, and distinct runtimes, Autolang allows the AI to express its intent solely through Autolang syntax, while coordination and control are handled by the system.
11. Operational Philosophy: AI Dictates 'What', the System Handles 'How'
If you let the AI directly operate across multiple different runtimes, you are burdened with managing environments, JSON files, access permissions, and a myriad of safety mechanisms.
Autolang flips this architecture. Instead of letting the AI directly touch every environment, you wrap everything into pre-defined functions. The AI only needs to call those functions through Autolang. The entire system revolves around the AI's intent, rather than the chaos of juggling multiple runtimes.
Humans only need to: wrap native functions, define interfaces, establish execution limits, and expose them to the AI for safe usage. Autolang is not a language born to replace human workflows — it is an intermediary layer optimized for humans and AI working together.
Autolang was not created to make AI "stronger" in the sense of being able to do anything. It was created to make AI safer, cheaper, easier to control, and fundamentally better suited for short-lived task execution.
Conclusion
Autolang was not created to compete with Python or JavaScript on every front. It was born to solve a very specific, but highly critical problem:
how to allow AI to interact with software tools in a way that is lighter, safer, consumes fewer resources, and is easier to control.
The core philosophy of Autolang is:
- do not replace the existing ecosystem,
- do not force rewriting everything from scratch,
- do not trust AI blindly,
- do not let runtimes bloat unnecessarily,
- and never sacrifice safety in exchange for fake flexibility.
Autolang is the management layer between the AI and the execution environment.
The AI expresses intent.
Autolang controls the action.
The underlying system executes the real work.