![]() |
If you could change one thing about GScript, what would it be?
If you could go back in time before GS2 and change any one thing about it, what would it be? Compatibility with old code is not a problem—even a change as drastic as strict typing is acceptable for this exercise. Ideally they will be entirely language-related and not things such as documentation, version control, etc.
My one thing: I would make objects use a strict class system, and make it easy for scripters to edit these object classes. There would be a list of scripts much like the NPCs list for object classes (not related to classes now). These classes would have constructors, and support inheritance. All object types (such as GuiScrollCtrl) would work in this fashion (although they would not appear in this class list) and could be extended by objects. I could make a class called GuiIPhoneScrollCtrl which extends GuiScrollCtrl and has iPhone-like scrolling. |
Remove the need for temp prefixing.
|
Quote:
|
Quote:
This would be my target result: PHP Code:
|
Make it based on a dependent type theory.
More realistically: make it much, much closer to JavaScript. Essentially, ECMAScript with a DOM-like interface to Graal. |
ability to restrict query execution/variable changes to certain classes/weapons/NPCs
|
The lack of masking support
http://forums.graalonline.com/forums...hp?t=134263607 |
Quote:
|
Quote:
|
Fix anonymous functions.
|
Quote:
|
Quote:
|
Quote:
Quote:
PHP Code:
HTML Code:
Script compiler output for *scratch*: |
Quote:
One nifty hack around this one is, for example, return (temp.f = function () { ... } );. But that's rather ugly and I certainly don't do it :p. But yeah, that is indeed another thing that should be changed and should be fairly straightforward. |
Quote:
|
Quote:
Quote:
|
Quote:
The main reason being is that's the main path C++ took and it's a horrendously complex language. There's an old saying but I can't remember it but it goes something like once is a tragedy but repeated again is a fallacy. It's essential repeating the mistakes of the past but even worse so because you have 2 object systems on the go (you know, for backwards compat). Why 2? Well, Graal has an object system which has features which are distinct from that of a class-based system. I think you know what I'm talking about: you can create a base object and join some classes to it. You can then clone that object and, if I remember rightly, the members will remain. This isn't very classical. To gel the two together, like C++ OO was squeezed on top of procedural language, you'll be doing something similar but squeezing one OO type onto another OO type. Bad news. That's just my take on it anyway. Maybe what you have in mind is a lot cleaner? I just envision seeing a load more keywords being brought in that must be learned and kept track of. |
By "compatibility is not an issue" I mean that for the purpose of this exercise, don't worry about existing code. Essentially, pretend you can make the changes before any code has been written. This was more for fun than to generate useful ideas for changes to be made now. Adding a strict class system on top of GScript now would be stupid.
|
Quote:
|
All times are GMT +2. The time now is 08:56 PM. |
Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Copyright (C) 1998-2019 Toonslab All Rights Reserved.