Comments (13)
I decided to dust off my C++ and see if I could be helpful. I added Nan as a dependency (it abstracts Node and V8 APIs: https://www.npmjs.com/package/nan) and used that in the places where the build was breaking. I made some naive assumptions to get it to build, so it probably doesn't actually work, but building was one step!
I'll try tomorrow to see if I can get the tests to run and everything, and then if you're okay with adding Nan as a dependency, I can create a PR for you. In the meantime, here's the commit where I got everything building on Node 4.2 (and still builds on Node 0.12.7):
from hdf5.node.
I'm not into nan. for the long haul. I have it building for v4; just didn't commit and publish. Am branching the code for v12 and v4.
I'll commit and publish tonight
from hdf5.node.
Cool, thanks for the update!
from hdf5.node.
Nan limits experimenting with the latest change in v8 and there are some cool things they keep adding
The incompatible change is node::Buffer initialization on the native side going through a check
from hdf5.node.
I pushed and published. I did this with nodejs v4.1.1 while building v4.2.1. Now this project builds with v4.2.1 yet during runtime with hdf5-1.8.15-patch1 I see a bug and am looking for it
from hdf5.node.
Also the mac I have to use is at work and I'm getting the network admin to put nodejs v4.2.1 on it to test ad create prebuilt packages
from hdf5.node.
node::Buffer::HasInstance
is returning a true for an object that is not a node::Buffer. Investigating further...
from hdf5.node.
HasInstance 1
constructor? Uint8Array
and Uint8Array is not a node::Buffer
Have to study this some more; definitely different between v4.1.1 and 4.2.1. Haven't tested 4.2.0
from hdf5.node.
Ah!
https://nodesource.com/blog/cpp-addons-for-nodejs-v4
node::Buffer has been completely rewritten with Uint8Array as its base. [Hope the buffer size is not now limited to int.]
When I do
var buffer=new Buffer(5*8, "binary");
buffer.type=H5Type.H5T_NATIVE_DOUBLE;
buffer.writeDoubleLE(1.0, 0);
buffer.writeDoubleLE(2.0, 8);
buffer.writeDoubleLE(3.0, 16);
buffer.writeDoubleLE(4.0, 24);
buffer.writeDoubleLE(5.0, 32);
console.dir("Buffer name "+buffer.constructor.name);
it says it's a Buffer; but the same object on the native side will say Uint8Array and also satisfy the HasInstance regardless if constructed by Buffer or Uint8Array. v4.2.1 has the change; v4.1.1 doesn't; building and testing v4.2.0... v4.2.0 has the issue.
I don't know why they change the constructor name going from javascript to native side; going to try to join a discussion on this.
from hdf5.node.
Yeah 4.2.0 is when they upgraded the v8 engine. It was the thing that held up the LTS blessing.
Interesting find. I will follow the node discussion as well.
Thanks all for all your hard work!
from hdf5.node.
ugh. unhappy with their take on it. Buffer=Uint8Array now
limits size to int and this is the size of all h5 dataset dimensions multiplied together.
It also is back to dealing with the Externalize which is a one time thing and breaks the multiple use of a buffer and passes memory cleanup to native. Have to think and study. Been wanting to look at streaming which will move multiple buffers along.
One of my design principles is avoid copying things and the Externalize just to get to the data causes a single use per buffer/object
from hdf5.node.
in the case of binaryjs streaming all the way to a browser page, native streaming of chunks/sections was on my list to tackle. As a step I had implemented regions access of a dataset; foreseeing numerous applications won't want to send a terabyte to the browser anyway.
need to move on from 4.1.x because of other broken things such as Buffer.concat
from hdf5.node.
Currently making Uint8Array work on the native side for Buffer and be as interchangeable at this point as possible. Hope your dataset size is within the size limit on Uint8Array.
Then going to develop streams
from hdf5.node.
Related Issues (20)
- Support for Single Writer Multiple Reader (SWMR)? HOT 7
- Getting dataset attribute (getDatasetAttribute) on a 32 bit floating point in NODE/javascript returns a totally different value HOT 6
- hdf5_home_win does not get set HOT 2
- Read dataset with 2d array stored fails on reading chunks HOT 10
- issues reading 4 dimensional dataset HOT 2
- SyntaxError: unsupported data type on compound datasets HOT 5
- Node 12? HOT 32
- Delete attribute HOT 6
- Tutorial: "Writing & Reading subsets" is not working. HOT 3
- Segfault reading HOT 4
- issue with appending to tables on windows 10
- Error: The specified procedure could not be found. (process.dlopen) HOT 1
- `hdf5.File is not a constructor` when bundled with webpack HOT 2
- cannot install HOT 3
- Win10+Node v14.15.5 Compilation errors HOT 6
- Getting data from Buffer
- Compile Error HOT 12
- install with yarn? HOT 2
- windows-build-tools / vs2017? HOT 37
- Error with handling variable length data (H5T_VLEN) HOT 6
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 hdf5.node.