Early preview: syntax, standard library APIs, and tooling may change.

Better Tradeoffs for the AI Era

AI has changed the economics of software: teams can produce more code, faster, and with less oversight. The hard parts are trust and quality. That's where Blorp comes in.

Blorp is an early preview, not a verified security boundary. These are language guard rails, not a substitute for testing or auditing native code and effectful code. The purity rules include a restricted debug-diagnostic exception.

Trust

Pure Code Can't Drop Your Database

Pure functions can transform data, but they cannot perform I/O, mutate global state, call the network, call impure functions, or launch tasks. If code can touch the outside world, that boundary is visible.

pure func process_text(text: String) -> String:
	-- This pipeline may be large, but it's pure, so we don't
	-- have to worry about surprising IO like data exfiltration or
	-- dropping a database.
	long_complicated_text_processing_pipeline(text)

Understand at First Glance

Part of trusting code is being able to reason about it. Blorp favors explicitness and low ceremony, so humans and agents can reason about the code in front of them. Value semantics, method chains, explicit failure, exhaustive matches, and more make Blorp code easy to grok -- whether you're coming from Python, TypeScript, Rust, Go, or other modern languages.

pure func parse_port(raw: String) -> Option[Int]:
	-- No exception path: bad input returns `None`.
	raw
		.trim()
		.parse_int()


pure func valid_port(port: Int) -> Bool:
	port >= 1 and port <= 65535


pure func describe_port(raw: String) -> String:
	match parse_port(raw):
		Some(port):
			if valid_port(port):
				"port ${port} is ready"
			else:
				"port ${port} is out of range"
		None:
			"not a number"


func main(args: List[String]) -> Void:
	print(describe_port(" 8080 ")) -- prints: port 8080 is ready
	print(describe_port("70000")) -- prints: port 70000 is out of range
	print(describe_port("oops")) -- prints: not a number

Smaller Surface, Fewer Problems

Blorp's type and ownership rules are designed to prevent buffer overflows, out-of-bounds access, null pointer exceptions, use-after-free, double-free, unchecked tensor shapes, and unhandled cases. Managed memory and checked operations keep that burden off application code. Compiler and runtime defects remain possible in this early preview.

Quality

Blorp makes good structure feel natural, so agents and humans are more likely to produce code worth keeping.

Model the Domain with Ease

Records, unions, and exhaustive pattern matching make illegal states harder to express. Correctness starts in the model, not in scattered defensive checks.

union Build:
	Queued
	Running(Int)
	Passed
	Failed(String)


pure func status_label(build: Build) -> String:
	match build:
		Queued: "queued"
		Running(percent): "running ${percent}%"
		Passed: "passed"
		Failed(reason): "failed: ${reason}"


func main(args: List[String]) -> Void:
	print(status_label(Running(42))) -- prints: running 42%

Imperative Shell, Functional Core

Keep effects in the shell, close to the program boundary. Keep decisions in pure functions that take plain values and return plain values.

import:
	system: read_file


record ReleaseReport {
	checks: Int,
	blockers: Int
}


pure func non_empty(line: String) -> Bool:
	line.trim() != ""


pure func is_blocker(line: String) -> Bool:
	line.contains("BLOCKER")


pure func build_report(raw: String) -> ReleaseReport:
	checks: List[String] = raw
		.lines()
		.filter(non_empty)

	{
		checks = checks.length(),
		blockers = checks
			.filter(is_blocker)
			.length()
	}


pure func format_report(report: ReleaseReport) -> String:
	if report.blockers == 0:
		"ready: ${report.checks} checks passed"
	else:
		"blocked: ${report.blockers} of ${report.checks} checks need review"


func main(args: List[String]) -> Int:
	-- Imperative shell: file I/O, printing, and exit codes stay near the boundary.
	match read_file("release-checks.txt"):
		Ok(raw):
			-- Functional core: parsing and release decisions stay pure.
			report = format_report(build_report(raw))
			print(report) -- prints: "blocked: 1 of 3 checks need review"
			0
		Err(message):
			print_error(message)
			1

Compiler Feedback That Steers Work

Compiler errors point humans and agents in the right direction. Blorp tries to show the problem, explains the fix, and keeps fixes local, so code moves from idea to application faster. A purity violation names the pure function and the impure call.

error: Pure function 'greet' cannot call impure function 'print'
  --> review.brp:2:2
   |
 2 | 	print(name)
   | 	^^^^^^^^^^^
   |
   = note: 'print' is impure because it performs I/O
   = help: Remove 'pure' from the function signature, or use a pure alternative

Native Performance

Blorp compiles to native code and uses automatic reference counting (no GC) for reliable performance. Optimized memory management keeps Blorp within range of C for many workflows.