All Versions
118
Latest Version
Avg Release Cycle
46 days
Latest Release
734 days ago
Changelog History
Page 7
Changelog History
Page 7
-
v0.18.2 Changes
June 16, 2016- 🛠 Fixed building Crystal from the source tarball
-
v0.18.1 Changes
June 16, 2016- Spec: passing
--profile
shows the slowest 10 specs (thanks @mperham) - ➕ Added
StringLiteral#>
andStringLiteral#<
in macros - 🛠 Several bugs fixes
- Spec: passing
-
v0.18.0 Changes
June 14, 2016- (breaking change)
IniFile
was renamed toINI
, and its methodload
renamed toparse
- (breaking change)
Process.getpgid
was renamed toProcess.pgid
- (breaking change) An
Exception
's backtrace is now set when it's raised, not when it's created: it'sbacktrace
method raises if it's not set, and there'sbacktrace?
to get it as a nilable array - (breaking change)
dup
is now correctly implemented in all types.clone
is not defined by default, but some types in the standard library do. Also checkObject#def_clone
- (breaking change) the
method_missing
macro only accepts a single argument: aCall
now. The form that accepted 3 arguments was removed. - (breaking change) the
delegate
macro must now be used likedelegate method1, method2, ..., methodN, to: object
- (breaking change)
Hash#each_with_index
andHash#each_with_object
now yield a tuple (pair) and an index, becauseHash
is nowEnumerable
. Usedo |(key, value), index|
for this. - (breaking change)
{"foo": 1}
denotes a named tuple literal now, not a hash literal. Use{"foo" => 1}
instead. This also applies to, for exampleHTTP::Headers{...}
- (breaking change) Extra block arguments now give a compile-time error. This means that methods that yield more than once, one time with N arguments and another time with M arguments, with N < M, will always give an error. To fix this, add M - N
nil
fillers on the yield side (this makes it more explicit thatnil
was intended to be a block argument value) - (breaking change)
OpenSSL::SSL::Context
andOpenSSL::SSL::Socket
can no longer be used directly anymore. Use their respective subclassesOpenSSL::SSL::Context::Client
, withOpenSSL::SSL::Socket::Client
,OpenSSL::SSL::Context::Server
withOpenSSL::SSL::Socket::Server
. - (breaking change) TLS server and client sockets now use sane defaults, including support for hostname verification for client sockets, used by default in
HTTP::Client
. - (breaking change) The
ssl
option was renamed totls
inHTTP::Client
,HTTP::Server
,HTTP::WebSocket
,OAuth::Consumer
,OAuth::Signature
andOAuth2::AccessToken
. - 👍 The
dns_timeout
setting in a few classes likeHTTP::Client
andTCPSocket
is now ignored until a next version supports a non-blockinggetaddrinfo
equivalent - 👍
OpenSSL::SSL::Socket::Client
supports server name indication now. - 🏗 The
build
command was renamed tocompile
. Thebuild
command is deprecated and will be removed in a future version - The
--cross-compile
flag no longer takes arguments, use--target
and-D
- ➕ Added a
Union
type that represents the type of a union, which can have class methods - Methods, procs and lib functions that are marked as returning
Void
now returnNil
- Methods that are marked as returning
Nil
are not checked for a correct return type, they always returnnil
now - When
as
fails at runtime it now includes which type couldn't be cast - Macros can now be used inside
lib
andenum
declarations - Macros can now be declared inside enums
- Macro calls can now be used as enum values
- Generic types can now include a splatted type variable. This already existed in the language (
Tuple(*T)
,Proc(*T)
) but there was no syntax to define such types. - 💎 Class variables are now inherited (only their type, not their value). They are now similar to Ruby class instance variables.
- Splats in
yield
can now be used - Splat in block arguments can now be used.
- ➕ Added block auto-unpacking: if a method yields a tuple and a block specifies more then one block argument, the tuple is unpacked to these arguments
- String literals are now allowed as external method arguments, to match named tuples and named arguments
sizeof
andinstance_sizeof
can now be used as generic type arguments (mostly useful combined withStaticArray
)Hash
,HTTP::Headers
,HTTP::Params
andENV
now include theEnumerable
moduleProc
is nowProc(*T, R)
Tuple(*T).new
andNamedTuple(**T).new
now correctly match the givenT
(#1828)Float64#to_s
now produces an ever more accurate output- 📜
JSON
parsing now correctly handle floats with many digits JSON.mapping
andYAML.mapping
now also accept named arguments in addition to a hash literal or named tuple literalInt#chr
now raises if the integer is out of a char's range. The old non-raising behaviour is now inInt#unsafe_chr
.- The output of
pp x
is nowx # => ...
instead ofx = ...
- The output of the
debug()
macro method now tries to format the code (passfalse
to disable this) - ➕ Added
JSON
andYAML
parsing and mapping for unions - ➕ Added
FileUtils.cp_r
(thanks @Dreauw) - ➕ Added
Tuple.from
andNamedTuple.from
(thanks @jhass) - ➕ Added
XML.escape
(thanks @juanedi) - Added
HTTP::Server::Response#respond_with_error
(thanks @jhass) - ➕ Added
TCPServer#accept?
- ➕ Added optional
base
argument toChar#digit?
andChar#hex?
(thanks @mirek) - ➕ Added
flag?
macro method, similar to usingifdef
.ifdef
is deprecated and will be removed in a future version. - ➕ Added
YAML::PullParser#read_raw
- ➕ Added
Proc#partial
- ➕ Added
Socket.ip?(str)
to validate IPv4 and IPv6 addresses - ➕ Added
Bytes
as an alias ofSlice(UInt8)
- Added
RangeLiteral
macro methods:begin
,end
,excludes_end?
,map
andto_a
- ➕ Added
ArrayLiteral#[range]
andArrayLiteral#[from, to]
in macros (applicable forTupleLiteral
too) - Added
Generic
macro methods:name
,type_vars
,named_args
- Spec: added JUnit formatter output (thanks @juanedi)
- The
tls
option inHTTP::Client
can now take aOpenSSL::SSL::Context::Client
in addition totrue
. - 🔊
HTTP::LogHandler
logs exceptions now (thanks @jhass) - 0️⃣
HTTP::ErrorHandler
does not tell the client which exception occurred by default (can be enabled with averbose
flag) (thanks @jhass) - 🛠 Several bug fixes
- (breaking change)
-
v0.17.4 Changes
May 26, 2016- ➕ Added string literals without interpolations nor escapes:
%q{...}
and<<-'HEREDOC'
. Also added%Q{...}
with the same meaning as%{...}
. - A method that uses
@type
inside a macro expression is now automatically detected as being amacro def
Float64#to_s
now produces a more accurate output- ➕ Added
Crystal::VERSION
and other compiler-metadata constants - Added
Object.from_json(string_or_io, root)
and aroot
option toJSON.mapping
- ➕ Added
System.hostname
(thanks @miketheman) - The
property
,getter
andsetter
macros now also accept assignments (property x = 0
) - The
record
macro now also accepts assignments (record Point, x = 0, y = 0
) - Comparison in macros between
MacroId
andStringLiteral
orSymbolLiteral
now work as expected (compares theid
representation) - 🛠 Some bug fixes
- ➕ Added string literals without interpolations nor escapes:
-
v0.17.3 Changes
May 20, 2016- 🛠 Fixed: multiple macro runs executions didn't work well (#2624)
- 🛠 Fixed incorrect formatting of underscore in unpacked block arguments
- 🛠 Fixed wrong codegen for global variable assignment in type declaration (#2619)
- 🛠 Fixed initialize default arguments where evaluated at the class scope (#731)
- The type guesser can now infer a block type from
def initialize(&@block)
- 👍 Allow type restriction in double splat argument (similar to restriction in single splat)
- 👍 Allow splat restriction in splat argument (useful for
Tuple.new
) - 👍 Allow double splat restriction in double splat argument (useful for
NamedTuple.new
)
-
v0.17.2 Changes
May 18, 2016- 🛠 Fixed crash when using pointerof of constant
-
v0.17.1 Changes
May 18, 2016- 💎 Constants and class vars are no longer initialized before "main". Now their initialization order goes along with "main", similar to how it works in Ruby (much more intuitive)
- ➕ Added syntax for unpacking block arguments:
foo { |(x, y)| ... }
- ➕ Added
NamedTupleLiteral#map
andHashLiteral#map
in macros (thanks @jhass) - 🛠 Fixed wrong codgen for tuples/named tuples merge with pass-by-value types
- 🛠 Formatter: fixed incorrect format for named tuple type
-
v0.17.0 Changes
May 17, 2016- (breaking change) Macro defs are now parsed like regular methods. Enclose the body with
{% begin %} .. {% end %}
if you needed that behaviour - (breaking change) A union of two tuples of the same size results in a tuple with the unions of the types in each position. This only affects code that later tested a tuple's type with
is_a?
, for exampletuple.is_a?({Int32, String})
- (breaking change) Method arguments have now a different semantic. This only affects methods that had a splat argument followed by other arguments.
- (breaking change) The syntax
{foo: 1, bar: 2}
now denotes aNamedTuple
, not aHash
with symbol as keys. Use{:foo => 1, :bar => 2}
instead - ⬆️ The syntax
exp as Type
is now deprecated and will be removed in the next version. Usecrystal tool format
to automatically upgrade your code - The compiler now gives an error when trying to define a method named
!
,is_a?
,responds_to?
,nil?
,as
oras?
- ➕ Added the
NamedTuple
type - ➕ Added double splatting
- ➕ Added external argument names
- Macro defs return type is no longer mandatory
- ➕ Added
as?
: similar toas
, but returnsnil
when the type doesn't match - ➕ Added
Number::Primitive
alias - ➕ Added
Tuple#+(Tuple)
- ➕ Added
ArrayLiteral#+(ArrayLiteral)
in macros Crypto::MD5
now allowsSlice(UInt8)
and a block form (thanks @will)- ➕ Added docs for XML (thanks @Hamdiakoguz)
- 🛠 Many bug fixes
- (breaking change) Macro defs are now parsed like regular methods. Enclose the body with
-
v0.16.0 Changes
May 05, 2016- (breaking change) Instance, class and global variables types must be told to the compiler, either explicitly or through a series of syntactic rules
- (breaking change) Non-abstract structs cannot be inherited anymore (abstract structs can), check the docs to know why. In many cases you can use modules instead.
- (breaking change) Class variables are now initialized at the beginning of the program (before "main"), make sure to read the docs about class variables and main
- (breaking change) Constants are now initialized at the beginning of the program (before "main"), make sure to read the docs about constants and main
- (breaking change) When doing
crystal program.cr arg1 arg2 arg3
,arg1
,arg2
andarg3
are considered arguments to pass to the program (not the compiler). Usecrystal run program.cr arg1 ...
to considerarg1
a file to include in the compilation. - (breaking change)
Int#**(Int)
now returns an integer, and raises if the argument is negative. Use a float base or exponent for negative exponents to work. - (breaking change)
Slice#to_s
andStaticArray#to_s
now include their type name in the output - 👌 Support for FreeBSD and musl libc has landed (thanks @ysbaddaden)
- The
.crystal
directory is now created at$HOME/.cache/crystal
or$HOME/.crystal
(or others similar), with a fallback to the current directory crystal doc
andcrystal tool hierarchy
are now much faster. Additionally, the hierarchy tool shows types for generic types, and doesn't show instantiations anymore (wasn't very useful)!
now does type filtering (for example you can do!x || x.bar
, assumingx
can benil
and the non-nil type responds tobar
)- Named arguments can now match any argument, even if they don't have a default value. Make sure to read the docs
- 🚀 The
as
operator can now be written as a method:exp.as(Type)
in addition toexp as Type
. The old syntax will be removed in a few releases. - ➕ Added
@x : Int32 = 1
syntax (declaration + initialization) new
/initialize
logic now works more as one would expect- ➕ Added
BigRational
(thanks @will) - ➕ Added
BigFloat
(thanks @Exilor) - ➕ Added
String#insert
- ➕ Added
Time::EpochConverter
andTime::EpochMillisConverter
- ➕ Added
%s
(unix epoch) directive toTime::Format
Time
now honours Daylight Saving andENV["TZ"]
- ➕ Added
HTTP::Server::Response#cookies
(thanks @jhass) - ➕ Added
Array#bsearch
,Array#bsearch_index
andRange#bsearch
(thanks @MakeNowJust) - ➕ Added
Range#reverse_each
iterator (thanks @omninonsense) JSON::Any
: addedas_...?
methods (thanks @DougEverly)JSON::Any
is nowEnumerable
YAML::Any
is nowEnumerable
- ➕ Added
JSON.parse_raw
that returns aJSON::Type
- 📜
JSON::PullParser
: added#read_raw
to read a JSON value as a raw string (useful for delayed parsing). Also addedString::RawConverter
to be used withJSON.mapping
. JSON
andYAML
: enums,BigInt
andBigFloat
are now serializableENV
: allow passingnil
as a value to delete an environment variableHash
: allowArray | Tuple
arguments for#select
,#select!
,#reject
and#reject!
Crypto::Subtle.constant_time_compare
now returnsBool
, and it can compare two strings in addition to two slices (thanks @skunkworker)HTTP::Server
: reset port zero after listening (thanks @splattael)- ➕ Added
File#each_line
iterator - ➕ Added
Number.slice
,Number.static_array
,Slice.[]
andStaticArray.[]
to easily create slices and static arrays - ➕ Added
Slice#hexdump
(thanks @will) - ➕ Added
Enumerable#product
(thanks @dkhofer) - 🛠 Fix: disallow using
out
withVoid*
pointers - 🛠 Fixed bug in
XML::Node#namespace_scopes
(thanks @Hamdiakoguz) - ➕ Added docs for
INIFile
(thanks @EvanHahn) - 🛠 Lots of bug fixes
-
v0.15.0 Changes
March 31, 2016- (breaking change)
!
has now its meaning hardcoded in the language. If you defined it for a type it won't be invoked as a method anymore. - (breaking change)
nil?
has now its meaning hardcoded in the language. If you defined it for a type it won't be invoked as a method anymore. - (breaking change)
typeof
is now disallowed inalias
declarations - ➕ Added
crystal tool format --check
to check that source code is properly formatted - 👍
crystal play
(playground) added workbooks support, as well as improvements and stabilizations - ➕ Added
Tempfile.dirname
(thanks @DougEverly) - ➕ Added
Path#resolve
method in macros {{...}}
arguments to a macro call are now expanded before macro invocation (#2392)- Special variables (
$~
and$?
) are now accessible after being defined in blocks (#2194) - 🛠 Some bugs and regressions fixed
- (breaking change)