Releases: crystal-lang/crystal
Releases · crystal-lang/crystal
0.7.0
- Crystal has evented IO by default. Added
spawn
andChannel
. - Correctly support the X86_64 and X86 ABIs. Now bindings to C APIs that pass and return structs works perfectly fine.
- Added
crystal init
to quickly create a skeleton library or application (thanks @waterlink) - Added
--emit
flag to the compiler. Now you can easily see the generated LLVM IR, LLVM bitcode, assembly and object files. - Added
--no-color
flag to supress color output, useful for editor tools. - Added macro vars:
%var
and%var{x, y}
create uniqely named variables inside macros. - Added typed splats.
- Added
Iterator
and many methods that return iterators, likeArray#each
,Hash#each
,Int#times
,Int#step
,String#each_char
, etc. - Added
sprintf
and improvedString#%
to support floats and float formatting. - Added more variants of
String#gsub
. - Added
Pointer#clear
and use it to clear anArray
's values when doingpop
and other shrinking methods. - Added
BigInt#to_s(base)
,BigInt::cast
and bit operators (thanks @exilor) - Allow invoking methods on a union class as long as all types in the union have it.
- Allow specifying a def's return type. The compiler checks the return type only for that def for now (not for subclasses overrding the method). The return type appears in the documentation.
- Allow constants and computed constants for a StaticArray length.
- Allow class vars in enums.
- Allow private and protected defs in enums.
- Allow reopening a
lib
and adding more@[Link]
attributes to it, even allowing duplicated attributes. - Allow getting a function pointer to a lib fun without specifying its types (i.e.
->LibC.getenv
) - Allow specifying
ditto
for a doc comment to reuse the previous comment. - Changed the semantic of
%
: previously it meantremainder
, not it meansmodulo
, similar to Ruby and Python. AddedInt#remainder
. #to_s
and#inspect
now work for a union class.- Spec: added global
before_each
andafter_each
hooks, which will simplify the use of mocking libraries like timecop.cr and webmock.cr. Range(T)
is nowRange(B, E)
again (much more flexible).- Improved Regex performance.
- Better XML support.
- Support LLVM 3.6.
- Exception class is now shown on unhandled exceptions
- The following types are now disallowed in generics (for now): Object, Value, Reference, Number, Int and Float.
- Lots of bug fixes, enhancements and optimizations.
0.6.1
- The
class
method now works in all cases. You can now compare classes with==
and ask theirhash
value. - Block variables can now shadow local variables.
Range(B, E)
is nowRange(T)
.- Added
Number::[]
. Now you can doInt64[1, 2, 3]
instead of[1_i64, 2_i64, 3_u64]
. - Better detection of nilable instance variables, and better error messages too.
- Added
Crypto::Blowfish
(thanks @akaufmann) - Added
Matrix
(thanks @exilor) - Added
CallConvention
attribute forfun
s. - Macros: added
constants
so you can inspect a type's constants at compile time. - Macros: added
methods
, which lists a type's methods (without including supertypes). - Macros: added
has_attribute?
for enum types, so you can check if an enum has the Flags attribute on it. - Many more small additions and bug fixes.
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
.