Skip to content

Releases: crystal-lang/crystal

1.2.0

13 Oct 20:49
1.2.0
9f90efe
Compare
Choose a tag to compare

Compiler

Language

  • Make .as?(NoReturn) always return nil (#10896, thanks @HertzDevil)
  • Compiler: make is_a?(union) work correctly for virtual types (#11176, thanks @asterite)
  • Adjust docs for Crystal::Macros::HashLiteral#[] (#10930, thanks @kevinsjoberg)
  • Fix path lookup when ancestor finds type with same name as current scope (#10901, thanks @HertzDevil)
  • Fix several compile-time operations on generic instance metaclasses (#11101, thanks @HertzDevil)
  • Make #is_a? in macros respect the AST node hierarchy (#11062, thanks @HertzDevil)
  • Add docs to string methods in SymbolLiteral and MacroId (#9298, thanks @makenowjust)
  • Add clarification about when instance_vars can be called (#11171, thanks @willhbr)
  • Add file_exists? macro method (#10540, thanks @Sija)

Standard Library

Collection

  • (breaking-change) Move Array#product to Indexable#cartesian_product (#10013, thanks @HertzDevil)
  • Disallow Slice(T).new(Int) where T is a union of primitive number types (#10982, thanks @HertzDevil)
  • Make Array#transpose, Enumerable#reject, Enumerable#to_h work with tuples (#10445, thanks @HertzDevil)
  • Fix Enumerable#each block return type (#10928, thanks @straight-shoota)
  • Fix key type f...
Read more

1.1.1

26 Jul 20:54
1.1.1
6d9a1d5
Compare
Choose a tag to compare

Language changes

Standard Library

Compiler

Other

1.1.0

14 Jul 18:27
af095d7
Compare
Choose a tag to compare

1.1.0 (2021-07-14)

Language changes

  • Support splat expansions inside tuple and array literals. (#10429, thanks @HertzDevil)
  • Support breaks with values inside while expressions. (#10566, thanks @HertzDevil)

Macros

Standard library

Global changes

Windows support

Type annotations

Numeric

Text

Collections

Crypto

Time

Files

Read more

1.0.0

22 Mar 18:29
dd40a24
Compare
Choose a tag to compare

Language changes

  • Support Tuple#[](Range) with compile-time range literals. (#10379, thanks @HertzDevil)

Macros

  • Don't use named argument key names as parameters for method_missing calls. (#10388, thanks @HertzDevil)

Standard library

  • (breaking-change) Drop deprecated definitions. (#10386, thanks @bcardiff)
  • Fix example codes in multiple places. (#10505, thanks @maiha)

Macros

  • (breaking-change) Always add explicit return types in getter/property macros. (#10405, thanks @Sija)

Numeric

Text

Collections

Serialization

Files

Networking

Logging

System

Runtime

Compiler

  • (breaking-change) Disallow surrogate halves in escape sequences of string and character literals, use \x for arbitrary binary values. (#10443, thanks @HertzDevil)
  • Fix ICE when exhaustive in-clause calls pseudo-method. (#10382, thanks @HertzDevil)
  • Fix ICE when parsing foo.% calls. (#10351, thanks @makenowjust)
  • Fix edge cases for symbol quoting rules. (#10389, thanks @HertzDevil)
  • Support closured vars inside Const initializer. (#10478, thanks @RX14)
  • Documentation grammar fix. (#10369, thanks @szTheory)

Language semantics

Doc generator

  • Detect source locations in more situations. (#10439, thanks @oprypin)

Others

0.36.1

02 Feb 18:04
Compare
Choose a tag to compare

Standard library

Text

  • Don't raise on String.new with null pointer and bytesize 0. (#10308, thanks @asterite)

Collections

Serialization

Runtime

  • Eager load DWARF only if CRYSTAL_LOAD_DWARF=1. (#10326, thanks @bcardiff)

Compiler

  • (performance) Initialize right-away constants in a separate function. (#10334, thanks @asterite)
  • Fix incorrect casting between different union types. (#10333, thanks @asterite)
  • Fix a formatting error in the "missing argument" error. (#10325, thanks @BlobCodes)
  • Fix while condition assignment check for Not. (#10347, thanks @asterite)
  • Allow operators and setters-like macros names back. (#10338, thanks @asterite)

Language semantics

  • Fix type check not considering virtual types. (#10304, thanks @asterite)
  • Use path lookup when looking up type for auto-cast match. (#10318, thanks @asterite)

0.36.0

26 Jan 18:24
1e6f96a
Compare
Choose a tag to compare

Language changes

  • (breaking-change) Reject annotations on ivars defined in base class. (#9502, thanks @waj)
  • (breaking-change) Make ** be right associative. (#9684, thanks @asterite)

Macros

Standard library

Macros

Numeric

Text

  • (breaking-change) Fix String#index not working well for broken UTF-8 sequences. (#9713, thanks @asterite)
  • (performance) String: Don't materialize Regex match[0] if not needed. (#9615, thanks @asterite)
  • Fix String#rindex default offset for matching empty regex correctly. (#9690, thanks @makenowjust)
  • Add various String#delete_at methods. (#9398, thanks @asterite)
  • Raise if passing null Pointer to String. (#9653, thanks @jgaskins)
  • Add Regex#capture_count. (#9746, thanks @Sija)
  • Add Regex::MatchData#[] overloading to Range. (#10076, thanks @makenowjust)
  • Fix duplicates in String documentation. (#9987, thanks @Nicolab)
  • Add docs for substitution to Kernel.sprintf. (#10227, thanks @straight-shoota)

Collections

  • (breaking-change) Make Hash#reject!, Hash#select!, and Hash#compact! consistent with Array and return self. (#9904, thanks @caspiano)
  • (breaking-change) Deprecate Hash#delete_if in favor of Hash#reject!, add Dequeue#reject! and Dequeue#select!. (#9878, thanks @caspiano)
  • (breaking-change) Change Set#delete to return Bool. (#9590, thanks @j8r)
  • (breaking-change) Drop deprecated Enumerable#grep. (#9711, thanks @j8r)
  • (breaking-change) Remove Hash#key_index . (#10016, thanks @asterite)
  • (breaking-change) Deprecate StaticArray#[]=(value) in favor of StaticArray#fill. (#10027, thanks @HertzDevil)
  • (breaking-change) Rename Set#{sub,super}set? to {sub,super}set_of?. (#10187, thanks @straight-shoota)
  • (performance) Optimize Array#shift and Array#unshift. (#10081, thanks @asterite)
  • (performance) Array#rotate optimization for small arrays. (#8516, thanks @wontruefree)
  • Fix Hash#dup and Hash#clone to return correct type for subclasses. (#9871, thanks @vlazar)
  • Fix Iterator#cons_pair return type. (#9788, thanks @asterite)
  • Fix key type restriction of Hash#merge block. (#9495, thanks @makenowjust)
  • Fix Range#step. (#10203, thanks @straight-shoota)
  • Let Range#step delegate to begin.step and allow float based ranges to be stepped. (#10209, thanks @straight-shoota)
  • Fix Indexable#join with IO. (#10152, thanks @straight-shoota)
  • Fix Flatten for value-type iterators. (#10096, thanks @f-fr)
  • Fix Indexable.range_to_index_and_count to not raise IndexError. (#10191, thanks @straight-shoota)
  • Handle recursive structures in def_clone, Hash, Array, Dequeue. (#9800, thanks @asterite)
  • Add BitArray#dup. ([#9550](#9550...
Read more

0.35.1

19 Jun 19:03
5999ae2
Compare
Choose a tag to compare

Standard library

Collections

  • Remove Hash#each type restriction to allow working with splats. (#9456, thanks @bcardiff)

Networking

  • Revert IO#write changes in 0.35.0 and let it return Nil. (#9469, thanks @bcardiff)
  • Avoid leaking logging context in HTTP request handlers. (#9494, thanks @Blacksmoke16)

Crypto

Logging

  • Fix Log.context.set docs for hash based data. (#9470, thanks @bcardiff)

Compiler

Others

0.35.0

09 Jun 18:51
3c48f31
Compare
Choose a tag to compare

Language changes

  • (breaking-change) Let case when be non-exhaustive, introduce case in as exhaustive. (#9258, #9045, thanks @asterite)
  • Allow ->@ivar.foo and ->@@cvar.foo expressions. (#9268, thanks @makenowjust)

Macros

  • Allow executing OpAssign (+=, ||=, etc.) inside macros. (#9409, thanks @asterite)

Standard library

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, reverse BigInt#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

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 an Iterator. (#9330, thanks @mneumann)
  • Make Range#each and Range#reverse_each work better with end/begin-less values. (#9325, thanks @asterite)
  • Improve docs on Hash. (#8887, thanks @rdp)

Serialization

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

Networking

  • (breaking-change) Make IO#skip, IO#write returns the number of bytes it skipped/written as Int64. (#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 to Socket::Address?. (#9210, thanks @waj)
  • Fix flush methods to always flush underlying IO. (#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 or flush_on_newline for standard I/O on Windows. (#9207, thanks @kubo)
  • Prefer HTTP basic authentication in OAuth2 client. (#9127, ...
Read more

0.34.0

06 Apr 20:36
4401e90
Compare
Choose a tag to compare

Language changes

Standard library

  • (breaking-change) Replace Errno, WinError, IO::Timeout with RuntimeError, IO::TimeoutError, IO::Error, File::Error, Socket::Error, and subclasses. (#8885, thanks @waj)
  • (breaking-change) Replace Logger module in favor of Log module. (#8847, #8976, thanks @bcardiff)
  • (breaking-change) Move Adler32 and CRC32 to Digest. (#8881, thanks @bcardiff)
  • (breaking-change) Remove DL module. (#8882, thanks @bcardiff)
  • Enable more win32 specs. (#8683, #8822, thanks @straight-shoota)
  • Make SemanticVersion::Prerelease comparable. (#8991, thanks @makenowjust)
  • Use flag?(:i386) instead of obsolete flag?(:i686). (#8863, thanks @bcardiff)
  • Remove Windows workaround using vsnprintf. (#8942, thanks @oprypin)
  • Fixed docs broken link to ruby's prettyprint source. (#8915, thanks @MattHin)
  • Update OptionParser example to exit on --help. (#8927, thanks @vlazar)

Numeric

Text

Collections

  • Fixed make Range#size raise on an open range. (#8829, thanks @Sija)
  • Add Enumerable#empty?. (#8960, thanks @Sija)
  • (performance) Optimized Implementation of Array#fill for zero Values. (#8903, thanks @toddsundsted)
  • Refactor Reflect to an Enumerable private definition. (#8884, thanks @bcardiff)

Serialization

Time

Files

  • Fixed multi-thread race condition by setting fd to -1 on closed File/Socket. (#8873, thanks @bcardiff)
  • Fixed File.dirname with unicode chars. (#8911, thanks @asterite)
  • Add IO::Buffered#flush_on_newline back and set it to true for non-tty. (#8935, thanks @asterite)
  • Forward missing methods of IO::Hexdump to underlying IO. (#8908, thanks @carlhoerberg)

Networking

  • (breaking-change) Correctly support WebSocket close codes. (#8975, #8981, thanks @RX14, @Sija)
  • Make HTTP::Client return empty body_io if content-length is zero. (#8503, thanks @asterite)
  • Fixed UDP specs in the case of a local firewall. (#8817, thanks @RX14)
  • Fixed MIME spec examples to not collide with actual registry. (#8795, thanks @straight-shoota)
  • Fixed UNIXServer, and HTTP::WebSocket specs to ensure server is accepting before closing. (#8755, #8879, thanks @bcardiff)
  • Add type annotation to tls argument in HTTP. (#8678, thanks @j8r)
  • Add Location to HTTP::Request common header names. (#8992, thanks @mamantoha)

Concurrency

System

Runtime

  • Fixed exceptions not being inspectable when running binary from PATH. (#8807, thanks @willhbr)
  • Move AtExitHandlers to Crystal namespace. (#8883, thanks @bcardiff)

Compiler

  • (breaking-change) Drop disable_overflow compiler flag. (#8772, thanks @Sija)
  • Fixed url in "can't infer block return type" error message. (#8869, thanks @nilium)
  • Fixed typo in math interpreter error message. (#8941, thanks @j8r)
  • Use CRYSTAL_OPTS environment variable as default compiler options. (#8900, thanks @bcardiff)
  • Avoid using the default --exclude-warnings value if some is specified. (#8899, thanks @bcardiff)
  • Honor LIBRARY_PATH as default library path, and allow linking with no explicit /usr/lib:/usr/local/lib paths. (#8948, thanks @bcardiff)
  • Fix Windows LLVM globals codegen in non-single-module mode. (#8978, thanks @oprypin)
  • Add support for LLVM 10. (#8940, thanks @RX14)
  • Remove redundant calls to Object.to_s in interpolation in compiler's code. (#8947, thanks @veelenga)

Language semantics

  • Type as NoReturn if calling method on abstract class with no concrete subclasses. (#8870, thanks @asterite)

Tools

Doc generator

Others

Read more

0.33.0

14 Feb 21:08
Compare
Choose a tag to compare

Language changes

Macros

  • Add TypeNode#name(generic_args : BoolLiteral) to return TypeNode's name with or without type vars. (#8483, thanks @Blacksmoke16)

Standard library

  • (breaking-change) Remove several previously deprecated methods and modules: PartialComparable, Crypto::Bcrypt::Password#==, HTTP::Server::Response#respond_with_error, JSON::PullParser::Kind#==, Symbol#==(JSON::PullParser::Kind), JSON::Token#type, String#at, Time.new, Time.now, Time.utc_now, URI.escape, URI.unescape. (#8646, #8596, thanks @bcardiff, @Blacksmoke16)
  • Fixed docs wording. (#8606, #8784, thanks @fxn)
  • Add Object#in?. (#8720, #8723, thanks @Sija)
  • Allow to create an enum from a symbol. (#8634, thanks @bew)
  • Add VaList#next for getting the next element in a variadic argument list. (#8535, #8688, thanks @ffwff, @RX14)
  • Refactor ARGF implementation. (#8593, thanks @arcage)
  • Fixed specs of Colorize on dumb terminal. (#8673, thanks @oprypin)
  • Fixed some specs on Win32. (#8670, thanks @straight-shoota)

Numeric

Text

  • Fixed \u0000 wrongly added on String#sub(Hash) replaces last char. (#8644, thanks @mimame)

Collections

  • Fixed Enumerable#zip to work with union types. (#8621, thanks @asterite)
  • Fixed docs regarding Hash's initial_capacity. (#8569, thanks @r00ster91)

Serialization

  • Improved JSON deserialization into union types. (#8689, thanks @kimburgess)
  • Fixed expected error message in libxml2 error spec. (#8699, thanks @straight-shoota)
  • Fixed JSON::PullParser overflow handling. (#8698, thanks @kimburgess)
  • Fixed JSON::Any#dig?/YAML::Any#dig? on non-structure values. (#8745, thanks @Sija)

Time

Files

  • (breaking-change) Deprecate File::Info#owner, and File::Info#group; use owner_id, and group_id. (#8007, thanks @j8r)
  • Fixed Path.new receiving Path as first argument. (#8753, thanks @straight-shoota)
  • Fixed File.size and File.info to work with Path parameters. (#8625, thanks @snluu)
  • Fixed Path specs when ENV["HOME"] is unset. (#8667, thanks @straight-shoota)
  • Refactor Dir.mkdir_p to use Path#each_parent and make it work on Win32. (#8668, thanks @straight-shoota)
  • Fixed IO::MultiWriter specs to close file before reading/deleting it. (#8674, thanks @oprypin)

Networking

  • Fixed invalid call to libevent and race conditions on closed IO when resuming readable/writable event. (#8707, #8733, thanks @bcardiff)
  • Fixed unexpected EOF in terminated SSL connection. (#8540, thanks @rdp)
  • Fixed HTTP::Cookie to support Int64 max-age values. (#8759, thanks @asterite)
  • Improve error message for getaddrinfo failure. (#8498, thanks @rdp)
  • Make IO::SysCall#wait_readable and IO::SysCall#wait_writable public, yet :nodoc:. (#7366, thanks @stakach)
  • Refactor StaticFileHandler to use Path. (#8672, thanks @straight-shoota)
  • Remove fixed date in spec. (#8640, thanks @bcardiff)
  • Remove non-portable error message in TCPServer spec. (#8702, thanks @straight-shoota)

Crypto

Concurrency

System

  • Enable system module for Win32 in prelude. (#8661, thanks @straight-shoota)
  • Handle exceptions raised at __crystal_sigfault_handler. (#8743, thanks @waj)

Runtime

  • Fixed wrongly collected exception object by the GC. Ensure LibUnwind::Exception struct is not atomic. (#8728, thanks @waj)
  • Fixed reporting of non-statement rows in DWARF backtrace. (#8499, thanks @rdp)
  • Add top level exception handler. (#8735, #8791, thanks @waj)
  • Try to open stdio in non-blocking mode. (#8787, thanks @waj)
  • Allow Crystal::System.print_error to use printf like format. (#8786, thanks @bcardiff)

Spec

Compiler

  • (breaking-change) Drop support for previously deprecated comma separators in enums and other cleanups. (#8657, thanks @bcardiff)
  • (breaking-change) Drop uppercase F32 and F64 float number suffixes. (#8782, thanks @rhysd)
  • Fixed memory corruption issues by using LLVM's memset and memcpy that matches target machine. (#8746, thanks @bcardiff)
  • Fixed ICE when trying to add type inside annotation. (#8628, thanks @asterite)
  • Fixed ICE on typeof in an unused block. (#8695, thanks @asterite)
  • Fixed ICE in case of wrong target triple. (#8710, thanks @Sija)
  • Fixed ICE when raising a macro exception with empty message. (#8654, thanks @jan-zajic)
  • Fixed parser bug macro with "eenum" in it. (#8760, thanks @asterite)
  • Change CRYSTAL_PATH to allow shards to override std-lib. (#8752, thanks @bcardiff)

Language semantics

  • Fixed missing virtualization of Proc pointer. (#8757, thanks @asterite)
  • Fixed type of vars after begin/rescue if all rescue are unreachable. (#8758, thanks @asterite)
  • Fixed visibility propagation to macro expansions in all cases. (#8762, #8796, thanks @asterite)

Tools

Formatter

  • Fixed indent after comme...
Read more