devlang.dev

dev

A language that compiles to a freestanding binary.

Imperative, statically typed, indent-based. Type inference on locals. No GC in v0.1. No C toolchain.

What it is

For tools, compilers, and canvas.

dev is compiled ahead of time: source becomes a native or Wasm image with raw OS calls (or WASI). Fit for CLI and systems work, and for browser Wasm where you own the pixels — canvas, graphics, games. The language is small on purpose; its own compiler is being written in dev.

Features

What v0.1 actually has.

The surface below is implemented, not a wishlist.

Example

Structs, defaults, slices, strings.

A short tour: move a point, take a slice, cut a string.

intro.dev# struct
Point:
  x = 0
  y = 0

# function
move: (p, dx, dy = 0) -> (q)
  q = Point(p.x + dx, p.y + dy)

# call
origin = Point()
p = move(origin, 3, 4)
print "at ", p.x, ",", p.y
step = move(p, 1)
print "step ", step.x, ",", step.y

# slice
nums = [](10, 20, 30, 40)
mid = nums[1:3]
print "mid ", mid[0], " ", mid[1], " len=", mid.len

# string
name = "devlang"
print name[0:3], " / ", name[3:]
outputat 3,4
step 4,4
mid 20 30 len=2
dev / lang

Targets

One frontend. Several targets.

Select with -t OS/ARCH. Default is the host. Listings via -S.