english-script icon indicating copy to clipboard operation
english-script copied to clipboard

EnglishScript should be translated into the π programming language

Open jarble opened this issue 8 years ago • 0 comments

Today, I found a programming language called π that has implemented many of the features of EnglishScript. π has an extensible syntax, so it should be very easy to convert EnglishScript source code into π source code and vice-versa.

From π's official website is an example of a pattern that can be defined. This is very similar to EnglishScript's pattern definition syntax:

declare_pattern
   integer_potentiation ≔
   integer:i %W- "^" %W- integer:j
   ⇒ integer ➞
   {
      int result = i;
      for (int k = 1; k <= j-1; k++)
         result *= i;
      return result;
   };

The name of this pattern is integer_potentiation, the type of the pattern is integer, and the parameters are integer:i and integer:j. This link shows another example of π's extensible syntax, which makes it an ideal target language for EnglishScript.

jarble avatar Feb 03 '16 05:02 jarble