发布于 2015-09-21 01:22:14 | 175 次阅读 | 评论: 0 | 来源: 网友投递
Crystal 编译型的编程语言
Crystal 是一个编译型的编程语言。
Crystal 0.8.0 发布,此版本主要改进:枚举定义问题方法;大大改进调试器支持;shards 成为官方依赖安装方法等等。
更新内容如下:
(breaking change) Renamed a couple of types: ChannelClosed
-> Channel::ClosedError
,UnbufferedChannel
-> Channel::Unbuffered
, BufferedChannel
-> Channel::Buffered
,DayOfWeek
-> Time::DayOfWeek
, MonthSpan
-> Time::MonthSpan
, TimeSpan
-> Time::Span
,TimeFormat
-> Time::Format
, EmptyEnumerable
-> Enumerable::EmptyError
, SocketError
-> Socket::Error
,MatchData
-> Regex::MatchData
, SignedInt
-> Int::Signed
, UnsignedInt
-> Int::Unsigned
,FileDescriptorIO
-> IO::FileDescriptor
, BufferedIO
-> IO::Buffered
, CharReader
-> Char::Reader
,PointerAppender
-> Pointer::Appender
.
(breaking change) All places that raised DomainError
raise ArgumentError
now.
(breaking change) Renamed Type.cast
to Type.new
(for example, Int32.new
instead of Int32.cast
)
(breaking change) Removed all macro instance variables except @type
(breaking change) Removed undef
(breaking change) Removed length()
and count()
methods from collections. The only method for this is now size
.
(breaking change) Removed the ability to invoke methods on a union class
Improved debugger support
crystal deps
now delegates to shards. Removed Projecfile
support.
Automatically convert numeric types when invoking C functions
Automatically define questions methods for enum members
Support quotes inside quoted symbols (thanks @wolflee)
Allow marking initialize
as private
Added method_added
macro hook (thanks @MakeNowJust)
Added ArrayLiteral#includes?(obj)
in macros
Added ASTNode#symbolize
in macros (thanks @kirbyfan64)
Added experimental yaml_mapping
Added nilable variants to Enumerable#max
, Enumerable#min
, and others (thanks @technorama)
Added Iterator#flatten
(thanks @jpellerin)
Added setting a read timeout to HTTP::Client
(thanks @benoist)
Added Array#delete_at(index, count)
and Array#delete_at(range)
(thanks @tebakane)
Added HTTP::Cookies
(thanks @netfeed)
Added Tuple#reverse
(thanks @jhass)
Added Number#clamp
(thanks @technorama)
Added serveral socket options (thanks @technorama)
Added WebSocket.open
(thanks @kumpelblase2)
Added Enum.flags
macro
Added support for sending chunked content in HTTP server (thanks @bcardiff)
Added future
, lazy
and delay
concurrency methods (thanks @technorama)
fork
now returns a Process
(thanks @technorama)
Documented Set
, and added a couple of methods (thanks @will)
Nicer formatting in Benchmark.ips
, and interactive mode (thanks @will)
The -f
format output is now honored in compiler errors (thanks @kirbyfan64)
Fixed an ambiguity with the crystal build
command (thanks @MakeNowJust)
Cast exceptions now raise TypeCastError
instead of Exception
(thanks @will)
Many bugs fixes
下载:
Crystal 是一个编译型的编程语言。特性:
语法类似 Ruby Ruby-inspired syntax.
无需指定变量类型和方法参数类型 Never have to specify the type of a variable or method argument.
可以调用 C 代码 Be able to call C code by writing bindings to it in Crystal.
编译时代码模拟和生成 Have compile-time evaluation and generation of code, to avoid boilerplate code.
编译成高效的本机代码 Compile to efficient native code.