Skip to content

Releases: matteopolak/jai

Jai Toolchain 0.10.0

Choose a tag to compare

@github-actions github-actions released this 11 Oct 01:49
v0.10.0
505f679

Jai now has a Neovim plugin, and doc comments behave in every popup while you type.

Highlights

  • Neovim plugin: jai.nvim sets up jailsp, jaifmt formatting, jailint and syntax highlighting, and can download the toolchain for you (:Jai install). Install it with vim.pack.add({ 'https://github.com/matteopolak/jai.nvim' }) or lazy.nvim. See the Neovim plugin.
  • Jai code in doc comment fences is highlighted by the language server, so every editor colours it.
  • Doc comment links reach the fields and parameters of polymorphic structs ([Ring.items]).
  • The playground tour shows off doc comments in its basics and polymorphism stops.

Fixes

  • Completion shows a declaration's whole doc comment after edits above it, instead of cutting it short.
  • Signature help shows docs, with working links, while the call is still unclosed.

Jai Toolchain 0.9.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 23:00
v0.9.0
3a627ba

Doc comments are now real documentation: the editor renders them as Markdown and follows the links in them. jailint gets two new rules and fewer false positives.

Highlights

  • Doc comments show as Markdown in hover, completion and signature help, with per-parameter docs. See doc comments.
  • Links like [print], [Basic.print] and [Point.LIMIT] in doc comments resolve: hover, go to definition and clickable links.
  • VS Code highlights Markdown in comments, and Jai inside fenced code blocks.
  • New jailint rules: broken_doc_link and redundant_alias (a := f(); b := a;).
  • index_only_loop and manual_index_counter now cover loops over strings.

Fixes

  • jailint --fix no longer rewrites nested index loops into it - it.
  • Fewer jailint false positives in defer_in_loop, unused_parameter and self_assignment.
  • The language server no longer crashes showing a completion's docs after an edit.
  • Parallel macOS builds into one directory no longer fail writing .build/ objects.
  • A metaprogram re-offering the same provide_import no longer hangs the compile.
  • jaifmt keeps notes with punctuation (@a!=b) as one token.

Jai Toolchain 0.8.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 18:34
v0.8.0
4f60198

Switches on constants are now checked like any other switch, so mistakes in them are caught and the editor understands every case.

