Skip to content

echou/eep0018

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

19 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Changes to davisp's EEP0018:

1. yajl_encode_string() adds an option "encode_utf8". If true, valid UTF-8 sequences are 
   encoded to \uXXXX format, otherwise are output as is. Invalid sequences are still encoded 
   to \u00XX format. 

2. encode_json.c. The following erlang terms are encoded to json maps:
   * {[ {K,V}, ... ]}, this is the original one.
   * [ {K,V}, ... ], simplified notation
   * {struct, [{K,V}, ...]}, this is mochijson2's notation.

   still, [] is mapped to empty json array. {[]} means empty json map.

3. Rewrite eep0018.erl according to Driver's Efficiency Guide.

4. Simple makefile, no need to use autoconf mechanism.


===========================================


This module strives to prepare an EEP0018 implemenation. It implements most of the 
functionality described there, with some additional features.  

YAJL
====

The parsing engine that drives behind that module is YAJL, see http://lloydforge.org/projects/yajl/.
The source tree contains a copy of that library, currently at version 0.4.0.
 
Differences to EEP 18
=======================

EEP 18's json_to_term function defines parsing of JSON objects. As CouchDB
needs a JSON parser that is able to parse JSON values this implementation adds
this functionality.

Implemenation Status
====================

The current development is done on OS/X 10.5. Other OSes might need a tuned
Makefile.

Critical Discussion
===================

For a critical discussion of JSON <-> Erlang interaction see here:

	http://fullof.bs/prototype-eep-18-considered-harmful-the-problems-with-erlang-to-json-term-translation#more-402
	
	and
	
	http://sc.tri-bit.com/outgoing/scjson%20parser%20halp.html

About

Improves a bit over davisp's EEP0018

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • C 66.4%
  • Erlang 33.6%