Skip to content

Instantly share code, notes, and snippets.

@thosakwe
Last active August 27, 2017 22:48
Show Gist options
  • Save thosakwe/17335dec85f7324d807b3b4aee3e06f0 to your computer and use it in GitHub Desktop.
Save thosakwe/17335dec85f7324d807b3b4aee3e06f0 to your computer and use it in GitHub Desktop.
The Greatest Language Ever

An ecosystem with complete conformity. At all times. Always. No doubt. Easy-to-write documentation.

For example, every asynchronous operation is either a Promise (one-time only), or a Stream (continuously fires events). There should be an official client API for consuming services over HTTP, etc.

import <http/client> as http
import <json> as json

def login [username: string, password: string] (
  // Something like a cascade, should be totally stateless...
  set rq (
    http::request("https://api.example.com/api/login")
      .method("POST")
      .body (
        json::encode({username, password})
      )
    )
	
  // An `async` block queues actions to run after an asynchronous
  // computation.
  return async (rq.send() => res) (
    // Here, `res` is the server's response...
    return json::decode(res.string())
  )
)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment