Skip to content

Releases: prasantkumarsahu/kalinga-lang

Kalinga 0.6.1

Choose a tag to compare

@github-actions github-actions released this 24 Oct 15:44
ce18a05

Fixes only: no new syntax, nothing that changes what working code does.

Fixes

  • kalinga fmt no 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 .kl files (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

Choose a tag to compare

@github-actions github-actions released this 24 Oct 11:12
3955e3b

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]) (call Shape's methods on a T), <T: Show + Eq>. A
    bound is an interface, Show (printable), Eq (==) or Ord (<, 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 as S: Store<int>. See
    Interfaces.
  • Generic enums: enum Tree<T> { Leaf, Node(value: T, left: Tree<T>, right: Tree<T>) };
    variants learn T from their values or the expected type. See
    Enums.
  • Lambdas can change outside variables: a var that 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 let as a value: let n = if let x = opt { x * 2 } else { 0 }.

Standard library

  • std/reactive: signal, computed, effect, batch and scope keep 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 the kalinga-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

Choose a tag to compare

@github-actions github-actions released this 24 Oct 08:21
a1c1946

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 (length and size → 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 --version and 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 whatever ubuntu-latest is.

Editor

  • The extension is also on Open VSX,
    for VSCodium, Cursor and other editors that use it.

Kalinga 0.5.2

Choose a tag to compare

@github-actions github-actions released this 24 Oct 07:28
d92018e

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 from kalinga.kalinga-lang: if you
    installed a .vsix before, uninstall that one.

Kalinga 0.5.1

Choose a tag to compare

@github-actions github-actions released this 24 Oct 06:38
09542f8

Fixes only: no new syntax, nothing that changes what working code does.

Fixes

  • kalinga fix only 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 whose utkal.toml says kalinga = "0.4" (or has no kalinga field).
    Otherwise print calls are left alone and kalinga fix says how many; running fix
    twice no longer changes anything. utkal fix reads 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 Box now 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 .kl icon with icon themes such as Material Icon Theme (see the
    extension's README or Tooling).

Kalinga 0.5.0

Choose a tag to compare

@github-actions github-actions released this 24 Oct 05:30
1502d6d

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

  • print no longer ends the line; println does. println() prints an empty line, and
    print shows its text at once. kalinga fix (and utkal fix) rewrites 0.4's print(...)
    to println(...).
  • Member constants are const NAME: Type = value, no longer static NAME: ...; the
    parser says so and kalinga fix rewrites them.
  • override fn for interface methods too. A method that comes from anything after :
    in class C : Base, Iface, a base class or an interface, must be marked override fn;
    the compiler says what to add, and the editor offers a quick fix.
  • The VS Code setting kalinga.checkOnType is gone: the language server checks every edit.

Language

  • Strings: s[i] (one character), slices s[a..b] / xs[a..b] (either end optional),
    and split, replace, starts_with, ends_with, find, code_at, chars,
    parse_int, parse_float; [str].join(sep); built-ins chr(code) and args().
  • Recursive enums: Add(left: Expr, right: Expr), also through structs and optionals.
  • Constants and static variables: top-level const NAME: T = value, and const /
    static var members of classes and structs, used as Type.NAME. Values that depend on
    themselves are rejected.
  • if and match as 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
    ranges a..=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
    need float(x).
  • std/fs: File, Dir and Path for reading, writing and listing, with Result
    errors worded the same on every system.
  • test fn with assert(condition[, message]) and assert_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 fmt lay code out in one standard style (--check for CI).
    They change only whitespace and line breaks and check that the tokens are unchanged.
  • kalinga test / utkal test run test fns, each on its own thread, and report
    failures with the Kalinga file and line.
  • kalinga fix / utkal fix update 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, a test snippet, and a
    Kalinga icon for .kl files: 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-fmt and kalinga-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.