Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
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)
1.16.0
Features
lang
- Support
Slice.literalin the interpreter (#15531, thanks @HertzDevil) - Support
Slice.literalwith inferred element type (#15529, thanks @HertzDevil) - (macros) Error on
TypeNode#instance_vars,#has_inner_pointers?macros in top-level scope (#15293, thanks @straight-shoota) - (macros) Support
sizeofandalignofinside macros for stable types (#15497, thanks @HertzDevil)
stdlib
- Fix
Box(Pointer).boxto not allocate pointer storage on the heap (#15562, thanks @ysbaddaden) - (collection) Add
Indexable#findand#find!(#15552, #15589, thanks @punteek, @Sija) - (llvm) Add
LLVM.version(#15354, thanks @straight-shoota) - (llvm) Support LLVM 20 (#15412, #15418, thanks @HertzDevil, @straight-shoota)
- (llvm) Add
LLVM.init_native_targetandLLVM.init_all_targets(#15466, thanks @HertzDevil) - (llvm) Support
$LLVM_VERSION,$LLVM_TARGETS, and$LLVM_LDFLAGS(#15091, thanks @HertzDevil) - (llvm) Add
LLVM::CodeModel::Tiny(#15608, thanks @HertzDevil) - (macros) Implement
StringLiteral#scan(#15398, thanks @homonoidian) - (networking) Add
Pathas possible argument type toUNIXSocketandUNIXServer(#15260, thanks @BigBoyBarney) - (networking) Add
Cookies#==(#15463, thanks @straight-shoota) - (runtime) Add
EventLoop#wait_readable,#wait_writablemethods methods (#15376, thanks @ysbaddaden) - (runtime) Initialize
Fiberwith an explicit stack (#15409, thanks @ysbaddaden) - (runtime) Add fiber queues for execution context schedulers (#15345, thanks @ysbaddaden)
- (runtime) RFC 2: Skeleton for ExecutionContext (#15350, #15596, thanks @ysbaddaden)
- (runtime) RFC 2: Add
Fiber::ExecutionContext::SingleThreadedscheduler (#15511, thanks @ysbaddaden) - (runtime) RFC 2: Add
Fiber::ExecutionContext::Isolated(#15513, thanks @ysbaddaden) - (runtime) RFC 2: Add
Fiber::ExecutionContext::Monitor(#15599, thanks @ysbaddaden) - (runtime) RFC 2: Add
Fiber::ExecutionContext::MultiThreaded(#15517, thanks @ysbaddaden) - (serialization) Add
Union.from_json_object_key?(#15411, thanks @straight-shoota) - (system) Add
Process::Status#description(#15468, thanks @straight-shoota) - (text) Add
IOoverloads toChar#upcase,#downcase,#titlecase(#15508, thanks @HertzDevil) - (text) [breaking] New algorithm for
File.match?(#15607, thanks @straight-shoota)
compiler
- (cli) Support
--outputlong option incrystal build(#15519, thanks @HertzDevil) - (cli) Support directory name in
--outputCLI option (#15471, thanks @straight-shoota) - (cli) [breaking] Add compiler path to
$PATHand$CRYSTAL_EXEC_PATHfor subcommands (#15186, thanks @straight-shoota) - (cli) Respect
--mcpu=helpin the compiler (#15595, thanks @HertzDevil) - (cli) Add
CRYSTAL_EXEC_PATHtocrystal env[followup #15186] (#15632, thanks @straight-shoota) - (codegen) Set linkage of
__crystal_*funs to internal (#15439, thanks @ysbaddaden) - (codegen) Add function name to
CRYSTAL_DEBUG_CODEGENlog helper (#15506, thanks @HertzDevil) - (parser) Handle properly stringifying multiline macro expressions (#15305, thanks @Blacksmoke16)
- (parser) [breaking] Check that def, macro, and block parameters don't end with
?or!(#12197, thanks @potomak)
tools
- (docs-generator) Add docs to enum member helper methods (#15379, thanks @nobodywasishere)
- (docs-generator) Add
:showdoc:directive forprivateandprotectedobjects (RFC #11) (#15337, thanks @nobodywasishere) - (docs-generator) Add documentation support for
lib,fun,union,cstruct,external, andtype(RFC #11) (#15447, thanks @nobodywasishere)
Bugfixes
stdlib
- (collection) Fix hash
@indicescan grow larger thanInt32::MAXbytes (#15347, thanks @ysbaddaden) - (collection) Fix
Tuple#to_a(&)for arbitrary block output type (#15431, thanks @straight-shoota) - (collection) Fix
Range#sizefor unsigned edge cases (#14978, thanks @straight-shoota) - (collection) [breaking] Fix the return type of
Enumerable#sum,#productfor union elements (#15314, thanks @rvprasad) - (concurrency) Fix
Reference#exec_recursive,#exec_recursive_cloneto be fiber aware (#15361, thanks @ysbaddaden) - (concurrency) RFC 2: MT safe fiber context switch on ARM (#15582, thanks @ysbaddaden)
- (crypto) Fix argument type for
EVP_CIPHER_get_flags(#15392, thanks @miry) - (files) Never remove UNC share name in
Path#dirname(#15583, thanks @HertzDevil) - (files) Fix
File.exists?for special devices on Windows (#15587, thanks @HertzDevil) - (llvm) Fix LLVM version detection for
-rc1(#15410, thanks @HertzDevil) - (networking) [breaking] Fix parsing HTTP resource string that looks like absolute URL (#15499, thanks @straight-shoota)
- (runtime) Fix
pkg_configname forlibgcbindings on FreeBSD (#15532, thanks @straight-shoota) - (runtime) RFC 2: MT safe fiber context switch on AArch64 (#15581, thanks @ysbaddaden)
- (runtime) Add thread safety to
at_exit(#15598, thanks @ysbaddaden) - (runtime) Remove top-level calls to
LibGC.has_method?for backwards compat (#15635, thanks @straight-shoota) - (serialization) Fix
Union.from_yamlto prioritizeStringfor quoted scalar (#15405, thanks @straight-shoota) - (system) signal handler mustn't depend on the event loop (#15325, thanks @ysbaddaden)
- (system) Corrects Windows lib lookup in case-sensitive OSes (#15362, thanks @luislavena)
- (system) Fix permissions application in
File.copy(#15520, thanks @straight-shoota) - (system) [security] Strip periods, spaces for batch file filtering on Windows (#15573, thanks @GeopJr)
- (system) Extend Windows
Processcompletion key's lifetime (#15597, thanks @HertzDevil)
compiler
- (cli) Fix query runtime version of LLVM ([#15355], thanks @straight-shoota)
- (cli)...
1.15.1
Bugfixes
stdlib
- (networking) Disable directory path redirect when
directory_listing=false(#15393, thanks @straight-shoota) - (runtime) [regression] abstract
EventLoop::Polling#system_addinvalid signature (#15380, backported from #15358, thanks @straight-shoota) - (system) [regression] Fix GC
sig_suspend,sig_resumeforgc_none(#15382, backported from #15349, thanks @ysbaddaden)
Documentation
stdlib
- (system) Fix code example in
Process::Status#exit_codedocs (#15381, backported from #15351, thanks @zw963)
Infrastructure
- Changelog for 1.15.1 (#15406, thanks @straight-shoota)
- Update distribution-scripts (#15385, backported from #15368, thanks @straight-shoota)
- Update distribution-scripts (#15388, thanks @straight-shoota)
- Add backports to changelog generator (#15402, thanks @straight-shoota)
- (ci) Add build shards to
mingw-w64workflow (#15344, thanks @straight-shoota) - (ci) Update shards 0.19.1 (#15384, backported from #15366, thanks @straight-shoota)
- (ci) Add check for shards binary in
test_dist_linux_on_docker(#15394, thanks @straight-shoota)