Repository navigation
Jacket 0.18.0
The project has a new name: Jacket ("Jai kit"). This release also lets editors open code you don't trust safely, and makes jailint faster and easier to extend.
Note
The standard library has been rewritten, this release may be a bit unstable.
Highlights
- New name, same tools. The repository is now matteopolak/jacket.
jaic,jailsp,jaifmtandjailintkeep their names, and so do the crates. - Workspace trust. In an untrusted folder,
jailspchecks your code without running any of its compile-time code (#run,#insert, build metaprograms). VS Code follows its own workspace trust setting; in Neovim, passtrusted = falsetosetup(). See workspace trust. jailintis several times faster on large trees. It lints each file once and compiles programs in parallel (-j).--allow-incompletelets you lint a tree where some modules only build on another OS.- Better switch completion. The "add missing cases" action now works on every kind of
if x == { case ...; }, and its error covers the switch's header instead of the whole block. - Native console colours on Windows.
Print_Colorsets console colours through the Windows API, so they also work in consoles that don't understand ANSI escapes.
Breaking changes
| What | Was | Now |
|---|---|---|
| VS Code extension | matteopolak.jai-toolchain (and matteopolak.jai before that) |
matteopolak.jacket. It offers to uninstall the old one, and your jai.* settings carry over. |
| Neovim plugin | matteopolak/jai.nvim |
matteopolak/jacket.nvim. The jai Lua module and the :Jai command are unchanged. |
| Homebrew | matteopolak/tap/jai |
matteopolak/tap/jacket. brew upgrade moves you over. |
| Release archives | jai-<platform>.tar.gz |
jacket-<platform>.tar.gz (.zip on Windows), unpacking to jacket-<platform>/. |
How jailint recognises procedures |
by name (trim, min, free, ...) |
by a note on the declaration: @UseResult, @Minimum, @Maximum, @RemovesElements, @Releases. The standard library already has them; add them to your own procedures if you want the rules to apply. See declaration notes. |
ImGui and Curl printf-style procedures (Text, TreeNode, curl_msnprintf, ...) |
a Jai string format, forwarded through a libffi bridge that releases never shipped |
the C functions themselves: the format is a C string and the arguments are C varargs. Pass text arguments as *u8 (cast(*u8) "ok", name.data), and TextColored takes *ImVec4. The _CFormat names are gone. |
Earlier releases have been removed. Install 0.18.0 or later.
Fixes
- A
*voidconverts to a procedure type without a cast, as it should. #no_resetis accepted alongside other declaration modifiers.- A variable is never treated as a constant, even when its initializer is one.
- The interpreter runs
memcpy,memsetandmemcmpwithout extra system calls, so memory-heavy programs under-interprun faster, especially on Linux. - On Linux, a shared library marked
link_alwaysis no longer dropped by--as-needed. - On X11, an empty clipboard reads as empty text instead of failing, and fullscreen works without a window manager.