More Annotations (Like //javascript)

So, there's one annotation (@gilles, is that the proper term?) that can be added to MicroScript files: //javascript as the first line. For projects with MicroScript language support, this runs the file as JavaScript instead. For example:

// javascript
function sayHello() {
  alert("Hello, World!")
}

global.say_hello = sayHello;
init = function()
  print(say_hello) // [native function]
  say_hello()
end

update = function()

end

draw = function()

end

My suggestion is to add more annotations, comments at the beginning of the file. To combine them, multiple comments would be used, one after another.

//annotation1
//annotation2

Here are a few things that could be useful:

  • //async (JavaScript) - Run the script as async. Useful for things that are, well, async.
  • //dependson [script] - Load this script after [script] has been loaded. Useful for scripts with classes that extend classes defined in other scripts. [script] could be a relative or absolute path.
  • //microscript (JavaScript) - Interpret as MicroScript. Useful for projects that are mostly JavaScript but partially MicroScript.
  • //first - Run this script first among the scripts in the folder. Useful to define a base class that is extended.
  • //last - Run this script last among the scripts in the folder. Useful for cleanup code.

I haven't looked much at the inner workings of MicroStudio, and I'm not sure how easy or possible any of these are to implement. But, if any of these suggestions are added, I would definitely appreciate it.