Re: Is there non-broken serialization of complex types in nim?

2020-04-07 Thread b3liever
my 
[package]([https://github.com/b3liever/eminim](https://github.com/b3liever/eminim))
 mostly works


Re: Is there non-broken serialization of complex types in nim?

2020-04-07 Thread readysloth
Forgive me, I spotted where i messed up! I made table with `new_table` 
function, which produces `ref Table`, but deserialized it as `Table`


Re: Is there non-broken serialization of complex types in nim?

2020-04-07 Thread cdome
I was using marshal quite successfully before. I also use samson 
[https://github.com/GULPF/samson](https://github.com/GULPF/samson).


Is there non-broken serialization of complex types in nim?

2020-04-07 Thread readysloth
Hi all.

I resently asked a [question](https://forum.nim-lang.org/t/6153) about how can 
i serialize type like `table[A, Hash_set[A]]` in nim. I used standard marhal 
package (and still want to stick to standard library), but i can't deserialize 
it after serialization.

When i try to, runtime crashes with 


/usr/lib/nim/pure/marshal.nim (333) to
/usr/lib/nim/pure/marshal.nim (266) loadAny
/usr/lib/nim/pure/marshal.nim (179) loadAny
/usr/lib/nim/pure/parsejson.nim (522) raiseParseErr
Error: unhandled exception: unknown file(1,1) Error: '{' expected for an 
object expected [JsonParsingError]


Run

But '{' is in place!

This is how i try to deserialize it: 


let deserialized = read_file("serialized.json").to[:Table[A, Hash_set[A]]


Run

BTW it doesn't work even for simple types like strings or ints :(