Skip to content

Migration guides

Each page lists the breaking changes in one release and what to change in your code when you upgrade to it. Read every page between the version you use and the one you move to.

  • v0.1.6
    • What a module imports no longer reaches the files that import it
    • std/assert and std/random drop the module name from their functions
    • A host or dylib block's functions are called with :: only
    • Rebuild your .cdlb artifacts: the artifact format is now version 15
    • Rebuild your .cdlb artifacts again: the artifact format is now version 16
    • std/convert and its to_* methods are removed
    • Default::default() is removed; a struct literal ends in a bare .. instead
    • A list of ints or floats passed to a C function sees what C writes into it
    • find is split: find(pred) searches with a predicate, index_of(x) finds a position
    • fs raises fs_directory_not_empty and fs_other for failures it had no kind for
    • The file functions are the std/fs module
    • A default function in a struct's impl block is now its default
    • An import binds the module's name instead of merging its names into scope
    • The is_* and as_* built-ins are replaced by is and as
    • The json_parse and json_stringify built-ins are removed
    • first, last, min and max on a list return an Option
    • list.partition(sep) is renamed list.split(sep)
    • m.get_or(k, fallback) is removed
    • m.get(k) returns an Option instead of the value
    • Map entries are written with m[k] = v; insert is removed
    • print(null) prints null
    • A set is made with set::Set<int>::new(); the module function new is removed
    • str(x) is renamed string(x)
    • s.is_int() and s.is_float() are replaced by s.parse<T>()
    • throw is a statement: throw "kind";
    • The string trim methods are renamed to trim_start, trim_end and trim_chars
  • v0.1.5
    • Returning an any from a function declared with another type checks the value
    • A call has the type its function declares, not the type its body returns
    • Rebuild your .cdlb artifacts: the artifact format is now version 14