Some more research turned up a macro in jsffi that works the way I want. Here's the improved code. import jsffi type Person = ref object of JsObject name: cstring val: int lang: cstring Rec = ref object of JsObject name: cstring val: int let obj1 {.exportc: "obj1".} = Rec{ friends: [ Person{ val: 19, name: "wendy", lang: "nim" } ], name: "sam", val: 21 } var myobj1 {.exportc: "myobj1".} = obj1 Run
- Exporting json objects to Javascript, how can I make this c... hiteshjasani
- Re: Exporting json objects to Javascript, how can I ma... juancarlospaco
- Re: Exporting json objects to Javascript, how can ... hiteshjasani