No post body was provided.
Untitled topic
1–2 of 2 posts
Re: undefined
#2I have some projects but I don't have much money, so I always use gemini flash for UI tasks and some features.
But I realized Gemini Flash is very fast and cheap but it's sometimes very stupid.
It hallucinates members or functions that don't exist and uses "as any" to make everything look OK.
Lightweight models are very cheap nowadays I need to use them for my products, so I thought what would happen if I created a language (but I think it's like a library).
It's my favorite thing to learn about compilers. But I also hope it's useful.
Its name is Autolang.
I wanted it as a library for runtime sandboxing, designed for lightweight models.
Developers would bind functions easily (JS Function, ...) and it has some features to protect runtime that can reduce development time (including bindings, limits, ...)
Developers should bind some features like Database.getProducts instead of Database.query
Supported npm
Some features:
- Static typing
- Stack traces and static typing help AI understand what went wrong and fix its code, especially for cheaper models that may make mistakes more often.
- A statically typed syntax inspired by languages like Kotlin and TS, but I think it should use Products.getProducts(). Many features should be used by developers to bind.
- Opcode limit
- Managed vm RAM (it will manage RAM used by VM)
The current Autolang instance uses about 0.5 MB with the full standard library enabled. A 1,800-line test peaked at around 3.8 MB on Windows 11.
I asked AI about it, and it sometimes asks:
- Why not tool calling ?
+ You should use Autolang when you want to avoid round-trip API calls. For example classify hundreds or thousands of customers where each round-trip adds up in cost and latency, ...
- It doesn't have any library like npm or pip, ...
+ This language is like a library, so I want developers to bind some functions that AI can use instead of everything.
- How is it different from isolated-vm, JS, Python
+ I think I'm building a language that is friendly to AI, with better stack traces and error messages, so lightweight models can understand what went wrong and fix their code more easily.
- Can it replace Docker, KVM, ...
+ No, I want it for sandbox that AI can use bound functions.
- Is prompt tokens large ?
+ I don't think so. I wanted AI to write scripts which don't include new libraries. So I think it should use some features like ?., ??, !., as, is, fun, closures and some standard libraries
- Use case:
+ I think I target internal SME products for analyzing some features, like having getUsers and letting AI classify users as VIP, normal, ... to solve problems quickly and reduce development time
Examples: compiler.registerBuiltInLibrary( "company/database", ` class Product( remaining: Bool price: Int )
/* Or
// Mark JS reference in place of cast to autolang object
@js_object
class Product {
@native("get_price")
fun getPrice(): Int
@native("is_remaining")
fun isRemaining(): Bool
}
If you are using some complexity data you should use it
*/
@js_object
class Products {
@native("get_products")
fun getProducts(): Array // Autolang VM saves the type and will auto cast
}
`,
{ autoImport: true },
{
get_products() {
...
}
...
}
);
TS function
await compiler.compileAndRun("main.atl", `
var expenseCount = 0
var normalCount = 0
var cheapCount = 0
Products.getProducts()
.filter {|product| product.remaining}
.forEach {|product|
when (product.price) {
>3 -> expenseCount += 1
==3 -> normalCount += 1
else -> cheapCount += 1
}
}
println(...)
`);
console.log(compiler.getOutput());
If you were facing the problem of using cheap/lightweight models to generate code for internal SME products, would you actually use something like this?