The language is the Eh programming language. The syntax is similar to JavaScript, except that instead of a line ending with a semicolon, it ends with a comma, a space, the word "eh" and a question mark (?). For example:
var src = 'script', eh? var s = '', eh? s += 'Hello', eh? s += ' ', eh? s += 'World', eh? s += ' from ' + src, eh? console.log(s), eh?This will print the following to the JavaScript console:
Hello World from scriptAn Eh script can be included inline using the "text/eh" type:
Or loaded from an external script file:
Here's the source code for the Eh compiler (in JavaScript) named eh.js:
// eh compiler
window.onload = function() {
// execute eh code
function executeEh(src) {
eval(src.replace(/,\seh\?/g, ';'));
}
// load eh scripts
var scripts = document.getElementsByTagName('script');
for (var s=0; s < scripts.length; s++) {
if (scripts[s].type === 'text/eh') {
if (scripts[s].src) {
// execute external eh scripts
var extScript = new XMLHttpRequest();
extScript.open("GET", scripts[s].src, true);
extScript.send();
extScript.onreadystatechange = function() {
if ((extScript.readyState== 4)
&& (extScript.status == 200)) {
executeEh(extScript.responseText);
}
};
} else {
// execute inline eh scripts
executeEh(scripts[s].innerHTML);
}
}
}
}
Eh supports all major JavaScript libraries and APIs.Here's a Plunker to demonstrate: http://plnkr.co/edit/ASrEWq3uoZgi6TwolGLd
If you make an Eh script, comment below and let me know!