Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
1.19.1
Bugfixes
stdlib
- (concurrency) [regression] Fix kqueue timer duration calculation (#16581, thanks @skuznetsov)
- (concurrency) [regression] time calculations in IOCP and Monitor thread (#16583, thanks @ysbaddaden)
Infrastructure
- Changelog for 1.19.1 (#16590, thanks @ysbaddaden)
1.19.0
Breaking changes
stdlib
- (crypto) Require OpenSSL 1.1.1+ or LibreSSL 3+ (#16480, thanks @ysbaddaden)
Features
lang
- (macros) [breaking] Add compiler flag values (#16310, thanks @straight-shoota)
- (macros) Add yielding variant of
StringLiteral#gsub(#16378, thanks @Blacksmoke16) - (macros) Support
StringLiteral#split(RegexLiteral)(#16423, thanks @HertzDevil) - (macros) Add
StringLiteral#match(#16464, thanks @HertzDevil) - (macros) Make all overloads of
ArrayLiteral#[]returnnilon out of bounds (#16453, thanks @HertzDevil)
stdlib
- (collection) Add
NamedTuple#reverse_merge(#16229, thanks @andrykonchin) - (collection) Pad
Hash#inspect,Tuple#inspectbefore{from first element (#16245, thanks @andrykonchin) - (collection) Add
Set#map!(#16271, thanks @andrykonchin) - (collection) Add
Hash#transform_keys!(#16280, thanks @andrykonchin) - (collection) Enhance error message for
Hash#[]when key is wrong type for default block (#16442, thanks @Blacksmoke16) - (concurrency) Add
Sync::MutexandSync::RWLock(#16399, thanks @ysbaddaden) - (concurrency) Add
Sync::ConditionVariable(#16440, thanks @ysbaddaden) - (concurrency) Import
Sync::ExclusiveandSync::Shared(#16487, thanks @ysbaddaden) - (crypto) Add
OpenSSL::SSL::Context::Server#on_server_namefor SNI (#16452, #16525, thanks @carlhoerberg, @straight-shoota) - (networking) Loosen type restrictions in
StaticFileHandlerhelper methods fromFiletoIO(#16238, thanks @andrykonchin) - (networking) Add
IPSocket#ipv6_only(#16347, thanks @stakach) - (networking) Expose
flagshint forgetaddrinfo(#16528, thanks @stakach) - (numeric) Add
Int.from_digitsas inverse ofInt#digits(#16237, #16566, thanks @andrykonchin, @ysbaddaden) - (numeric) Add
BigInt.from_digits(#16259, thanks @HertzDevil) - (numeric) Add
Int#tdivmod(#16258, thanks @andrykonchin) - (runtime) Add
Proc#[]as alias to#call(#16220, thanks @andrykonchin) - (runtime) Add
#unshift,#popand#pop?toCrystal::PointerLinkedList(#16287, thanks @ysbaddaden) - (runtime) Add
Random.next_booland.next_int(#16297, thanks @ysbaddaden) - (runtime) Add
Random#splitand#split_internalAPI for splittable PRNGs (#16342, #16495, thanks @ysbaddaden) - (runtime) Add
Pointer#fill(#16338, thanks @straight-shoota) - (runtime) Add
Crystal::PointerLinkedList#first?(#16400, thanks @ysbaddaden) - (runtime) Ensure single reader and writer to system fd on Unix (#16209, thanks @ysbaddaden)
- (runtime) Protect
Box.unboxfrom dereferencing null pointer (#16514, thanks @straight-shoota) - (runtime) Register execution context schedulers with the event loop (#16519, thanks @ysbaddaden)
- (runtime) Add
Fiber::ExecutionContext::Scheduler.current?(#16521, thanks @ysbaddaden) - (runtime) Move execution context event loop lock to each event loop (#16520, thanks @ysbaddaden)
- (serialization) Support deserialization of YAML anchors of value types (#16186, thanks @HertzDevil)
- (serialization) Add end locations to scalars and aliases in
YAML::Nodes.parse(#16187, thanks @HertzDevil) - (serialization) Set
JSON::SerializableError#attributewhen appropriate (#16158, thanks @spuun) - (serialization) Support large JSON files (#16211, thanks @RX14)
- (serialization) Add
YAML::Nodes.parse_all(#16247, thanks @HertzDevil) - (specs) Rescale execution context in spec runner with
CRYSTAL_WORKERS(#16444, #16471, thanks @straight-shoota, @ysbaddaden) - (system) Add
Process.debugger_present?for Windows and Linux (#16248, thanks @HertzDevil) - (system) Implement
execvpe_impl(#16322, #16344, thanks @straight-shoota) - (system) Add
::exit(Process::Status)(#16436, thanks @straight-shoota) - (system) Standardize system error codes for
File::Error(#16024, thanks @straight-shoota) - (system) Add
Path#relative?(#16473, thanks @Sija) - (text) PCRE2: use thread local for jit stack and match data (#16175, thanks @ysbaddaden)
- (text) Support 0X, 0O, 0B prefixes in string to integer conversion (#16226, thanks @andrykonchin)
- (text) Add
String#each_lineparameterremove_empty(#16232, thanks @andrykonchin) - (time) Add
weeksparameter toTime::Span.new(#16208, thanks @Sija) - (time) Treat GMT as a legacy alias of UTC (#16292, thanks @straight-shoota)
- (time) Add
/etc/zoneinfoto zoneinfo lookup paths (#16463, thanks @straight-shoota) - (time) Add support for
$TZDIR(#16466, thanks @straight-shoota) - (time) Add
Time::Instant(#16490, thanks @straight-shoota) - (time) [breaking] Adjust monotonic clocks to include suspended time with precision (#16516, thanks @straight-shoota)
compiler
- (codegen) Build compiler with
-Dexecution_context(#16447, #16502, thanks @ysbaddaden, @straight-shoota) - (interpreter) Support
->LibX.fun_namein the interpreter (#16194, thanks @ysbaddaden) - (semantic) Add error message to
CrystalPath::NotFoundError(#16365, thanks @willhbr) - (semantic) Retain original location for errors in
included,extendedhooks (#13261, thanks @Blacksmoke16)
tools
- (docs-generator) Add optional sanitizer to docs generator (#14646, #16251, thanks @nobodywasishere, @straight-shoota)
Bugfixes
lang
- (macros) Fix nested sigil delimiter parsing inside macros (#16266, thanks @HertzDevil)
stdlib
- Fix
OptionParsersubcommand help to respect customsummary_indent([#16334], thanks @kojix2) - (collection) Fix
Hashmethods to retaincompare_by_identityflag ([#16356], thanks @andrykonchin) - (collection) Fix Hash methods and retaining default value ([...
1.18.2
Bugfixes
stdlib
- (files) [regression] Revert type restriction for
IO#read_bytes(#16231, thanks @straight-shoota) - (runtime) Fix
Fiber::ExecutionContext.default_workers_countto avoid taking into account unsupported values (#16227, thanks @Sija)
Infrastructure
- Changelog for 1.18.2 (#16243, thanks @matiasgarciaisaia)
1.18.1
Bugfixes
stdlib
- (networking) [regression] Revert adding type restrictions on
HTTP::WebSocket#sendetc. (#16218, thanks @straight-shoota)
compiler
- (parser) [regression] Fix allow space after base type in enum def (#16217, thanks @straight-shoota)
Infrastructure
- Changelog for 1.18.1 (#16224, thanks @matiasgarciaisaia)
1.18.0
Features
lang
- Support
ProcPointers of lib funs with parameter types (#16089, thanks @HertzDevil) - (annotations) Print deprecation warning on types and aliases (#15962, thanks @ysbaddaden)
- (annotations) Print deprecation warnings on deprecated method argument (#15999, thanks @ysbaddaden)
- (macros) [breaking] Expand empty
(Named)TupleLiteralto(Named)Tuple.newinstead of{}(#16108, thanks @spuun) - (macros) Add
ArrayLiteral#*,StringLiteral#*andTupleLiteral#*(#16154, #16206, thanks @jneen, @ysbaddaden)
stdlib
- Add
summary_widthandsummary_indenttoOptionParser(#15326, thanks @kojix2) - (collection) Add
Set#select!and#reject!(#16060, thanks @HertzDevil) - (concurrency) Speed up
Parallel::Scheduler#quick_dequeue?formax=1(#15961, thanks @ysbaddaden) - (concurrency) Default execution context is now parallel (MT:1) (#16136, thanks @ysbaddaden)
- (files) [deprecation] Add
.set_blockingtoSocketandIO::FileDescriptorand deprecate#blockingproperty (#16033, #16129, thanks @ysbaddaden) - (llvm) Support LLVM 21.1 and 22.0 (#16062, #16198, thanks @HertzDevil, @straight-shoota)
- (macros) Add
NumberLiteral#zero?(#10248, thanks @Sija) - (macros) Add
thread_localmacro (#16173, thanks @ysbaddaden) - (networking) Fix
URI#host=to wrap IPv6 address in brackets (#16164, thanks @stakach) - (runtime) Lazily instantiate the event loop of isolated execution contexts (#16063, thanks @ysbaddaden)
- (runtime) Add
Fiber::ExecutionContext::Parallel#resize(#15956, thanks @ysbaddaden) - (runtime) Add
Crystal::System.effective_cpu_count(#16148, thanks @ysbaddaden) - (runtime) Improve
Fiber::ExecutionContext.default_workers_count(#16149, thanks @ysbaddaden) - (serialization) Add
Time::Location.from_json_object_key(#15957, thanks @Sija) - (serialization) Resolve YAML aliases in
YAML::Any(#15941, thanks @willhbr) - (serialization) Embed libxml2 version number on Windows MSVC (#16104, thanks @HertzDevil)
- (serialization) Add
JSON::Anywrapper aroundJSON::Any#inspectoutput (#15979, thanks @jneen) - (specs) Add
with_tempdirspec helper (#16005, thanks @straight-shoota) - (system) Add
File.readlink?(#16004, thanks @straight-shoota) - (text) Add
SemanticVersion.valid?&SemanticVersion.parse?(#15051, thanks @devnote-dev) - (text) Add
String.additive_identity(#15998, thanks @straight-shoota) - (text) Use proper ANSI reset codes in
Colorize(#16052, thanks @Blacksmoke16) - (text) Update Unicode to 17.0.0 (#16160, thanks @HertzDevil)
- (time) Use canonical IANA name for the local Windows system time zone (#15967, thanks @HertzDevil)
- (time) Load
Location.localby symlink name (#16002, #16022, thanks @straight-shoota) - (time) Add
Time::Location.load?(#16121, thanks @straight-shoota) - (time) Format
Time#inspectwith Internet Extended Date/Time Format (#16039, thanks @straight-shoota)
compiler
- (cli) Add the ability to dump type information to a JSON file (#16027, thanks @HertzDevil)
- (interpreter) Support
Proc.new(Void*, Void*)in the interpreter (#16044, thanks @HertzDevil) - (interpreter:repl) Fully exit the process on
exit!from REPL (#16171, thanks @jneen) - (semantic) Resolve types when guessing return type from class method overloads (#16118, thanks @HertzDevil)
- (semantic) Guess instance variable types from global method calls (#16119, thanks @HertzDevil)
tools
- (docs-generator) Add support for deprecated parameters in doc generator (#16012, thanks @straight-shoota)
- (hierarchy) Show extern union types in hierarchy tool (#16026, thanks @HertzDevil)
Bugfixes
stdlib
- (files) Fix
fcntlreference forfds[1]in socketpair setup (#16072, thanks @kojix2) - (log) Make crystal log resilient to empty LOG_LEVEL env var (#15963, thanks @anaPerezGhiglia)
- (networking) Preserve query params in
StaticFileHandlerredirects (#15789, thanks @syeopite) - (networking) Fix
StaticFileHandlerto return 404 on file error (#16025, #16077, thanks @straight-shoota) - (networking) Run
before_requestcallback inHTTP::Clientonly once (#16064, thanks @straight-shoota) - (networking) Fix
HTTP::Request#query=typing (#16143, thanks @Blacksmoke16) - (runtime)
Fiber::ExecutionContext::Parallel::Scheduler#tickmust be unsigned (#16155, thanks @ysbaddaden) - (serialization) Fix add missing
#==overloads forLog::Metadata::ValueandYAML::Any(#15732, thanks @straight-shoota) - (serialization) Fix pointer access bug in
XML::NodeSet(#16055, thanks @toddsundsted) - (serialization) Remove
NOERRORfrom LibXML default options (#16103, thanks @straight-shoota) - (serialization) Move
*::Serializable's private constructors intomacro includedhook (#16147, thanks @HertzDevil) - (serialization) Correctly reference global JSON/YAML modules (#16161, #16169, thanks @Sija, @straight-shoota)
- (serialization) Fix element type inference in
YAML::ArrayConverter.from_yaml(#16166, thanks @HertzDevil) - (system) Fix return type of
system_close_on_exec=on Windows (#16095, thanks @straight-shoota) - (time) Fix time zone identifier
America/Argentina/Buenos_Aires(#16078, thanks @straight-shoota) - (time) Fix
Time#at_beginning_of_week,#at_end_of_weekto respect local timezone (#16113, thanks @straight-shoota)
compiler
- (codegen) Never generate assignments to a block's underscore parameters ([#16057], thanks @HertzDevil)
- (codegen) Fix
@[Primitive]codegen for typedefs ([#16110], thanks @HertzDevil) - (interpreter) never generate assignments to a block's underscore parameters ([#16058], thanks @HertzDevil)
- (interpreter) Add
writer.close_on_finalize = falsefor signal pipe ([#16167], thanks @straight-shoota) - (interpreter:repl) Continue REPL prompt if input consists entirely of annotations ([#16045], thanks @HertzDevil)
- (parser) Disall...
1.17.1
Bugfixes
tools
- (docs-generator) [regression] Revert "Handle doc locations when file is in parent directory" (#15996, thanks @Blacksmoke16)
Infrastructure
- Changelog for 1.17.1 (#16009, thanks @straight-shoota)
1.17.0
Breaking changes
stdlib
- Make
Colorize.on_tty_only!the default behavior (#15881, thanks @HertzDevil) - (concurrency) Rename execution contexts + improve their docs (#15936, thanks @ysbaddaden)
- (files) Refactor
IO.pipeblocking mode (#15823, thanks @ysbaddaden) - (files) Fix: set
IO::Stapled.pipeblocking args to nil, as perIO.pipe(#15925, thanks @ysbaddaden) - (networking) Refactor
Socketblocking mode (#15804, thanks @ysbaddaden) - (runtime) Let the event loop decide the blocking mode of
File(#15930, thanks @ysbaddaden) - (serialization) Fix: libxml manual memory management (#15906, #15933, thanks @ysbaddaden)
- (system) Turn
SystemError.from_errnointo a macro (#15874, thanks @straight-shoota)
Features
lang
- (macros) Handle properly stringifying single line blocks (#15568, thanks @Blacksmoke16)
- (macros) Handle properly stringifying multiline named tuple literals (#15566, thanks @Blacksmoke16)
- (macros) Handle properly stringifying multiline calls (#15691, thanks @Blacksmoke16)
- (macros) Handle significant whitespace before a blocks body (#15692, thanks @Blacksmoke16)
- (macros) Support
{% if ...; end; ... %}macro expressions (#15917, thanks @HertzDevil) - (macros) Support
{% elsif %}when stringifyingMacroIfnodes (#15928, thanks @HertzDevil)
stdlib
- Add
Colorize.default_enabled?(#15912, thanks @HertzDevil) - [experimental] Add
Struct.pre_initialize(#15896, thanks @HertzDevil) - (files) Support Windows local device paths in
Path(#15590, thanks @HertzDevil) - (llvm) Support LLVM 21.0 (development branch) (#15771, thanks @HertzDevil)
- (networking) Extract
WebSocket#do_ping,#do_closehelper methods for overrides (#15545, thanks @luislavena) - (networking) Add support for IPv6 scoped addresses (RFC4007) (#15263, thanks @foxxx0)
- (networking) Expose
HTTP::Request#uri(#15816, thanks @syeopite) - (numeric) Add
BigRational#to_i(#15809, thanks @HertzDevil) - (numeric) Add
Float::Primitive#sign_bit(#15830, thanks @HertzDevil) - (runtime) Add explicit
Crystal::EventLoop#reopened(FileDescriptor)hook (#15640, thanks @ysbaddaden) - (runtime) Add
Crystal::EventLoop::FileDescriptor#open(#15750, thanks @ysbaddaden) - (runtime) Add
Thread::Local(T)(#15616, thanks @ysbaddaden) - (serialization) Add
XML.libxml2_version(#15623, thanks @straight-shoota) - (serialization) Add
YAML::Builder#start_document(*, implicit_start_indicator)(#15835, thanks @straight-shoota) - (serialization) Support pretty printing of
XMLtypes (#15833, thanks @HertzDevil) - (serialization) Expose error message from libyaml on emitter errors (#15841, thanks @straight-shoota)
- (serialization) Add
Path.from_json_object_key(#15877, thanks @jneen) - (serialization) Add
Time::Location#{to,from}_{json,yaml}(#15939, thanks @Sija) - (serialization) Extract
XML::DocumentfromXML::Node(#15920, thanks @ysbaddaden) - (text) [experimental] Add
Crystal::System.wstr_literalon Windows (#15747, thanks @HertzDevil) - (text) Add
String#ensure_suffixandString#ensure_prefix(#15782, thanks @MatheusRich) - (text) Add
truncate_at_nullparameter toString.new(Bytes)and.from_utf16(#15887, thanks @HertzDevil) - (time) Add
Time.month_week_date(#15620, thanks @HertzDevil) - (time) Improve the TZif database file parser (#15825, thanks @HertzDevil)
- (time) Support POSIX TZ environment variable strings (#15792, thanks @HertzDevil)
- (time) Improve whitespace handling in
Time::Format(#15890, thanks @HertzDevil) - (time) Support Windows system time zone transitions in all years (#15891, thanks @HertzDevil)
- (time) Support POSIX TZ strings in TZif databases (#15863, thanks @HertzDevil)
compiler
- (cli) Support
--x86-asm-syntaxfor emitting Intel style assembly (#15612, thanks @HertzDevil) - (debugger) Support debug info of 128-bit enum members (#15770, thanks @HertzDevil)
- (parser) More robust trailing expressions newline implementation (#15614, thanks @Blacksmoke16)
- (parser) Handle properly stringifying multiline (boolean) expressions (#15709, thanks @Blacksmoke16)
- (parser) Stringify
MacroIfunlessnodes properly (#15919, thanks @HertzDevil) - (parser) Support
elsifwhen stringifyingIfnodes (#15918, thanks @HertzDevil) - (parser) Add location info to
MacroVarnodes (#15947, thanks @Blacksmoke16) - (semantic) Improve error message for
pointerof(#15876, thanks @straight-shoota)
tools
- Macro code coverage tool (#15738, thanks @Blacksmoke16)
- (docs-generator) Limit paragraph
max-widthin API docs (#15672, thanks @straight-shoota)
Bugfixes
lang
- [experimental] Do not use private linkage for slice literal buffers (#15746, thanks @HertzDevil)
stdlib
- Require
NO_COLORto be non-empty ([#15880], thanks @HertzDevil) - (benchmark) Use
UInt64to track iteration count during warm-up calculation inBenchmark::IPS([#15780], thanks @syeopite) - (collection) Fix
Array#|for different item types ([#15756], thanks @straight-shoota) - (concurrency) Fix calling
Fiber::ExecutionContext#enqueuefrom bareThread([#15767], thanks @ysbaddaden) - (concurrency) Simplify
Crystal::System::Fiber::RESERVED_STACK_SIZEinitializer on Windows ([#15820], thanks @HertzDevil) - (concurrency) Do not print adjacent nodes in
Thread::LinkedList#inspect([#15829], thanks @HertzDevil) - (files) Fix async append to file in IOCP ([#15681], thanks @ysbaddaden)
- (numeric) [regression] Fix
BigFloat#formatnot compiling ([#15796], thanks @HertzDevil) - (numeric) Never output exponent in
BigDecimal#format([#15795], thanks @HertzDevil) - (numeric) Preserve precision when passing
BigDecimalorBigFloattosprintf%i([#15808], thanks @HertzDevil) - (numeric) Fix
Float32#absfor signed zeros ([#15814], thanks @HertzDevil) - (numeric) Ensure unary
Float32#-andFloat64#-flip sign bit ([#15857], thanks @HertzDevil) - (runtime) reopen async
Filepassed toProcess.execand.run(win32) ([#15703], thanks @ysbaddaden) - (runtime) raise on manual fiber resume from sleep ([#15744], thanks @ysbaddaden)
- (runtime) race condition in
Fiber::ExecutionContext::Isolated#wait([#15872], thanks @ysbaddaden) - (runtime) Prevent leaking memory when
exec_recursive's block r...
1.16.3
Bugfixes
stdlib
- (runtime) Fix
Crystal::EventLoop::LibEventandFiberExecutionContextintegration (#15759, backported from #15743, thanks @ysbaddaden)
compiler
- (codegen) Add fallback if
__crystal_raise_cast_failedis missing (#15769, backported from #15762, thanks @HertzDevil) - (semantic) [regression] Remove type binding on
TforPointer(T)#value=(#15757, backported from #15751, thanks @HertzDevil)
Infrastructure
- Changelog for 1.16.3 (#15758, thanks @straight-shoota)
1.16.2
Bugfixes
stdlib
- (numeric) Fix show
unit_separatorin#humanize_byteswith empty prefix (#15717, backported from #15683, thanks @straight-shoota) - (runtime)
CRYSTAL_LOAD_DEBUG_INFO=1fails with-Dexecution_context(#15715, backported from #15704, thanks @ysbaddaden) - (runtime) Fix
-Dtracingraises math overflows on fiber sleep (#15725, backported from #15722, thanks @ysbaddaden) - (runtime) Fix
Fiber::ExecutionContext::Isolated#waitmust suspend fiber (#15723, backported from #15720, thanks @ysbaddaden) - (runtime) Fix run win32 console reader in bare thread (#15726, backported from #15724, thanks @ysbaddaden)
compiler
- (semantic) Do not add
ReferenceStoragetoValue's subclasses twice (#15718, backported from #15706, thanks @HertzDevil)
Refactor
compiler
- (codegen) Add
__crystal_raise_cast_failedfor non-interpreted code (#15712, backported from #15708, thanks @HertzDevil)
Infrastructure
- Changelog for 1.16.2 (#15716, thanks @straight-shoota)
- (ci) Fix package shards on MinGW (#15719, thanks @straight-shoota)
- (ci) Only set up Cygwin on Windows CI if truly required (#15713, backported from #15661, thanks @HertzDevil)
1.16.1
Bugfixes
stdlib
- (runtime) Correctly transfer FD ownership in polling event loop (#15650, thanks @ysbaddaden)
- (runtime) Fix error message when
PollDescriptorcan't transfer fd (#15663, thanks @ysbaddaden) - (runtime) Fix
libgcpkg-config name for version discovery (#15636, thanks @straight-shoota) - (serialization) [regression] Fix link
bcryptwithlibxml2on Windows (#15651, thanks @straight-shoota)
compiler
- (cli) [regression] Fix
crystal evalread from stdin (#15655, thanks @straight-shoota)
Documentation
stdlib
- (runtime) Enable docs for
ExecutionContext(#15644, thanks @straight-shoota) - (runtime) Fix mark method overrides on
ExecutionContextas:nodoc:(#15659, thanks @ysbaddaden) - (runtime) Update docs for
Fiber::ExecutionContext.default_workers_count(#15664, thanks @ysbaddaden) - (runtime) Enhance documentation for
ExecutionContext(#15665, thanks @straight-shoota)
Infrastructure
- Changelog for 1.16.1 (#15666, thanks @straight-shoota)