Crystal Versions Save

The Crystal Programming Language

1.8.2

11 months ago

Standard Library

Collection

  • Fix codegen bug with Iterator::ChainIterator (#13412, thanks @straight-shoota)

Log

  • Fix Log::Metadata#dup crash with 2+ entries (#13369, thanks @HertzDevil)

Serialization

  • Fixup for JSON::Serializable on certain recursively defined types (#13430, thanks @kostya)

Text

  • Fix String#scan with empty Regex match at multibyte char (#13387, thanks @HertzDevil)
  • (performance) Check subject UTF-8 validity just once for String#gsub, #scan, #split (#13406, thanks @HertzDevil)

Compiler

Codegen

  • Always use 0 for offset of StaticArray's @buffer (#13319, thanks @HertzDevil)

Other

  • Backport bugfixes to release/1.8 for release 1.8.2 (#3435, thanks @straight-shoota)

1.8.1

1 year ago

Standard Library

Serialization

  • Fix JSON::Serializable on certain recursively defined types (#13344, thanks @HertzDevil)

Text

  • Fix String#gsub with empty match at multibyte char (#13342, thanks @straight-shoota)
  • Fix PCRE2 Regex with more than 127 named capture groups (#13349, thanks @HertzDevil)

1.8.0

1 year ago

Language

  • The compiler uses PCRE2 to validate regex literals (#13084, thanks @straight-shoota)
  • Fill docs for TupleLiteral (#12927, thanks @straight-shoota)
  • Allow namespaced Paths as type names for lib (#12903, thanks @HertzDevil)

Standard Library

  • Fix SyntaxHighlighter::HTML to escape identifier values (#13212, thanks @straight-shoota)
  • Add workaround for Value#not_nil! copying the receiver (#13264, thanks @HertzDevil)
  • Fix Pointer#copy_to overflow on unsigned size and different target type (#13269, thanks @HertzDevil)
  • Docs: Added note about imports where necessary (#13026, #13066, thanks @Tamnac, @straight-shoota)
  • Suppress compiler output in compile_file spec helper (#13228, thanks @straight-shoota)
  • Define equality for Process::Status and OAuth::RequestToken (#13014, thanks @HertzDevil)
  • Fix some Linux glibc bindings (#13242, #13249, thanks @ysbaddaden, @HertzDevil)

Collection

  • (breaking-change) Fix Enum#includes? to require all bits set (#13229, thanks @straight-shoota)
  • (breaking-change) Deprecate Enum.flags (#12900, thanks @straight-shoota)
  • (breaking-change) Remove compile-time error for Range#size, #each, #sample (#13278, thanks @straight-shoota)
  • (breaking-change) Docs: Require all Indexables to be stable (#13061, thanks @HertzDevil)
  • Add Enum.[] convenience constructor (#12900, thanks @straight-shoota)
  • Rename internal Iterator::Slice type to not conflict with ::Slice (#12983, thanks @Blacksmoke16)
  • Fix Array#replace on shifted arrays (#13256, thanks @HertzDevil)
  • Add Tuple#to_static_array (#12930, thanks @straight-shoota)
  • Add Enum#inspect (#13004, thanks @straight-shoota)
  • Add Slice#+(Slice) and Slice.join (#12081, thanks @HertzDevil)
  • Add Enumerable#min(count) and #max(count) (#13057, thanks @nthiad)
  • Fix Array(T)#[]=(Int, Int, Array(T)) on shifted arrays (#13275, thanks @HertzDevil)

Concurrency

  • Fix: Make sure to dup Array in Channel.select_impl (#12827, #12962, thanks @straight-shoota)
  • Add memory barriers on lock/unlock of SpinLock (#13050, thanks @bcardiff)
  • (performance) Avoid Array allocation in Channel.select(Tuple) (#12960, thanks @straight-shoota)

Files

  • (breaking-change) Deprecate Termios (#12940, thanks @HertzDevil)
  • (breaking-change) Windows: make File.delete remove symlink directories, not Dir.delete (#13224, thanks @HertzDevil)
  • Leverage fileapi for opening files on windows (#13178, thanks @Blacksmoke16)
  • Windows: fix error condition when File.open fails (#13235, thanks @HertzDevil)
  • Skip eacces spec for superuser (#13227, thanks @straight-shoota)
  • Improve File.symlink on Windows (#13141, thanks @HertzDevil)
  • Implement File.readlink on Windows (#13195, thanks @HertzDevil)

LLVM

  • (breaking-change) Drop support for LLVM < 8 (#12906, thanks @straight-shoota)
  • (breaking-change) Support LLVM 15 (#13173, thanks @HertzDevil)
  • Error when find-llvm-config is unsuccessful (#13045, thanks @straight-shoota)
  • Remove LibLLVM.has_constant?(:AttributeRef) checks (#13162, thanks @HertzDevil)
  • Refactor LLVM::Attribute#each_kind to use Enum#each (#13234, thanks @straight-shoota)

Networking

  • Fix socket specs when network not available (#12961, thanks @straight-shoota)
  • Fix wrong default address when binding sockets (#13006, thanks @etra0)
  • Clarify WebSocket documentation (#13096, thanks @j8r)
  • Add Socket::IPAddress#link_local? (#13204, thanks @GeopJr)
  • Clean up back\slash.txt in HTTP::StaticFileHandler specs (#12984, thanks @HertzDevil)
  • Add MIME::Multipart.parse(HTTP::Client::Response, &) (#12890, thanks @straight-shoota)
  • Replace LibC.ntohs and htons with native code (#13027, thanks @HertzDevil)
  • Add OAuth2::Client#make_token_request returning HTTP response (#12921, thanks @cyangle)
  • Use exhaustive case in HTTP::WebSocket#run (#13097, thanks @j8r)
  • Increase time drift for HTTP::StaticFileHandler's gzip check (#13138, thanks @HertzDevil)
  • OpenSSL: use Windows' system root certificate store (#13187, thanks @HertzDevil)
  • Handle Range requests in HTTP::StaticFileHandler (#12886, thanks @jgaskins, @straight-shoota)
  • Skip hostname spec if hostname command fails (#12987, thanks @Blacksmoke16)
  • Fix Socket#tty? to false on Windows (#13175, thanks @Blacksmoke16)
  • Fix HTTP::Server::Response#reset for status_message (#13282, thanks @straight-shoota)

Numeric

  • Define Math.pw2ceil for all integer types (#13127, thanks @HertzDevil)
  • Workaround for more Int128-and-float methods on Windows with LLVM 14+ (#13218, thanks @HertzDevil)
  • Fix Int128-and-float conversion overflow checks on Windows LLVM 14+ (#13222, thanks @HertzDevil)
  • Add Char.to_i128 and .to_u128 (#12958, thanks @meatball133)
  • Docs: Add references to Number collection convenience constructors (#13020, thanks @straight-shoota)
  • Docs: Fix examples for #byte_swap with different int types (#13154, #13180, thanks @pan, @Blacksmoke16)
  • Make BigRational.new(BigFloat) exact (#13295, thanks @HertzDevil)

Runtime

  • Increase timeout for slow specs (#13043, thanks @straight-shoota)
  • Use Crystal::System.print_error instead of LibC.printf (#13161, thanks @HertzDevil)
  • Windows: detect stack overflows on non-main Fibers (#13220, thanks @HertzDevil)
  • Add missing require for Crystal::ThreadLocalValue (#13092, thanks @Sija)

Serialization

  • Remove obsolete error handling in XPathContext (#13038, thanks @straight-shoota)
  • Fix JSON, YAML use_*_discriminator for recursive Serializable::Strict types (#13238, thanks @HertzDevil)
  • Add more specs for YAML::Any#[] and #[]? (#11646, thanks @straight-shoota)
  • Add from_json for 128-bit integers (#13041, thanks @straight-shoota)
  • Reduce JSON, YAML serializable test types (#13042, thanks @straight-shoota)

Specs

  • Format spec results with pretty inspect (#11635, thanks @JamesGood626)
  • Spec: Add --color option to spec runner (#12932, thanks @straight-shoota)
  • Add Spec::Item#all_tags (#12915, thanks @compumike)

System

  • (breaking-change) Add full stub for Windows signals (#13131, thanks @HertzDevil)
  • (breaking-change) Deprecate and internalize Process.fork (#12934, thanks @straight-shoota)
  • Fix Process spec to wait on started processes (#12941, thanks @straight-shoota)
  • Drop privileges in chroot spec (#13226, thanks @straight-shoota)
  • Drop deprecated from_winerror overload for flock_* (#13039, thanks @HertzDevil)
  • Add Process.on_interrupt (#13034, thanks @HertzDevil)
  • Add Process::Status#to_s and #inspect (#13044, thanks @straight-shoota)
  • Add graceful parameter to Process#terminate (#13070, thanks @HertzDevil)
  • Add Process::ExitReason and Process::Status#exit_reason (#13052, thanks @HertzDevil)
  • Implement File.tempfile in Crystal (#12111, thanks @straight-shoota)
  • System::User#name: Fall back to #username if unavailable (#13137, thanks @HertzDevil)
  • Implement Process.ppid on Windows (#13140, thanks @HertzDevil)
  • AArch64 Android support (#13065, thanks @HertzDevil)
  • Windows 7 support (#11505, thanks @konovod)

Text

  • (breaking-change) Fix PCRE crashing on invalid UTF-8 (#13240, #13311, #13313, thanks @straight-shoota)
  • (breaking-change) Switch default regex engine to PCRE2 (#12978, thanks @straight-shoota)
  • (breaking-change) Add more members to Regex::Options (#13223, thanks @straight-shoota)
  • (breaking-change) Add Regex::MatchOptions (#13248, thanks @straight-shoota)
  • Fix PCRE2 implementation and tests (#13105, thanks @straight-shoota)
  • Remove pending spec for Path#drive with IPv6 UNC host names (#13190, thanks @HertzDevil)
  • Remove Regex::PCRE2#finalize redefinition (#13309, thanks @HertzDevil)
  • Clarify behavior of strings with invalid UTF-8 byte sequences (#13314, thanks @HertzDevil)
  • Refer to PCRE2 in Regex's summary (#13318, thanks @HertzDevil)

Compiler

  • Escape filenames when running crystal spec with multiple files (#12929, thanks @HertzDevil)
  • Handle ARM64 MSVC paths when cross-compiling on Windows (#13073, thanks @HertzDevil)
  • Use relative paths to vendored shards" (#13315, thanks @straight-shoota)

Debugger

  • Always use 0 for offsets of lib / extern union members (#13305, thanks @HertzDevil)

Codegen

  • (breaking-change) Support LLVM 15 (#13173, thanks @HertzDevil)
  • Remove obsolete functions from llvm_ext.cc (#13177, thanks @HertzDevil)

Generics

  • Fix type names for generic instances with empty splat type vars (#13189, thanks @HertzDevil)

Interpreter

  • Fix: Interpreter value_to_bool for module, generic module and generic module metaclass (#12920, thanks @asterite)
  • Fix redundant cast in interpreter (#12996, thanks @asterite)
  • Dynamic library loader: search in -L directories before default ones (#13069, thanks @HertzDevil)
  • Simplify expectation of loader spec error messages (#12858, thanks @straight-shoota)
  • Add support for 128-bit literals in the interpreter (#12859, thanks @straight-shoota)
  • Fix interpreter value_to_bool for NoReturn (#13290, thanks @straight-shoota)

Parser

  • Fix x @y and x @@y in def parameters when y is reserved (#12922, thanks @HertzDevil)
  • Disallow empty exponents in number literals (#12910, thanks @HertzDevil)
  • Stricter checks for multiple assignment syntax (#12919, thanks @HertzDevil)

Semantic

  • Compiler: type declaration with initial value gets the value's type (#13025, thanks @asterite)
  • Stricter checks for enum definitions (#12945, thanks @HertzDevil)
  • Fix error handling in macro system method when execution fails (#12893, thanks @straight-shoota)
  • Add comment for LiteralExpander select (#12926, thanks @straight-shoota)
  • Improve locations of some AST nodes (#12933, thanks @straight-shoota)
  • Refactor SemanticVisitor tighter rescue scope in Require visitor (#12887, thanks @straight-shoota)
  • Add specs for regex literal expansion (#13253, thanks @straight-shoota)

Tools

  • Fix Crystal tool cursor parsing for filenames containing : (#13129, thanks @HertzDevil)

Formatter

  • Formatter: fix end indent after comment inside begin (#12994, thanks @asterite)
  • Parser: remove obsolete handling of else inside lib struct (#13028, thanks @HertzDevil)
  • Fix formatter empty array literal with comment on extra line (#12907, thanks @straight-shoota)
  • Fix formatter comment on extra line at end of method args (#12908, thanks @straight-shoota)
  • Fix formatter not merge consecutive but separated comment lines (#12909, thanks @straight-shoota)
  • Formatter: add (&) to param-less yielding defs before comment line (#13126, thanks @HertzDevil)
  • Formatter: add & to yielding methods without a block parameter (#12951, thanks @HertzDevil)
  • Formatter: Add feature flag for method_signature_yield (#13215, thanks @straight-shoota)
  • Macro interpolation: add & to yielding Defs without a block parameter (#12952, thanks @HertzDevil)

Infrastructure

  • Fix bin/crystal print no error message when crystal is missing (#12981, thanks @straight-shoota)
  • Prevent infinitely recursive wrapper script (#11712, thanks @ThunderKey)
  • Changelog helper: Report error from HTTP request (#13011, thanks @straight-shoota)
  • Fix wrapper script to handle CRYSTAL variable pointing to itself (#13032, thanks @straight-shoota)
  • Propagate exit code correctly in Windows wrapper batch script (#13048, thanks @HertzDevil)
  • Remove __declspec(dllimport) from Windows libiconv build (#13219, thanks @HertzDevil)
  • Update previous Crystal release - 1.7.0 (#12925, thanks @straight-shoota)
  • [CI] Remove verbose=1 in test_llvm (#12931, thanks @straight-shoota)
  • Missing quotes in Wrapper Script (#12955, thanks @stellarpower)
  • Makefile: refactor test recipe (#12979, thanks @straight-shoota)
  • Merge release branch for 1.7 into master (#12998, thanks @straight-shoota)
  • Update previous Crystal release - 1.7.2 (#13001, thanks @straight-shoota)
  • Update distribution-scripts (#13051, #13068, #13188, #13213, #13298, thanks @straight-shoota)
  • [CI] Use Ubuntu 22.04 base image for LLVM tests (#13035, thanks @straight-shoota)
  • Add instructions for other repos to pre-commit hook (#10535, thanks @straight-shoota)
  • Makefile: Add ./scripts to format recipe (#13064, thanks @straight-shoota)
  • Crystal wrapper script enhancements (#12959, thanks @j8r)
  • Fix sed command in scripts/update-distribution-scripts.cr (#13071, thanks @straight-shoota)
  • Update GH Actions (#13075, #13132, thanks @renovate)
  • CI: Enable testing with libpcre2 on wasm32 (#13109, thanks @lbguilherme)
  • Build the compiler with PCRE2 (#13084, #13133, thanks @straight-shoota)
  • Prefer matching llvm-config in find-llvm-config (#13087, thanks @straight-shoota)
  • (performance) Run compiler specs in release mode (#13122, thanks @straight-shoota)
  • [CI] Increase no_output_timeout on circleci (#13151, thanks @straight-shoota)
  • Update NOTICE.md (#13159, thanks @HertzDevil)
  • Merge release/1.7@1.7.3 (#13168, thanks @straight-shoota)
  • [CI] Cancel in-progress jobs when another commit is pushed (#13179, thanks @Blacksmoke16)
  • Mute shell comments in Makefile (#13201, thanks @straight-shoota)
  • Update previous Crystal release - 1.7.3 (#13167, thanks @straight-shoota)
  • [CI] Remove cross-compiliation on Windows (#13207, thanks @straight-shoota)
  • [CI] Increase no_output_timeout on circleci (cont.) (#13185, thanks @straight-shoota)
  • [CI] Update Windows job to LLVM 15 (#13208, thanks @straight-shoota)
  • Clean up .gitignore (#13241, thanks @straight-shoota)
  • [CI] Extract LLVM tests in separate workflow (#13246, thanks @straight-shoota)
  • [CI] Extract interpreter workflow and split std_spec execution (#13267, thanks @straight-shoota)
  • Avoid test.cr in root of repo conflicting with parser warning specs (#13259, thanks @Blacksmoke16)
  • Fix bin/crystal in symlink working directory (#13281, thanks @straight-shoota)
  • Fix bin/crystal when no global crystal command is installed (#13286, thanks @straight-shoota)
  • Makefile: Add interpreter_spec (#13251, thanks @straight-shoota)
  • Makefile: Add all target as default before including Makfile.local (#13276, thanks @straight-shoota)
  • Update shards 0.17.3 (#13296, thanks @straight-shoota)

Other

  • Do not match expectations outside specs (#13079, thanks @HertzDevil)
  • Enable or fix specs that already work on Windows (#13186, thanks @HertzDevil)

1.7.3

1 year ago

Standard Library

Text

  • Do not use @[ThreadLocal] for PCRE2's JIT stack (#13056, thanks @HertzDevil)
  • Fix libpcre2 bindings with arch-dependent types (SizeT) (#13088, thanks @straight-shoota)
  • Fix libpcre2 bindings function pointers (#13090, thanks @straight-shoota)
  • Fix PCRE2 do not allocate JIT stack if unavailable (#13100, thanks @straight-shoota)
  • Backport PCRE2 fixes to 1.7 (#13136, thanks @straight-shoota)
  • Fix MatchData#[] named capture with identical prefix (#13147, thanks @straight-shoota)
  • Fix Regex::Option behaviour for unnamed members (#13155, thanks @straight-shoota)
  • (performance) Improve PCRE2 match performance for JIT and interpreted (#13146, thanks @straight-shoota)

Compiler

Generics

  • Explicitly treat unbound type vars in generic class methods as free variables (#13125, thanks @HertzDevil)

Other

  • [CI] Fix add PCRE2 to GHA cache for win job (#13089, thanks @straight-shoota)
  • [CI] Pin use_pcre in build environments where PCRE2 is not yet available (#13102, thanks @straight-shoota)

1.7.2

1 year ago

Runtime

  • Fix: Add Nil return type restrictions to load_debug_info (#12992, thanks @straight-shoota)

Compiler

Codegen

  • Add error handling to compiler when linker is unavailable (#12899, thanks @straight-shoota)

Parser

  • Revert "Parser: Fix restrict grammar for name and supertype in type def (#12622)" (#12977, thanks @straight-shoota)

Other

  • Update VERSION to 1.7.2-dev (#12993, thanks @straight-shoota)

1.7.1

1 year ago

Tools

Playground

  • Fix baked-in path in playground to resolve at runtime (#12948, thanks @straight-shoota)

Other

  • Update VERSION to 1.7.1-dev (#12950, thanks @straight-shoota)

1.7.0

1 year ago

Language

  • Add lib functions earlier so that they are visible in top-level macros (#12848, thanks @asterite)

Standard Library

  • Improve Benchmark docs (#12782, thanks @r00ster91, @straight-shoota)
  • Improve documentation for Object#to_s and #inspect (#9974, thanks @straight-shoota)
  • Add methods to manipulate semantic versions (#12834, thanks @gabriel-ss)
  • Add types to methods with defaults (#12837, thanks @caspiano)
  • examples: fix (2022-10) (#12665, thanks @maiha)
  • Fix documentation for Pointer#move_to (#12677, thanks @TheEEs)
  • (performance) Eliminate nil from many predicate methods (#12702, thanks @HertzDevil)
  • examples: fix (2022-12) (#12870, thanks @maiha)

Collection

  • Fix missed elements in Hash#select!(keys : Enumerable) (#12739, thanks @caspiano)
  • Add missing docs for Indexable combinations methods (#10548, thanks @keidax)
  • (performance) Optimize Range#sample(n) for integers and floats (#12535, thanks @straight-shoota)
  • Add Iterable#each_cons_pair (#12726, thanks @caspiano)
  • Add links to equivalent Iterator methods in Iterable (#12727, thanks @caspiano)
  • (performance) Optimize Hash#select(Enumerable) and #merge!(Hash, &) (#12737, thanks @HertzDevil)
  • Add Indexable#rindex! method variant (#12759, thanks @Sija)
  • (performance) Use mutating collection methods (#12644, thanks @caspiano)
  • Fix Enum#to_s for flag enum containing named and unnamed members (#12895, thanks @straight-shoota)

Concurrency

  • Allow the EventLoop implementation to be detected at runtime (#12656, thanks @lbguilherme)
  • (performance) Optimize uniqueness filter in Channel.select_impl (#12814, thanks @straight-shoota)
  • Implement multithreading primitives on Windows (#11647, thanks @HertzDevil)

Crypto

  • (breaking-change) Implement Digest class in Digest::CRC32 and Digest::Adler32 (#11535, thanks @BlobCodes)
  • Fix OpenSSL::SSL::Context::Client#alpn_protocol= (#12724, thanks @jaclarke)
  • Fix HTTP::Client certificate validation error on FQDN (host with trailing dot) (#12778, thanks @compumike)
  • Enable arc4random(3) on all supported BSDs and macOS/Darwin (#12608, thanks @dmgk)

Files

  • Fix: Read UInt in zip directory header (#12822, thanks @pbrumm)
  • Add File.executable? for Windows (#9677, thanks @nof1000)

Macros

  • Fix TypeNode#nilable? for root types (#12354, thanks @HertzDevil)
  • Add argless #annotations overload (#9326, thanks @Blacksmoke16)
  • Add specs for addition between ArrayLiteral and TupleLiteral (#12639, thanks @caspiano)
  • Add ArrayLiteral#-(other) and TupleLiteral#-(other) (#12646, #12916 thanks @caspiano, @straight-shoota)

Networking

  • (breaking-change) Add HTTP::Headers#serialize (#12765, thanks @straight-shoota)
  • Ensure HTTP::Client closes response when breaking out of block (#12749, thanks @straight-shoota)
  • Add HTTP::Server::Response#redirect (#12526, thanks @straight-shoota)
  • (performance) Websocket: write masked data to temporary buffer before sending it (#12613, thanks @asterite)
  • Validate cookie name prefixes (#10648, thanks @Blacksmoke16)
  • IPAddress#loopback? should consider ::ffff:127.0.0.1/104 loopback too (#12783, thanks @carlhoerberg)

Numeric

  • Support new SI prefixes in Number#humanize (#12761, thanks @HertzDevil)
  • Fix BigInt#% for unsigned integers (#12773, thanks @straight-shoota)
  • [WASM] Add missing __powisf2 and __powidf2 compiler-rt functions (#12569, thanks @lbguilherme)
  • Add docs for Int#downto (#12468, thanks @yb66)
  • Upgrade the Dragonbox algorithm (#12767, thanks @HertzDevil)
  • Support scientific notation in BigDecimal#to_s (#10805, thanks @HertzDevil)
  • Add #bit_reverse and #byte_swap for primitive integers (#12865, thanks @HertzDevil)
  • Fix Number comparison operator docs (#12880, thanks @fdocr)

Runtime

  • Exception::CallStack: avoid allocations in LibC.dl_iterate_phdr (#12625, thanks @dmgk)
  • Fix explicit type conversion to u64 for GC::Stats (#12779, thanks @straight-shoota)
  • Add custom message parameter to #not_nil! (#12797, thanks @straight-shoota)
  • Refactor specs for Enum#to_s using assert_prints (#12882, thanks @straight-shoota)

Serialization

  • (performance) Leverage GC.malloc_atomic for XML (#12692, thanks @HertzDevil)
  • Refactor libXML error handling to remove global state (#12663, #12795, thanks @straight-shoota)
  • Use qualified type reference YAML::Any (#12688, thanks @zw963)
  • Automatically cast Int to Float for {JSON,YAML}::Any#as_f (#12835, thanks @compumike)

Specs

  • Print seed info at start and end of spec output (#12755, thanks @straight-shoota)

System

  • (breaking) Rename File.real_path to .realpath (#12552, thanks @straight-shoota)
  • (breaking-change) Drop FreeBSD 11 compatibility code (#12612, thanks @dmgk)
  • Trap when trying to raise wasm32 exceptions (#12572, thanks @lbguilherme)
  • Use single helper method to pass UTF-16 strings to Windows (#12695, #12747, thanks @HertzDevil, @straight-shoota)
  • Implement flock_* fiber-aware, without blocking the thread (#12861, #12728, thanks @straight-shoota)
  • Implement flock_* for Win32 (#12766, thanks @straight-shoota)
  • Add docs to ENV#has_key? (#12781, thanks @straight-shoota)
  • Improve specs by removing absolute path references (#12776, thanks @straight-shoota)
  • Update FreeBSD LibC types (#12651, thanks @dmgk)
  • Organize Process specs (#12889, thanks @straight-shoota)
  • Add tests for Process::Status (#12881, thanks @straight-shoota)

Text

  • Raise IndexError on unmatched subpattern for MatchData#begin and #end (#12810, thanks @straight-shoota)
  • Swap documentation for String#split array and block versions (#12808, thanks @hugopl)
  • Add String#index/rindex! methods (#12730, thanks @Sija)
  • Re-organize and enhance specs for Regex and Regex::MatchData (#12788, #12789, thanks @straight-shoota)
  • Add missing positive spec for Regex#match with option (#12804, thanks @straight-shoota)
  • Replace if !blank? with unless blank? (#12800, thanks @vlazar)
  • Add references between String equality, comparison methods (#10531, thanks @straight-shoota)
  • Extract internal Regex API for PCRE backend (#12802, thanks @straight-shoota)
  • Implement Regex engine on PCRE2 (#12856, #12866, #12847, thanks @straight-shoota, thanks @HertzDevil)
  • Add missing overloads for String#byte_slice (#12809, thanks @straight-shoota)

Compiler

  • Improve error message when there are extra types (#12734, thanks @asterite)
  • Handle triples without libc (#12594, thanks @GeopJr)
  • Remove unused Program#cache_dir property (#12669, thanks @straight-shoota)
  • Fix: Unwrap nested errors in error handler for Crystal::Error (#12888, thanks @straight-shoota)

Codegen

  • Add missing specs for ->var.foo semantics with assignments (#9419, thanks @makenowjust)
  • Use File#flock_exclusive on win32 in compiler (#12876, thanks @straight-shoota)

Generics

  • Redefine defs when constant and number in generic arguments are equal (#12785, thanks @HertzDevil)
  • Fix restriction of numeral generic argument against non-free variable Path (#12784, thanks @HertzDevil)

Interpreter

  • Interpreter: fix class var initializer that needs an upcast (#12635, thanks @asterite)
  • Reverting #12405 Compiler: don't always use Array for node dependencies and observers (#12849, thanks @beta-ziliani)
  • Match Nix loader errors in compiler spec (#12852, thanks @bcardiff)
  • Interpreter reply (#12738, thanks @I3oris)

Parser

  • (breaking-change) Parser: Fix restrict grammar for name and supertype in type def (#12622, thanks @caspiano)
  • Lexer: fix global capture vars ending with zero, e.g. $10? (#12701, thanks @FnControlOption)
  • Lexer: allow regex after CRLF (#12713, thanks @FnControlOption)
  • Assignment to global regex match data is not allowed (#12714, thanks @caspiano)
  • Error when declaring a constant within another constant declaration (#12566, thanks @caspiano)
  • Fix calls with do-end blocks within index operators (#12824, thanks @caspiano)
  • Remove oct/bin floating point literals (#12687, thanks @BlobCodes)
  • Parser: fix wrong/missing locations of various AST nodes (#11798, thanks @FnControlOption)
  • Refactor: use helper method instead of duplicate code in lexer (#12590, thanks @straight-shoota)
  • Simplify sequential character checks in Crystal lexer (#12699, thanks @caspiano)
  • Lexer: delete redundant scan_ident calls (#12691, thanks @FnControlOption)
  • Rename Def#yields to Def#block_arity (#12833, thanks @straight-shoota)
  • Fix warning on space before colon with anonymous block arg (#12869, thanks @straight-shoota)
  • Warn on missing space before colon in type declaration/restriction (#12740, thanks @straight-shoota)

Semantic

  • Fix: Do not merge union types in truthy filter (#12752, thanks @straight-shoota)
  • Fix crash when using sizeof, instance_sizeof, or offsetof as a type arg (#12577, thanks @keidax)
  • Resolve type of free variable on block return type mismatch (#12754, thanks @caspiano)
  • Order _ after any other Path when comparing overloads (#12855, thanks @HertzDevil)
  • [Experimental] Compiler: try to solve string interpolation exps at compile time (#12524, thanks @asterite)
  • Support @[Deprecated] on annotation (#12557, thanks @caspiano)
  • Add more specific error message for uninstantiated proc type (#11219, thanks @straight-shoota)
  • Add specs for system macro method (#12885, thanks @straight-shoota)

Tools

Docs-generator

  • Fix range literals causing method lookups in docs generator (#12680, thanks @caspiano)
  • Fix method lookup for single char class names (#12683, thanks @caspiano)

Formatter

  • Formatter: document stdin filename argument (-) (#12620, thanks @caspiano)

Other

Infrastructure

  • [CI] Drop Alpine libreSSL 3.1 test (#12641, thanks @straight-shoota)
  • Bump version to 1.7.0-dev (#12640, thanks @straight-shoota)
  • [CI] Update GHA actions (#12501, thanks @straight-shoota)
  • Opt in to new overload ordering behavior in Makefile (#12703, thanks @HertzDevil)
  • Merge release 1.6.2 into master (#12719, thanks @beta-ziliani)
  • Configure Renovate (#12678, thanks @renovate)
  • [CI] Add version pin for ilammy/msvc-dev-cmd in windows CI (#12746, thanks @straight-shoota)
  • [CI] Update dependencies for windows CI (#12745, thanks @straight-shoota)
  • Update GH Actions (#12742, thanks @renovate)
  • [CI] Run specs in random order by default (#12541, thanks @straight-shoota)
  • Update shell.nix for newer LLVM versions and aarch64-darwin (#12591, thanks @HertzDevil)
  • Update previous Crystal release - 1.6.2 (#12750, thanks @straight-shoota)
  • [CI] Update PCRE 8.45 for Windows CI (#12762, thanks @HertzDevil)
  • Add WebAssembly specs (#12571, thanks @lbguilherme)
  • Update actions/checkout action to v3 (#12805, thanks @renovate)
  • Enable multithreading specs on Windows CI (#12843, thanks @HertzDevil)
  • [CI] Update mwilliamson/setup-wasmtime-action action to v2 (#12864, thanks @renovate)
  • [CI] Update distribution-scripts (#12891, thanks @straight-shoota)
  • [CI] Update shards 0.17.2 (#12875, thanks @straight-shoota)
  • Rotate breached credentials in CircleCI (#12902, thanks @matiasgarciaisaia)
  • Update NOTICE.md (#12901, thanks @HertzDevil)
  • Split pre-1.0 changelog (#12898, thanks @straight-shoota)

Code Improvements

  • Style: Remove redundant begin blocks (#12638, thanks @caspiano)
  • Lint: Fix variable name casing (#12674, thanks @Sija)
  • Lint: Remove comparisons with boolean literals (#12673, thanks @Sija)
  • Lint: Use Object#in? instead of multiple comparisons (#12675, thanks @Sija)
  • Lint: Remove useless assignments (#12648, thanks @Sija)
  • Use Object#in? in place of multiple comparisons (#12700, thanks @caspiano)
  • Style: Remove explicit returns from the codebase (#12637, thanks @caspiano)
  • Lint: Use Enumerable#find!/#index! variants (#12686, thanks @Sija)
  • Style: Use short block notation for simple one-liners (#12676, thanks @Sija)
  • Couple of ameba lint issues fixed (#12685, thanks @Sija)
  • Use context-specific heredoc deliminators (#12816, thanks @straight-shoota)

1.6.2

1 year ago

Language

  • Fix VirtualMetaclassType#implements? to ignore base type (#12632, thanks @straight-shoota)

Compiler

  • Compiler: handle yield expressions without a type (#12679, thanks @asterite)
  • Partial revert "Compiler: refactor and slightly optimize merging two types (#12436)" (#12709, thanks @caspiano)

Semantic

  • Compiler: ignore type filters when accepting cast for obj and to (#12668, thanks @asterite)

Other

  • (security) CI: Update to OpenSSL 3.0.7 for bundled lib on Windows (#12712, thanks @beta-ziliani)

1.6.1

1 year ago

Compiler

Interpreter

  • Interpreter (repl): migrate types even if their size remains the same (#12581, thanks @asterite)
  • Unbreak the interpreter on FreeBSD (#12600, thanks @dmgk)
  • Fix FFI specs on release builds (#12601, thanks @HertzDevil)
  • Adding welcome message to the interpreter (#12511, thanks @beta-ziliani)

Semantic

  • Treat single splats with same restriction as equivalent (#12584, thanks @HertzDevil)

Tools

Formatter

  • Formatter: escape backslashes in macro literals when subformatting (#12582, thanks @asterite)

Playground

  • Fix origin validation in playground server for localhost (#12599, thanks @straight-shoota)

Other

  • Fix doc typos in Socket::IPAddress (#12583, thanks @Blacksmoke16)
  • Fix building Wasm32 on Crystal 1.6 (Regression) (#12580, thanks @lbguilherme)
  • Bump version to 1.6.1-dev (#12588, thanks @straight-shoota)
  • Disable failing specs on Windows CI (#12585, thanks @HertzDevil)
  • Detect llvm-configXX while building compiler (#12602, thanks @HertzDevil)

1.6.0

1 year ago

Language

  • Add 'wasm_import_module' option to the @[Link] annotation (#11935, thanks @lbguilherme)

Standard Library

  • Use GC.malloc_atomic with GC.realloc, not Pointer#realloc (#12391, thanks @HertzDevil)
  • Improve syntax highlighter (#12409, thanks @I3oris)
  • Enable miscellaneous parts of the standard library on Windows (#12281, thanks @HertzDevil)
  • Use interpreter to run std spec tests (#12355, thanks @cyangle)
  • Remove most uses of Symbol variables in standard library specs (#12462, thanks @HertzDevil)
  • Use @[::Primitive] and @[::Flags] where necessary (#11900, thanks @HertzDevil)
  • Document how to change base type of an enum (#9803, thanks @Blacksmoke16)
  • Spec: bump and document timeouts in interpreted mode (#12430, thanks @asterite)

Collection

  • Refactor and improve NamedTuple deserialization from JSON and YAML (#12008, thanks @HertzDevil)
  • (performance) Optimize BitArray#tally(hash) (#11909, thanks @HertzDevil)
  • Use Slice#unsafe_slice_of and #to_unsafe_bytes in the standard library and compiler (#12280, thanks @HertzDevil)
  • (performance) Optimize block-less overloads of BitArray#index and #rindex (#12087, thanks @HertzDevil)
  • Support tuple metaclass indexers with non-literal arguments (#11834, thanks @HertzDevil)
  • Add Indexable#index! overloads with offset parameter (#12089, thanks @HertzDevil)

Concurrency

  • Fix fiber clean loop on Windows (#12300, thanks @HertzDevil)
  • Enable Mutex on Windows (#12213, thanks @HertzDevil)

Crypto

  • Add support for Bcrypt algorithm version 2y (#12447, thanks @docelic)
  • Allow using U/Int128 in Random (#11977, thanks @BlobCodes)

Files

  • (breaking-change) Define #system_echo and #system_raw on all systems (#12352, thanks @HertzDevil)
  • (breaking-change) Do not expose Crystal::System::FileInfo through File::Info (#12385, thanks @HertzDevil)
  • Fix IO.pipe spec on FreeBSD (#12324, thanks @dmgk)
  • Fix docs error for File.match? ** globbing pattern. (#12343, thanks @zw963)
  • Add Dir#info (#11991, thanks @didactic-drunk)
  • Implement IO::FileDescriptor's console methods on Windows (#12294, thanks @HertzDevil)
  • Fix typo: LibC::DT_LINK -> DT_LNK (#11954, thanks @HertzDevil)
  • Document IO::FileDescriptor#info (#12384, thanks @HertzDevil)
  • (performance) Introduce IO::DEFAULT_BUFFER_SIZE (#12507, thanks @straight-shoota)
  • Add support for IO::FileDescriptor staying open on finalize (#12367, thanks @refi64)

Macros

  • Enhance record documentation (#12334, thanks @straight-shoota)

Networking

  • Add Socket::IPAddress.valid? (#12489, #10492, thanks @straight-shoota)
  • Fix HTTP::Client#exec to abort retry when client was closed (#12465, thanks @straight-shoota)
  • Fix specs with side effects (#12539, thanks @straight-shoota)
  • Fix HTTP::Client implicit compression with retry (#12536, thanks @straight-shoota)
  • HTTP::StaticFileHandler: Reduce max stat calls from 6 to 2 (#12310, thanks @didactic-drunk)
  • Add warning about concurrent requests in HTTP::Client (#12527, thanks @straight-shoota)

Numeric

  • Add full integer support to sprintf and String#% (#10973, thanks @HertzDevil)
  • Make Float#to_s ignore NaN sign bit (#12399, thanks @HertzDevil)
  • Make sprintf and String#% ignore NaN sign bit (#12400, thanks @HertzDevil)
  • Fix Complex#to_s imaginary component sign for certain values (#12244, thanks @HertzDevil)
  • More accurate definition of Complex#sign (#12242, thanks @HertzDevil)
  • Fix overflow for rand(Range(Int, Int)) when signed span is too large (#12545, thanks @HertzDevil)
  • (performance) Add #rotate_left and #rotate_right for primitive integers (#12307, thanks @HertzDevil)
  • (performance) Optimize BigDecimal#div for inexact divisions (#10803, thanks @HertzDevil)
  • Implement the Dragonbox algorithm for Float#to_s (#10913, thanks @HertzDevil)
  • Add U/Int128 to isqrt spec (#11976, thanks @BlobCodes)

Runtime

  • Fix: Parse DWARF5 Data16 values (#12497, thanks @stakach)
  • macOS: Fix call stack when executable path contains symlinks (#12504, thanks @HertzDevil)
  • WASM: Add support for wasi-sdk 16: don't rely on __original_main (#12450, thanks @lbguilherme)

Serialization

  • Fix YAML serialization class name ambiguity (#12537, thanks @hugopl)
  • Allow non-type converter instances in ArrayConverter and HashValueConverter (#10638, thanks @HertzDevil)
  • Document after_initialize method for yaml and json serializers (#12530, thanks @analogsalad)

System

  • Add missing fields to LibC::Passwd on FreeBSD (#12315, thanks @dmgk)
  • Add platform-specific variants of Process.parse_arguments (#12278, thanks @HertzDevil)
  • Make Dir.current respect $PWD (#12471, thanks @straight-shoota)

Text

  • Fix String shift state specs on FreeBSD (#12339, thanks @dmgk)
  • Disallow mixing of sequential and named sprintf parameters (#12402, thanks @HertzDevil)
  • Fix Colorize doc example (#12492, thanks @zw963)
  • (performance) Optimize String#downcase and String#upcase for single byte optimizable case (#12389, thanks @asterite)
  • (performance) Optimize String#valid_encoding? (#12145, thanks @HertzDevil)
  • Implement String#unicode_normalize and String#unicode_normalized? (#11226, thanks @HertzDevil)
  • Support parameter numbers in sprintf (#12448, thanks @HertzDevil)
  • Use LibC.malloc instead of GC.malloc for LibPCRE allocations (#12456, thanks @lbguilherme)
  • Unicode: Update to version 15.0.0 (#12479, thanks @HertzDevil)
  • Avoid free call in interpreted mode (#12496, thanks @straight-shoota)

Compiler

  • Improve recursive splat expansion detection (#11790, thanks @asterite)
  • Compiler: fix #to_s for empty parameters of lib funs (#12368, thanks @HertzDevil)
  • Compiler: transform Proc(*T, Void) to Proc(*T, Nil) (#12388, thanks @asterite)
  • Compiler: indent begin Expressions that are direct node children (#12362, thanks @HertzDevil)
  • Compiler: add missing location to node on literal expander for array (#12403, thanks @asterite)
  • Compiler: a generic class type can also be reference-like (#12347, thanks @asterite)
  • Hoist complex element expressions outside container literals (#12366, thanks @HertzDevil)
  • (performance) Compiler: bind to tuple, not array (#12423, thanks @asterite)
  • Use Path.new(string) instead of Path.new([string]) (#12419, thanks @asterite)
  • Decouple warning detection from program instances (#12293, thanks @HertzDevil)
  • (performance) Compiler: only have freeze_type in select AST nodes (#12428, thanks @asterite)
  • Correctly display codegen when cross-compiling (#12414, thanks @luislavena)
  • Compiler: simplify some calls (#12417, thanks @asterite)
  • (performance) Compiler: optimizations in merge_if_vars (#12432, #12433, thanks @asterite)
  • Compiler refactor: extract type_from_dependencies (#12437, thanks @asterite)
  • (performance) Compiler: refactor and slightly optimize merging two types (#12436, thanks @asterite)
  • (performance) Compiler optimization: don't create call for hook unless needed (#12452, thanks @asterite)
  • (performance) CrystalPath: Cache Dir.current to avoid thousands of allocations (#12455, thanks @yxhuvud)
  • Better call error messages (#12469, thanks @asterite)
  • (performance) Compiler optimization: avoid intermediate array when matching call arg types (#12485, thanks @asterite)

Codegen

  • Codegen: fix how unions are represented to not miss bytes (#12551, thanks @asterite)
  • Fix alignment typo in compiler comments (#12564, thanks @mdwagner)
  • Remove redundant code from x86_64 abi (#12443, thanks @mattrberry)
  • Codegen: use var pointer for out instead of an extra variable (#10952, thanks @asterite)

Debugger

  • Basic GDB formatter support (#12209, thanks @HertzDevil)
  • Add Visual Studio formatters for String, Array, and Hash (#12212, thanks @HertzDevil)

Interpreter

  • Interpreter: handle the case of a def's body with no type (#12220, thanks @asterite)
  • Interpreter: simplify ivar initialization (#12222, thanks @asterite)
  • Interpreter: fix autocasting in multidispatch (#12223, thanks @asterite)
  • Interpreter: handle next inside captured block (#12237, thanks @asterite)
  • Interpreter: fix crystal_type_id for virtual metaclass type (#12246, thanks @asterite)
  • Interpreter: handle yield with splat combined with tuple unpacking (#12247, thanks @asterite)
  • Interpreter: handle inlined call that returns self for structs (#12259, thanks @asterite)
  • Interpreter: implement Int128/UInt128 intrinsics (#12258, thanks @asterite)
  • Interpreter: fix some conversion primitives (#12257, thanks @asterite)
  • Interpreter: don't override special vars inside block (#12251, thanks @asterite)
  • Interpreter: add missing cast from tuple to other tuple inside union (#12249, thanks @asterite)
  • Interpreter: allow declaring local vars during a pry session (#12180, thanks @asterite)
  • Interpreter: handle bitreverse intrinsics (#12273, thanks @asterite)
  • Interpreter: cache methods with captured block (#12285, thanks @asterite)
  • Interpreter: missing downcast from MixedUnionType to NilableProcType (#12286, thanks @asterite)
  • Interpreter: fix with ... yield with extra arguments (#12301, thanks @asterite)
  • Interpreter: consider nodes without a type as NoReturn (#12275, thanks @asterite)
  • Interpreter: take with ... yield scope into account for args bytesize (#12317, thanks @asterite)
  • Fix loader spec on FreeBSD (#12323, thanks @dmgk)
  • Interpreter: inline ivar access for virtual call with a single child (#12321, thanks @asterite)
  • Interpreter: fix as? when there's no resulting type (#12328, thanks @asterite)
  • Interpreter: handle missing closured struct self (#12345, thanks @asterite)
  • Interpreter: use non_nilable_type in NilableCast (#12348, thanks @asterite)
  • Interpreter: implement mixed union cast with compatible tuple types (#12349, thanks @asterite)
  • Interpreter: fix missing upcast_distinct from A+ to B (Crystal::VirtualType to Crystal::NonGenericClassType) (#12374, thanks @asterite)
  • Interpreter: discard tuple and named tuple (#12387, thanks @asterite)
  • Interpreter: cast proc call arguments to proc arg types (#12375, thanks @asterite)
  • Interpreter: set correct scope for class var initializer (#12441, thanks @asterite)
  • Interpreter (repl): use new MainVisitor each time we need to interpret code (#12512, thanks @asterite)
  • Interpreter: allow inspecting block vars without affecting program (#12520, thanks @asterite)
  • Interpreter: check upcast in nilable cast (#12533, thanks @asterite)
  • Interpreter: implement variable autocast (#12563, thanks @asterite)
  • Interpreter: handle missing upcast from GenericClassInstanceMetaclassType to VirtualMetaclassType (#12562, thanks @asterite)
  • Interpreter: let local vars be seen by macros in repl and pry (#12240, thanks @asterite)
  • Interpreter: handle local variable type declaration (#12239, thanks @asterite)
  • Support libffi on Windows (#12200, thanks @HertzDevil)
  • Add $CRYSTAL_INTERPRETER_LOADER_INFO to show loaded libraries (#12221, thanks @straight-shoota)
  • Interpreter: node override (#12287, thanks @asterite)
  • Interpreter: introduce a Prompt type (#12288, thanks @asterite)
  • Interpreter: missing i += 1 (#12381, thanks @asterite)
  • Support building the interpreter on Windows (#12397, thanks @HertzDevil)
  • Don't exit in interpreter spec and change type from Nil to NoReturn in FixMissingTypes (#12230, thanks @asterite)
  • Interpreter: fix multidispatch with captured block (#12236, thanks @asterite)
  • Interpreter: don't change compiled mode logic (#12252, thanks @asterite)
  • Wait more in HTTP::Server specs in interpreted mode (#12420, thanks @asterite)

Parser

  • Lexer: fix index out of bounds when scanning numbers (#12482, thanks @asterite)
  • Fix parser to never create doc from trailing comment (#11268, thanks @straight-shoota)
  • Parser: declare local vars of indirect type declarations in call args (#11983, thanks @asterite)
  • Remove redundant conditional (#12196, thanks @potomak)
  • Warn on suffix-less integer literals outside Int64's range (#12427, thanks @HertzDevil)
  • Use enum instead of symbols for keywords in the lexer (#11871, thanks @HertzDevil)
  • Parser: Rename arg* to param* (#12235, thanks @potomak)
  • Fix test cases (#12508, thanks @potomak)

Semantic

  • (breaking-change) Allow Union restrictions to be ordered before all other restrictions (#12335, thanks @HertzDevil)
  • (breaking-change) Use more robust ordering between def overloads (#10711, thanks @HertzDevil)
  • Fix: Instance vars should not be allowed on Class, Tuple, NamedTuple, Enum, Pointer , Proc, StaticArray and Union. (#12160, thanks @I3oris)
  • Compiler and interpreter: fix is_a? from virtual metaclass to generic metaclass (#12306, thanks @asterite)
  • Compiler: fix type descendent for union metaclass (#12308, thanks @asterite)
  • Compiler: fix is_a? from generic class against generic class instance type (#12312, thanks @asterite)
  • Fix self in restrictions when instantiating macro def in subtypes (#10954, thanks @HertzDevil)
  • Never resolve free variables as types during overload ordering (#11973, thanks @HertzDevil)
  • Use instantiated type as self when inferring instance variable types (#12466, thanks @HertzDevil)
  • Fix restriction comparison between Metaclass and Path (#12523, thanks @HertzDevil)
  • (performance) Compiler: don't always use Array for node dependencies and observers (#12405, thanks @asterite)
  • Compiler: better error message for symbol against enum (#12478, thanks @asterite)

Tools

Docs-generator

  • Fix docs generator search constants id (#12262, thanks @GeopJr)

Formatter

  • Formatter: format comment after select (#12506, thanks @asterite)
  • Formatter: try to format macros that don't interpolate content (#12378, thanks @asterite)

Playground

  • Playground: Fix pass bound hostname to run sessions (#12356, thanks @orangeSi)
  • Don't show stacktrace when playground port is already in use. (#11844, thanks @hugopl)
  • Indent playground code using spaces (#12231, thanks @potomak)

Other

  • bin/crystal: Ensure sh compatibility (#12486, thanks @HertzDevil)
  • bumping version 1.6.0-dev (#12263, thanks @beta-ziliani)
  • updating CI to 1.5.0 (#12260, thanks @beta-ziliani)
  • Add fish shell completion (#12026, thanks @TunkShif)
  • Execute compopt only when it's present (#12248, thanks @potomak)
  • Use Makefile.win and wrapper script on Windows CI (#12344, thanks @HertzDevil)
  • [Makefile] Add format target (#11420, thanks @straight-shoota)
  • Update contact section of CODE of CONDUCT (#9219, thanks @paulcsmith)
  • Update nixpkgs 22.05 and LLVM 11 (#12498, thanks @straight-shoota)
  • [Makefile] Use EXPORT_CC for make crystal (#11760, thanks @straight-shoota)
  • Update distribution-scripts (#12502, #12555, thanks @straight-shoota)
  • Fix and enhance scripts/update-distribution-scripts.sh (#12503, thanks @straight-shoota)
  • [CI] Upgrade GitHub Actions to macos-11 (#12500, thanks @straight-shoota)
  • Add icon and metadata to Windows Crystal compiler binary (#12494, thanks @HertzDevil)
  • Remove spec/win32_std_spec.cr and spec/generate_windows_spec.sh (#12282, #12549, thanks @HertzDevil and @straight-shoota)