Repository navigation
Releases: prasantkumarsahu/kalinga-lang
Releases · prasantkumarsahu/kalinga-lang
Release list
Kalinga 0.6.1
Fixes only: no new syntax, nothing that changes what working code does.
Fixes
kalinga fmtno longer refuses a file when it re-indents a line holding an interpolated
string ("the formatter would change the program").
Editor (VS Code extension 0.6.3)
import "offers the project's own.klfiles (and those in folders below), before the
standard modules and packages; the list opens as you type"or/.- Completion inside a string's
{...}: variables and functions after{, members after
., also while the string is still being typed. Suggestions show while typing in
strings, and{opening a block no longer opens a list.
Kalinga 0.6.0
Everything here is new; code written for 0.5 compiles and does the same thing.
Language
- Bounds on type parameters:
fn largest<T: Ord>(xs: [T]) -> T?,
fn total<T: Shape>(xs: [T])(callShape's methods on aT),<T: Show + Eq>. A
bound is an interface,Show(printable),Eq(==) orOrd(<,sort). A type that
does not meet a bound is reported where it is used, and generic code that needs a bound
is told which one to add. See Generics. - Generic interfaces:
interface Store<T>,class Counter : Store<int>, values of type
Store<int>,interface Cache<T> : Store<T>, and bounds such asS: Store<int>. See
Interfaces. - Generic enums:
enum Tree<T> { Leaf, Node(value: T, left: Tree<T>, right: Tree<T>) };
variants learnTfrom their values or the expected type. See
Enums. - Lambdas can change outside variables: a
varthat a lambda changes is shared with
it (var count = 0; let inc = fn() { count += 1 }), so counters and callbacks work.
Variables no lambda changes are still copied, as before. See
Lambdas. - Tuples:
(int, str),return (lo, hi),let (lo, hi) = min_max(xs),
for (name, age) in people,t.0. See
Functions. if letas a value:let n = if let x = opt { x * 2 } else { 0 }.
Standard library
std/reactive:signal,computed,effect,batchandscopekeep values that
depend on each other up to date, with no garbage collector (a scope frees what was made
in it). See Reactive Values.
Editor
- Hover shows bounds; completion and signature help work on bounded type parameters and
on generic interface values, with their type arguments filled in. - On Open VSX the extension is
kalinga-lang.kalinga-lang, in thekalinga-lang
namespace (page).
Tooling
- The release workflow can be re-run after a failed publish step ("Re-run failed jobs"):
an existing release gets its files and notes replaced.
Kalinga 0.5.3
Fixes only: no new syntax, nothing that changes what working code does.
Fixes
- Hints for names from other languages: "did you mean ...?" also suggests the
snake_case form of a camelCase name (s.startsWith(...)→starts_with) and
Kalinga's name for common ones (lengthandsize→len,toUpperCase→upper,
indexOf→find, ...), but only names the type actually has. - Every download is tested before it is published: the release workflow runs
kalinga --version,utkal --versionand a small program with each of the four builds
(the Intel macOS one under Rosetta). - The release and CI workflows use actions that run on Node.js 24, and Ubuntu 24.04
instead of whateverubuntu-latestis.
Editor
- The extension is also on Open VSX,
for VSCodium, Cursor and other editors that use it.
Kalinga 0.5.2
The VS Code extension on the Marketplace; the compiler and the language are unchanged.
Editor (VS Code extension 0.6.2)
- On the VS Code Marketplace as Kalinga Language (
PrasantKumarSahu.kalinga-lang);
each release publishes it. The extension ID changed fromkalinga.kalinga-lang: if you
installed a.vsixbefore, uninstall that one.
Kalinga 0.5.1
Fixes only: no new syntax, nothing that changes what working code does.
Fixes
kalinga fixonly rewrites code older than the rule. The 0.4 → 0.5 rule
(print(...)→println(...)) runs when the code is from 0.4:kalinga fix --from 0.4,
or a project whoseutkal.tomlsayskalinga = "0.4"(or has nokalingafield).
Otherwiseprintcalls are left alone andkalinga fixsays how many; runningfix
twice no longer changes anything.utkal fixreads the version before updating it.- "did you mean ...?" for misspelt variables, functions, types, fields, methods
(inherited and built-in ones too), static methods, enum variants, constants and library
functions. - A reserved type name such as
Boxnow says why it is reserved. - The language server no longer crashes on half-written code: signature help and
completion failed when a non-ASCII character (such as an emoji) came before a name. A
request that still fails is answered with an error instead of stopping the server.
A new test breaks every example and library file thousands of ways and checks that the
compiler, the formatter and the language server never crash.
Editor (VS Code extension 0.6.1)
- The extension is bundled into one file: a 13-file package (was 328) that loads faster.
- How to get the
.klicon with icon themes such as Material Icon Theme (see the
extension's README or Tooling).
Kalinga 0.5.0
From this release on, code that compiles keeps compiling in 0.x: any unavoidable change
comes with a kalinga fix rule (see Stability).
Breaking changes
printno longer ends the line;printlndoes.println()prints an empty line, and
printshows its text at once.kalinga fix(andutkal fix) rewrites 0.4'sprint(...)
toprintln(...).- Member constants are
const NAME: Type = value, no longerstatic NAME: ...; the
parser says so andkalinga fixrewrites them. override fnfor interface methods too. A method that comes from anything after:
inclass C : Base, Iface, a base class or an interface, must be markedoverride fn;
the compiler says what to add, and the editor offers a quick fix.- The VS Code setting
kalinga.checkOnTypeis gone: the language server checks every edit.
Language
- Strings:
s[i](one character), slicess[a..b]/xs[a..b](either end optional),
andsplit,replace,starts_with,ends_with,find,code_at,chars,
parse_int,parse_float;[str].join(sep); built-inschr(code)andargs(). - Recursive enums:
Add(left: Expr, right: Expr), also through structs and optionals. - Constants and static variables: top-level
const NAME: T = value, andconst/
static varmembers of classes and structs, used asType.NAME. Values that depend on
themselves are rejected. ifandmatchas values:let x = if a > b { a } else { b },
let n = match d { Up => 1, _ => 0 }; one-line match arms take commas.- Loops:
while let x = optional { },for i, x in xs,for k, v in m, and inclusive
rangesa..=b(in slices too). - Named arguments:
clamp(15, low: 0, high: 10),Rect(w: 10, h: 5), checked against
the parameters; struct fields with defaults may be skipped. - Whole-number literals where a float is expected:
Vec2(600, 300); variables still
needfloat(x). std/fs:File,DirandPathfor reading, writing and listing, withResult
errors worded the same on every system.test fnwithassert(condition[, message])andassert_eq(value, expected).- Doc comments:
///above a declaration is its documentation (Markdown); plain//is
not.
Tooling
kalinga lsp, a language server built on the compiler: errors as you type (all of
them at once), completion, hover with docs, signature help, go to definition, find
references, rename (methods together with what they override or implement), outline,
quick fixes and formatting.kalinga fmt/utkal fmtlay code out in one standard style (--checkfor CI).
They change only whitespace and line breaks and check that the tokens are unchanged.kalinga test/utkal testruntest fns, each on its own thread, and report
failures with the Kalinga file and line.kalinga fix/utkal fixupdate code for a new version.- The compiler reports up to 20 errors at once instead of the first, and the parser keeps
going after a mistake in one declaration.
Editor
- VS Code extension 0.6.0: a thin client of
kalinga lsp(the old JavaScript completion
engine is gone), with a Run Tests in File command, Format Document, atestsnippet, and a
Kalinga icon for.klfiles: a 24-spoke wheel after the Ashoka Chakra.
Internals
- The compiler is a Cargo workspace:
kalinga-syntax,kalinga-sema,kalinga-codegen,
kalinga-driver,kalinga-project,kalinga-fmtandkalinga-lsp. - Type checking produces a typed tree that code generation prints; the runtime is real Rust
files (crates/kalinga-codegen/runtime/), checked by rustfmt and the compiler. - One registry of built-in functions and methods feeds the type checker, the editor and the
docs, and tests keep them in step. - Errors are typed values in every library crate; spans cover whole names.
- Tests: output snapshots for every UI case, every doc example run and its output checked,
the language server's features, the formatter on all repository code. CI runs on
Windows, Linux and macOS, with clippy, rustfmt, ESLint and Prettier.
Fixes
- Async timers that are due at the same time now finish in time order, also on a busy
machine.