Comments (4)
Edit: with debug output:
$User/.nimble/pkgs/nesm-0.3.1/nesm.nim(186, 9) Hint: TypeDef
Sym "MNIST_imgs"
Empty
ObjectTy
Empty
Empty
RecList
IdentDefs
Postfix
Ident ident"*"
Ident ident"magic_number"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"n_imgs"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"n_rows"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"n_cols"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"data"
BracketExpr
Sym "seq"
Sym "uint8"
Empty [User]
/Users/tesuji/.nimble/pkgs/nesm-0.3.1/nesm.nim(208, 9) Hint: TypeDef
Sym "MNIST_imgs"
Empty
ObjectTy
Empty
Empty
RecList
IdentDefs
Postfix
Ident ident"*"
Ident ident"magic_number"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"n_imgs"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"n_rows"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"n_cols"
Sym "int32"
Empty
IdentDefs
Postfix
Ident ident"*"
Ident ident"data"
BracketExpr
Sym "seq"
Sym "uint8"
Empty [User]
serialization_nesm.nim(10, 15) template/generic instantiation from here
/Users/tesuji/.nimble/pkgs/nesm-0.3.1/nesm/generator.nim(100, 10) Error: undeclared identifier: 'data'
from nesm.
Not related to the bug but it looks like the structure was not described in correct way. seq[uint8]
reads the number of elements first and then reads elements themselves.
To serialize such a structure you need to use special pragma-like options {size: N}
and {sizeof: N}
from the devel branch. Examples can be found here and here.
from nesm.
I can not reproduce it on both of latest master or devel (aad2ce3 and 076639c) NESM branches with nim-lang/Nim@35133d9
Could you please provide the commit hash of the NESM version you are using?
from nesm.
It's the latest released version that doesn't work (v0.3.1), I build NESM from head and it works. So closing.
And thanks for the extra info on the structure.
from nesm.
Related Issues (16)
- Feature requests for network programming HOT 12
- No deserialization in release build HOT 2
- feature request: support `when defined` blocks.
- feature request: setting lengths and field defaults HOT 8
- strange error which occurs only during nim doc; should docs work? HOT 3
- Feature Request: Option to Skip Serialization of certain Fields
- Bug: Dynamic variants cannot be nested in periodic types HOT 1
- Bug: Users cannot import library without also defining nimOldCaseObjects HOT 1
- Bug: Nimdoc comments for objects are lost in serializable macro HOT 2
- Instantiating enums with ARC gives different error messages break tests
- Doesn't work on devel (0.17.3) HOT 2
- support js backend? HOT 1
- Custom size and sizeof for sequences not working HOT 1
- Wrong size of an enum's set HOT 2
- Problem serializing nested objects HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from nesm.