crystal v1.4.0 Release Notes

Release Date: 2022-04-06 // about 2 years ago
  • Language

    • โž• Add support for Int128 in codegen and macros (#11576, thanks @BlobCodes)
    • ๐Ÿ‘Œ Support ProcPointers with global path and top-level method references (#11777, thanks @HertzDevil)
    • ๐Ÿ›  Fix documentation for macros system and run (#11740, thanks @lbguilherme)
    • ๐Ÿ‘ Experimental: better type inference for ivars/cvars (#11812, thanks @asterite)
    • ๐Ÿ‘Œ Support @[Deprecated] on constants (#11680, thanks @HertzDevil)

    Standard Library

    • ๐Ÿ›  Fix compiler flags with optional arg eating following flags (#11201, thanks @yb66)
    • ๐Ÿ‘Œ Support GNU style optional arguments in OptionParser (#11546, thanks @HertzDevil)
    • โœ‚ Remove some unnecessary link annotations (#11563, thanks @straight-shoota)
    • โœ‚ Remove useless assignments (#11774, thanks @IgorPolyakov)
    • ๐Ÿ“š Use "truthy" and "falsey" in more places in the documentation (#11784, thanks @HertzDevil)
    • โž• Add missing code blocks for self in documentation (#11718, thanks @HertzDevil)
    • โž• Add support for LLVM 14.0 (#11905, thanks @HertzDevil)
    • ๐Ÿ›  Fix code examples in doc comments (2022-03) (#11927, thanks @maiha)

    Collection

    • โœ‚ Remove Iterator.of(Iterator.stop) from implementations (#11613, thanks @asterite)
    • โž• Add allow Enumerable arguments for Hash#select and #reject (#11750, thanks @mamantoha)
    • โž• Add docs for Hash#reject! (#11691, thanks @wontruefree)
    • โž• Add raising method variants Enumerable#find! and #index! (#11566, thanks @yxhuvud)
    • ๐ŸŽ (performance) Optimize block-less overloads of BitArray#fill (#11450, thanks @HertzDevil)
    • โž• Adds docs for Array#replace (#11682, thanks @wontruefree)
    • ๐ŸŽ (performance) Optimize BitArray's counting methods (#11591, thanks @HertzDevil)
    • โž• Add some return types to Array, Hash, Set and String (#11822, thanks @asterite)
    • โž• Add Hash#update (#11881, thanks @ftarulla)
    • ๐Ÿ‘ Allow Bytes[] to construct an empty Bytes (#11897, thanks @HertzDevil)
    • ๐Ÿ‘Œ Improve BitArray's constructors (#11898, thanks @HertzDevil)
    • โž• Add overload to Enumerable#tally and #tally_by accepting a hash (#11815, thanks @mamantoha)

    Crypto

    • โž• Add support for Bcrypt algorithm version 2b (#11595, thanks @docelic)

    Files

    • ๐Ÿ›  Fix race condition in chown (#11885, thanks @didactic-drunk)
    • โž• Add docs for Dir#each_child (#11688, thanks @wontruefree)
    • โž• Add docs for Dir#path (#11689, thanks @wontruefree)
    • ๐Ÿ‘Œ Support read-write + binary file modes in File.open (#11817, thanks @HertzDevil)
    • โž• Add docs for Dir#entries (#11701, thanks @wontruefree)
    • Add IO#getb_to_end (#11830, thanks @HertzDevil)
    • ๐Ÿ›  Fix IO::FileDescriptor#pos giving incorrect position after write (#10865, thanks @didactic-drunk)
    • โœ‚ Remove reference to binary file mode in File.open (#11824, thanks @HertzDevil)

    Macros

    • โž• Add #parse_type (#11126, thanks @Blacksmoke16)

    Networking

    • ๐ŸŽ (performance) Optimize URI.decode (#11741, thanks @asterite)
    • ๐Ÿ›  Fix address_spec expectation for Windows Server 2022 (#11794, thanks @straight-shoota)
    • Add space_to_plus option in URI::Params everywhere (#11821, thanks @asterite)
    • ๐Ÿ‘Œ Improve URI::Params#inspect to use hash-like literal (#11880, thanks @straight-shoota)
    • ๐Ÿ‘‰ Use enums instead of symbols for MIME::Multipart and HTTP::FormData (#11617, thanks @HertzDevil)

    Numeric

    • (breaking-change) Fix: Hide BigDecimal::ZERO and BigDecimal::TEN (#11820, thanks @lbguilherme)
    • (breaking-change) Add support for scientific notation in BigFloat#to_s (#10632, thanks @HertzDevil)
    • ๐Ÿ›  Fix: Inspect string in error message for number parsing (#11883, thanks @straight-shoota)
    • โž• Add docs for Complex#zero? (#11697, thanks @wontruefree)
    • ๐Ÿ›  Fix E notation parsing in BigDecimal (#9577, thanks @stevegeek)
    • ๐ŸŽ (performance) Optimize Integer decoding from bytes (#11796, thanks @carlhoerberg)

    โš™ Runtime

    • ๐Ÿ›  Fix interpreter when shared library pthread is missing (#11807, thanks @straight-shoota)
    • ๐ŸŽ (performance) Implement Intrinsics.pause for aarch64 (#11742, thanks @lbguilherme, @jgaskins)
    • โž• Add crash handler on Windows (#11570, thanks @HertzDevil)
    • โž• Add specs for NamedTuple#from (#11816, thanks @straight-shoota)
    • ๐Ÿ‘Œ Improve error for incompatible generic arguments for WeakRef (#11911, thanks @straight-shoota)
    • โž• Add the wasm entrypoint defined in Crystal (#11936, thanks @lbguilherme)

    Serialization

    • ๐Ÿ‘ Allow passing instance method or conditional expressions to option ignore_serialize on JSON::Field (#11804, thanks @cyangle)
    • Implement Iterator.from_json and #to_json (#10437, thanks @wonderix)

    Specs

    • โž• Add file and line arguments to it_iterates (#11628, thanks @straight-shoota)
    • โœ‚ Remove duplicate word in documentation (#11797, thanks @samueleaton)

    System

    • (breaking-change) (security) Fix character mappings for Windows path conversions (#11847, thanks @straight-shoota)
    • โž• Add fallback for Path.home on Unix (#11544, thanks @HertzDevil)
    • ๐Ÿ˜Œ Relax ENV.fetch(key, &)'s block restriction (#11779, thanks @HertzDevil)
    • ๐Ÿ”จ Refactor target clauses for system implementations (#11813, thanks @straight-shoota)
    • ๐Ÿ›  Fix Path support for UNC shares (#11827, thanks @straight-shoota)
    • ๐Ÿ›  Fix regression for Linux older than 3.17: properly check that getrandom is available (#11953, thanks @lbguilherme)

    Text

    • ๐Ÿ›  Fix ensure PCRE JIT mode is available before running spec (#11533, thanks @Blacksmoke16)
    • โž• Add more Colorize overloads and fix docs (#11832, thanks @asterite)
    • ๐Ÿ”จ Refactor Colorize::Mode enum (#11663, thanks @straight-shoota)
    • โž• Add some docs for UUID (#11683, thanks @wontruefree)
    • โž• Add docs for UUID#urn (#11693, thanks @wontruefree)
    • โž• Add docs for String#[] (#11690, thanks @wontruefree)
    • ๐Ÿ‘ Allow explicit usage of libiconv (#11876, thanks @luislavena)
    • (breaking-change) Fix: Honour encoding in IO::Memory#to_s (#11875, thanks @straight-shoota)
    • โž• Add self return type to UUID constructor methods (#10539, thanks @straight-shoota)
    • ๐Ÿ›  Fix infinite loop for certain StringPool initial capacities (#11929, thanks @HertzDevil)

    Time

    • โž• Add examples to Time::Format methods (#11713, thanks @ThunderKey)
    • ๐Ÿ‘Œ Support day of year (%j) in Time parsers (#11791, thanks @HertzDevil)

    Compiler

    • Hello WebAssembly! (MVP implementation) (#10870, thanks @lbguilherme)
    • ๐Ÿ›  Fix compiler specs git integration for configurable default branch (#11754, thanks @yxhuvud)
    • ๐Ÿšš Crystal::ToSVisitor: Remove decorate_* methods (#11724, thanks @HertzDevil)
    • ๐Ÿ‘‰ Use fewer symbols in the compiler source (#11625, thanks @HertzDevil)
    • โž• Add support for --m* flags to crystal spec and crystal eval (#11767, thanks @yxhuvud)
    • โž• Add local compiler wrapper script for Windows (#11524, thanks @HertzDevil)
    • โž• Add Crystal::Program#check_deprecation (#11684, thanks @HertzDevil)
    • ๐Ÿ”จ Refactor symbols for primitive number kinds to enums (#11621, thanks @HertzDevil)
    • โœ‚ Remove useless assignments II (#11843, thanks @IgorPolyakov)
    • Limit the number of rendered overloads on signature mismatch (#10890, thanks @caspiano)
    • ๐Ÿ‘Œ Support "can't infer type parameter" error for uninstantiated generic modules (#11904, thanks @HertzDevil)
    • ๐Ÿ›  Fix: Accept only option flags in CRYSTAL_OPTS for build commands (#11922, thanks @HertzDevil, @beta-ziliani)
    • Evaluate LibLLVM::IS_LT_* during macro expansion time (#11913, thanks @HertzDevil)
    • ๐Ÿ›  Fix incorrect var type inside nested exception handler (#11928, thanks @asterite)
    • ๐Ÿ›  Fix: Look up return type in defining type (#11962, thanks @asterite)

    Codegen

    • ๐ŸŽ (performance) Codegen: Do not always request value for Proc#call (#11675, thanks @HertzDevil)

    Debugger

    • ๐Ÿ›  Fix debug location of inlined Proc#call body (#11676, thanks @HertzDevil)

    Generics

    • ๐Ÿ†“ Resolve non-type free variables in return type restrictions (#11861, thanks @HertzDevil)
    • ๐Ÿ›  Fix recursive pointerof detection with generic splat type variables (#11811, thanks @HertzDevil)

    Interpreter

    • ๐Ÿ›  Fix for Crystal interpreter crash (#11717, thanks @wmoxam)
    • ๐Ÿ‘ Interpreter: support Tuple#[] with range literals (#11783, thanks @HertzDevil)
    • Interpreter: Promote arguments of variadic function calls (#11795, thanks @straight-shoota)
    • Check if libraries are present using dlopen (#11852, thanks @FnControlOption)
    • ๐Ÿ‘‰ Use Crystal::Loader in the interpreter (#11579, thanks @straight-shoota)
    • ๐Ÿ‘Œ Improve Crystal::Loader errors (#11860, thanks @straight-shoota)
    • Enable interpreter integration specs for YAML (#11801, thanks @straight-shoota)

    ๐Ÿ“œ Parser

    • ๐Ÿ›  Fix parser error with semicolon + newline in parenthesized Expressions (#11769, thanks @straight-shoota)
    • ๐Ÿ›  Fix comment indentation in ASTNode#to_s (#11851, thanks @FnControlOption)
    • โž• Add locations for else, ensure, end keywords (#11476, thanks @FnControlOption)
    • โž• Add parser support to handle CRLF the same as LF (#11810, thanks @asterite)
    • Lexer: use Crystal::Token::Kind enum instead of symbols (#11616, thanks @HertzDevil)
    • ๐Ÿ‘Œ Support Generic nodes with no type variables (#11906, thanks @HertzDevil)

    Semantic

    • (breaking-change) Drop skip_abstract_def_check flag support (#9217, thanks @makenowjust)
    • โž• Add error when instance variable is inherited from module and supertype (#11768, thanks @straight-shoota)
    • Check file-private types for abstract defs and recursive structs (#11838, thanks @HertzDevil)
    • ๐Ÿ›  Fix: Prevent eager instance_sizeof on structs (#11856, thanks @mattrberry)
    • ๐Ÿ›  Fix: Do not consider global Path in def parameter restriction as free variable (#11862, thanks @HertzDevil)

    Tools

    • Do not inherit from Hash in the compiler (#11707, thanks @HertzDevil)
    • ๐Ÿ“œ Use OptionParser in crystal env (#11720, thanks @HertzDevil)

    Playground

    • โšก๏ธ Replace PNG icon with optimized SVG for playground (#7616, thanks @straight-shoota)

    Other

    • ๐Ÿš€ Update previous Crystal release - 1.3.2 (#11715, thanks @straight-shoota)
    • โž• Add scripts/release-update.sh (#11716, thanks @straight-shoota)
    • [Makefile] Honour $CC in EXPORT_CC (#11548, thanks @straight-shoota)
    • ๐Ÿ›  Fix typo in GHA aarch64 config (#11793, thanks @straight-shoota)
    • โœ… [CI] Test against LLVM 13 (#11343, thanks @straight-shoota)
    • [CI] Use parameters in circleci config (#11714, thanks @straight-shoota)
    • ๐Ÿ”จ Refactor etc/completion.bash (#11719, thanks @HertzDevil)
    • ๐Ÿ— [CI] Renaming jobs to be arch-os-job or arch-build-job (#11207, thanks @beta-ziliani)
    • ๐Ÿ‘Œ Improve documentation for review and merge processes (#11800, thanks @straight-shoota)
    • ๐Ÿ‘Œ Improve section ordering in scripts/github-changelog.cr (#11770, thanks @straight-shoota)
    • ๐Ÿ— Upload build artifacts to S3 bucket (#11902, thanks @matiasgarciaisaia, @straight-shoota)
    • ๐Ÿ›  Fix make install for BSD (#11758, thanks @straight-shoota)
    • ๐Ÿ›  Fix typo (#11939, thanks @taupiqueur)
    • โšก๏ธ [CI] Update to shards 0.17.0 (#11930, thanks @straight-shoota)
    • ๐Ÿ‘‰ Use be_empty expectations in more specs (#11937, thanks @HertzDevil)
    • โšก๏ธ [CI] Update distribution-scripts (#11969, thanks @straight-shoota)