1.13.0 (2024-07-09)
Features
lang
- Allow rescuing exceptions that include a module (#14553, thanks @Blacksmoke16)
- (macros) Allow assignment to
_
inside macro expressions (#14452, thanks @HertzDevil)
stdlib
- (collection) Add
Array#insert_all
(#14486, thanks @summer-alice) - (collection) Improve compile time error for
#sort(&block : T, T -> U)
(#14693, thanks @beta-ziliani) - (concurrency) Add
WaitGroup
synchronization primitive (#14167, thanks @ysbaddaden) - (concurrency) Allow
Atomic
s of pointer types (#14401, thanks @HertzDevil) - (concurrency) Add
Thread.new
yields itself (#14543, thanks @ysbaddaden) - (concurrency) Add support for
Atomic(Bool)
(#14532, thanks @ysbaddaden) - (concurrency) Add
Thread.sleep(Time::Span)
(#14715, thanks @ysbaddaden) - (files) Implement
IO#tty?
in Win32 (#14421, thanks @HertzDevil) - (files) Implement
File.readable?
and.writable?
in Win32 (#14420, thanks @HertzDevil) - (files) Make
File.readable?
and.writable?
follow symlinks on Windows (#14514, thanks @HertzDevil) - (llvm) Add some missing
LLVM::Context
bindings (#14612, thanks @ysbaddaden) - (llvm) Do not strip the macOS target triple (#14466, thanks @hovsater)
- (log) Support
UInt32
andUInt64
in Log Context (#14459, thanks @toddsundsted) - (macros) Add AST node methods for macro-related nodes (#14492, thanks @HertzDevil)
- (macros) Support short blocks in
#[]
operator call's macro interpolation (#14523, thanks @HertzDevil) - (macros) Add macro methods for
Select
(#14600, thanks @HertzDevil) - (macros) Add
TypeNode#private?
,#public?
and#visibility
(#11696, thanks @Hadeweka) - (macros) Add
StringLiteral#to_utf16
(#14676, thanks @ysbaddaden) - (networking) Relax type restriction of handlers in
HTTP::Server.new
toIndexable(HTTP::Handler)
(#14413, thanks @hugopl) - (networking) [security] OpenSSL: don't change default cipher suites (#14655, thanks @ysbaddaden)
- (networking) Allow parsing cookies with space in the value (#14455, thanks @anton7c3)
- (runtime) Add
EventLoop::Socket
module (#14643, thanks @straight-shoota) - (runtime) Add
EventLoop::FileDescriptor
module (#14639, thanks @straight-shoota) - (runtime) Add
Crystal::Tracing
for runtime tracing (#14659, thanks @ysbaddaden) - (system) [security] [breaking] Disable implicit execution of batch files on Windows (#14557, thanks @straight-shoota)
- (system) Add
EventLoop#run(blocking)
andEventLoop#interrupt
(#14568, thanks @ysbaddaden) - (system) Add
Crystal::System::Time.ticks
(#14620, thanks @ysbaddaden) - (system) Add
Crystal::System::Thread.current_thread?
,#scheduler?
(#14660, thanks @ysbaddaden) - (system) Protect fork/exec on targets that don't support atomic CLOEXEC (#14674, thanks @ysbaddaden)
- (system) Add
Crystal::System.panic
(#14733, thanks @ysbaddaden) - (text) Add
Regex::MatchOptions
overload forString#index!
(#14462, thanks @HertzDevil) - (text) Add
StringPool#get?
(#14508, thanks @HertzDevil) - (text) Add
pkg_config
names forpcre2
andpcre
(#14584, thanks @straight-shoota) - (text) Add UUID v7 (#14732, thanks @jgaskins)
- (time) Add
Time::Error
(#14743, thanks @Blacksmoke16)
compiler
- (codegen) Add compiler flags
-Os
and-Oz
to optimize binary size (#14463, thanks @ysbaddaden) - (codegen) Add compiler support for AVR architecture (Arduino) (#14393, thanks @ysbaddaden)
tools
- (formatter) Allow new formatter styles for trailing comma and whitespace around proc literal (#14726, thanks @Blacksmoke16)
Bugfixes
lang
- (macros) Fix parsing of non-trailing
if
bodies inside macro expressions (#14505, thanks @HertzDevil) - (macros) Drop parentheses around
->
inside certain comma-separated lists (#14506, thanks @HertzDevil) - (macros) Fix indentation of
Select
nodes' macro interpolation (#14510, thanks @HertzDevil) - (macros) Fix indentation of parenthesized
Expressions#to_s
(#14511, thanks @HertzDevil)
stdlib
- (collection) [regression] Ensure
Enumerable#to_a
andEnumerable#tally
properly retain return type ofT
(#14447, thanks @Blacksmoke16) - (collection) [breaking] Never raise
IndexError
in#[]?(Range)
(#14444, thanks @HertzDevil) - (collection) [breaking] Fix
Set#to_a(&)
(#14519, thanks @meatball133) - (collection) Fix
Hash#rehash
to reset@first
(#14606, thanks @straight-shoota) - (collection) Fix macro interpolation in
NamedTuple#from
(#14790, thanks @HertzDevil) - (collection) [regression] Fix regression with
NamedTuple.new
when using key with a hyphen (#14785, thanks @Blacksmoke16) - (files) Allow
#fsync
and#flock_*
onIO::FileDescriptor
(#14432, thanks @HertzDevil) - (files) Make
IO::FileDescriptor#tty?
return false for NUL on Windows (#14509, thanks @HertzDevil) - (files) Fix blockless
IO::FileDescriptor
echo and raw mode methods (#14529, thanks @HertzDevil) - (files) Remove target path's forward slashes in
File.symlink
on Windows (#14522, thanks @HertzDevil) - (files) Fix
IO#same_content?
accepting prefix on second stream (#14664, thanks @straight-shoota) - (files) Fix overflow in
File#read_at
for large offsets on Windows (#14708, thanks @HertzDevil) - (files) Fix
IO::FileDescriptor.new
for closed fd (#14697, thanks @straight-shoota) - (files) Fix
IO::Delimited
reading into limited slice with peek (#14772, thanks @straight-shoota) - (files) Fix
Compress::Gzip
extra field (#14550, thanks @kojix2) - (log) delete source from builder cache when finalize (#14475, thanks @ysbaddaden)
- (networking) Fix
Socket#close
error handling on Windows (#14517, thanks @HertzDevil) - (networking) Set UTF-8 charset on directory listing in
HTTP::StaticFileHandler
(#14546, thanks @alexkutsan) - (networking) Don't pass socket file descriptors to subprocesses on Unix (
SOCK_CLOEXEC
) (#14632, thanks @carlhoerberg) - (networking) [security] OpenSSL: don't set default ECDH curve (#14656, thanks @ysbaddaden)
- (networking) [security] OpenSSL: deprecate Mozilla's TLS Server recommendation (#14657, thanks @ysbaddaden)
- (networking) use
SOCK_CLOEXEC
withFD_CLOEXEC
fallback (#14672, thanks @ysbaddaden) - (networking) [regression] Fix regression on
Socket#connect
timeout type restriction (#14755, thanks @straight-shoota) - (networking) Drop default timeout for
Socket#connect
on Windows (#14756, thanks @straight-shoota) - (networking) don't hardcode alpn protocol byte size (OpenSSL) (#14769, thanks @ysbaddaden)
- (numeric) Fix
BigRational#format
(#14525, thanks @meatball133) - (numeric) [regression] Restore leading zero in exponent for
printf("%e")
andprintf("%g")
(#14695, thanks @straight-shoota) - (runtime) Fix enable docs for builtin constants (#14571, thanks @straight-shoota)
- (runtime) Fix
GC.malloc
forgc_none
to clear memory (#14746, thanks @straight-shoota) - (serialization) Fix JSON discriminator for Bool
false
value (#14779, thanks @dammer) - (specs) Fix relative file paths in spec output (#14725, thanks @straight-shoota)
- (system) Fix using
System.retry_with_buffer
with stack buffer (#14615, thanks @straight-shoota) - (system) Harmonize close on exec for
Socket
&FileDescriptor
on Windows (#14634, thanks @ysbaddaden) - (system) Use
dup3
andpipe2
to setO_CLOEXEC
when available (#14673, thanks @ysbaddaden) - (system) Fix calls to
retry_with_buffer
when big buffer is necessary (#14622, thanks @BlobCodes) - (system) Fix
Process.run
with closed IO (#14698, thanks @straight-shoota) - (system) Prefer
strerror_r
overstrerror
for thread-safe errno (#14764, thanks @ysbaddaden) - (text) Make
String#sub
raiseIndexError
if index is equal to size (#14458, thanks @HertzDevil) - (text) Fix
libpcre2
version detection not working for-RC{N}
versions (#14478, thanks @Frityet) - (text) Fix
Regex#inspect
with non-literal-compatible options (#14575, thanks @straight-shoota) - (text) Fix ECR escape sequences containing
-
(#14739, thanks @HertzDevil)
compiler
- (codegen) Fix create new
target_machine
for every program (#14694, thanks @straight-shoota) - (codegen) Make
ReferenceStorage(T)
non-atomic ifT
is non-atomic (#14730, thanks @HertzDevil) - (codegen) Detect and error on failed codegen process (#14762, thanks @ysbaddaden)
- (codegen) Fix stats and progress issues in codegen (#14763, thanks @ysbaddaden)
- (debugger) Fix LLDB
crystal_formatters.py
for Python 3 (#14665, thanks @zw963) - (parser) Disallow assignments to calls with parentheses (#14527, thanks @HertzDevil)
- (parser) Fix parser validate UTF-8 on first input byte (#14750, thanks @straight-shoota)
- (semantic) Fix type def reopening type from parent namespace (#11208, thanks @straight-shoota)
- (semantic) Fix
Crystal::Path#to_macro_id
for global path (#14490, thanks @straight-shoota) - (semantic) Fix
Class#===
on metaclass (#11162, thanks @makenowjust)
tools
- (docs-generator) Fix generate docs for builtins
HOST_TRIPLE
andTARGET_TRIPLE
(#14570, thanks @straight-shoota) - (docs-generator) Decode URI component for search functionality in docs (#14645, thanks @nobodywasishere)
- (formatter) Fix formatting for short block inside
#[]
operator call (#14526, thanks @HertzDevil) - (formatter) Fix formatter to skip trailing comma for single-line parameters (#14713, thanks @Blacksmoke16)
Chores
stdlib
- (collection) Drop obsolete workaround in
Range#reverse_each
(#14709, thanks @yxhuvud) - (concurrency) Add
WaitGroup
todocs_main.cr
(#14624, thanks @straight-shoota) - (files) [deprecation] Move
File.readable?
,.writable?
,.executable?
toFile::Info
(#14484, thanks @straight-shoota) - (networking) Drop
Crystal::System::Socket#system_send
(#14637, thanks @straight-shoota) - (networking) Add type restriction
host : String
inTCPSocket
andAddrinfo
(#14703, thanks @straight-shoota) - (runtime) Fix abstract def parameter name in
LibEvent::EventLoop#send_to
(#14658, thanks @straight-shoota) - (runtime) [breaking] Drop unused methods in
IO::Evented
(#14666, thanks @straight-shoota) - (runtime) Drop
IO::Overlapped
(#14704, thanks @straight-shoota)
compiler
- (codegen) [breaking] Remove
CRYSTAL_LIBRARY_RPATH
and delay-load helper (#14598, thanks @HertzDevil)
Performance
stdlib
- (collection) Optimize
Hash
for repeated removals and insertions (#14539, thanks @HertzDevil) - (runtime) Remove unnecessary explicit memory barriers on ARM (#14567, thanks @ysbaddaden)
- (serialization) Optimize JSON parsing a bit (#14366, thanks @asterite)
- (text) Use wrapping arithmetic for
Int::Primitive#unsafe_chr
(#14443, thanks @HertzDevil) - (text) Optimize
String#index(Char)
and#rindex(Char)
for invalid UTF-8 (#14461, thanks @HertzDevil) - (text) Optimize
String#to_utf16
(#14671, thanks @straight-shoota)
Refactor
stdlib
- Remove unnecessary calls to
#unsafe_as(UInt64)
etc. (#14686, thanks @straight-shoota) - (crypto) Replace calls to
StaticArray(UInt8, 1)#unsafe_as(UInt8)
(#14685, thanks @straight-shoota) - (files) Remove calls to
LibC._setmode
(#14419, thanks @HertzDevil) - (files) Use file handles directly instead of C file descriptors on Win32 (#14501, thanks @HertzDevil)
- (files) Refactor win32
System::FileDescriptor#unbuffered_{read,write}
(#14607, thanks @straight-shoota) - (files) Extract
#system_read
and#system_write
forFileDescriptor
andSocket
(#14626, thanks @straight-shoota) - (files) Drop unused slice parameters of
#evented_*
methods (#14627, thanks @straight-shoota) - (networking) Refactor use
IO#read_byte
instead of#read_char
inHTTP::ChunkedContent
(#14548, thanks @straight-shoota) - (runtime)
Thread
owns its current fiber (instead ofCrystal::Scheduler
) (#14554, thanks @ysbaddaden) - (runtime) Use
Fiber#enqueue
(#14561, thanks @ysbaddaden) - (runtime) Add
Crystal::EventLoop.current
(#14559, thanks @ysbaddaden) - (runtime) Add
Fiber.suspend
(#14560, thanks @ysbaddaden) - (runtime) Remove
OverlappedOperation#synchronous
(#14663, thanks @straight-shoota) - (runtime) Rename
Crystal::Iocp
toCrystal::IOCP
(#14662, thanks @straight-shoota) - (runtime) Unify
EventLoop.create
(#14661, thanks @straight-shoota) - (serialization) Replace
type
declarations for void pointers withalias
inlibxml2
(#14494, thanks @straight-shoota) - (serialization) Refactor
JSON::Any#size
to use two branches instead of three (#14533, thanks @meatball133) - (specs) Move
Spec
context state intoSpec::CLI
(#14259, thanks @HertzDevil) - (system) Update
WinError#to_errno
(#14515, thanks @HertzDevil) - (system) Rename
Crystal::System.print_error(fmt, *args, &)
toprintf
(#14617, thanks @ysbaddaden) - (system) Refactor
Crystal::System.retry_with_buffer
calling#to_slice
(#14614, thanks @straight-shoota) - (system) Extract system implementation of
UNIXSocket.pair
asCrystal::System::Socket.socketpair
(#14675, thanks @ysbaddaden) - (system) Remove calls to
Pointer.new(Int)
(#14683, thanks @straight-shoota) - (system) Cleanup for
IOCP::OverlappedOperation
(#14723, thanks @straight-shoota) - (system) Refactor
IOCP::OverlappedOperation
internalizehandle
andwait_for_completion
(#14724, thanks @straight-shoota)
compiler
- (codegen) Add
Program#size_t
andTarget#size_bit_width
(#14442, thanks @ysbaddaden) - (parser) Replace
Crystal::Select::When
withCrystal::When
(#14497, thanks @HertzDevil)
Documentation
stdlib
- (collection) Fix doc for
Set#proper_superset_of?
(#14516, thanks @meatball133) - (collection) Fix result formatting in code example for
Indexable#[]?
(#14721, thanks @meatball133) - (concurrency) Fix example for
WeakRef
by removingref.value
call (#10846, thanks @hugopl) - (networking) Improve API docs for
Socket#send
(#14638, thanks @straight-shoota) - (networking) Add documentation for
HTTP::WebSocket#stream
(#14537, thanks @meatball133) - (numeric) Add documentation for complex methods inside Number (#14538, thanks @meatball133)
- (runtime) Add documentation for standard streams blocking behaviour (#14577, thanks @straight-shoota)
- (serialization) Fix docs for
CSV::Builder#row(&)
(#14736, thanks @philipp-classen) - (system) [breaking] Undocument
IO::Evented
(#14749, thanks @straight-shoota) - (system) Fix code example for
Process.on_terminate
(#14798, thanks @philipp-classen) - (text) Fix docs for
Char#ascii_number?
stating wrong minium base (#14521, thanks @meatball133) - (text) Enhance documentation for regex options
NO_UTF_CHECK
(#14542, thanks @straight-shoota)
Specs
stdlib
- Remove incorrect uses of
describe
(#14757, thanks @HertzDevil) - (files) Add spec for
Compress::Gzip::Writer
withextra
(#14788, thanks @straight-shoota) - (runtime) Add specs for
Pointer::Appender
(#14719, thanks @straight-shoota) - (text) Add test helper for
normalize/regex_spec
(#14545, thanks @straight-shoota)
Infrastructure
- Changelog for 1.13.0 (#14712, thanks @straight-shoota)
- Update previous Crystal release 1.12.1 (#14480, thanks @straight-shoota)
- Highlight regression bugfixes in changelog (#14474, thanks @straight-shoota)
- Write release version to
src/VERSION
inupdate-changelog
andrelease-update
(#14547, thanks @straight-shoota) - Fix
shell.nix
usellvmPackages.bintools
with wrapper for rpath config (#14583, thanks @straight-shoota) - Add
src/SOURCE_DATE_EPOCH
to release tree (#14574, thanks @straight-shoota) - Update distribution-scripts (#14562, thanks @straight-shoota)
- Update distribution-scripts (#14594, thanks @straight-shoota)
- Use
boehmgc
package from nixpkgs inshell.nix
(#14591, thanks @straight-shoota) - Simplify LLVM dependency in
shell.nix
(#14590, thanks @straight-shoota) - Fix nixpkgs
pkg-config
name inshell.nix
(#14593, thanks @straight-shoota) - Update previous Crystal release 1.12.2 (#14647, thanks @straight-shoota)
- Update distribution-scripts (#14648, thanks @straight-shoota)
- Update distribution-scripts (#14714, thanks @straight-shoota)
- Update distribution-scripts (#14776, thanks @straight-shoota)
- Fix changelog generator increase topic priority for
infrastructure
(#14781, thanks @straight-shoota) - Remove
SetShouldExit
in Powershell wrapper (#13769, thanks @straight-shoota) - (ci) Run
primitives_spec
with the interpreter on CI (#14438, thanks @HertzDevil) - (ci) Add LLVM 18 to LLVM CI (#14565, thanks @HertzDevil)
- (ci) Update to Ruby 3 in macOS circleCI runner (#14777, thanks @straight-shoota)
- (ci) Distribute
shards.pdb
on Windows (#14415, thanks @HertzDevil) - (ci) Drop Windows CI workaround for 1.12.0-dev (#14483, thanks @HertzDevil)