Language changes
- (breaking-change) Let
case when
be non-exhaustive, introducecase in
as exhaustive. (#9258, #9045, thanks @asterite) - Allow
->@ivar.foo
and->@@cvar.foo
expressions. (#9268, thanks @makenowjust)
Macros
Standard library
- (breaking-change) Refactor to standardize on first argument for methods receiving
IO
. (#9134, #9289, #9303, #9318, thanks @straight-shoota, @bcardiff, @oprypin) - (breaking-change) Cleanup Digest and OpenSSL::Digest. (#8426, thanks @didactic-drunk)
- Fix
Enum#to_s
for private enum. (#9126, thanks @straight-shoota) - Refactor
Benchmark::IPS::Entry
to useUInt64
inbytes_per_op
. (#9081, thanks @jhass) - Add
Experimental
annotation and doc label. (#9244, thanks @bcardiff) - Add subcommands to
OptionParser
. (#9009, #9133, thanks @RX14, @Sija) - Make
NamedTuple#sorted_keys
public. (#9263, thanks @waj) - Fix example codes in multiple places. (#9203, thanks @maiha)
Macros
- (breaking-change) Remove top-level
assert_responds_to
macro. (#9085, thanks @bcardiff) - (breaking-change) Drop top-level
parallel
macro. (#9097, thanks @bcardiff) - Fix lazy property not forwarding annotations. (#9140, thanks @asterite)
- Add
host_flag?
macro method, not affected by cross-compilation. (#9049, thanks @oprypin) - Add
.each
and.each_with_index
to various macro types. (#9120, thanks @Blacksmoke16) - Add
StringLiteral#titleize
macro method. (#9269, thanks @makenowjust) - Add
TypeNode
methods to check what "type" the node is. (#9270, thanks @Blacksmoke16) - Fix support
TypeNode.name(generic_args: false)
for generic instances. (#9224, thanks @Blacksmoke16)
Numeric
- (breaking-change) Add
Int#digits
, reverseBigInt#digits
result. (#9383, thanks @asterite) - Fix overflow checking for operations with mixed sign. (#9403, thanks @waj)
- Add
BigInt#factorial
using GMP. (#9132, thanks @peheje)
Text
- Add
String#titleize
. (#9204, thanks @hugopl) - Add
Regex#matches?
andString#matches?
. (#8989, thanks @makenowjust) - Add
IO
overloads to variousString
case methods. (#9236, thanks @Blacksmoke16) - Improve docs examples regarding
Regex::MatchData
. (#9010, thanks @makenowjust) - Improve docs on
String
methods. (#8447, thanks @jan-zajic)
Collections
- (breaking-change) Add
Enumerable#first
with fallback block. (#8999, thanks @makenowjust) - Fix
Array#delete_at
bug with negative start index. (#9399, thanks @asterite) - Fix
Enumerable#{zip,zip?}
when self is anIterator
. (#9330, thanks @mneumann) - Make
Range#each
andRange#reverse_each
work better with end/begin-less values. (#9325, thanks @asterite) - Improve docs on
Hash
. (#8887, thanks @rdp)
Serialization
- (breaking-change) Deprecate
JSON.mapping
andYAML.mapping
. (#9272, thanks @straight-shoota) - (breaking-change) Make
INI
a module. (#9408, thanks @j8r) - Fix integration between
record
macro andJSON::Serializable
/YAML::Serializable
regarding default values. (#9063, thanks @Blacksmoke16) - Fix
XML.parse
invalid mem access in multi-thread. (#9098, thanks @bcardiff, @asterite) - Fix double string escape in
XML::Node#content=
. (#9300, thanks @straight-shoota) - Improve xpath regarding namespaces. (#9288, thanks @asterite)
- Escape CDATA end sequences. (#9230, thanks @Blacksmoke16)
- Add
JSON
andYAML
serialization toPath
. (#9156, thanks @straight-shoota) - Specify pkg-config name for
libyaml
. (#9426, thanks @jhass) - Specify pkg-config name for
libxml2
. (#9436, thanks @Blacksmoke16) - Make YAML specs robust against libyaml 0.2.5. (#9427, thanks @jhass)
Time
- (breaking-change) Support different number of fraction digits for RFC3339 time format. (#9283, thanks @waj)
- Fix parsing AM/PM hours. (#9334, thanks @straight-shoota)
- Improve
File.utime
precision from second to 100-nanosecond on Windows. (#9344, thanks @kubo)
Files
- (breaking-change) Move
Flate
,Gzip
,Zip
,Zlib
toCompress
. (#8886, thanks @bcardiff) - (breaking-change) Cleanup
File
&FileUtils
. (#9175, thanks @bcardiff) - Fix realpath on macOS 10.15 (Catalina). (#9296, thanks @waj)
- Fix
File#pos
,File#seek
andFile#truncate
over 2G on Windows. (#9015, thanks @kubo) - Fix
File.rename
to overwrite the destination file on Windows, like elsewhere. (#9038, thanks @oprypin) - Fix
File
's specs and related exception types on Windows. (#9037, thanks @oprypin) - Add support for
Path
arguments to multiple methods. (#9153, thanks @straight-shoota) - Add
Path#each_part
iterator. (#9138, thanks @straight-shoota) - Add
Path#relative_to
. (#9169, thanks @straight-shoota) - Add support for
Path
pattern toDir.glob
. (#9420, thanks @straight-shoota) - Implement
File#fsync
on Windows. (#9257, thanks @kubo) - Refactor
Path
regarding empty and.
. (#9137, thanks @straight-shoota)
Networking
- (breaking-change) Make
IO#skip
,IO#write
returns the number of bytes it skipped/written asInt64
. (#9233, #9363, thanks @bcardiff) - (breaking-change) Improve error handling and logging in
HTTP::Server
. (#9115, #9034, thanks @waj, @straight-shoota) - (breaking-change) Change
HTTP::Request#remote_address
type toSocket::Address?
. (#9210, thanks @waj) - Fix
flush
methods to always flush underlyingIO
. (#9320, thanks @straight-shoota) - Fix
HTTP::Server
sporadic failure in SSL handshake. (#9177, thanks @waj) WebSocket
shouldn't reply with same close code. (#9313, thanks @waj)- Ignore response body during
WebSocket
handshake. (#9418, thanks @waj) - Treat cookies which expire in this instant as expired. (#9061, thanks @RX14)
- Set
sync
orflush_on_newline
for standard I/O on Windows. (#9207, thanks @kubo) - Prefer HTTP basic authentication in OAuth2 client. (#9127, thanks @crush-157)
- Defer request upgrade in
HTTP::Server
(aka: WebSockets). (#9243, thanks @waj) - Improve
URI::Punycode
,HTTP::WebSocketHandler
,HTTP::Status
documentation. (#9068, #9130, #9180, thanks @Blacksmoke16, @dscottboggs, @wontruefree) - Remove
HTTP::Params::Builder#to_s
, use underlyingIO
directly. (#9319, thanks @straight-shoota) - Fixed some regular failing specs in multi-thread mode. (#9412, thanks @bcardiff)
Crypto
- (security) Update SSL server secure defaults. (#9026, thanks @straight-shoota)
- Add LibSSL
NO_TLS_V1_3
option. (#9350, thanks @lun-4)
Logging
- (breaking-change) Rename
Log::Severity::Warning
toWarn
. DropVerbose
. AddTrace
andNotice
. (#9293, #9107, #9316, thanks @bcardiff, @paulcsmith) - (breaking-change) Allow local data on entries via
Log::Metadata
and redesignLog::Context
. (#9118, #9227, #9150, #9157, thanks @bcardiff, @waj) - (breaking-change) Split top-level
Log::Metadata
fromLog::Metadata::Value
, drop immutability via clone, improve performance. (#9295, thanks @bcardiff) - (breaking-change) Rework
Log.setup_from_env
and defaults. (#9145, #9240, thanks @bcardiff) - Add
Log.capture
spec helper. (#9201, thanks @bcardiff) - Redesign
Log::Formatter
. (#9211, thanks @waj) - Add
to_json
forLog::Context
. (#9101, thanks @paulcsmith) - Add
Log::IOBackend#new
withformatter
named argument. (#9105, #9434, thanks @paulcsmith, @bcardiff) - Allow
nil
as context raw values. (#9121, thanks @bcardiff) - Add missing
Log#with_context
. (#9058, thanks @bcardiff) - Fix types referred in documentation. (#9117, thanks @bcardiff)
- Allow override context within logging calls. (#9146, thanks @bcardiff)
- Check severity before backend. (#9400, thanks @asterite)
Concurrency
- (breaking-change) Drop
Concurrent::Future
and top-level methodsdelay
,future
,lazy
. Use crystal-community/future.cr. (#9093, thanks @bcardiff)
System
- (breaking-change) Deprecate
Process#kill
, useProcess#signal
. (#9006, thanks @oprypin, @jan-zajic) Process
raisesIO::Error
(or subclasses). (#9340, thanks @waj)- Add
Process.quote
and fix shell usages in the compiler. (#9043, #9369, thanks @oprypin, @bcardiff) - Implement
Process
support on Windows. (#9047, #9021, #9122, #9112, #9149, #9310, thanks @oprypin, @RX14, @kubo, @jan-zajic) - Fix compile-time checking of
dup3
/clock_gettime
methods definition. (#9407, thanks @asterite) - Use
Int64
as portableProcess.pid
type. (#9019, thanks @oprypin)
Runtime
- (breaking-change) Deprecate top-level
fork
. (#9136, thanks @bcardiff) - (breaking-change) Move
Debug
toCrystal
namespace. (#9176, thanks @bcardiff) - Fix segfaults when static linking with musl. (#9238, thanks @waj)
- Allow calling
at_exit
insideat_exit
. (#9388, thanks @asterite) - Rework DWARF loading and fix empty backtraces in musl. (#9267, thanks @waj)
- Add DragonFly(BSD) support. (#9178, thanks @mneumann)
- Add
Crystal::System::Process
to split out system-specific implementations. (#9035, thanks @oprypin) - Move internal
CallStack
toException::CallStack
. (#9076, thanks @bcardiff) - Specify pkg-config name for
libevent
. (#9395, thanks @jhass)
Spec
- Reference global Spec in
be_a
macro. (#9066, thanks @asterite) - Add
-h
short flag to spec runner. (#9164, thanks @straight-shoota) - Fix
crystal spec
file paths on Windows. (#9234, thanks @oprypin) - Refactor spec hooks. (#9090, thanks @straight-shoota)
Compiler
- (breaking-change) Improve compiler single-file run syntax to make it shebang-friendly
#!
. (#9171, thanks @RX14) - (breaking-change) Use
Process.quote
forcrystal env
output. (#9428, thanks @makenowjust) - (breaking-change) Simplify
Link
annotation handling. (#8972, thanks @RX14) - Fix parsing of
foo:"bar"
inside call or named tuple. (#9033, thanks @asterite) - Fix parsing of anonymous splat and block arg. (#9113, thanks @makenowjust)
- Fix parsing of
unless
inside macro. (#9024, #9167, thanks @makenowjust) - Fix parsing of
\
(backslash + space) inside regex literal to - Fix parsing of ambiguous '+' and '-'. (#9194, thanks @max-codeware)
- Fix parsing of capitalized named argument. (#9232, thanks @asterite)
- Fix parsing of
{[] of Foo, self.foo}
expressions. (#9329, thanks @makenowjust) - Fix cast fun function pointer to Proc. (#9287, thanks @asterite)
- Make compiler warn on deprecated macros. (#9343, thanks @bcardiff)
- Basic support for Win64 C lib ABI. (#9387, thanks @oprypin)
- Make the compiler able to run on Windows and compile itself. (#9054, #9062, #9095, #9106, #9307, thanks @oprypin, @Sija)
- Add docs regarding
CRYSTAL_OPTS
. (#9018, thanks @straight-shoota) - Remove
Process.run("which")
from compiler. (#9141, thanks @straight-shoota) - Refactor type parser. (#9208, thanks @makenowjust)
- Refactor & clean-up in compiler. (#8781, #9195, thanks @rhysd, @straight-shoota)
- Refactor
CrystalPath::Error
. (#9359, thanks @straight-shoota) - Refactor and improvements on spec_helper. (#9367, #9059, #9393, #9351, #9402, thanks @straight-shoota, @jhass, @oprypin)
- Split general ABI specs from x86_64-specific ones, run on every platform. (#9384, thanks @oprypin)
Language semantics
- Fix
RegexLiteral#to_s
output when first character of literal is whitespace. (#9017, thanks @makenowjust) - Fix autocasting in multidispatch. (#9004, thanks @asterite)
- Fix propagation of annotations into other scopes. (#9125, thanks @asterite)
- Fix yield computation inside macro code. (#9324, thanks @asterite)
- Fix incorrect type generated with
as?
when type is a union. (#9417, #9435, thanks @asterite) - Don't duplicate instance var in inherited generic type. (#9433, thanks @asterite)
- Ensure
type_vars
works for generic modules. (#9161, thanks @toddsundsted) - Make autocasting work in default values against unions. (#9366, thanks @asterite)
- Skip no closure check for non-Crystal procs. (#9248, thanks @jhass)
Debugger
- Improve debugging support. (#8538, thanks @skuznetsov)
- Move recent additions to
DIBuilder
toLLVMExt
. (#9114, thanks @bcardiff)
Tools
Formatter
- Fix formatting of regex after some comments. (#9109, thanks @makenowjust)
- Fix formatting of
&.!
. (#9391, thanks @makenowjust) - Avoid crash on heredoc with interpolations. (#9382, thanks @makenowjust)
- Refactor: code clean-up. (#9231, thanks @makenowjust)
Doc generator
- Fix links to methods with
String
default values. (#9200, thanks @bcardiff) - Fix syntax highlighting of heredoc. (#9396, thanks @makenowjust)
- Correctly attach docs before annotations to following types. (#9332, thanks @asterite)
- Allow annotations and
:ditto:
in macro. (#9341, thanks @bcardiff) - Add project name and version to API docs. (#8792, thanks @straight-shoota)
- Add version selector to API docs. (#9074, #9187, #9250, #9252, #9254, thanks @straight-shoota, @bcardiff)
- Show input type path instead of full qualified path on generic. (#9302, thanks @makenowjust)
- Remove README link in API docs. (#9082, thanks @straight-shoota)
- Remove special handling for version tags in docs generator. (#9083, thanks @straight-shoota)
- Refactor
is_crystal_repo
based on project name. (#9070, thanks @straight-shoota) - Refactor
Docs::Generator
source link generation. (#9119, #9305, thanks @straight-shoota)
Playground
- Allow building compiler without 'playground', to avoid dependency on sockets. (#9031, thanks @oprypin)
- Add support to jquery version 3. (#9028, thanks @deiv)
Others
- CI improvements and housekeeping. (#9012, #9129, #9242, #9370, thanks @bcardiff)
- Update to Shards 0.11.1. (#9446, thanks @bcardiff)
- Tidy up Makefile and crystal env output. (#9423, thanks @bcardiff)
- Always include
lib
directory in theCRYSTAL_PATH
. (#9315, thanks @waj) - Use
SOURCE_DATE_EPOCH
only to determine compiler date. (#9088, thanks @straight-shoota) - Win CI: Bootstrap Crystal, build things on Windows, publish the binary. (#9123, #9155, #9144, #9346, thanks @oprypin)
- Regenerate implementation tool sample. (#9003, thanks @nulty)
- Avoid requiring non std-lib spec spec_helper. (#9294, thanks @bcardiff)
- Improve grammar and fix typos. (#9087, #9212, #9368, thanks @makenowjust, @j8r)
- Hide internal functions in docs. (#9410, thanks @bcardiff)
- Advertise full
crystal spec
command for running a particular spec. (#9103, thanks @paulcsmith) - Update README. (#9225, #9163, thanks @danimiba, @straight-shoota)
- Fix LICENSE and add NOTICE file. (#3903, thanks @makenowjust)