unofficial mirror of guile-user@gnu.org 
 help / color / mirror / Atom feed
From: Andy Wingo <wingo@pobox.com>
To: Corey Thomasson <cthom.lists@gmail.com>
Cc: guile-user@gnu.org
Subject: Re: json parser
Date: Sat, 28 Aug 2010 16:55:59 -0700	[thread overview]
Message-ID: <m3r5hi1ecw.fsf@unquote.localdomain> (raw)
In-Reply-To: <n2y4754958d1004011839g6814044dm672d28c010dbbbfe@mail.gmail.com> (Corey Thomasson's message of "Thu, 1 Apr 2010 21:39:15 -0400")

Hi Corey,

On Thu 01 Apr 2010 18:39, Corey Thomasson <cthom.lists@gmail.com> writes:

> I'm new to scheme/guile, but I got tired of writing web pages in
> php/html and started poking around my shared hosts /bin. Turns out
> guile 1.8 is installed, so I got to hacking.
>
> I couldn't find any json parsers that worked with guile, so I hacked
> on together.
>
> I don't know if it works with 1.9x, or how it could be improved
> (though I'm positive it could), or how unidiomatic it is, so any
> comment/advice/criticism/ridicule is welcome.
>
> http://github.com/cthom06/guile-json

Interesting stuff :) Some comments:

 * Indentation is non-standard; you should read
   http://mumble.net/~campbell/scheme/style.txt. It's a bit
   curmudgeonly, but correct.

 * Alists would be better for objects, I think, as it's a serializable
   data structure; obviously some form of serializable map would be
   better, if Guile had them ;)

 * Use #:use-module and #:export clauses in your define-module forms.

 * In fact a number of your let statements have bad syntax; apologies
   that guile 1.8 didn't catch this for you (it would have if the code
   were executed). 2.0 would have caught it at expansion time.

There are a few more things. If we were to include this in Guile 2.0
we'd probably use an expansion-time parser/lexer generator, perhaps via
PEG.

Happy hacking,

Andy
-- 
http://wingolog.org/



      reply	other threads:[~2010-08-28 23:55 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-04-02  1:39 json parser Corey Thomasson
2010-08-28 23:55 ` Andy Wingo [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/guile/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m3r5hi1ecw.fsf@unquote.localdomain \
    --to=wingo@pobox.com \
    --cc=cthom.lists@gmail.com \
    --cc=guile-user@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).