This topic created in 1564 days ago, the information mentioned may be changed or developed.
比如这些问题:
之所以决定尝试 nim 是因为我一直使用 python ,看 nim 的语法觉得上手会比较快;能够编译到 javascript , 在个人 web 项目中应该可以更好维护。
我在尝试之前定下的小目标是用 nim 实现个异步的 i3ipc ,然后做个 web 前端实现对 i3wm 的远程控制,看到上面的两个问题我有些犹豫要不要继续了:
- 这两个问题都没能很好地解决,看起来语言实现还不够成熟
- 官方并没有给出明确的后续改进安排,也就是短期内无解
不知道大家对这个语言了解多吗,有啥可以分享的经验没?
 |
|
1
haoliang Feb 11, 2022
单纯从代码表现力来说,我真是爱了
``` import std/[asyncdispatch, times, sugar, sequtils]
proc main: int = proc ticker(ident, stop, interval: int) {.async.} = var remain = stop while remain > 0: await interval.sleepAsync echo ident, " ", now() dec remain
let futs = collect(newSeq): for ident in 1..3: ticker ident, 3, 1000
waitFor futs.foldl(a and b)
when isMainModule: quit main() ```
|
 |
|
2
haoliang Feb 11, 2022
上面的格式不对,重发一次
```nim import std/[asyncdispatch, times, sugar, sequtils]
proc main: int = proc ticker(ident, stop, interval: int) {.async.} = var remain = stop while remain > 0: await interval.sleepAsync echo ident, " ", now() dec remain
let futs = collect(newSeq): for ident in 1..3: ticker ident, 3, 1000
waitFor futs.foldl(a and b)
when isMainModule: quit main() ```
|