Skip to content

Releases: crystal-lang/crystal

0.6.0

12 Feb 10:50
Compare
Choose a tag to compare

Same as 0.5.10

0.5.10

12 Feb 10:15
Compare
Choose a tag to compare

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 struct
  • Pointer is now correctly considered a struct
  • Renamed Function to Proc

0.5.9

07 Feb 20:35
Compare
Choose a tag to compare
  • Random is now a module, with static methods that default to the Random::MT19937 class.
  • Added Random::ISAAC engine (thanks @ysbaddaden!)
  • Added String#size (thanks @zamith!)
  • Added limit to all String#split variants (thanks @jhass!)
  • Raising inside a Thread is now rescued and re-raised on join (thanks @jhass!)
  • Added path option to Projectfile for crystal 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 and Enumerable#minmax_of, Enumerable#to_h, Dir.chdir and Number#fdiv (thanks @jhass!)
  • Added String#match, String#[], String#[]? and MatchData#[]? related to regexes (thanks @jhass!)
  • Allow T::Bar when T is a generic type argument.
  • Added subclasses and all_subclasses in macros.
  • Now you can invoke to_s and inspect on C structs and unions, making debugging C bindings much easier!
  • Added #to_f and #to_i to Time and TimeSpan (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 and String#squeeze (thanks @jhass!)
  • Added -D flag option to the compiler to set compile-time flags to use in ifdef.
  • 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

16 Jan 20:43
Compare
Choose a tag to compare
  • Added Random and Random::MT19937 (Mersenne Twister) classes (thanks @rhysd).
  • Docs: removed automatic linking. To link to classes and methods surround with backticks.
  • Fixed #328: != bug.

0.5.7

02 Jan 23:47
Compare
Choose a tag to compare
  • Fixed: doc command had some hardcoded paths and didn't work
  • Added: private def at the top-level of a file is only available inside that file

0.5.6

31 Dec 17:49
Compare
Choose a tag to compare
  • 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

12 Dec 22:59
Compare
Choose a tag to compare
  • Removed src and crystal compiler libs directory from CRYSTAL_PATH.
  • Several bug fixes.

0.5.4

04 Dec 19:33
Compare
Choose a tag to compare
  • (breaking change) require "foo" always looks up in CRYSTAL_PATH. require "./foo" looks up relative to the requiring file.
  • (breaking change) Renamed Json to JSON, Xml to XML and Yaml to YAML to follow a convention.
  • (breaking change) To use HTTP types do, for example, require "http/client" instead of the old require "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? and File::directory?.
  • CSV parser can parse from String or IO.
  • When invoking the compiler like this: crystal foo.cr -o foo the build command is assumed instead of run.
  • Added short symbol notation for methods that are operators (i.e. :+, :*, :[], etc.).
  • Added TimeSpan#ago, TimeSpan#from_now, MonthSpan#ago and MonthSpan#from_now.

0.5.3

06 Nov 21:57
Compare
Choose a tag to compare
  • Spec: when a should or should_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 inherit Enum, 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. Use enum Name : BaseType.
  • Added Array#<=> and make it comparable to other arrays.

0.5.2

04 Nov 22:20
@waj waj
Compare
Choose a tag to compare
  • 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 example node.is_a?(HashLiteral).
  • Added emit_null property to json_mapping.
  • Added converter property to json_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 and Arg macro methods.
  • Added Time and TimeSpan 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 and unless 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.