Skip to content

0.31.0

Compare
Choose a tag to compare
@bcardiff bcardiff released this 23 Sep 19:42
· 3936 commits to master since this release
8d4715a

Language changes

  • Allow non-captured block args with type restriction using & : T -> U. (#8117, thanks @asterite)

Macros

  • Ensure @type is devirtualized inside macros. (#8149, thanks @asterite)

Standard library

  • (breaking-change) Remove Markdown from the std-lib. (#8115, thanks @asterite)
  • (breaking-change) Deprecate OptionParser#parse!, use OptionParser#parse. (#8041, thanks @didactic-drunk)
  • Fix example codes in multiple places. (#8194, thanks @maiha)

Numeric

  • (breaking-change) Enable overflow by default. (#8170, thanks @bcardiff)
  • (breaking-change) Make / the arithmetic division for all types. (#8120, thanks @bcardiff)
  • Add BigDecimal#** and BigRational#** (pow operator). (#7860, thanks @jwbuiter)
  • Avoid overflow exception in Number#round(digits, base). (#8204, thanks @bcardiff)
  • Refactor Int#divisible_by? for clarity. (#8045, thanks @yxhuvud)

Text

  • (performance) Minor String#lchop? ASCII-only optimization. (#8052, thanks @r00ster91)

Collections

  • (performance) Array optimizations for small number of elements. (#8048, thanks @asterite)
  • (performance) Optimize Array#*. (#8087, thanks @asterite)
  • (performance) Hash now uses an open addressing algorithm. (#8017, #8182, thanks @asterite)
  • (performance) Optimize Hash#to_a, Hash#keys and Hash#values. (#8042, thanks @asterite)
  • (performance) Add Hash#put and optimize Set#add?. (#8116, thanks @asterite)
  • Fixed Slice#== for some generic instantiations, add Slice#<=>. (#8074, thanks @asterite)
  • Add docs on idempotence and methods involving eager evaluation in Iterator. (#8053, thanks @kimburgess)
  • Add Set#+. (#8121, thanks @sam0x17)
  • Refactor Hash to use integer division instead of float division. (#8104, thanks @asterite)

Serialization

  • (breaking-change) Rename XML::Type to XML::Node::Type, introduce XML::Reader::Type. (#8134, thanks @asterite)
  • Fixed JSON and YAML parsing of NamedTuple with nilable fields. (#8109, thanks @asterite)
  • Fixed YAML to emit unicode characters as such. (#8132, thanks @asterite)
  • Fixed INI generation of empty sections. (#8106, thanks @j8r)

Files

  • (performance) Optimize Path#join by precomputing capacity if possible. (#8078, thanks @asterite)
  • (performance) Optimize Path#join for the case of joining one single part. (#8082, thanks @asterite)
  • (performance) Optimize Dir.glob. (#8081, thanks @asterite)
  • Fixed File.basename off-by-one corner-case. (#8119, thanks @ysbaddaden)
  • Fixed unneeded evaluation of Path.home on Path.expand. (#8128, thanks @asterite)
  • Fixed Zip::Writer STORED compression. (#8142, thanks @asterite)
  • Fixed missing check on ARGF if read_count is zero. (#8177, thanks @Blacksmoke16)

Networking

  • (breaking-change) Replace HTTP::Server::Response#respond_with_error with #respond_with_status. (#6988, thanks @straight-shoota)
  • (breaking-change) Handle too long URIs and too large header fields in HTTP::Request.from_io and remove HTTP::Request::BadRequest. (#8013, thanks @straight-shoota)
  • Fixed memory leak from SSL_new if ssl_accept fails. (#8088, thanks @rdp)
  • Fixed WebSocket ipv6 hostname connection. (#8066, thanks @MrSorcus)
  • Add URI#query_params method. (#8090, thanks @rodrigopinto)
  • Add URI#resolve and URI#relativize. (#7716, thanks @straight-shoota)
  • Add #clear, #delete, and #size methods to HTTP::Cookies. (#8107, thanks @sam0x17)
  • Refactor http/server_spec. (#8056, thanks @straight-shoota)
  • Refactor UDP specs to use random port. (#8139, thanks @waj)

Concurrency

  • Multithreading. (#8112, thanks @waj)
  • Delay releasing of fiber stack in multi-thread mode. (#8138, thanks @waj)
  • Make Crystal::Scheduler.init_workers block until workers are ready. (#8145, thanks @bcardiff)
  • Make Crystal::ThreadLocalValue thread-safe. (#8168, thanks @waj)
  • Let exec_recursive use a thread-local data structure. (#8146, thanks @asterite)
  • Add explicit return types for some channel methods. (#8161, thanks @Blacksmoke16)
  • Remove the dedicated fiber to run the event loop. (#8173, thanks @waj)
  • Fix corruption of thread linked list. (#8196, thanks @waj)
  • Workaround compile on win32 until fibers is implemented. (#8195, thanks @straight-shoota)

System

Spec

Compiler

Language semantics

  • Fixed abstract def check regarding generic ancestor lookup. (#8098, thanks @asterite)
  • Fixed missing virtualization of type arguments in Proc types. (#8159, thanks @asterite)
  • Fixed incorrect typing after exception handler. (#8037, thanks @asterite)
  • Fixed behaviour when a yield node can't be typed. (#8101, thanks @asterite)
  • Fixed offsetof on reference types. (#8137, thanks @mcr431)
  • Allow rescue var to be closured. (#8143, thanks @asterite)
  • Refactor class var and constant initialization. (#8067, #8091, thanks @waj)
  • Add runtime check for recursive initialization of class variables and constants. (#8172, thanks @waj)

Tools

Doc generator

  • Fixed link to constructors of another class. (#8110, thanks @asterite)
  • Enable docs from previous def and/or ancestors to be inherited. (#6989, thanks @asterite)

Others