Giter VIP home page Giter VIP logo

jsondata's People

Contributors

freaky avatar prataprc avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

jsondata's Issues

Sortable JSON

When JSON is the document format for databases, there shall always be some
need to define PartialOrd and Ord for JSON formated values. More specifically
we may need to figure out the following details -

  • Sort order for different types - null, bool, number, string, array, object.
  • Sort order for bool - false values sort before true values.
  • Sort order for float
    • NaN sort before negative-infinity.
    • negative-infinity sort before all floating point values.
    • positive-infinity sort after all floating point values.
  • For Strings, Unicode sort order or binary sort order.
  • Should array size sort before array elements.
  • Should object size sort before object elements.
  • Minbound and Maxbound, especially useful when JSON is used in range queries.

Arithmetic and logical ops.

Following list of operations can be implemented.

  • Arithmetic operations, ADD, SUB, MUL, DIV, REM, NEG.
  • Bitwise operations, SHL, SHR, BITAND, BITOR, BITXOR.
  • Logical operations, NOT, AND, OR.
  • Compare operations EQ, NE, LT, LE, GT, GE.
  • Index operations.
  • Range operations.

Relicense request

In case you need jsondata to be part of a proprietary distribution or to be part of a different license agreement, please post your request here or contact the author directly.

Dependence on nightly

It looks like the following feature prevents the crate from compiling on stable Rust.

#![feature(total_cmp)]

Is it possible to work around this feature in order to get the crate to compile on stable? If not, is there an expected time frame for when this feature might make it into stable? I would really like to use the crate, but the dependence on nightly could become an issue.

Unicode collation

Unicode specification for sorting string has this to say:

Because collation varies by language and not just by script, it is not possible to arrange the encoding for characters so that simple binary string comparison produces the desired collation order for all languages. Because multi-level sorting is a requirement, it is not even possible to arrange the encoding for characters so that simple binary string comparison produces the desired collation order for any particular language.

Note that the current implementation of Ord on JSON string simply does a byte-by-byte comparison.

README badges.

Would be nice to add the following badges.

  • Build passing, Travis continuous integration.
  • Code coverage, codecov and coveralls.
  • Crates badge
  • Downloads badge
  • License badge
  • Rust version badge.
  • Maintenance-related badges based on isitmaintained.com
  • Documentation
  • Gitpitch

Hash stability

Values in jsondata::Json should not change in its hash value for any given hashing algorithm. Also the serialized form of jsondata::Json should not affect its hash value for any give hashing algorithm.

List of common hashing algorithm:

fasthash::city
fasthash::murmur3
SHA1

Streaming JSON parser.

Parse an incoming stream of JSON text. This can have separate
implementation from parsing non-streaming JSON text to avoid performance
overheads for the later case.

JSON5 implementation.

JSON5 extends JSON specification.

  • Object keys may be an ECMAScript 5.1 IdentifierName.
  • Objects may have a single trailing comma.
  • Arrays may have a single trailing comma.
  • Strings may be single quoted.
  • Strings may span multiple lines by escaping new line characters.
  • Strings may include character escapes.
  • Numbers may be hexadecimal.
  • Numbers may have a leading or trailing decimal point.
  • Numbers may be IEEE 754 positive infinity, negative infinity, and NaN.
  • Numbers may begin with an explicit plus sign.
  • Single and multi-line comments are allowed.
  • Additional white space characters are allowed.

Refer: Full JSON5 specification

Benchmark JSON operations.

Benchmark JSON operations like:

  • Arithmetic operations, ADD, SUB, MUL, DIV, REM, NEG.
  • Bitwise operations, SHL, SHR, BITAND, BITOR, BITXOR.
  • Logical operations, NOT, AND, OR.
  • Compare operations EQ, NE, LT, LE, GT, GE.
  • Index operations.
  • Range operations.

Alternate parsing, assuming ASCII encoding for JSON string.

JSON Strings can be unicode encoded and parsing them can be costly: For example

for r#""汉语 / 漢語; Hàn\b \tyǔ ""#

bench_string:  771 ns/iter (+/- 213)

By not supporting unicode encoded string, we can improve the performance of JSON deserialisation.

Right now parse_string() handles string parsing for JSON. Implement parse_ascii_string() as alternate feature.

Validate Total ordering for Numbers.

Total ordering is complex for floating point numbers. Adding to that in JSON, due to mixed type of integer and floating-point, total ordering need to be worked out across both integers and floats.

A detailed description for total ordering is covered here
Also there is a discussion thread in users.rust-lang.org.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.