english-script
english-script copied to clipboard
EnglishScript should be translated into the π programming language
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.