unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
* JSON->lisp Mapping: Hash vs AList
@ 2017-12-12  1:39 raman
  2017-12-12 13:08 ` Nicolas Petton
  2017-12-13 22:37 ` Philipp Stephani
  0 siblings, 2 replies; 31+ messages in thread
From: raman @ 2017-12-12  1:39 UTC (permalink / raw)
  To: emacs-devel

Build Emacs from @Head and started playing with the native
implementation of JSON parsing -- it works well and is much faster
than the lisp version as expected.

After writing some code with it, I have a feature request --- could we
set it up so that the caller can specify that json-hashes map to lisp
alists -- rather than lisp hash-tables? 

Justification:

1. JSON dicts tend to be deeply nested -- but rarely have a large
number of entries -- so  lisp  hash-tables may be overkill.

2. The deeply nested nature of JSON dicts makes accessing things at
deeper levels  require nested  calls to  gethash -- leads to code that
is opaque.

3. JS code succinctly accesses such nested data as a.b.c --- mapping
json dicts to lisp alists gives the same expressiveness when using
let-alist -- for an example see 
http://emacspeak.blogspot.com/2017/07/data-binding-in-emacs-lisp-let-alist.html

--raman 


-- 

-- 

-- 



^ permalink raw reply	[flat|nested] 31+ messages in thread

end of thread, other threads:[~2017-12-26 20:46 UTC | newest]

Thread overview: 31+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-12-12  1:39 JSON->lisp Mapping: Hash vs AList raman
2017-12-12 13:08 ` Nicolas Petton
2017-12-12 15:52   ` raman
2017-12-13 22:37 ` Philipp Stephani
2017-12-14  0:00   ` T.V Raman
2017-12-14 16:27   ` Eli Zaretskii
2017-12-16 22:24     ` Philipp Stephani
2017-12-17 15:53       ` Eli Zaretskii
2017-12-17 17:44         ` Philipp Stephani
2017-12-17 20:07           ` Eli Zaretskii
2017-12-18 19:55             ` Philipp Stephani
2017-12-18 20:19               ` Eli Zaretskii
2017-12-18 20:59                 ` Philipp Stephani
2017-12-19  3:50                   ` Vibhav Pant
2017-12-19 17:49                     ` Philipp Stephani
2017-12-19 17:08                   ` Eli Zaretskii
2017-12-19 17:22                     ` Philipp Stephani
2017-12-18 16:15           ` Clément Pit-Claudel
2017-12-19 17:50             ` Philipp Stephani
2017-12-15  4:13   ` Vibhav Pant
2017-12-16 22:25     ` Philipp Stephani
2017-12-18 20:26       ` [PATCH] Accept alists when serializing JSON Philipp Stephani
2017-12-20  5:58         ` Vibhav Pant
2017-12-22 13:55           ` Philipp Stephani
2017-12-24 17:16             ` Vibhav Pant
2017-12-26 20:46               ` Philipp Stephani
2017-12-24 13:00         ` Philipp Stephani
2017-12-16 22:34   ` JSON->lisp Mapping: Hash vs AList Stefan Monnier
2017-12-16 22:38     ` Philipp Stephani
2017-12-17  0:54       ` Paul Eggert
2017-12-17  2:41       ` Stefan Monnier

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).