English as a Programming Language

Today we are going to be using Hupreter to show you how you can use English, a natural language, as a programming language. As you probably know, there are many, many reasons why this is hard:

  • Sentences in spoken English are usually ambigous (more than one possible meaning).
  • References to the objects around the room. Example: ‘that chair is red’.
  • Sarcasm.
  • Many more

But, in spite of all those reasons, it is possible to create apps and write programs using your own words, in your own language. Here are some examples:

Print even numbers using Hupreter
Print even numbers using Hupreter

Now that we have seen that it is possible to give the computer instruction in spoken English, let’s go a bit further.

Imagine you have a thermoteter at home and you want to calculate the median temperature. You can pass those values in to Hupreter as a list (click here to see other supported data types):

Given the list [28, 27, 29, 19, 20, 21, 22, 23], calculate the median.

Once you tell your computer what to do, Hupreter will do the rest:

Calculating the median with Hupreter
Calculating the median with Hupreter

Automation and APIs

You might want to automate the previous tasks and have hupreter automatically calculate the median temperature every X amount of days. In order to achieve that, we will save the app as an API:

a) Click on the App menu, and select “Save as API”.

b) Choose a name for your app.

c) Call the API using the provided endpoint.

Additionally, Hupreter allows you to specify parameters or inputs for your App/API.

See examples of how to build an App.

Read more about APIs with Hupreter.