Teyru
A Java-shaped language that compiles to a native binary. No JVM, no bytecode.
Read the documentationclass Hello {
public static void main(String[] args) {
System.out.println("Hello, Teyru!")
}
}
Install the compiler
go install github.com/teyru-lang/Teyru/cmd/teyru@latest
Requires Go and clang or gcc.
What it is
- Native binary
- Compiled through a Go front end, generated C and clang/LLVM into a native executable — no JVM, no bytecode.
- Standard library
- Written in Teyru itself, and compiled and checked together with every program.
- Annotations
- Lombok-compatible, expanded into ordinary members during semantic analysis.
- Web framework
- A Spring-shaped container and web layer: SpringApplication.run reads application.properties, @ConfigurationProperties binds it, @Profile picks beans, and advice, interceptors, static files and CORS are all there — with the routes compiled.
- Sessions
- Sessions.of(req) finds the session a request's cookie names, and the server stamps that cookie on the answer on the way out, so a run of requests has one identity.
- Validation
- @NotNull, @Size, @Min and @Max on a field, checked by Validation.check; a bound body that breaks one is a 400 that says which field.
- Uploads
- HttpRequest.multipart(name) hands back the part a multipart form sent, as a MultipartFile: field name, original filename, content type, bytes.
- HTTP client
- Http.get and HttpClient send real requests and reuse a keep-alive connection, and the accept loop (ServerTask) runs on a thread — a client and a server in one program.
- WebSocket
- Implement WebSocketHandler and mark it @WebSocketMapping to have it declared like a controller; WebSocketSession is the connection after the upgrade.
- Threads
- Real threads: Thread and Runnable, real synchronized (the method modifier too) and Object.wait/notify, with a collector that stops every thread before it traces.
- JSON binding
- Gson-shaped, with the object binding generated by the compiler.
- Garbage collector
- A C runtime with a conservative mark-and-sweep collector and no virtual machine.