[go: up one dir, main page]

Skip to content

A fast JSON parser for Elixir with some extra features

Notifications You must be signed in to change notification settings

rusterlium/juicy

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

8 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Juicy

Juicy is a JSON parser written as a NIF in the Rust language.

Juicy is currently in active development. It is not production ready yet.

Features:

  • Safety - Juicy is written entirely in safe Rust code. This means that there is a lot less ways it can crash the VM than something written in C. I have not had a single VM crash while developing this.
  • Speed - Juicy is comparible in speed to jiffy, and beats Poison at all benchmarks I have tried so far.
  • Streaming - Juicy supports parsing a stream of JSON. It can be configured to yield parts of a JSON document as they are read in, without keeping the whole file in memory. This makes it possible to parse very large JSON files while avoiding keeping the whole file in memory.
  • Convenience - Juicy supports parsing JSON directly into a rigidly defined schema. That includes maps with atom keys and elixir structs. Not fully implemented
  • UTF-8 compliance - Juicy is fully UTF-8 compliant. All invalid unicode codepoints result in parse errors.

It also has some disadvantages:

  • NIF - Being a NIF written in Rust, you need the Rust compiler installed to compile it. Using native code also complicates cross-compilation. There is also a higher risk of something bad happening to the VM when using a NIF.
  • No encoder - The project is currently focused on doing JSON parsing right, and does not have an encoder. This will probably change in the future.

Installation

If available in Hex, the package can be installed by adding juicy to your list of dependencies in mix.exs:

def deps do
  [{:juicy, "~> 0.1.0"}]
end

Documentation can be generated with ExDoc and published on HexDocs. Once published, the docs can be found at https://hexdocs.pm/jinx.

Releases

No releases published

Packages

No packages published