I went ahead and skimmed the sample output C++ files for their test sources, but I have not yet seen everything in the project. I can not find an import for a garbage collector, so does this compile Typescript to non-GC’ed C++?
Looking at the example code in the readme, it looks like it doesn't even bother freeing memory. This project looks like it's just "write (a memory-leaking subset of) C++ in Typescript syntax". Maybe neat for educational purposes for people learning about the languages or learning about parsing, but doesn't seem directly useful.
I’ve looked a little more since I posted and I think your right as far as memory management goes. I hope this is a WIP project and not just a learning project doing what you guess. I think the idea/challenge of implementing a structural type system and then compiling it down to C++ more basic bidirectional checking style is interesting.
Doesn't Vala compile to C and handle memory safety somehow? Obviously that depends on some GObject stuff but I think a similar approach could probably be used in this case.
> Doesn't Vala compile to C and handle memory safety somehow? Obviously that depends on some GObject stuff but I think a similar approach could probably be used in this case.
Well, Vala still has some amount of manual memory management because it translates directly to GObject, not only for system resources but for types as well, so it isn't 100% memory safe, like Java or Javascript.
Vala is/was a great project, unfortunately, the C people at Gnome hated that and some Gimp maintainers refused to hear about Vala, and then it was blamed for I'm not sure what exactly by people who wanted to turn Gnome into a Rust project. The later also failed, because the same C guys don't want to hear about Rust either.
Interesting bits about internal politics at Gnome.
At that point I am wondering what the point of the project is... If you end up implementing a GC and all the other bells and whistles then it is possible that the end result is not much faster than just running a conventional Javascript VM. However, without a GC you are better off just writing C++ code.
At first glance, you create new object subclasses on the heap without cleanup. So it is obviously either very early or designed for rather short-lived applications.