Nim 0.17.0 发布,命令式编程语言
局长 2017年05月19日

Nim 0.17.0 发布,命令式编程语言

局长 局长 发布于2017年05月19日 收藏 7 评论 12
利发国际官方网全球专享福利,云栖大会购票大返现!>>>   Nim 0.17.0 发布了,Nim 是一种专注于性能,可移植性和表现力的系统编程语言。此版本修复了 0.16.0 版本中最重要的回归,特别是内存管理器和通道错误已经修复。
语言方面也有很多重大改进,特别是在概念(concepts)方面投入大量的工作。请查看下面的更改日志,获取全面的更改列表。影响向后兼容性的变更:
  1. There are now two different HTTP response types, Response and AsyncResponseAsyncResponse’s body accessor returns a Future[string]!Due to this change you may need to add another await in your code.
  2. httpclient.request now respects the maxRedirects option. Previously redirects were handled only by get and post procs.
  3. The IO routines now raise EOFError for the “end of file” condition. EOFError is a subtype of IOError and so it’s easier to distinguish between “error during read” and “error due to EOF”.
  4. A hash procedure has been added for cstring type in hashes module. Previously, hash of a cstring would be calculated as a hash of the pointer. Now the hash is calculated from the contents of the string, assumingcstring is a null-terminated string. Equal string and cstring values produce an equal hash value.
  5. Macros accepting varargs arguments will now receive a node having the nkArgList node kind. Previous code expecting the node kind to be nkBracket may have to be updated.
  6. memfiles.open now closes file handles/fds by default. Passing allowRemap=true to memfiles.open recovers the old behavior. The old behavior is only needed to call mapMem on the resulting MemFile.
  7. posix.nim: For better C++ interop the field sa_sigaction*: proc (x: cint, y: var SigInfo, z: pointer) {.noconv.} was changed to sa_sigaction*: proc (x: cint, y: ptr SigInfo, z: pointer) {.noconv.}.
  8. The compiler doesn’t infer effects for .base methods anymore. This means you need to annotate them with .gcsafe or similar to clearly declare upfront every implementation needs to fullfill these contracts.
  9. system.getAst templateCall(x, y) now typechecks the templateCall properly. You need to patch your code accordingly.
  10. macros.getType and macros.getTypeImpl for an enum will now return an AST that is the same as what is used to define an enum. Previously the AST returned had a repeated EnumTy node and was missing the initial pragma node (which is currently empty for an enum).
  11. macros.getTypeImpl now correctly returns the implementation for a symbol of type tyGenericBody.
  12. If the dispatcher parameter’s value used in multi method is nil, a NilError exception is raised. The old behavior was that the method would be a nop then.
  13. posix.nim: the family of ntohs procs now takes unsigned integers instead of signed integers.
  14. In Nim identifiers en-dash (Unicode point U+2013) is not an alias for the underscore anymore. Use underscores instead.
  15. When the requiresInit pragma is applied to a record type, future versions of Nim will also require you to initialize all the fields of the type during object construction. For now, only a warning will be produced.
  16. The Object construction syntax now performs a number of additional safety checks. When fields within case objects are initialiazed, the compiler will now demand that the respective discriminator field has a matching known compile-time value.
  17. On posix, the results of waitForExitpeekExitCodeexecCmd will return 128 + signal number if the application terminates via signal.
  18. ospaths.getConfigDir now conforms to the XDG Base Directory specification on non-Windows OSs. It returns the value of the XDG_CONFIG_DIR environment variable if it is set, and returns the default configuration directory, “~/.config/”, otherwise.
  19. Renamed the line info node parameter for newNimNode procedure.
  20. The parsing rules of do changed.  foo bar do:     bazUsed to be parsed as:  foo(bar(do:     baz))Now it is parsed as:  foo(bar, do:     baz)
详情请参阅发布主页
下载地址
  1. Source code (zip)
  2. Source code (tar.gz)
  3. https://nim-lang.org/install.html
