Page 2 of 4

Re: What devs would like in MP4 for ManiaScript

Posted: 08 Jan 2016, 11:33
by Miss
+1 on all of this.. I've been thinking of writing a Coffeescript to Maniascript transcoder just so that we can have structures and classes, but I can't find the time for it :P

Re: What devs would like in MP4 for ManiaScript

Posted: 08 Jan 2016, 14:23
by toffe
Miss wrote:+1 on all of this.. I've been thinking of writing a Coffeescript to Maniascript transcoder just so that we can have structures and classes, but I can't find the time for it :P
999. ManiaScript ==> JS (replace)

Re: What devs would like in MP4 for ManiaScript

Posted: 08 Jan 2016, 16:16
by Miss
toffe wrote:
Miss wrote:+1 on all of this.. I've been thinking of writing a Coffeescript to Maniascript transcoder just so that we can have structures and classes, but I can't find the time for it :P
999. ManiaScript ==> JS (replace)
That would be something.. though if there ever is going to be a secondary way of writing Maniascript, I'd suggest implementing Angelscript, since it's a familiar language (to C++ programmers, at least) and it's also pretty easy to implement into host applications.

Re: What devs would like in MP4 for ManiaScript

Posted: 08 Jan 2016, 22:31
by Dommy
Replacing MS with another programming language would make a small mess (mostly for people most related to it, guess who), instead the addition of new features is better move imo. :)

Re: What devs would like in MP4 for ManiaScript

Posted: 08 Jan 2016, 23:34
by oliverde8
There have always been discussions about this, what would have happened if Nadeo had integrated LUA ? It was designed to work with C. Simple to program lot's of possibilities and offers lot's of possibilities.

But now to late, we have Maniascript. :(

What we need is someone with some lex/yacc knowledge and lot's of time to build us a compiler from C/C++ to Maniascript. But to do that properly he needs to understand both the input & output language ver well.

Re: What devs would like in MP4 for ManiaScript

Posted: 08 Jan 2016, 23:45
by Nerpson
ManiaScript is great and fun to code! Replacing it is clearly not a solution. Some things could be improved and that's the aim of this topic, suggestions.

Re: What devs would like in MP4 for ManiaScript

Posted: 09 Jan 2016, 02:22
by Miss
I never said replace it, I said add a secondary scripting language (so that old scripts still work and new scripts can be written with either language)

The only thing that would be challenging is that you might not be able to do the whole state/yield thing.. :roll:

Re: What devs would like in MP4 for ManiaScript

Posted: 09 Jan 2016, 12:15
by zocka
The main issue of the language itself addressed in this thread is the lack of structs and classes. Besides that I agree with previous posts that ManiaScript isn't all that bad once you're a bit into it.

Replacing it definitly isn't an option so some kind of (probably community-driven) transpiler seems to be the best way. In my eyes some alteration of ManiaScript with some extra features and shortcuts would be the most handy option. (Please no JS ._. It's just working completely different from ManiaScript. Callbacks would be nice in ManiaScript though)

As a compromise I can imagine some script translating a "class" structure by prefixing methods and attributes and inserting handles as method-argument and property array-keys so that the remaining code is a bit cleaner to write. Translating some self.method(a,b,c) to class_method(self, a, b, c) and self.attribute to class_attribute[self] shouldn't be too big a problem, but as I am not so much a fan of writing parsers I haven't realized my thoughts on that yet.
Another question is if there really is some general best practice to transpile to: e.g. I can create unlimited "objects" with a handle of type Text for more abstract objects, while I could think of CMlControl for something like Dialogs, where I then can use .Show() or .Hide() directly on the handle the constructor returns. (But maybe that's bad practice as it is inconsistent - and you can't handle show/hide-calls on your own.)

Re: What devs would like in MP4 for ManiaScript

Posted: 09 Jan 2016, 14:23
by Miss
zocka wrote:The main issue of the language itself addressed in this thread is the lack of structs and classes. Besides that I agree with previous posts that ManiaScript isn't all that bad once you're a bit into it.

Replacing it definitly isn't an option so some kind of (probably community-driven) transpiler seems to be the best way. In my eyes some alteration of ManiaScript with some extra features and shortcuts would be the most handy option. (Please no JS ._. It's just working completely different from ManiaScript. Callbacks would be nice in ManiaScript though)

As a compromise I can imagine some script translating a "class" structure by prefixing methods and attributes and inserting handles as method-argument and property array-keys so that the remaining code is a bit cleaner to write. Translating some self.method(a,b,c) to class_method(self, a, b, c) and self.attribute to class_attribute[self] shouldn't be too big a problem, but as I am not so much a fan of writing parsers I haven't realized my thoughts on that yet.
Another question is if there really is some general best practice to transpile to: e.g. I can create unlimited "objects" with a handle of type Text for more abstract objects, while I could think of CMlControl for something like Dialogs, where I then can use .Show() or .Hide() directly on the handle the constructor returns. (But maybe that's bad practice as it is inconsistent - and you can't handle show/hide-calls on your own.)
Hmm considering I really need this and I've been thinking about doing this before, I might experiment a bit with it later today.

Re: What devs would like in MP4 for ManiaScript

Posted: 09 Jan 2016, 16:08
by Miss
I decided to give it a shot, here's what I have now.. still lacks a lot of features but it's something I guess.. not sure if I should continue working on it :roll:

But I guess this is a little bit off-topic, should I make a new thread for this?

Image