crystal v1.5.0 Release Notes

Release Date: 2022-07-06 // over 1 year ago
  • Language

    • (breaking-change) Warn on positional parameter mismatches for abstract def implementations (#11915, #12167, thanks @HertzDevil)
    • ๐Ÿ›  Fix \{{...}} syntax in macro inside comments (#12175, thanks @asterite)
    • Let constant tuple indexers work with constants (#12012, thanks @asterite)
    • ๐Ÿ”จ Refactor restriction mechanism for autocasting (#12014, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support unions in Crystal::Macros::ASTNode#is_a? (#12086, thanks @HertzDevil)
    • Experimental: restriction augmenter (#12103, #12136, #12143, #12130, thanks @asterite)
    • ๐Ÿ‘ Method/macro parameter annotation support (#12044, thanks @Blacksmoke16)

    Standard Library

    • ๐Ÿ‘Œ Support Path for chdir arg in Process methods (#11932, thanks @caspiano)
    • โž• Add docs for Enum#value (#11947, thanks @lbguilherme)
    • ๐Ÿ›  Fix positional parameter warnings in specs (#12158, thanks @straight-shoota)
    • ๐Ÿ‘‰ Use more specific expectations in specs (#11951, thanks @HertzDevil)
    • ๐Ÿ‘‰ Use contain expectations in more specs (#11950, thanks @HertzDevil)

    Collection

    • ๐Ÿ›  Fix Hash#reject! for non-equality key (#10511, thanks @straight-shoota)
    • Introduce Tuple.element_type and NamedTuple.element_type (#12011, thanks @HertzDevil)
    • ๐Ÿ“‡ Rename "take" to "first" (#11988, thanks @jmdyck)
    • โž• Add spec for Array#- with different generic type arguments (#12049, thanks @straight-shoota)

    Concurrency

    • Windows: Always use GC_set_stackbottom on Windows (#12186, thanks @HertzDevil)
    • ๐Ÿ Windows: Event loop based on IOCP (#12149, thanks @straight-shoota, @wonderix, @yxhuvud, @HertzDevil)
    • ๐Ÿ‘‰ Use enum instead of symbol for Atomic primitives (#11583, thanks @HertzDevil)
    • Allow Enumerable(Channel) parameter for Channel.send_first, .receive_first (#12101, thanks @carlhoerberg)

    Crypto

    • ๐ŸŽ (performance) Add faster Digest#hexfinal (#9292, thanks @didactic-drunk)
    • ๐Ÿ– Handle OpenSSL 3.0 KTLS ctrl calls (#12034, thanks @1player)

    Files

    • ๐Ÿ›  Fix Path#join(Enumerable) (#12032, thanks @straight-shoota)
    • ๐Ÿ›  Fix Path#join to convert argument path to base kind (#12033, thanks @straight-shoota)
    • ๐Ÿ›  Fix Dir.glob with multi components after recursive wildcard (#12057, thanks @straight-shoota)
    • โž• Add File#delete? and Dir#delete? (#11887, thanks @didactic-drunk)
    • Accept Path arguments in Compress::Zip (#11925, thanks @didactic-drunk)
    • โšก๏ธ Update file.cr (#12024, thanks @rdp)
    • โž• Add File#chown and #chmod (#11886, thanks @didactic-drunk)

    ๐ŸŒฒ Log

    • ๐Ÿ”„ Change Log emitters to not emit event when block output is nil (#12000, thanks @robacarp)

    Networking

    • ๐Ÿ Enable more networking specs on Windows (#12176, thanks @HertzDevil)
    • โž• Add specs for Windows directory separators in StaticFileHandler paths (#11884, thanks @straight-shoota)
    • โž• Add property HTTP::Server::Response#status_message (#10416, thanks @straight-shoota)

    Numeric

    • ๐Ÿ›  Fix Complex.multiplicative_identity (#12051, thanks @I3oris)
    • โž• Add docs for Float, BigFloat rounding methods (#12004, thanks @marksiemers)
    • Implement rt builtins __ashlti3, __ashrti3 and __lshrti3 for wasm32 (#11948, thanks @lbguilherme)

    Specs

    • Align Spec::Be, BeClose failure message to other messages (#11946, thanks @jgaskins)

    System

    • ๐Ÿ”’ (security) Fix check for null byte in File#tempfile args (#12076, thanks @straight-shoota)
    • โž• Add missing SC_PAGESIZE constant for aarch64-darwin (#12037, thanks @carlhoerberg)
    • ๐Ÿ“„ Docs: Add more prominent note about path traversal in File.tempfile (#12077, thanks @straight-shoota)
    • ๐Ÿ‘Œ Support Enumerable as argument to File.join (#12102, thanks @caspiano)

    โš™ Runtime

    • Mention #value explicitly in Pointer overview. (#12184, thanks @elebow)

    Text

    • Add specs for String#char_bytesize_at (#11872, thanks @straight-shoota)
    • Flush shift state for String#encode (#11993, thanks @HertzDevil)
    • ๐Ÿ– Handle invalid bytes in single-byte optimizable Strings correctly (#12108, thanks @HertzDevil)
    • ๐Ÿ›  Fix: Don't stop on null byte in String#% (#12125, thanks @asterite)
    • โž• Add UUID.parse? (#11998, thanks @jgaskins)

    Time

    • ๐Ÿ›  Fix: Better error message for Time.parse! when end of input is reached (#12124, thanks @asterite)

    Compiler

    • โš  Clean up compiler warning specs (#11916, thanks @HertzDevil)
    • โž• Add support for NO_COLOR to Colorize (#11984, thanks @didactic-drunk)
    • ๐ŸŽ (performance) Use LLVM's new pass manager when possible (#12116, thanks @asterite)

    Macros

    • Document Crystal::Macros::Self and Underscore (#12085, thanks @HertzDevil)

    Generics

    • ๐Ÿ‘ Allow the empty instantiation NamedTuple() (#12009, thanks @HertzDevil)

    Interpreter

    • โž• Add missing EXPORT in interpreter spec (#12201, thanks @HertzDevil)
    • ๐Ÿ– Handle escaping exceptions in pry (#12211, thanks @asterite)
    • ๐Ÿ‘ Allow some options, and colorize whereami (#12198, thanks @asterite)
    • ๐Ÿ›  Fix instance var offset of virtual struct (#12189, thanks @asterite)
    • ๐Ÿ– Handle explicit return when method type is Nil (#12179, thanks @asterite)
    • Crystal::Loader: don't check if file exists, leave that to dlopen (#12207, thanks @asterite)
    • ๐Ÿ›  Fix call receiver by value from VirtualType struct (#12194, thanks @asterite)
    • Clear finished hooks after intepreting (#12174, thanks @asterite)
    • ๐Ÿ›  Fix FFI bindings for libffi >= 3.4 (#12192, thanks @straight-shoota)
    • ๐Ÿ›  Fix .class for modules and unions (#12205, thanks @asterite)
    • Implement Crystal::Loader for MSVC (#12140, thanks @HertzDevil)
    • ๐Ÿ›  Fix: cast from virtual metaclass to union (#12163, thanks @asterite)
    • ๐Ÿ‘ Allow inspect vars when inside a block (#12165, thanks @asterite)
    • ๐Ÿ‘€ Let pry see closured vars (#12169, thanks @asterite)
    • ๐Ÿ›  Fix caller (#12182, thanks @asterite)
    • Apply shell expansion in ldflags (#12094, thanks @mdwagner)
    • ๐Ÿ›  Fix expression value of constant assignment in interpreter (#12016, thanks @beta-ziliani)
    • ๐Ÿ›  Fix: Don't link librt and libdl on GNU systems (#12038, thanks @1player)

    ๐Ÿ“œ Parser

    • (breaking-change) Disallow empty parameter and argument names (#11971, thanks @HertzDevil)
    • ๐Ÿ†“ Disallow duplicate free variables in defs (#11965, thanks @HertzDevil)
    • Disallow duplicate fun parameter names (#11967, thanks @HertzDevil)
    • โœ‚ Remove redundant check for EOF on Crystal::Parser (#12067, thanks @lbguilherme)

    Semantic

    • Compiler: don't check ivar read forms a closure in exp.@x (#12183, thanks @asterite)
    • Compiler: raise when allocating an abstract virtual type (#12141, thanks @asterite)
    • Compiler: don't use with_scope if Call has a receiver (#12138, thanks @asterite)
    • Compiler: fix proc return type restriction for Proc(...) (#12129, thanks @asterite)
    • Compiler: simpler way to compute Def#raises? (#12121, thanks @asterite)
    • โœ‚ Remove unused ASTNode#unbind_all (#12120, thanks @asterite)

    Debugger

    • ๐Ÿ‘Œ Improve the LLDB spec driver script (#12119, thanks @HertzDevil)

    Tools

    ๐Ÿ“„ Docs-generator

    • ๐Ÿ“„ [Docs] Adjust method sort order to sort all operators first (#12104, thanks @straight-shoota)

    Formatter

    • ๐Ÿ›  Fix formatter lib-fun declaration with newlines (#12071, thanks @ftarulla)
    • ๐Ÿ›  Fix formatter alias-def with no-space before equals (#12073, thanks @ftarulla)
    • ๐Ÿ›  Fix formatter for parenthesized arg after space (#11972, thanks @straight-shoota)

    Playground

    • Playground: fix modalContenDom typo (#12188, thanks @HertzDevil)
    • ๐Ÿ›  Fix: Unset executable bit from js/css files in playground (#12053, thanks @carlhoerberg)

    Other

    • ๐Ÿ— [CI] Add build compiler step to smoke tests (#11814, thanks @straight-shoota)
    • โž• Add Makefile for Windows (#11773, thanks @HertzDevil)
    • โšก๏ธ [CI] Update distribution-scripts (#12155, thanks @straight-shoota)
    • โšก๏ธ [CI] Add update-distributions-scripts.sh (#12156, thanks @straight-shoota)
    • [CI] Ignore pax_global_header on Windows CI (#12173, thanks @HertzDevil)
    • ๐Ÿš€ [CI] Invalidate cached libraries on new MSVC release (#12064, thanks @HertzDevil)
    • ๐Ÿ›  Fix spelling (#12040, thanks @jsoref)
    • ๐Ÿš€ Update previous Crystal release - 1.4.1 (#12029, thanks @straight-shoota)
    • ๐Ÿ“Œ [CI] Pin version of ubuntu base image for circleci jobs (#12030, thanks @straight-shoota)
    • Samples: avoid Symbol variables (#11923, thanks @HertzDevil)