Replies: 3 comments 2 replies
-
I'm confused? why not quickjs? https://github.com/Geequlim/ECMAScript |
Beta Was this translation helpful? Give feedback.
-
I've done the type checker, now only codegen and LSP remaining.
foo.vs:
|
Beta Was this translation helpful? Give feedback.
-
https://github.com/Tencent/puerts Take a look at this, it might also support Godot. However, it seems that currently it needs to rely on C# for intermediary processing. |
Beta Was this translation helpful? Give feedback.
-
If anyone is interested into something similiar to TypeScript and that has types not erased at runtime and not requiring V8 optimizations such as property caching, I've done the type checker for VioletScript.
It's a generic language. Just missing codegen and LSP support.
GDScript uses reference-counting; I've designed VioletScript for a garbage collected environment. If needed I could change that.
VioletScript has:
Type inference is similiar to CSharp and Java. Unlike TypeScript, Haxe and various functional languages there is no:
But there is type inference just like in CSharp and Java for certain cases, like lambdas, variable initializers and
enum
variants.Enums
enum
s are safe and flexible:static
)Compile-time safety
E.g. uniting a type to
undefined
and/ornull
causes a compile-time error if you try accessing a property from a specific type.Maps (hash maps)
Everything is covered in the VioletScript docs, but you've all flexibility you've in GDScript. You can use object initializer for various types, including
Map
; e.g.:In this case, the
character
key turns into a string literal, which is then implicitly converted to the any type.Etc.
Various features from ECMAScript and TypeScript:
import.meta
Here is the compiler draft. This .NET project is named "parser", but contains type checker and semantic data model together. In the AST you can see some
SemanticN
properties; they're not part of the node but a result of the compile-time verifier.Beta Was this translation helpful? Give feedback.
All reactions