All Projects → elm → bytes

elm / bytes

Licence: BSD-3-Clause license
Work with bytes and implement network protocols

Programming Languages

elm
856 projects
javascript
184084 projects - #8 most used programming language

Projects that are alternatives of or similar to bytes

Deku
Declarative binary reading and writing: bit-level, symmetric, serialization/deserialization
Stars: ✭ 136 (+76.62%)
Mutual labels:  serialization, bytes, deserialization
Noproto
Flexible, Fast & Compact Serialization with RPC
Stars: ✭ 138 (+79.22%)
Mutual labels:  serialization, deserialization
Bytes
Swift Library for working with sequences of Bytes (aka [UInt8])
Stars: ✭ 35 (-54.55%)
Mutual labels:  serialization, bytes
Marshmallow Jsonapi
JSON API 1.0 (https://jsonapi.org/) formatting with marshmallow
Stars: ✭ 203 (+163.64%)
Mutual labels:  serialization, deserialization
sqlathanor
Serialization / De-serialization support for the SQLAlchemy Declarative ORM
Stars: ✭ 105 (+36.36%)
Mutual labels:  serialization, deserialization
har-rs
A HTTP Archive format (HAR) serialization & deserialization library, written in Rust.
Stars: ✭ 25 (-67.53%)
Mutual labels:  serialization, deserialization
Aspjson
A fast classic ASP JSON parser and encoder for easy JSON manipulation to work with the new JavaScript MV* libraries and frameworks.
Stars: ✭ 165 (+114.29%)
Mutual labels:  serialization, deserialization
Yaxlib
Yet Another XML Serialization Library for the .NET Framework and .NET Core
Stars: ✭ 124 (+61.04%)
Mutual labels:  serialization, deserialization
Mashumaro
Fast and well tested serialization framework on top of dataclasses
Stars: ✭ 208 (+170.13%)
Mutual labels:  serialization, deserialization
Schematics
Project documentation: https://schematics.readthedocs.io/en/latest/
Stars: ✭ 2,461 (+3096.1%)
Mutual labels:  serialization, deserialization
Jsonapi Rb
Efficiently produce and consume JSON API documents.
Stars: ✭ 219 (+184.42%)
Mutual labels:  serialization, deserialization
Flatsharp
Fast, idiomatic C# implementation of Flatbuffers
Stars: ✭ 133 (+72.73%)
Mutual labels:  serialization, deserialization
Pyjson tricks
Extra features for Python's JSON: comments, order, numpy, pandas, datetimes, and many more! Simple but customizable.
Stars: ✭ 131 (+70.13%)
Mutual labels:  serialization, deserialization
Borer
Efficient CBOR and JSON (de)serialization in Scala
Stars: ✭ 131 (+70.13%)
Mutual labels:  serialization, deserialization
avro-serde-php
Avro Serialisation/Deserialisation (SerDe) library for PHP 7.3+ & 8.0 with a Symfony Serializer integration
Stars: ✭ 43 (-44.16%)
Mutual labels:  serialization, deserialization
Orjson
Fast, correct Python JSON library supporting dataclasses, datetimes, and numpy
Stars: ✭ 2,595 (+3270.13%)
Mutual labels:  serialization, deserialization
Yyjson
The fastest JSON library in C
Stars: ✭ 1,894 (+2359.74%)
Mutual labels:  serialization, deserialization
Awesome Python Models
A curated list of awesome Python libraries, which implement models, schemas, serializers/deserializers, ODM's/ORM's, Active Records or similar patterns.
Stars: ✭ 124 (+61.04%)
Mutual labels:  serialization, deserialization
Dart Json Mapper
Serialize / Deserialize Dart Objects to / from JSON
Stars: ✭ 206 (+167.53%)
Mutual labels:  serialization, deserialization
Jsonapi Rails
Rails gem for fast jsonapi-compliant APIs.
Stars: ✭ 242 (+214.29%)
Mutual labels:  serialization, deserialization

Bytes

Work with densely packed sequences of bytes.

The goal of this package is to support network protocols such as ProtoBuf. Or to put it another way, the goal is to have packages like elm/http send fewer bytes over the wire.

Motivation = A vision for data interchange in Elm

Please read it!

Example

This package lets you create encoders and decoders for working with sequences of bytes. Here is an example for converting between Point and Bytes values:

import Bytes exposing (Endianness(..))
import Bytes.Encode as Encode exposing (Encoder)
import Bytes.Decode as Decode exposing (Decoder)


-- POINT

type alias Point =
  { x : Float
  , y : Float
  , z : Float
  }

toPointEncoder : Point -> Encoder
toPointEncoder point =
  Encode.sequence
    [ Encode.float32 BE point.x
    , Encode.float32 BE point.y
    , Encode.float32 BE point.z
    ]

pointDecoder : Decoder Point
pointDecoder =
  Decode.map3 Point
    (Decode.float32 BE)
    (Decode.float32 BE)
    (Decode.float32 BE)

Rather than writing this by hand in client or server code, the hope is that folks implement things like ProtoBuf compilers for Elm.

Again, the overall plan is described in A vision for data interchange in Elm!

Scope

This API is not intended to work like Int8Array or Uint16Array in JavaScript. If you have a concrete scenario in which you want to interpret bytes as densely packed arrays of integers or floats, please describe it on https://discourse.elm-lang.org/ in a friendly and high-level way. What is the project about? What do densely packed arrays do for that project? Is it about perf? What kind of algorithms are you using? Etc.

If some scenarios require the mutation of entries in place, special care will be required in designing a nice API. All values in Elm are immutable, so the particular API that works well for us will probably depend a lot on the particulars of what folks are trying to do.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].