
Crystal 1.22
We are announcing a new Crystal release 1.22.0 with several new features and bug
以下正文同步自 Hacker News,版权归原站所有,已转换为易读排版。
We are announcing a new Crystal release 1.22.0 with several new features and bug fixes.
Pre-built packages are available on GitHub Releases and our official distribution channels. See crystal-lang.org/install for installation instructions.
Section titled Stats
This release includes 251 changes since 1.21.1 by 33 contributors. We thank all the contributors for all the effort put into improving the language! ❤️
Section titled Changes
Below we list the most remarkable changes in the language, compiler, and stdlib. For more details, visit the full changelog.
Section titled Breaking: Exit on pipe error
Crystal processes exit immediately when writing to STDOUT or STDERR fails with EPIPE. This closely resembles the default behaviour of the SIGPIPE signal. Previously, the failing write would raise IO::Error, which typically prints an error message and exits. This error message is now removed (#17335).
You can opt out of this behaviour with STDOUT.exit_on_broken_pipe = false.
Section titled Constants with type declarations
Constants can have type declarations (#16951). They work exactly as you would expect the combination of constants and type declarations to be.
module Foo BAR : Int32 = 1 BAZ : String = "" QUX : Int64 = 123 # autocasts 123 to Int64 end
Thanks, @stakach
Section titled aarch64-linux promoted to Tier 1
The targets aarch64-linux-gnu and aarch64-linux-musl moved from Tier 2 to Tier 1. The only missing piece was that we were lacking official builds, but we have that since 1.19.
Section titled Breaking: Process.fork removed
Process.fork had been deprecated sine before 1.0 and now we finally removed it (#17367)
Section titled New Macros
New macros enable more text operations at compile time: StringLiteral#bytesize (#17176), NumberLiteral#chr (#17169) and RangeLiteral#each supports CharLiteral (#17170)
Thanks, @straight-shoota
Section titled Compiler
New constants Crystal::ALL_FLAGS and Crystal::USER_FLAGS provide access to the compile time flags (#17392).
Section titled DWARF refactor
We completely revamped DWARF parsing to enhance performance and reduce memory usage. The DWARF parser now scans sections on demand (#17283) and builds an efficient index table once (#17410, #17455), which results in blazingly fast look 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).
Section titled HTTP improvements
We merged numerous improvements and bug fixes for HTTP.
Thanks @straight-shoota, @hahwul, @jgaskins, @Sija
Section titled Eventloop
All targets support a native event loop based directly on the system selector and use it by default.
We enabled epoll on Solaris (#17370) and kqueue on all remaining BSD targets (#17421, #17420). libevent is still available as a fallback, but now it’s strictly opt-in and becoming technically obsolete. We expect to deprecate in a following release.
Section titled KernelTLS
We finally enabled support for Kernel TLS in the OpenSSL bindings by default (#17059)
Section titled Misc
File.exists? (#17307), as well as File::Info.readable?, .writable?, .executable? now receive 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 when linking with -static-pie on musl-libc (#17316)
Thanks, @straight-shoota, @ysbaddaden
Section titled Deprecations
Uppercase instance and class variables (#17160)
HTTP::Request#local_address and #remote_address (#17260)
LLVM::Type#size and #alignment (#17494)
Dependencies
Section titled Dependencies
Support for LLVM 23.1 and 24.0 (#17432)
Updated markd 0.6.0 (#17269)
Thanks, @straight-shoota, @hertzdevil
Section titled Packages
Updated distribution-scripts (#17178) brings upgrades of package dependencies, docker base images etc.
This is the first release featuring builds for aarch64-windows-msvc.
Section titled Maintainers
Crystal established a forward compatibility policy in RFC 30: Building Crystal 1.22 requires a stage-0 compiler at 1.14 or higher.
We have been able to do all of this thanks to the continued support of 84codes and all other sponsors. To maintain and increase the development pace, donations, and sponsorships are essential. OpenCollective is available for that.
Reach out to crystal@manas.tech if you’d like to become a direct sponsor or find other ways to support Crystal. We thank you in advance!
正文由 探How 从来源站点 RSS 同步,内容未经改写;遇到排版缺失或需要图片、视频时请以原文为准。