Nim is a compiled, garbage-collected systems programming language which has an excellent productivity/performance ratio. Nim's design focuses on efficiency, expressiveness, elegance (in the order of priority).
import redis
import uri
import strutils
proc main(url: string): void =
var u = uri.parseUri(url)
var client = redis.open(host=u.hostname, port=parseInt(u.port))
client.setk("nim_redis:test", "Hello, World")
let value = client.get("nim_redis:test")
assert(value == "Hello, World")
return
when isMainModule:
main("redis://127.0.0.1:6380/0")
6379.Port
? proc open*(host = "localhost", port = 6379.Port): Redis =
varargsLen
in a proc
always return 1
but in a template
it returns the right number of varargs
? eg. https://play.nim-lang.org/#ix=2F3a