Hacker News new | ask | show | jobs
by mpweiher 4858 days ago
While I agree with the title, I am not so sure about the solution presented. HATEOAS, whether encoded in JSON or XML, can only give you so much information about the semantics of links.

IMHO, what's needed is better support for "generic" REST in programming languages and/or libraries. Objective-Smalltalk (http://objective.st) features "Polymorphic Identifiers", which make it possible to both interact directly and abstract over web interfaces.

To reference a URL, just write it down:

   news := http://news.ycombinator.com
Arguments can be added without string processing:

   #!/usr/local/bin/stsh
   #-zip:zipCode
   ref:http://zip.elevenbasetwo.com getWithArgs zip:zipCode
This is a file downloader, similar to curl:

   #!/usr/local/bin/stsh
   #-<void>scurl:<ref>urlref
   fileComponent := urlref url path lastPathComponent.
   file:{fileComponent} := urlref value.
For abstraction, you can build your own schemes, either directly in code or by composing/modifying other schemes. For example, if I want to look up RFCs, I can define the rfc scheme:

   scheme:rfc := ref:http://datatracker.ietf.org/doc asScheme
Or I can compose schemes so the rfc scheme looks in a bunch of different places (memory, local directoy, several http/ftp servers).