Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
0.6.0
0.5.10
Note: This release makes core, breaking changes to the language, and doesn't work out of the box with its accompanying standard library. Use 0.6.0 instead.
- Improved error messages related to nilable instance variables.
- The magic variables
$~
and$?
are now method-local and concurrent-safe. Tuple
is now correctly considered a structPointer
is now correctly considered a struct- Renamed
Function
toProc
0.5.9
Random
is now a module, with static methods that default to theRandom::MT19937
class.- Added
Random::ISAAC
engine (thanks @ysbaddaden!) - Added
String#size
(thanks @zamith!) - Added
limit
to allString#split
variants (thanks @jhass!) - Raising inside a Thread is now rescued and re-raised on join (thanks @jhass!)
- Added
path
option to Projectfile forcrystal deps
(thanks @naps62!) - Many fixes towards making Crystal work on linux 32 bits.
- Huge refactors, additions and improvements for sockets: Socket, IPSocket, TCPSocket, TCPServer, UDPSocket, UNIXSocket, UNIXServer (thanks @ysbaddaden!)
- Allow regex with empty spaces in various places.
- Added
HTML.escape(String)
(thanks @naps62!) - Added support for
%w[...]
,%w{...}
,%w<...>
as alternatives to%w(...)
. Same goes for%i(...)
(thanks @zamith!) - Added
Enumerable#min_of
,Enumerable#max_of
andEnumerable#minmax_of
,Enumerable#to_h
,Dir.chdir
andNumber#fdiv
(thanks @jhass!) - Added
String#match
,String#[]
,String#[]?
andMatchData#[]?
related to regexes (thanks @jhass!) - Allow
T::Bar
when T is a generic type argument. - Added
subclasses
andall_subclasses
in macros. - Now you can invoke
to_s
andinspect
on C structs and unions, making debugging C bindings much easier! - Added
#to_f
and#to_i
toTime
andTimeSpan
(thanks @epitron!) - Added
IO.select
(thanks @jhass!) - Now you can use
ifdef
inside C structs and unions. - Added
include
inside C structs, to include other struct fields (useful for composition and avoiding an explicit indirection). - Added
Char#in_set?
,String#count
,String#delete
andString#squeeze
(thanks @jhass!) - Added
-D flag
option to the compiler to set compile-time flags to use inifdef
. - More support for forward declarations inside C libs.
- Rewritten some
Function
primitives in Crystal itself, and added methods for obtaining the pointer and closure data, as well as for recreating a function from these. - Added a
Logger
class (thanks @ysbaddaden!) - Lots of bugs fixed.
0.5.8
0.5.7
0.5.6
- Added a
crystal doc
command to automatically generate documentation for a project using Markdown syntax. The style is still ugly but it's quite functional. Now we only need to start documenting things :-) - Removed the old
@:
attribute syntax. - Fixed #311: Issues with invoking lib functions in other ways (thanks @Scidom).
- Fixed #314: NoReturn information is not lazy.
- Fixed #317: Fixes in UTF-8 encoding/decoding (thanks @yous).
- Fixed #319: Unexpected EOF (thanks @exilor).
{{yield}}
inside macros now preserve the yielded node location, leading to much better error messages.- Added
Float#nan?
, `Float#infin
0.5.5
0.5.4
- (breaking change)
require "foo"
always looks up inCRYSTAL_PATH
.require "./foo"
looks up relative to the requiring file. - (breaking change) Renamed
Json
toJSON
,Xml
toXML
andYaml
toYAML
to follow a convention. - (breaking change) To use HTTP types do, for example,
require "http/client"
instead of the oldrequire "net/http"
. - Added
alias_method
macro (thanks @exilor and @jtomschroeder). - Added some
Complex
number methods and many math methods, refactors and specs (thanks @Scidom). - Inheriting generic classes is now possible.
- Creating arrays of generic types (i.e.:
[] of Thread
) is now possible. - Allow using an alias in a block type (i.e.:
alias F = Int32 ->
,&block : F
). json_mapping
macro supports a simpler syntax:json_mapping({key1: Type1, key2: Type2})
.- Spec: added
be_a(type)
matcher. - Spec: added
be > ...
and similar matchers for>=
,<
and<=
. - Added
File::file?
andFile::directory?
. - CSV parser can parse from String or IO.
- When invoking the compiler like this:
crystal foo.cr -o foo
thebuild
command is assumed instead ofrun
. - Added short symbol notation for methods that are operators (i.e.
:+
,:*
,:[]
, etc.). - Added
TimeSpan#ago
,TimeSpan#from_now
,MonthSpan#ago
andMonthSpan#from_now
.
0.5.3
- Spec: when a
should
orshould_not
fail, the filename and line number, including the source's line, is included in the error message. - Spec: added
-l
switch to be able to run a spec defined in a line. - Added
crystal spec file:line
- Properties (property, setter, getter) can now be restricted to a type with the syntax
property name :: Type
. - Enums can be used outside
lib
. They inheritEnum
, can have methods and can be marked with @[Flags]. - Removed the distinction between
lib
enums and regular enums. - Fixed: it was incorrectly possible to define
class
,def
, etc. inside a call block. - The syntax for specifying the base type of an enum,
enum Name < BaseType
has been deprecated. Useenum Name : BaseType
. - Added
Array#<=>
and make it comparable to other arrays.
0.5.2
- New command line interface to the compiler (
crystal build ...
,crystal run ...
,crystal spec
, etc.). The default is to compiler and run a program. crystal eval
without arguments reads from standard input.- Added preliminar
crystal deps
command. __FILE__
,__DIR__
and__LINE__
, when used as def default arguments, resolve to the caller location (similar to D and Swift)- Allow
as
to determine a type even if the casted value doesn't have a type yet. - Added
is_a?
in macros. The check is against an AST node name. For examplenode.is_a?(HashLiteral)
. - Added
emit_null
property tojson_mapping
. - Added
converter
property tojson_mapping
. - Added
pp
in macros. - Added
to_pretty_json
. - Added really basic
CSV.parse
. - Added
Regex.escape
. - Added
String#scan
. - Added
-e
switch to spec, to run specs that match a pattern. - Added
--fail-fast
swtich to spec. - Added
HTTPClient#basic_auth
. - Added
DeclareVar
,Def
andArg
macro methods. - Added
Time
andTimeSpan
structs.TimeWithZone
will come later. - Added
Array#fill
(thanks @exilor). - Added
Array#uniq
. - Optimized
File.read_lines
. - Allow any expression inside
{% ... %}
so that you can intepret code without outputting the result. - Allow
\
at the end of a line. - Allow using
if
andunless
inside macro expressions. - Allow marking a
fun/def
as@[Raises]
(useful when a function can potentially raise from a callback). - Allow procs are now considered
@[Raises]
. OAuth2::Client
supports getting an access token via authorization code or refresh token.- Consecutive string literals are automatically concatenated by the parser as long as there is a
\
with a newline between them. - Many bug fixes.