Crystal 0.24.1 released!
Crystal 0.24.1 has been released!
As any release it includes numerous bugfixes, cool features and performance improvements - in 387 commits since 0.23.1.
0.24.0 was a preview release so this is the canonical release following 0.23.1.
Exciting Changes
Section titled Exciting Changes- Added
ThinLTOsupport for LLVM 4.0 and above, which speeds up release builds. It can be activated using the compiler option--lto=thin. - (breaking-change)
SecureRandomis renamed toRandom::SecureandSecureRandom.uuidis replaced by a newUUIDtype, created usingUUID.random. BigDecimalwas added, it offers arbitrary precision, exact decimal numbers. SupplementingBigIntandBigFloatwith all three being included usingrequire "big".Setinstances can now be used as condition forcase, matching when the case variable is included in the set.- (breaking-change)
Time::Formatmore robustly supports parsing sub-second precision. Tempfilenow supports custom extensions.- The docs generator outputs documentation as JSON which can be easily parsed and used for external applications. The output directory of the docs generator can be configured using
--outputflag. - Garbage collection can be disabled using compiler flag
-Dgc_none. - The default hash function uses an algorithm based on FunnyHash which is resiliant against DoS attacks.
- (breaking-change)
HTML.escapeonly escapes HTML special characters&<>"'.HTML.escaperecognizes all HTML5 named entities. - (breaking-change) Multiple assignment can no longer be used to create an array (
a = 1, 2, 3). - (breaking-change)
skipmacro method was renamed toskip_file. rescue,ensureandelseblocks can be used directly indo ...endblocks.
%w(foo bar).each do |x|
raise x
rescue e
p e
end
funnames and lib function calls can now start with uppercase.- YAML 1.1 core schema is now fully supported.
TimeandTime::Spanhave nanosecond precision.Time.monotonicandTime.measure { ... }allow reading and measuring time using a monotonic clock not influences by time zones, leap seconds and time corrections.Crystal.mainwas added to allow more easily redefining themainof a program.- Named tuples can be merged using
NamedTuple#merge(other : NamedTuple). YAMLandJSONmappings supportpresence: trueoption.Dirhas two new class methods:childrenandeach_child { ... }which include all entries except.and...
Other Breaking Changes
Section titled Other Breaking Changes- (breaking-change)
HTTP::Client#post_formis nowHTTP::Client.post(form: ...) - (breaking-change)
Array#reject!,Array#compact!andArray#select!now returnself - (breaking-change) Remove the possibility to require
big_int,big_floatorbig_rationalindividually: userequire \"big\"instead - (breaking-change) Spec: remove
expect_raiseswithout type argument - (breaking-change)
IOis now a class, no longer a module - (breaking-change) Time constructors now have
nanosecondandkindas named argument - (breaking-change) Removed
XML.escape. UseHTML.escapeinstead - (breaking-change) Removed
macro def - (breaking-change) To define a custom
hashmethod you must now definehash(hasher) - (breaking-change)
Flate::Reader.new(&block)andFlate::Writer.new(&block)now use the nameopen - (breaking-change) Use an Enum for Process stdio redirections
- (breaking-change) Remove ‘$0’ special syntax
- (breaking-change)
StaticArray#mapandSlice#mapnow return their same type instead ofArray - (breaking-change)
Tuple#map_with_indexnow returns a Tuple.
Thanks to everyone who supported this release through contributions, reviews and suggestions.