buffet's People
Forkers
drupbuffet's Issues
Talk about interface
Idea behind buffet
is to provide a safe interface to manipulate buffer (string
, bytes
and bigstring
). buffet
has different levels about interface:
Buffet0
this is the foundation for the next level, it's just a bunch ofexternal
,bigstringaf
and nothing else. We provide getter and setter onchar
,int
,int32
andint64
(little-endian and big-endian) like whatbigstringaf
does already.Buffet1
: we start with a GADT to keep kind of buffer. We merge all on atype 'kind tag
type which is used to dispatch functions to the good implementation.Buffet1.get bytes
will callBytes.get
.Buffet2
: we continue with a GADT but put some information like if we have a read, write or async (leave the global lock) capability on one of kinds of buffer. Limitation on GADT can not permit us to use a sub-typing (like we do in a common way with polymorphic variant). In this implementation, we lint some pattern-matching like the dispatcher on theset
/unsafe_set
function which don't allow aString
kind for example.Buffet3
: we put a new information, an offset and a length withtype ('a, 'k) Buffet1.access
which check at any step if slice is available on the buffer'k
. I decided to return aresult
type,Ok
if we have an access on the buffer'k
with a specific slice or an error, you can see the functioncommit
orwith_off
andwith_len
with the bind operator>>=
.Buffet4
: again, a GADT to hidden/packtype ('a, 'k) Buffet3.meta
with 'k. Then, we check with GADT if we are allowed toread
/write
and so on on it with reflection. In other case, we raise an exception.
I'm currently on a new implementation of Buffet2
which use polymorphic variant. Then, we need to do some benchmark to compare them and see which is the best:
- discard
String
case - or raise an exception
If you have any advise, I will happy to discuss about that (@hannesm, @samoht, @cfcs, @let-def, @Drup).
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.