< Back home
Refingere Language

Refingere Language In progress

Statically typed language that stays out of Your way.

Errors are values, the outside world comes through a context You can replace, and the things most programs need are built in. It's designed to be straightforward to read and hard to get wrong, making a program's possible mistakes visible up front instead of letting them surprise You later.
Visit page

Built with

  • TypeScript
  • Bun
  • Vue 3
  • Vite
  • Tailwind CSS
  • Prism

Key concepts

Errors are values

Errors are values

Not surprises

A function that can fail says so in its type, and the caller decides what to do, right where it's called. !! passes an error up in two characters, ?? gives a fallback, match takes it apart and defer cleans up on every way out. And when the compiler finds a problem, it points straight at the offending code.
Context & Inject

Context & Inject

Testable without changing a line

The clock, the file system, output, randomness and Your own services are context values, read by name anywhere and provided by the caller with inject for everything it calls. No globals, no parameters threaded through every call. Tests simply inject a fixed clock or an in-memory file system.
No imports

No imports

Folders are the modules

Every file sees every other file in its folder, and other folders are reached by path. No list of imports at the top of each file to keep up to date, no packages to configure. local keeps a helper private when it shouldn't be seen outside.
Types built from parts

Types built from parts

Combined, not extended

Structs, enums with data, interfaces and generics, and no inheritance. && combines structs' fields, || combines enums' cases, interfaces can be implemented separately even for builtin types, and match takes everything apart.
Code that reads like math

Code that reads like math

Notation and custom operators

Roots, powers, subscripts and chained comparisons work as written: √x, x², xsi, 0 ≤ x < n. A folder can declare its own operators like ⋅ or ⨯, with a precedence. Vectors, matrices, complex numbers and quaternions are built in.
Macros

Macros

Other languages, checked when You compile

SQL, HTML, CSS, JSON and regular expressions are written as themselves, checked by their own parsers and turned into typed values. A typo in the SQL is a compile error pointing into the query, and values go in through #{ }, escaped for each language. Write Your own macros, derives and attributes too.
Batteries included

Batteries included

Rarely start by choosing libraries

Tables queried like SQL, graphs, linear algebra, dates, regular expressions and async promises are part of the language. Attributes turn plain functions into HTTP routes and structs into browser components, so servers and web apps need nothing extra.
Keep tests close

Keep tests close

Tests can live right next to the code

Write a @test right beneath the function it covers, in the same file. No separate test folder to keep in sync and no hunting across the project to find what exercises a given piece of code.
Fully tested

Fully tested

Confidence backed by numbers

Every feature of the language is backed by an extensive test suite, run on every change before it ships. Hundreds of tests and over a thousand assertions across dozens of files, all passing in a fraction of a second, so regressions get caught before they ever reach You.
Designed in Modeling

Designed in Modeling

The grammar is a model too

The language's grammar lives inside Modeling Refingere: every rule is a node, drawn as a live railroad diagram right next to its source. Edit a rule and the diagram follows; press Compile and each parser pass gets its rules resolved into a node of its own. The language is designed with the same tools as everything else in Refingere.
Learn more