编程语言Red 0.5.4发布:新datatypes、异常处理和set操作

更新时间:2015-06-16 10:37:41点击次数:832次

颇具内涵的Red语言Logo

Red是一种可以运行于多种平台的全栈语言,它的语法主要继承于Rebol,同时在设计过程中借鉴了Scala和Lua的优点 。作为一门全栈语言,Red既可以用于高层级的编程,如DSL(Domain Specific Language),也可用于低层级的编程,如设备驱动。

Red 0.5.4版本是一次重大的更新,带来了大量的新特性。接下来他将支持GUI,也可能会支持DSL。

Red开始支持了一些新的datatype,包括:Pair! datatype、Percent! datatype、Tuple! datatype、Map! datatype等。

同时,它也支持了Set操作,主要有:

  • union: returns the union of two data sets.

  • exclude: returns the first data set less the second data set.

  • intersect: returns the intersection of two data sets.

  • difference: returns all the values which differ from two data sets.

  • unique: returns the data set with duplicates removed.

而这些操作可以应用于这些datatypes:block!、string!、bitset!、typeset!。(注:会在下一个版本中支持 Hash! datatype)

New natives:as-pair、break、continue、extend。

New action:put。(注:PUT仅支持在map!中实现,其它的支持请静候未来版本)

New function:cause-error

Red/System additions

添加New natives是为了更好地支持新的Red功能:

其它更新

  • exit/return are now defined as natives instead of volatile keywords.

  • do can accept error! values.

  • parse and load are now more stable when errors are raised from parsing rules.

  • load errors handling greatly improved (no console exit on syntax errors anymore).

  • value? now supports any type, except unset! as argument.

  • fixed bugs and little improvement of help output.

  • minor Redbin speed and generated payload size improvement.

  • prin output in console fixed.

  • fixed Red/System's #get directive not working in some cases.

  • system/words now defined as an object!.

  • compiler now supports system/words/ prefix to access global context words.

  • many fixes and improvements on vector! datatype, especially on math operations.

  • color definitions are now available.

  • vector! unit tests significantly extended.

  • an op! used without arguments in the interpreter now reports an error.

  • pick and poke now accept a logic! value as index.

  • added missing comparison operators for vector!.

  • paths evaluation errors in interpreter are now more accurate.

  • first memory frame allocation increased from 512KB to 1MB.

  • fixed memory corruptions caused by function with refinements in interpreter.

  • division by zero now properly caught for floats.

  • last but not least, 44 bugs reported on Github's tracker fixed in this release!

项目迁移至Gitter

Red团队认为Gitter虽然年轻,但前途不可限量,所以已经将项目迁移至了Gitter,用GitHub账户也可直接登录。



  • 项目经理 点击这里给我发消息
  • 项目经理 点击这里给我发消息
  • 项目经理 点击这里给我发消息
  • 项目经理 点击这里给我发消息