Hello,
I would like to introduce you to a new project of mine, a new programming language for StarCraft 2.
Before I start telling you about it, I would like to point out that everything here is subject to change and totally WIP. It is not ensured that this project will ever get released at this point.
I'd like to start out saying that Grape was designed with one goal in mind: No Bullshit™.
What does this mean? It means no trying-to-do-everything-at-once. It means no structs, no backwards compatibility, no properties/accessors, no fancy lambda syntax. Just clean, readable code that is as simple as possible:
As you can see, this language is entirely "verbal" and line-based. The syntax is based partially on Ruby and partially on Lua.
There are also some changes from normal language with OOP "logic". For example, all functions inherited from a base class may be overridden. The only case they may not be overridden, is if a function is declared as sealed. This means that there is no virtual modifier.
This language is also very code completion friendly. So while it may take time to write without any "help", it will take almost no time to write in an IDE.
Speaking of IDEs, this language will have full support in Moonlite, and no support in the StarCraft 2 Editor. In Moonlite, however, the features will be along the lines of full code completion like Visual Studio, Quick Links, navigation, etc., etc.
At this point, I am totally open to suggestions for the syntax. However, I will not change the basics -- suggestions for a bracket language should not be posted and will be ignored.
Here's a list of the features I have planned:
Any feedback will be appreciated.
PS: Yes, Moonlite is still going on. If you're wondering, v1.0.2.0 will feature a lot of new stuff - along with full Andromeda code completion and generally full Andromeda support. It will be released about the same time as Andromeda v2, most likely.
I would like to introduce you to a new project of mine, a new programming language for StarCraft 2.
Before I start telling you about it, I would like to point out that everything here is subject to change and totally WIP. It is not ensured that this project will ever get released at this point.
I'd like to start out saying that Grape was designed with one goal in mind: No Bullshit™.
What does this mean? It means no trying-to-do-everything-at-once. It means no structs, no backwards compatibility, no properties/accessors, no fancy lambda syntax. Just clean, readable code that is as simple as possible:
Code:
package grape.sample
import system
import system.collections
import system.utils
// mod_base is a built-in class that provides all the base functions for a SC2 mod
// for example, the user can override main which is run on map initialization
class mod inherits mod_base
string args
override void main(string args)
string[100] args_array = args.split(" ")
if args_array.null_or_empty
return exit_code_failure
end
foreach string arg in args_array
if arg.null_or_empty
break
end
game.echo(arg)
end
// in grape, there are no for loops - I found while loops to be prettier, and more "scripting"-like
int index = 0
while index < 10
game.echo(index)
index = index + 1
end
bool debug_mode_on = false
bool is_unit_test = false
switch args_array[0]
case "debug_mode_on"
debug_mode_on = true
end
case "is_unit_test"
is_unit_test = true
end
default
// execute default action here
// this code is run when none of the above cases were handled
end
end
end
void before_base_initialize()
end
void after_base_initialize()
end
// Constructors/destructors
ctor mod()
init this("")
end
ctor mod(string args)
before_base_initialize()
init base()
after_base_initialize()
this.args = args
end
dctor mod()
args.destroy()
end
end
As you can see, this language is entirely "verbal" and line-based. The syntax is based partially on Ruby and partially on Lua.
There are also some changes from normal language with OOP "logic". For example, all functions inherited from a base class may be overridden. The only case they may not be overridden, is if a function is declared as sealed. This means that there is no virtual modifier.
This language is also very code completion friendly. So while it may take time to write without any "help", it will take almost no time to write in an IDE.
Speaking of IDEs, this language will have full support in Moonlite, and no support in the StarCraft 2 Editor. In Moonlite, however, the features will be along the lines of full code completion like Visual Studio, Quick Links, navigation, etc., etc.
At this point, I am totally open to suggestions for the syntax. However, I will not change the basics -- suggestions for a bracket language should not be posted and will be ignored.
Here's a list of the features I have planned:
- OOP: only classes, no enums, structs, interfaces -- only classes
- all declared functions are overridable unless declared as sealed
- full integration with Moonlite
- the built-in Galaxy functions will not be usable except through the stdlib provided with the language.
- "extensions" for the language will be possible, meaning C# code that processes certain items in the written code at compilation-time will be possible. This will open for a lot of things, such as preprocessing certain pieces of code and most likely debugging in Moonlite.
Any feedback will be appreciated.
PS: Yes, Moonlite is still going on. If you're wondering, v1.0.2.0 will feature a lot of new stuff - along with full Andromeda code completion and generally full Andromeda support. It will be released about the same time as Andromeda v2, most likely.