unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
* guile-sjson's first public release (v0.2)!
@ 2017-04-25  4:18 Christopher Allan Webber
  2017-04-25  4:54 ` Marko Rauhamaa
  2017-04-25 13:06 ` Mark Oteiza
  0 siblings, 2 replies; 9+ messages in thread
From: Christopher Allan Webber @ 2017-04-25  4:18 UTC (permalink / raw)
  To: guile-user

[-- Attachment #1: Type: text/plain, Size: 1970 bytes --]

Hello all!  I'm happy to announce the first public release of
guile-sjson!

What's guile-sjson?  Well, it's basically the previous work David
Thompson did on (ice-9 json), but since that seemed to sit without being
merged for a while and I needed it for several projects, I went ahead
and turned it into a module, with Dave's blessing.

Here's the repo:

  https://gitlab.com/dustyweb/guile-sjson

And as for the release:

  https://dustycloud.org/misc/sjson-0.2.tar.gz
  https://dustycloud.org/misc/sjson-0.2.tar.gz.asc

You can see some more about it on its README:

  https://gitlab.com/dustyweb/guile-sjson/blob/master/README.org

In sum though, it has a nice s-expression based syntax:

  scheme@(guile-user)> (define a-horse
                        '(@ ("name" "buttercup")
                            ("age" 6)
                            ("animal" "horse")
                            ("noise" "neigh!")
                            ("food" ("carrot" "oats"))))
                            scheme@(guile-user)> (json-pprint a-horse)
  {
    "name": "buttercup",
    "age": 6,
    "animal": "horse",
    "noise": "neigh!",
    "food": [
      "carrot",
      "oats"
    ]
  }

However, since I'm using this for some fancy linked data stuff using
json-ld, linear access on the hashmaps wasn't great.  No problem!  I
bundled Andy Wingo's fash.scm in the package:

  scheme@(guile-user)> (read-json-from-string "{\"some-key\": \"some-value\"}"
                                              #:use-fash #t)
  $2 = #<fash ((some-key . some-value))>

This also means that since there isn't any other package of fash.scm
right now that I know of, guile-sjson is also a reasonable if roundabout
way to get fashes :)

Anyway, there are also some useful utilities for slicing and dicing
json objects in (sjson utils), so check those out also!

And right after this email, I'm going to submit this to Guix, so
hopefully it'll be in Guix soon as well!

Happy hacking!
 - Chris

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 832 bytes --]

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

end of thread, other threads:[~2017-04-26 14:57 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2017-04-25  4:18 guile-sjson's first public release (v0.2)! Christopher Allan Webber
2017-04-25  4:54 ` Marko Rauhamaa
2017-04-26  4:03   ` Christopher Allan Webber
2017-04-26  5:14     ` Marko Rauhamaa
2017-04-26 14:55       ` Christopher Allan Webber
2017-04-26 13:57     ` Thompson, David
2017-04-26 14:57       ` Christopher Allan Webber
2017-04-25 13:06 ` Mark Oteiza
2017-04-26  3:55   ` Christopher Allan Webber

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).