Monday, April 27, 2015

The smallest possible cloud language

How small can a language be? Specifically, how small can we make a language for cloud computing?

Programs running in the cloud need not do a number of things that traditional programs must do. A program running in the cloud does not interact with a user, for example. (There may be a user directing a mobile app which in turn directs a cloud app, but that is an indirect interaction.)

Cloud programs do not read or write disk files, either. Nor do they access databases (directly).

Here's my list of minimal functions for a cloud program:

  • Accept an incoming web request (possibly with data in JSON)
  • Process the request (that is, operate on the JSON data)
  • Generate web requests to other servers
  • Receive responses from other servers
  • Send a response to the original web request (possibly with data in JSON)

That is the list for the smallest, simplest language for cloud computing. There is a little complexity hidden in the "operate on the JSON data"; the language must handle the values and data structures of JSON. Therefore it must handle numeric values, text values, boolean values, "null", lists, and dictionaries.

But that is it. That is the complete set of operations. The language (and its supporting libraries) does not have to handle dialogs, screen resolutions, responsive design, disk files, databases (those are handled by specialized database servers), or printing. We can remove functions that support all of those operations.

If we're clever, we can avoid the use of "generic" loops ("for i = 0; i < x; i++ ") and use the looping constructs of recent languages such as Python and Ruby ("x.times()" or ."x.each()" ).

So the smallest -- not necessarily ideal, just the smallest -- language for cloud computing may be a reduced version of Python. Or Ruby.

Or perhaps a variant of a functional programming language like Haskell or Erlang. Possibly F#, but with reductions to eliminate unused functions.

Or -- and this is a stretch -- perhaps an extended version of Forth. Forth has little overhead to start, so there is little to remove. It operates on 16-bit numeric values; we would need support for larger numeric values and for text values. Yet it could be done.

  • Our list of candidates for cloud computing are:
  • A reduced version of Python
  • A reduced version of Ruby
  • Haskell
  • Erlang
  • A reduced F#
  • An enhanced Forth

Look for them in future cloud platforms.

No comments: