LOOK Language — VS Code Extension
LOOK is a web-first scripting language that combines single-file deployment with a persistent FastCGI runtime.
PHP deployment simplicity, Go-inspired runtime model.
Why LOOK?
LOOK occupies a specific space: server-side scripting with the deployment simplicity of a single file and the runtime model of a compiled language.
| Feature |
Built-in |
| Warm-start runtime |
Yes |
| Persistent DB connections |
Yes |
| FastCGI workers |
Yes |
| Routing |
Yes |
| WebSocket + SSE |
Yes |
| Channel-based concurrency |
Yes |
| Bytecode VM |
Yes |
Design decisions:
- Routing is built into the language — no framework to install, no router to configure
- No hidden variables — everything is passed explicitly through closures;
$_GET, $_SESSION replaced by request::, session::
- Semicolons are optional — Go-style ASI
- Single deployment unit — drop
.lk files, configure Apache/Nginx, done
What is Warm Start?
Unlike CGI (new process per request), LOOK's FastCGI runtime boots once and stays alive. DB connections are established at startup and reused across requests — no reconnect overhead per request.
CGI: [request] → fork process → parse → connect DB → respond → die
LOOK: [request] → dispatch → respond (process already running, DB already connected)
This is why LOOK achieves 8,000+ RPS on a modest VPS with a live MySQL database.
Quick Start
$conn = db::connect("mysql://root:@127.0.0.1/mydb")
route("GET", "/", function() use ($conn) {
$rows = db::query($conn, "SELECT * FROM urunler LIMIT 10", [])
print(json::encode(["ok" => true, "urunler" => $rows]))
})
route("GET", "/urun/{id}", function($id) use ($conn) {
$rows = db::query($conn, "SELECT * FROM urunler WHERE id = ?", [$id])
if (count($rows) == 0) {
response::status(404)
print(json::encode(["ok" => false, "hata" => "Bulunamadı"]))
return
}
print(json::encode(["ok" => true, "urun" => $rows[0]]))
})
route("404", function() {
response::status(404)
print(json::encode(["ok" => false, "hata" => "Sayfa bulunamadı"]))
})
Features
Syntax Highlighting
- Keywords —
if, while, foreach, function, route, struct, const, parallel, switch
- Variables —
$değişken distinct color
- Modules —
db::, ws::, sse::, timer::, request::, response::, session::, template::
- Strings — double
"...", single '...', backtick `...`
- String interpolation —
"{$var}", "{true}", "{string::upper($x)}" highlighted inside strings
- Comments —
# line comment
Snippets
| Prefix |
Description |
route-get |
GET route handler |
route-post |
POST route handler |
route-param |
Route with URL parameter |
route-404 |
404 handler |
route-ws |
WebSocket route + hub channel |
route-sse |
SSE route + timer::every |
db-connect |
DB connection with 3-retry + warm start |
db-query |
Parametrized query + not-found check |
db-exec |
INSERT / UPDATE / DELETE |
db-check |
db_check() helper |
parallel |
Channel-based concurrency |
parallel-fanout |
Fan-out 3 goroutines |
timer-every |
Repeating timer |
timer-after |
One-shot timer |
template |
template::render + print |
use-file |
use "dosya.lk" |
struct-def |
Struct definition |
const-iota |
const { A = iota } |
try-catch |
try / catch / finally |
fn |
Function definition |
foreach |
foreach loop |
json-ok |
JSON success response |
json-error |
JSON error + return |
session-check |
Session auth check |
switch |
switch statement (Go-style, no break) |
log |
log::info / warn / error |
Language Configuration
- Line comment:
#
- Bracket matching:
{}, [], ()
- Auto-close:
", ', `, {, [, (
- Auto-indent: after
{
Language Overview
Variables: $name = value
Functions: function greet($name) { return "Hello " . $name }
Closures: function() use ($conn) { ... }
Structs: struct User { name; email; active: true }
Constants: const { OK = 200; ERR = 400 }
DB: $rows = db::query($conn, "SELECT ...", [$id])
Routes: route("GET", "/path/{id}", function($id) use ($conn) { ... })
WebSocket: route("WS", "/chat", function($ws) use ($hub) { ... })
Concurrency: parallel(function() use ($ch) { send($ch, result) })
Templates: print(template::render($tpl . "/view", ["key" => $val]))
Compatible runtimes
| Mode |
Use case |
look-fcgi --port 9000 |
Production — FastCGI behind Apache/Nginx |
look-fcgi --mode http |
Standalone HTTP server, no Apache |
look-cgi |
Fallback CGI mode |
look |
CLI / scripting |
Installation
code --install-extension look-lang-0.2.1.vsix
Developer
Codlook Bilişim — Diyarbakır, Türkiye
LOOK programlama dili, Diyarbakır'da faaliyet gösteren yazılım şirketi Codlook Bilişim tarafından geliştirilmektedir.
Links