Repository navigation
Releases: matteopolak/jai
Release list
Jai Toolchain 0.10.0
Jai now has a Neovim plugin, and doc comments behave in every popup while you type.
Highlights
- Neovim plugin: jai.nvim sets up
jailsp,jaifmtformatting,jailintand syntax highlighting, and can download the toolchain for you (:Jai install). Install it withvim.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
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
jailintrules:broken_doc_linkandredundant_alias(a := f(); b := a;). index_only_loopandmanual_index_counternow cover loops over strings.
Fixes
jailint --fixno longer rewrites nested index loops intoit - it.- Fewer
jailintfalse positives indefer_in_loop,unused_parameterandself_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_importno longer hangs the compile. jaifmtkeeps notes with punctuation (@a!=b) as one token.
Jai Toolchain 0.8.0
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 whenxis 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
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
-O0runs about 1.6x faster (e.g. a recursivefib(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
Smaller downloads, more checks that catch mistakes, and more of your program visible to compile-time code.
Highlights
- Release archives are 4 to 18 MiB smaller on every platform.
- New warnings for code after
return,breakorcontinue, 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
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_viewwith a count past the end returns what exists instead of failing.- Type info reports
#no_paddingstructs, structs whose members are all uninitialized, and notes on struct constants. - A context hook added with
#add_contextshows up in the context's type info before anything uses it.
Jai Toolchain 0.6.1
The language server now copes with real projects and very large files, and uses a fraction of the memory.
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.tomlfind theirmodules/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.tomlorjailint.tomlthat 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:linefor every frame.
Language server timings can be measured with the benchmark script.
Jai Toolchain 0.6.0
Builds with optimizations on compile up to 2.7 times faster, and unoptimized builds of large programs about 1.3 times faster.
Highlights
- Faster builds: see the chart, and compile speed for how.
jailspcompletes inside range expressions such asfor i: 0..table.co.jailint'sindex_only_loopalso catches loops that fill elements from their index, and offers a fix.self_assignmentandabsurd_comparisonget editor quick fixes.- Compiler messages
PERFORMANCE_REPORTandDEBUG_DUMPare sent, so thePerformance_Reportplugin 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_Watcherno longer misses a change because of float rounding.- Windows:
JAIC_LINKERfinds the SDK and C runtime libraries outside a developer prompt.
Jai Toolchain 0.5.1
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
Vector2by value now get the right values (every Dear ImGui function returning anImVec2). -sanitizereports on Intel Macs showfile.jai:lineagain.
See compile speed for what changed.
Jai Toolchain 0.5.0
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.
Highlights
print-style format strings are checked at compile time. See format string check.- Built programs stop with
null pointer dereferenceat the offending line instead of crashing. - New
Extensions/Args: declare a struct and get a command-line parser with help, suggestions and shell completions.jaifmtuses 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
justcommands 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
jaifmthelp and error messages are clearer, and every flag has a--no-form.jailspshows type errors for every declaration, not just the first.- Names from files you have not opened are visible to the language server.
jailintgiven 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_lineandFile.read_stdin_line;exit(n)works in the playground. - More
Compilermodule procedures work, and more directives reach metaprograms as their own node kinds. See the Compiler module. - More
#asminstructions, andoffset_ofandis_value_typeare implemented. - Windows:
#fileandget_absolute_pathuse/, and a metaprogram's custom link command handles five or more libraries. rpmallocno longer crashes when a new thread allocates.