Archived
1172ab6351
Axum HTTP server (port 7771) serving a single-page IDE with CodeMirror 6 syntax highlighting for engram-lang, a force-directed type graph visualizer, LSP (completions, hover, diagnostics), SSE-streamed build/run output, a plugin host with five first-party plugins, and a reasoning panel that proxies to engram-server. 28 tests across three crates, zero warnings.
42 lines
725 B
EmacsLisp
42 lines
725 B
EmacsLisp
fn main() -> Void {
|
|
let greeting: String = "Hello from Engram"
|
|
let count: Int = 42
|
|
}
|
|
|
|
type Point {
|
|
x: Float
|
|
y: Float
|
|
}
|
|
|
|
fn distance(a: Point, b: Point) -> Float {
|
|
let dx: Float = a.x - b.x
|
|
let dy: Float = a.y - b.y
|
|
return dx * dx + dy * dy
|
|
}
|
|
|
|
type Circle {
|
|
center: Point
|
|
radius: Float
|
|
}
|
|
|
|
enum Shape {
|
|
Dot
|
|
Line(String)
|
|
Polygon(Int)
|
|
}
|
|
|
|
fn classify(s: Shape) -> String {
|
|
match s {
|
|
Shape::Dot => "point"
|
|
Shape::Line(name) => name
|
|
Shape::Polygon(sides) => "polygon"
|
|
}
|
|
}
|
|
|
|
// activate example — spreading activation query
|
|
// let circles: [Circle] = activate Circle where "large circles near origin"
|
|
|
|
sealed {
|
|
let api_key: String = "secret-key"
|
|
}
|