Wow, I was thinking of doing exactly this myself, so thumbs up!
What I am missing the most in ACS (which are I believe in your scope):
- proper arrays (which would work as local variables, function parameters or return values), dynamic arrays
- ability to implement data structures such as linked lists and simple trees (you seem to have handled this by inclusion of pointers)
- preprocessor macros (this can be easily worked around by using separate preprocessor - I use mcpp for this)
- function types + anonymous functions (so you can have a variable/parameter which takes a function + is able to call the function on parameters of its choice) - this might be already possible with script numbers, but is too cumbersome to use
- proper math library (sqrt, log, atan, pow)
- 64bit math
- dynamic string manipulation (something seems to be happening in ZDoom on this front lately, but this does't quite help yet, because it requires SVN versions)
- foreach statement
- module discovery/namespaces (text-based inclusion is sooo from 90s
, figuring working order of functions is sometimes quite a challenge in ACS currently
Some of these are definitely not really necessary, but still would make mod development experience much more pleasant one
What is really necessary are the struct and array related features. I still get shivers every time I look at my macro-based matrix math functions (it failed to figure out any other way of implementing matrix function without structs and arrays).
Structs + function types would make a proper GUI library a possibility, which would also be a huge leap forward.
Math functions can be emulated within ACS, but those are inefficient and/or inaccurate parodies on real math.
And some which I think are not in your scope:
- ability to retrieve string information about actors and weapons (such as class name or tag)
- proper identification of actors beyond TID, comparison of actors
- enumeration of actors based on some criteria (primarily actors within range of a point)
I touched some of these in my preprocessor
(actor identification and enumeration, string actor properties, custom actor properties), but there is only so much you can do with regex-based analysis and generation of ACS and DECORATE code.\
Good luck with your project!
I had a look at the repo you linked.
You started from some existing C parser?
Also, from the actual scripts you included, it seems you are going for some horribly convoluted syntax elements.
Code: Select all
__extfunc memcpy(void *restrict s1, void const *restrict s2, size_t n) -> void *
__variable __autoreg char const *end = (char const *)s2 + n;
__variable __autoreg char *i1 = (char *)s1;
__variable __autoreg char const *i2 = (char const *)s2;
while (i2 != end)
*i1++ = *i2++;
I don't think even Managed C++ spammed double underscores so much
I also don't understand why you decided for that exact return type syntax you are using, assuming everything else seems to be pretty much exact C.
I personally hoped for a bit more higher-level (like C# or Java) approach but I guess with some work, this can still be much better than ACS.
Does the thing you've got generate some ZDoom bytecode already? I can't find anything code generation related in the code
DH-acc uses a completely different language, DamnScript, which operates at a higher level than ACS.
Are you sure "higher" is the word? All the DS heap managment code and gazillion pointers make me think exact opposite