Its so frustrating when there are lots of things that you want to do but no time to do them in! I’ve got my parents in law’s garden to finish off (3 years and counting!) a bookcase in the bedroom, Java song or what ever I eventually call it and I have recently come across an application called Javacc. This app lets you define a language grammer and then generates the Java classes necessary to interpret and execute your new language. Which got me thinking, since there is an international speak like a pirate day why not create a language for pirates to program in? Consider the following Java:
if (2 > 3) {
System.out.println(“True”);
}
else {
System.out.println(“False”);
}
In Pirate this could be expressed as:
2 > 3 This be true?
Aye
Ahoy “True”
That it be
Nay
Ahoy “False”
It be not
Ok so its a bit verbose and probably has no real use but whats that got to do with it. All thats needed is to expand the syntax a bit and have a go with Javacc. Which comes back to not having any time……