Comments (6)
Wow I feel silly, I forgot this is actually a component of the library's FFI already x_x I'm exposing it now, sorry for the delay!
from purescript-arraybuffer.
@jamesdbrock could you propose an expected type signature? I'm not sure if I completely understand what you're asking for.
from purescript-arraybuffer.
I'm just proposing to add part'
to the export list.
This one:
from purescript-arraybuffer.
Oh, I've been assuming that I could work with DataView
and ArrayView
on the same ArrayBuffer
, but that's not really how this is supposed to work, is it? DataView
is for network transport. ArrayView
is for buffers that stay on the local machine.
I can see now that probably no-one would ever want to construct a non-aligned ArrayView
.
from purescript-arraybuffer.
I mean, it might make sense. I personally share an ArrayBuffer
between multiple DataView
s and ArrayView
s often. ArrayBuffer
is just a reference to some mutable state, like an STRef
that you can't read or write to, because it's not formatted. DataView
gives you manual set
and read
functions, based on specific byte-wise indexes, but only with one value at a time. However, an ArrayView
gives you a typed interface to an ArrayBuffer
for the whole thing, acting as a typed array for a specific numeric type.
If I recall correctly, there is a way to slice into ArrayBuffer
s, giving you a new one to the same piece of memory, so you could offset manually like that, but I don't actually see an issue with what you're proposing. The thing is, though, this library should be a lightweight layer on top of the native interface javascript provides. I'll have to dig a little, but I'll try to get this idea fleshed out.
from purescript-arraybuffer.
Cool, thanks for maintaining this library, it's really nice.
from purescript-arraybuffer.
Related Issues (20)
- 8 bit read/writes should not send an Endianness argument HOT 1
- why do Getter results live in Eff? HOT 4
- why does `fromArray` take an `Array Number` argument instead of `Array Int`? HOT 2
- Expand String Conversion Support To Full Utf-16 Range of Code Points HOT 5
- `as_Array` is broken HOT 6
- Transient Purescript-Text-Encoding is overly burdensome. HOT 20
- purescript-quotient HOT 2
- typelevel dependency HOT 2
- transfer to purescript-contrib HOT 1
- Don't export Typed.part' HOT 1
- Polyfill is not defined when using `spago bundle-app` HOT 21
- publishing a breaking release as v12.0.0
- Sync issue labels with standard names
- ST instead of Effect? HOT 5
- fromUint8Array, toUint8Array HOT 1
- Reification
- Slice and subArray documentation reversed HOT 1
- BigInt64Array, BigUint64Array
- Mutability of types in Data.ArrayBuffer.ArrayBuffer HOT 4
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 purescript-arraybuffer.