Skip to content

Releases: crystal-lang/crystal

0.7.0

30 Apr 20:41
Compare
Choose a tag to compare
  • Crystal has evented IO by default. Added spawn and Channel.
  • 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, like Array#each, Hash#each, Int#times, Int#step, String#each_char, etc.
  • Added sprintf and improved String#% to support floats and float formatting.
  • Added more variants of String#gsub.
  • Added Pointer#clear and use it to clear an Array's values when doing pop 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 meant remainder, not it means modulo, similar to Ruby and Python. Added Int#remainder.
  • #to_s and #inspect now work for a union class.
  • Spec: added global before_each and after_each hooks, which will simplify the use of mocking libraries like timecop.cr and webmock.cr.
  • Range(T) is now Range(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

05 Mar 00:46
Compare
Choose a tag to compare
  • The class method now works in all cases. You can now compare classes with == and ask their hash value.
  • Block variables can now shadow local variables.
  • Range(B, E) is now Range(T).
  • Added Number::[]. Now you can do Int64[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 for funs.
  • 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

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.