[racket] wffi (a "literate" web service "FFI" using a markdown file with parameterized HTTP messages)

From: Eli Barzilay (eli at barzilay.org)
Date: Thu Oct 11 18:13:07 EDT 2012

Two days ago, Greg Hendershott wrote:
> 2. A markdown -> API JSON format tool, to make quick work of other
>    web services.

In the Racket context this should be almost trivial, since you don't
need markdown -- just have text with @scribble things that have the
json stuff as-is instead of parsing text.


Two days ago, Greg Hendershott wrote:
> 
> 2. Part of me is starting to suspect seduction by the sirens of
> runtime dynamism and macros. Instead, maybe real users want a
> library that works, don't care how, but do want good docs and
> checks. Instead of a runtime/macro proposition, a tool could emit a
> literal .rkt file, plus maybe some head-start markdown and/or
> Scribble docs. To which a package developer would apply some spit
> and polish, and push to PLaneT and/or GitHub.
> 
> Re this second approach, note that the Google JSON API format
> appears to have enough info to generate contracts for untyped
> Racket, as well as Typed Racket interfaces.
> 
> I'm not sure if I'm explaining the choice clearly, but, any feelings
> or suggestions about this?

I'm not sure about the details, but usually it's fine to start with
something "very dynamic" that can even go as far as using `eval' to
generate code -- and then you have enough code to "shift things up"
and do the work at the macro level instead, producing code rather than
strings/sexpr/etc.  (But IMO it's necessary to do the switch for a
proper library, so the danger of doing this is giving up half-way and
staying with the dynamic hacks.)

-- 
          ((lambda (x) (x x)) (lambda (x) (x x)))          Eli Barzilay:
                    http://barzilay.org/                   Maze is Life!

Posted on the users mailing list.