I solved my problem like this:
proc deserialize[T](filename: string): ref T =
let obj = read_file(filename).to[:T]
result = new T
result[] = obj
let obj = spawn deserialize[A]("my_file.json")
RunBut i find it ugly, isn't it? Extra copy operation