Highlights

  • Every case of an if x == { switch is type-checked even when x is a constant, so the language server shows hover, go to definition and highlighting in all of them.

Breaking changes

Was Now
A switch on a compile-time constant checked only the matching case, and skipped #complete Every case is checked and #complete applies; use #if to skip code

Jai Toolchain 0.7.1

Choose a tag to compare

@github-actions github-actions released this 10 Oct 07:50
v0.7.1
188efab

Faster debug builds: programs built without optimization run up to 1.7x faster, and they compile a little faster too.

Highlights

  • Call-heavy code built at -O0 runs about 1.6x faster (e.g. a recursive fib(40) takes 1.0 s instead of 1.6 s), and code that returns structs by value about 1.7x faster.
  • Stack traces cost less: procedures that call nothing no longer record a frame.
  • Small struct copies, and division or shifts by a constant, compile to shorter code.

Jai Toolchain 0.7.0

Choose a tag to compare

@github-actions github-actions released this 10 Oct 03:25
v0.7.0
32cffa0

Smaller downloads, more checks that catch mistakes, and more of your program visible to compile-time code.

Release archive sizes, 0.6.2 against 0.7.0: every platform is smaller

Highlights

  • Release archives are 4 to 18 MiB smaller on every platform.
  • New warnings for code after return, break or continue, and for procedures that can end without returning a value.
  • get_type_table() works in compile-time code and lists every declared type.
  • Type info marks local structs and lists every procedure constant of a struct.
  • get_build_options() reports real output paths before a metaprogram changes anything.
  • Compiler messages now include procedures nothing calls, and file-level declarations say so.

Breaking changes

Was Now
A name declared twice in one scope was accepted An error (procedures still overload)
An unknown or mistyped module import argument was ignored An error
#import "M" after #import "M"(FLAG = true) shared the configured instance A separate instance with the default parameters
if true return 1; or while true {} as the last statement counted as returning Warns not all control paths return a value; end such loops with a return
Release binaries kept function names in backtraces Stripped; build from source for full backtraces

Jai Toolchain 0.6.2

Choose a tag to compare

@github-actions github-actions released this 10 Oct 01:23
v0.6.2
08fbb1d

Programs built from source behave better, and type info reports more.

Fixes

  • Focus built from source takes keyboard input, and its open-file dialog no longer aborts.
  • A GetRect subwindow's close button closes it.
  • array_view with a count past the end returns what exists instead of failing.
  • Type info reports #no_padding structs, structs whose members are all uninitialized, and notes on struct constants.
  • A context hook added with #add_context shows up in the context's type info before anything uses it.

Jai Toolchain 0.6.1

Choose a tag to compare

@github-actions github-actions released this 09 Oct 23:48
v0.6.1
c105655

The language server now copes with real projects and very large files, and uses a fraction of the memory.

Language server peak memory, 0.6.0 against 0.6.1: down by a factor of two to five

Highlights

  • Memory use on large files is down by a factor of two to five.
  • Typing stays responsive: diagnostics wait until you pause, and completion no longer recompiles.
  • Files up to 32 MiB open; before, large files lost hover, symbols and diagnostics.
  • Go to definition reaches struct fields, enum members and the one overload a call uses.
  • . completes enum members wherever the type is known.
  • Projects without a jai.toml find their modules/ folders.
  • A large real project (Focus) now gets its first diagnostics in about 0.3 seconds. It never finished before.

Fixes

  • Signature help works for calls through procedure-typed variables and members.
  • Workspace symbols list files you haven't opened.
  • A jai.toml or jailint.toml that doesn't parse is reported instead of ignored silently.
  • A crash while answering one request no longer ends the server.
  • Sanitized builds on Intel Macs keep file:line for every frame.

Language server timings can be measured with the benchmark script.

Jai Toolchain 0.6.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 21:01
v0.6.0
4869dd9

Builds with optimizations on compile up to 2.7 times faster, and unoptimized builds of large programs about 1.3 times faster.

Optimized build times, 0.5.1 against 0.6.0: Focus 12.7 to 7.8 seconds, chess-jai 4.5 to 1.7 seconds

Highlights

  • Faster builds: see the chart, and compile speed for how.
  • jailsp completes inside range expressions such as for i: 0..table.co.
  • jailint's index_only_loop also catches loops that fill elements from their index, and offers a fix.
  • self_assignment and absurd_comparison get editor quick fixes.
  • Compiler messages PERFORMANCE_REPORT and DEBUG_DUMP are sent, so the Performance_Report plugin works. See build options.
  • The playground tour runs every stop in order, without waiting for input.

Breaking changes

Was Now
enable_split_modules = false built an optimized program as one module Still split into parts; set JAIC_CODEGEN_UNITS=1 for whole-program optimization
File_Change.time_of_last_change was a float32 A float64
index_only_loop skipped loops that write elements from the index Reports them, so a clean lint run may now warn
The playground tour took --stop, --all and --help It always runs every stop

Fixes

  • The GPU stop of the tour draws in its own window instead of aborting; without a display it says it skipped. See WebGPU.
  • File_Watcher no longer misses a change because of float rounding.
  • Windows: JAIC_LINKER finds the SDK and C runtime libraries outside a developer prompt.

Jai Toolchain 0.5.1

Choose a tag to compare

@github-actions github-actions released this 09 Oct 10:09
v0.5.1
eccb072

Unoptimized builds and compile-time code both run about twice as fast, and release archives carry more libraries.

Highlights

  • Unoptimized builds compile 1.7 to 2.4 times faster on Apple silicon.
  • Compile-time code (#run, jaic run) is about twice as fast, and calls into C three times.
  • Release archives include FreeType, Dear ImGui and MojoShader on every platform, and SDL2 on Windows x64, so programs using them need no setup.
  • Library licences ship in each archive.
  • On macOS, unoptimized builds no longer run dsymutil; objects stay in .build/ beside the program, so add it to your .gitignore.

Fixes

  • C functions that take or return a Vector2 by value now get the right values (every Dear ImGui function returning an ImVec2).
  • -sanitize reports on Intel Macs show file.jai:line again.

See compile speed for what changed.

Jai Toolchain 0.5.0

Choose a tag to compare

@github-actions github-actions released this 09 Oct 06:33
v0.5.0
ced226e

Programs get checked more thoroughly: print format strings, null pointers, notes and clashing names. There is also a command-line parser for your own tools and a much bigger set of editor refactorings.

jaic warns that a print call has too few arguments for its format string

Highlights

  • print-style format strings are checked at compile time. See format string check.
  • Built programs stop with null pointer dereference at the offending line instead of crashing.
  • New Extensions/Args: declare a struct and get a command-line parser with help, suggestions and shell completions. jaifmt uses it.
  • Editor refactorings: extract into variable or procedure, inline variable, add missing cases or fields, convert ifx.
  • Call hierarchy, expand selection, pull diagnostics, and rename of struct fields and enum members. See refactorings.
  • A procedure that can end without returning a value warns. See diagnostics.
  • New just commands for building, formatting, linting and testing the repository. See Justfile.

Breaking changes

Was Now
print("% %\n", a) ran A warning; the build goes on
jailint rule format_arg_count Removed, since jaic reports it; delete it from jailint.toml
a: int @tag;, clashing using members, identical overloads Errors; write notes after the semicolon: a: int; @tag
jailsp pushed diagnostics to every client Clients that ask for pull diagnostics are no longer pushed to
Windows File.handle was an s64 A HANDLE
Null reads and writes in built programs were not checked Checked; Build_Options.null_pointer_check = .OFF removes the check

Fixes

  • jaifmt help and error messages are clearer, and every flag has a --no- form.
  • jailsp shows type errors for every declaration, not just the first.
  • Names from files you have not opened are visible to the language server.
  • jailint given a file that another program #loads now lints it as part of that program.
  • C structs now pass correctly in more cases, including packed structs and structs through .... See C ABI.
  • New File.file_read_line and File.read_stdin_line; exit(n) works in the playground.
  • More Compiler module procedures work, and more directives reach metaprograms as their own node kinds. See the Compiler module.
  • More #asm instructions, and offset_of and is_value_type are implemented.
  • Windows: #file and get_absolute_path use /, and a metaprogram's custom link command handles five or more libraries.
  • rpmalloc no longer crashes when a new thread allocates.