We are announcing a new Crystal publish 1.22.0 alongside multiple new features and bug fixes.
Pre-built packages are accessible on GitHub Releases and our official allocation channels. See crystal-lang.org/install for installation instructions.
This publish includes 251 changes since 1.21.1 by 33 contributors. We appreciate all the contributors for all the attempt put into improving the language! ❤️
Below we catalog the most notable changes in the language, compiler, and stdlib. For additional details, sojourn the full changelog.
Crystal processes exit immediately whenever penning to STDOUT or STDERR fails alongside EPIPE. This closely resembles the default behavior of the SIGPIPE signal. Previously, the failing compose would lift IO::Error, which typically prints an error communication and exits. This error communication is now removed (#17335).
You can opt out of this behavior alongside STDOUT.exit_on_broken_pipe = false.
Thanks, @straight-shoota
Constants can have category declarations (#16951). They activity exactly as you would anticipate the blend of constants and category declarations to be.
module Foo BAR : Int32 = 1 BAZ : String = "" QUX : Int64 = 123 # autocasts 123 to Int64 end
Thanks, @stakach
The targets aarch64-linux-gnu and aarch64-linux-musl moved from Tier 2 to Tier 1. The lone missing part was that we were lacking authoritative builds, but we have that since 1.19.
Process.fork had been deprecated sine before 1.0 and now we eventually removed it (#17367)
Thanks, @straight-shoota
- New macros allow additional content operations at compile time: StringLiteral#bytesize (#17176), NumberLiteral#chr (#17169) and RangeLiteral#each supports CharLiteral (#17170)
Thanks, @straight-shoota
New constants Crystal::ALL_FLAGS and Crystal::USER_FLAGS provision admission to the compile period flags (#17392).
Thanks, @straight-shoota
We entirely revamped DWARF parsing to enhance achievement and decrease recollection usage. The DWARF parser now scans sections on petition (#17283) and builds an productive indicator array formerly (#17410, #17455), which results in blazingly accelerated appearance ups. Decoded backtrace lines are cached in an LRU cache (#17285).
Also added aupport for DWARF 5 features DW_FORM_addrx<n> and DW_FORM_strx<n> (#17445).
Thanks, @ysbaddaden
We merged many improvements and bug fixes for HTTP.
- #remote_address and #local_address moved from HTTP::Request to HTTP::Context (#17196)
- Add HTTP::Headers#merge (#17326)
- Serialize IO::Memory in HTTP build alongside Content-Length header (#17388)
Bug fixes:
- Reject unrecognized HTTP Transfer-Encoding header (#17140), invalid Content-Encoding (#17262), and invalid HTTP trailer (#17337)
- [breaking] Fix the come back values of HTTP::Request#body= and #content_length= (#17257, #17273)
- Fix HTTP.parse_headers_and_body to not lift alongside without_zlib (#17272)
- Validate properties of HTTP::WebSocketHandler (#17235), HTTP::Request (#17255,#17304, #17374, #17310, #17312, #17258), HTTP::Headers name (#17317)
- Close HTTP::Client on IO::Error during petition (#17318)
- Fix Content-Encoding: deflate (#17261)
- Fix HTTP::Request.from_io parsing bare header name (#17254)
- Fix HTTP::Request#form_params? to disregard invalid content-type (#17256)
Thanks @straight-shoota, @hahwul, @jgaskins, @Sija
All targets assistance a native event iteration based immediately on the scheme selector and use it by default.
We enabled epoll on Solaris (#17370) and kqueue on all remaining BSD targets (#17421, #17420). libevent is motionless accessible as a fallback, but now it’s strictly opt-in and becoming technically obsolete. We anticipate to deprecate in a following release.
Thanks, @ysbaddaden
We eventually enabled assistance for Kernel TLS in the OpenSSL bindings by default (#17059)
Thanks, @ysbaddaden
- File.exists? (#17307), as fine as File::Info.readable?, .writable?, .executable? now obtain a follow_symlinks: false argument(#17391)
- Add Char::Reader.new(Bytes) (#17428)
- Add Time::Span#to_nanoseconds etc. (#17190)
- Add GC.syscall(&) (#17150)
- Fixed backtraces whenever linking alongside -static-pie on musl-libc (#17316)
Thanks, @straight-shoota, @ysbaddaden
- Uppercase case and category variables (#17160)
- HTTP::Request#local_address and #remote_address (#17260)
- LLVM::Type#size and #alignment (#17494)
Thanks, @straight-shoota, @hertzdevil
Updated distribution-scripts (#17178) brings upgrades of bundle dependencies, docker basis images etc.
Thanks, @straight-shoota
This is the archetypal publish featuring builds for aarch64-windows-msvc.
Thanks, @hertzdevil
Crystal established a onward compatibility guideline in RFC 30: Building Crystal 1.22 requires a stage-0 compiler at 1.14 or higher.
Thanks
We have been capable to do all of this gratitude to the continued assistance of 84codes and all another sponsors. To keep and addition the betterment pace, donations, and sponsorships are essential. OpenCollective is accessible for that.
Reach out to [email protected] if you’d akin to rotate into a straightforward sponsor or discover another ways to assistance Crystal. We appreciate you in advance!