>>>【全民狂欢,评论有礼】5月15日-31日评论每日更新的“新闻资讯和软件更新资讯”,评论点赞数超过 20 的可登上每周更新的“源资讯”和“软件周刊”两大栏目,点赞数超过 50 的还将获得 5 活跃积分奖励和利发国际官方网定制好礼。详情
本站文章除注明转载外,均为本站原创或编译。欢迎任何形式的转载,但请务必注明出处,尊重他人劳动共创开源社区。
转载请注明:文章转载自 利发国际官方网社区 [http://www.oschina.net]
本文标题:Nim 0.17.0 发布,命令式编程语言
分享
评论(12)
精彩评论
3
这个语言的实现方式很有趣,和大多数新语言直接用LLVM或者JVM不同,他是先生成C代码然后用C编译器来编译成机器码。
3

引用来自“利发国际官方网-首席村长”的评论

Nim什么时候能想kotlin一样崛起?
那得找个大腿抱一抱
1
lgphp@lgphp-mint ~ $ wrk -t3 -c1000 -d10s http://localhost:3002/
Running 10s test @ http://localhost:3002/
3 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 25.35ms 13.44ms 317.56ms 96.06%
Req/Sec 12.07k 3.31k 19.23k 77.00%
360292 requests in 10.06s, 56.35MB read
Requests/sec: 35802.13
Transfer/sec: 5.60MB
我用php跑的。
https://github.com/lgphp/lgphp-webframework 用例在这里
1
这个有点渣啊,C系的除了nginx还有那个可以玩下?

Running 5m test @ http://127.0.0.1:8888/
120 threads and 400 connections

1,java undertow 这个做为最低基准,java都超越不了,实在怀疑有没有搞的必要
4507892 requests in 5.00m, 9.47GB read
Requests/sec: 15021.42
Transfer/sec: 32.32MB


2,rust hyper <还有些错误,不完善>
29311840 requests in 5.00m, 60.30GB read
Socket errors: connect 0, read 0, write 458, timeout 0
Requests/sec: 97674.38
Transfer/sec: 205.77MB


3,nim jester
33139 requests in 5.00m, 522.36MB read
Socket errors: connect 648, read 33141, write 5, timeout 106
Requests/sec: 110.43
Transfer/sec: 1.74MB
1
更新太慢,等了四个月了,才有这么点更新。至少要达到sbcl那样的更新速度才能强大起来。
最新评论
1
lgphp@lgphp-mint ~ $ wrk -t3 -c1000 -d10s http://localhost:3002/
Running 10s test @ http://localhost:3002/
3 threads and 1000 connections
Thread Stats Avg Stdev Max +/- Stdev
Latency 25.35ms 13.44ms 317.56ms 96.06%
Req/Sec 12.07k 3.31k 19.23k 77.00%
360292 requests in 10.06s, 56.35MB read
Requests/sec: 35802.13
Transfer/sec: 5.60MB
我用php跑的。
https://github.com/lgphp/lgphp-webframework 用例在这里
0

引用来自“游客”的评论

这个有点渣啊,C系的除了nginx还有那个可以玩下?

Running 5m test @ http://127.0.0.1:8888/
120 threads and 400 connections

1,java undertow 这个做为最低基准,java都超越不了,实在怀疑有没有搞的必要
4507892 requests in 5.00m, 9.47GB read
Requests/sec: 15021.42
Transfer/sec: 32.32MB


2,rust hyper <还有些错误,不完善>
29311840 requests in 5.00m, 60.30GB read
Socket errors: connect 0, read 0, write 458, timeout 0
Requests/sec: 97674.38
Transfer/sec: 205.77MB


3,nim jester
33139 requests in 5.00m, 522.36MB read
Socket errors: connect 648, read 33141, write 5, timeout 106
Requests/sec: 110.43
Transfer/sec: 1.74MB
这个结果不符合直觉啊。差距应该没有这么大。
1
这个有点渣啊,C系的除了nginx还有那个可以玩下?

Running 5m test @ http://127.0.0.1:8888/
120 threads and 400 connections

1,java undertow 这个做为最低基准,java都超越不了,实在怀疑有没有搞的必要
4507892 requests in 5.00m, 9.47GB read
Requests/sec: 15021.42
Transfer/sec: 32.32MB


2,rust hyper <还有些错误,不完善>
29311840 requests in 5.00m, 60.30GB read
Socket errors: connect 0, read 0, write 458, timeout 0
Requests/sec: 97674.38
Transfer/sec: 205.77MB


3,nim jester
33139 requests in 5.00m, 522.36MB read
Socket errors: connect 648, read 33141, write 5, timeout 106
Requests/sec: 110.43
Transfer/sec: 1.74MB
0
你妹加油
1
更新太慢,等了四个月了,才有这么点更新。至少要达到sbcl那样的更新速度才能强大起来。
1
:laughing:

nim 可以编译成OJ
1
尼玛?🤣🤣这是门愤怒的语言
0
这种语言,感觉更加玩具。
3
这个语言的实现方式很有趣,和大多数新语言直接用LLVM或者JVM不同,他是先生成C代码然后用C编译器来编译成机器码。
0
6666
3

引用来自“利发国际官方网-首席村长”的评论

Nim什么时候能想kotlin一样崛起?
那得找个大腿抱一抱
Nim什么时候能想kotlin一样崛起?
顶部
利发国际官方网