crystal v1.3.0 Release Notes

Release Date: 2022-01-06 // about 2 years ago
  • Compiler

    • Refer to T.class as "metaclass" in error messages, not "class" (#11378, thanks @HertzDevil)
    • Create Reason enum for exhaustive case in nil-reason check (#11449, thanks @rymiel)
    • ๐Ÿ‘Œ Improve cache directory behaviour on Windows (#11436, thanks @HertzDevil)
    • ๐Ÿ Automatically detect MSVC tools on Windows via vswhere (#11496, thanks @HertzDevil)
    • Clean up .pdb files for temporary executables on MSVC (#11553, thanks @HertzDevil)
    • Disable incremental linking on MSVC (#11552, thanks @HertzDevil)
    • ๐Ÿ‘ Allow multiple --emit compiler options to stack (#11556, thanks @HertzDevil)
    • ๐Ÿ”จ Refactor some type restrictions in the compiler (#11531, thanks @straight-shoota)
    • Detect cl.exe's path for compiler specs requiring a C compiler (#11560, thanks @HertzDevil)
    • 0๏ธโƒฃ Increase default stack size on MSVC to 8 MB (#11569, thanks @HertzDevil)
    • Resolve compiler wildcard require (#11562, thanks @straight-shoota)
    • Compiler: use enums instead of symbols in various places (#11607, thanks @HertzDevil)

    Codegen

    • Disable specs for StaticArray#sort_by on broken targets (#11359, thanks @straight-shoota)
    • ๐Ÿ›  Fix link flag behaviour on Windows MSVC (#11424, thanks @HertzDevil)
    • Attach debug locations to splat expansions inside array-like literals (#11655, thanks @HertzDevil)
    • ๐Ÿ‘‰ Use full name for private types' class variables during codegen (#11651, thanks @HertzDevil)
    • ๐Ÿ›  Fix codegen when instantiating class methods of typedefs (#11636, thanks @HertzDevil)
    • โž• Add minimal load-time DLL support on Windows, support dllimport storage class (#11573, thanks @HertzDevil)

    Debugger

    • Attach debug locations to auto-generated initialize methods (#11313, thanks @HertzDevil)
    • Fix debug location for ~check_proc_is_not_closure (#11311, thanks @HertzDevil)

    Interpreter

    • crystal i, a Crystal interpreter (#11159, thanks @asterite)
    • Implement FFI bindings (#11475, thanks @straight-shoota)
    • โž• Add Crystal::Loader (#11434, #11662, thanks @straight-shoota, @HertzDevil)
    • Mark bswap32 instrinsic with interpreter primitive annotation (#11582, thanks @rymiel)
    • Split interpreter specs into separate files (#11578, thanks @straight-shoota)
    • โ†ช Workaround for GC issues in interpreter specs (#11634, thanks @straight-shoota)

    ๐Ÿ“œ Parser

    • ๐Ÿ“œ Parser: allow keyword as named argument inside macros (#10377, thanks @asterite)
    • ๐Ÿ“œ Parser: add missing end location to IsA node (#11351, thanks @FnControlOption)
    • ๐Ÿ›  Fix node locations for ProcLiterals with parameters (#11365, thanks @HertzDevil)
    • ๐Ÿ›  Fix parser error with named argument end in macro body (#11463, thanks @straight-shoota)
    • Report syntax error for too-long bin/hex/oct integer literals (#11447, thanks @oprypin)
    • [lexer] Correctly increase nesting for escaped macro unless (#11440, thanks @rymiel)
    • ๐Ÿ“œ Show proper syntax errors in some edge cases in the parser (#11446, thanks @oprypin)
    • ๐Ÿ›  Fix parse yield with parenthesis (#11469, thanks @straight-shoota)
    • ๐Ÿ”จ Lexer number parsing refactor (#11211, thanks @BlobCodes)
    • ๐Ÿ‘ Allow underscores after a leading zero in String#to_i (regression fix) (#11672, thanks @BlobCodes)
    • ๐Ÿ›  Fix no comma before short block in ToSVisitor (#11677, thanks @homonoidian)
    • Unify format of "unexpected token" error (#11473, thanks @straight-shoota)
    • ๐Ÿ‘ Implement lexer int128 support (#11571, thanks @BlobCodes)

    Semantic

    • ๐Ÿ‘‰ Show proper owner for Class's methods in error messages (#10590, thanks @HertzDevil)
    • Be more strict about ProcNotation variable declarations (#11372, thanks @HertzDevil)
    • ๐Ÿ‘ Allow metaclass parameters in Proc literals and pointers (#11367, thanks @HertzDevil)
    • ๐Ÿ›  Fix top-level multi-assign splat variable not working in macros (#11600, thanks @HertzDevil)
    • Replace semantic with assert_no_errors in compiler specs whenever possible (#11288, thanks @HertzDevil)
    • 0๏ธโƒฃ Make inject_primitives = false default for semantic specs (#11297, thanks @HertzDevil)
    • โž• Add spec for #8428 (#10073, thanks @docelic)
    • โœ‚ Remove and resolve spurious cast and its associated FIXME (#11455, thanks @rymiel)
    • โž• Add pending spec for recursive abstract struct (#11470, thanks @HertzDevil)

    Language

    • (breaking-change) Require elements in 1-to-n assignments to match targets exactly (#11145, thanks @HertzDevil)
    • (breaking-change) Require right-hand side of one-to-many assignments to be Indexable (#11545, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support splats on left-hand sides of multiple assignment expressions (#10410, thanks @HertzDevil)
    • ๐Ÿ‘‰ Make all AST nodes immutable through container-returning methods (#11397, thanks @HertzDevil)
    • โž• Add auto upcast for integer and float values (#11431, #11529, thanks @asterite, @beta-ziliani)

    Standard Library

    • ๐Ÿ›  Fix Process::INITIAL_PWD for non-existent path (#10525, thanks @straight-shoota)
    • Resolve some TODOs (#11369, thanks @straight-shoota)
    • ๐Ÿ”จ Refactor some target flag uses (#11466, thanks @straight-shoota)
    • ๐Ÿ‘‰ Use Slice(UInt8)#fill in the standard library (#11468, thanks @HertzDevil)
    • Update spec/win32_std_spec.cr (#11432, #11637, thanks @HertzDevil)
    • ๐Ÿ‘‰ Use strings instead of symbols in #finalize specs (#11619, thanks @HertzDevil)
    • ๐Ÿ›  Fix Enum.parse to handle case-sensitive member names (#11659, thanks @straight-shoota)
    • ๐Ÿ‘Œ Improve docs for Object#not_nil! (#11661, thanks @straight-shoota)

    Collection

    • (breaking-change) Always use start as parameter in subrange-accepting methods (#11350, thanks @HertzDevil)
    • (breaking-change) Refactor Indexable::Mutable#fill's overloads (#11368, thanks @HertzDevil)
    • โž• Add sorting methods to StaticArray (#10889, thanks @HertzDevil)
    • โž• Add spaceship operator to StaticArray (#11364, thanks @henrikac)
    • ๐ŸŽ (performance) Optimize BitArray#reverse! (#11363, thanks @HertzDevil)
    • ๐ŸŽ (performance) Grow large arrays more slowly (#11482, thanks @mgomes)
    • ๐Ÿ›  Fix docs for Indexable::Mutable#map! (#11349, thanks @HertzDevil)
    • Add Slice#unsafe_slice_of, #to_unsafe_bytes (#11379, thanks @HertzDevil)
    • ๐ŸŽ (performance) Avoid reallocation in Enumerable#each_cons and Iterator#cons's default reused array (#10384, thanks @HertzDevil)
    • ๐Ÿ›  Fix Array#unshift for large arrays (#11656, thanks @HertzDevil)

    Crypto

    • ๐Ÿ‘Œ Support OpenSSL on Windows (#11477, thanks @HertzDevil)
    • ๐Ÿ Encode OpenSSL version on Windows (#11516, thanks @HertzDevil)
    • โž• Add docs to Crypto::Bcrypt (#9647, thanks @j8r)
    • ๐Ÿ›  Fix getrandom for interpreter (#11624, thanks @straight-shoota)
    • ๐ŸŽ (performance) Use more efficient method to split UInt32 to bytes in Crypto::Blowfish (#11594, thanks @BlobCodes)

    Files

    • Add bindings to __xstat, __fxstat and __lxstat for x86_64-linux-gnu (#11361, #11536, thanks @straight-shoota)
    • ๐Ÿ›  Fix IO::Memory#to_s appending to itself (#11643, thanks @straight-shoota)

    LLVM

    • ๐Ÿ›  Fix LLVMExtDIBuilderCreateArrayType argument alignInBits should be UInt64 (#11644, thanks @lbguilherme)

    ๐ŸŒฒ Log

    • โž• Add Log.with_context with kwargs (#11517, thanks @caspiano)
    • ๐Ÿ”จ Refactor Log::BroadcastBackend#single_backend? (#11530, thanks @straight-shoota)

    Macros

    • โž• Add macro methods for Return, Break, Next, Yield, and exception handlers (#10822, thanks @HertzDevil)
    • โž• Add Crystal::Macros::ProcNotation#resolve and #resolve? (#11373, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support explicit return types in ProcLiterals (#11402, thanks @HertzDevil)
    • โž• Add several missing ASTNode macro methods (#10811, thanks @HertzDevil)
    • ๐Ÿ‘ Allow incomplete range arguments for #[](Range) macro methods (#11380, thanks @HertzDevil)
    • โž• Add macro methods for Metaclass nodes (#11375, thanks @HertzDevil)

    Networking

    • ๐Ÿ‘ Datagram support for UNIXServer (#11426, thanks @carlhoerberg)
    • ๐Ÿ›  Fix WebSocket#stream flushing for not exactly buffer size, add specs (#11299, thanks @will)
    • ๐Ÿ›  Fix flag for UNIX-like OS (#11382, thanks @straight-shoota)
    • โž• Add more check_headers to HTTP::Server::Response (#11253, thanks @straight-shoota)
    • Enable LogHandler address for win32 (#11465, thanks @straight-shoota)
    • Enable two specs to run on all platforms (#11467, thanks @straight-shoota)
    • TCPServer: explain how to get an ephermal port (#11407, thanks @rdp)
    • ๐Ÿ›  Fix HTTP::Server::Response#close when replaced output syncs close (#11631, thanks @straight-shoota)

    Numeric

    • (breaking-change) Fix Random.rand(max : Float32) return Float32 (#9946, thanks @j8r)
    • ๐Ÿ›  Fix Math linking errors on Windows MSVC (#11435, thanks @HertzDevil)
    • Implement compiler-rt __multi3 for arm (#11499, thanks @straight-shoota)
    • ๐Ÿ Use MPIR for Big* numbers on Windows (#11412, thanks @HertzDevil)
    • Add BigRational#to_big_r (#11462, thanks @HertzDevil)
    • ๐Ÿšš Move specs for arithmetic primitives to primitives_spec (#11298, thanks @HertzDevil)
    • Implement compiler-rt's 128-bit integer conversions to/from floats (#11437, thanks @HertzDevil)
    • ๐Ÿ›  Fix Number.significant to return 0 as is, not as Float64 (#11321, thanks @Sija)
    • ๐Ÿ›  Fix inequality for floating-point NaNs (#11229, thanks @HertzDevil)
    • โž• Add workaround for 128-bit integer division/modulo on Windows (#11551, thanks @HertzDevil)
    • Reject near-boundary and NaN values for Float-to-Int conversions (#11230, thanks @HertzDevil)

    โš™ Runtime

    • โš  GC/Boehm: Silence GC warnings about big allocations. (#11289, thanks @yxhuvud)
    • Disable impossible spec on win32, previously marked as pending (#11451, thanks @straight-shoota)
    • ๐Ÿ‘Œ Support call stacks on Windows (#11461, thanks @HertzDevil)
    • ๐Ÿ Make Windows PDB lookup relative to running executable (#11493, thanks @HertzDevil)

    Serialization

    • ๐Ÿ“œ Parses JSON UInt64 numbers. (#11395, thanks @hugopl)
    • ๐Ÿ›  Fix YAML::Any deserialize with alias (#11532, thanks @straight-shoota)

    Specs

    • ๐Ÿ‘‰ Use enums instead of symbols for Spec-related types (#11585, thanks @HertzDevil)

    System

    • โž• Add native Linux syscall interface (#10777, thanks @lbguilherme)
    • ๐Ÿ Implement Path.home on Windows (#11503, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support ~\ for Windows paths in Path#expand and File.expand_path (#11559, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support non-ASCII command-line arguments on Windows (#11564, thanks @HertzDevil)
    • ๐Ÿ Enable kernel_spec.cr on Windows CI (#11554, thanks @HertzDevil)
    • ๐Ÿ›  Fix getrandom syscall was blocking and didn't had proper error checking (#11460, thanks @lbguilherme)

    Text

    • Regex: use PCRE_UCP (#11265, thanks @asterite)
    • โž• Add missing it in UUID spec (#11353, thanks @darkstego)
    • โž• Add Char#unicode_escape and fix #dump and #inspect format (#11421, thanks @straight-shoota)
    • ๐Ÿ›  Fix Char#letter? to include all letter categories (#11474, thanks @straight-shoota)
    • Pass JIT Compile flag to study (#11325, thanks @Blacksmoke16)
    • โž• Add Comparison operator to UUID (#11352, thanks @darkstego)
    • โž• Add Char#printable? (#11429, thanks @straight-shoota)
    • ๐Ÿ›  Fix String#inspect and Char#inspect escape all non-printable characters (#11452, #11626, thanks @straight-shoota)
    • ๐Ÿ‘Œ Support custom encodings on Windows through GNU libiconv (#11480, thanks @HertzDevil)
    • (breaking-change) Change Regex#name_table to return Hash(Int32, String) (#11539, thanks @straight-shoota)
    • ๐Ÿ›  Fix skip surrogates in Char#succ and #pred (#11506, thanks @straight-shoota)
    • ๐ŸŽ (performance) Improve Base64 decoding performance (#11094, thanks @BlobCodes)
    • ๐Ÿ”จ Refactor syntax highlighter and add ANSI escape code highlighter for console (#11366, thanks @straight-shoota)
    • ๐Ÿ›  Fix UTF-8 console input/output on Windows (#11557, thanks @HertzDevil)
    • Implement Unicode grapheme clusters (#11472, #11611, thanks @straight-shoota)
    • (breaking-change) Fix Char#ascii_control? restrict to ASCII characters (#11510, thanks @straight-shoota)
    • ๐ŸŽ (performance) Performance: specify string sizes in advance (#11592, thanks @BlobCodes)
    • ๐ŸŽ (performance) Improve performance of Char#to_s (#11593, thanks @BlobCodes)
    • โž• Add docs to Colorize (#11664, thanks @straight-shoota)
    • ๐Ÿ‘Œ Support ANSI escape sequence output on more Windows consoles (#11622, thanks @HertzDevil)

    Tools

    • ๐Ÿ“„ [docs] Fix ditto with additional lines (#11336, thanks @straight-shoota)
    • ๐Ÿ“„ [docs] Compact some JSON fields for search (#11438, thanks @rymiel)
    • ๐Ÿ“„ [docs] Add 404.html page (#11428, thanks @straight-shoota)
    • ๐Ÿ“„ [docs] Improve search input a11y for generated docs (#11604, thanks @chances)
    • ๐Ÿ“„ [docs] use shard.yml version when no git tag present (#11232, thanks @superhawk610)
    • [formatter] Fix weird interactions with comments near indentation (#11441, thanks @rymiel)
    • [formatter] fix extra newline after comment in case else (#11448, thanks @rymiel)
    • [formatter] Fix space between call name and parenthesized arg (#11523, thanks @straight-shoota)
    • ๐Ÿ”จ [playground] Refactor PlaygroundPage resources list (#11608, thanks @straight-shoota)

    Other

    • ๐Ÿš€ Update previous Crystal release - 1.2.2 (#11430, thanks @straight-shoota)
    • Prepare 1.3.0-dev (#11317, thanks @straight-shoota)
    • [CI] Fix test_dist_linux_on_docker (#11512, thanks @straight-shoota)
    • ๐Ÿ‘Œ Improve compiler spec helpers for macro methods (#11139, thanks @HertzDevil)
    • โž• Add Makefile to build samples (#11419, thanks @straight-shoota)
    • ๐Ÿ‘Œ Verify downloads' hashes in Windows CI (#11423, thanks @matiasgarciaisaia)
    • ๐Ÿ Make the Windows compiler artifact more portable (#11494, thanks @HertzDevil)
    • ๐Ÿ‘ Allow compiler executable under test to be overridden (#11457, thanks @HertzDevil)
    • ๐Ÿ›  Fix CI rules for building libiconv on Windows (#11504, thanks @HertzDevil)
    • โšก๏ธ Update license template (#11498, thanks @taupiqueur)
    • ๐Ÿ“Œ Pin alpine repo for ssl libs to 3.15 (#11500, thanks @straight-shoota)
    • ๐Ÿ Don't generate PDB for MPIR on Windows (#11521, thanks @HertzDevil)
    • [Makefile] Check for LLVM_CONFIG only when LLVM is used (#11519, thanks @straight-shoota)
    • โšก๏ธ Update distribution-scripts (#11514, #11515, thanks @straight-shoota)
    • โž• Add commit hash to Windows builds (#11538, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support BuildTools and other VS variants in vswhere detection (#11534, thanks @neatorobito)
    • ๐Ÿ Define LIBXML_STATIC when building xml2.lib on Windows (#11574, thanks @HertzDevil)
    • ๐Ÿ‘Œ Improve texts in README.md (#11587, thanks @athix)
    • ๐Ÿ Include shards with Windows build artifacts (#11543, thanks @neatorobito)
    • ๐Ÿšš [CI] Remove libatomic_ops (#11598, thanks @straight-shoota)
    • โšก๏ธ Update NOTICE Copyright year to 2022 (#11679, thanks @matiasgarciaisaia)