首页 > PHP资讯 > Python培训 > 编程语言Red 0.5.4发布:新datatypes、异常处理和set操作

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

Python培训
  

 

  颇具内涵的Red语言Logo

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

  更多详情请看这篇文章:《Red语言:向编程复杂性反击》

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

  

 

  图为:Red Language architecture schema

  关于编程语言Red请参见百科:百度和维基。

  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功能:

  break

  continue

  loop

  其它更新:

  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账户也可直接登录,你可以去这里和他们沟通交流:https://gitter.im/red/red

  下一步

  这次发布标志着在master重新集成Android分支的开始。另外,Red团队称将在0.6.0中支持GUI引擎和GUI DSL,不过Android back-end不在下个版本的计划中。此外,由于Android的开发周期很慢和调试选项的限制,所以Windows会成为GUI的第一个支持平台,可快速完成引擎和DSL。最后,在0.6.1中将会合并Android GUI back-end和toolchain。

本文由欣才IT学院整理发布,未经许可,禁止转载。