-
Notifications
You must be signed in to change notification settings - Fork 11
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
'new' keyword #97
Comments
Hey, @liuhenry4428—I was just having a few thoughts while reading over these new issues about language features to promote parity with TypeScript. It occurs to me that, while some of these would undoubtedly be convenient, it should certainly be a non-goal to completely replicate the entirety of TypeScript within Gator. That's way too much work! And the focus should be on making interesting geometric code expressible, not on writing any old random library interaction code. Of course, we need a way to support the kind of code we want to write, and things like Put stuff like this in a runtime library. That is, make the TS backend produce code that Then the Gator code that needs to do things like this can just call simple functions that do the TypeScript dirty work underneath. Or use simple type names to refer to complex TypeScript types, declared as For example, there could be a function called I'd be interested in @Checkmate50's opinion on this stuff! |
I like this idea a lot! I think this principle should also be used for TypeScript features that haven't been implemented yet but should be (such as #96, cause duh), since it centralizes the uses of each feature so they can be replaced as Gator supports them. I do think it's still important to create issues for these features and support some of them; otherwise I could imagine this sort of design getting out of hand. This issue in particular seems to provide an example of a potential metaprogramming/design explosion. With Gator slated to support structs (see #63), being able to create objects/classes in some way seems important to avoid type-checking complexity around internal variables and functions. Graphics in general just has so much need for object structure (such as when bundling light information), that it seems way too complicated to not support. I do agree with something like #99 not getting explicit support; however, I think I'll keep them as an issue (I'll tag those with wontfix), since they document cases where we intend to use internal "hacks" without compiler implementation. |
TypeScript use case:
img[i] = new Image();
The text was updated successfully, but these errors were encountered: