Project goals?
Opened this issue · 2 comments
I find this project interesting (as I do with all TypeScript => Native compilation efforts). May I suggest you put together a quick write up explaining the intended goals for this project? This would help generate sustained interest. For example:
- Why the project is being put together.
- TypeScript features that are intended to be implemented, features that aren't.
- Timeline expectations, if any.
- Differentiation between this and Microsoft's "Static TypeScript" effort:(https://www.microsoft.com/en-us/research/uploads/prod/2019/09/mplr19main-id10-p-41a6cf2-42682-final.pdf)
-
all projects which I write I do it only for my personal enjoinment as I love to resolve some complex tasks
-
I was considering implement only features which can be impalement in C++ (which means unions and conjunction types are not plans for the project even thou it can be implemented in C++)
-
No time lines at all as I am writing when I have time or desire to do so
-
Static TypeScript has very limited set of features so I stopped considering it as alternative for native compilation.
PS General idea of this project was that I liked C++ and still like it but syntaxes of the C++ are really really horrible so I decided to write transpiler to generate code from TS files into C++ but it is becoming more than just transpiler.
Hi!
Your TypeScript2Cxx and TypeScript LLVM projects are super cool, inspiring and have a huge potential in my opinion.
There are many (client side) applications, where performance is relevant. Some of them, e.g. figma, already made the step in the WASM world,
often using rust or c++ in order to reduce memory consumption and improve execution speed. The thing with C++ and emscripten is that
C++ syntax is just horrible and even simple things like returning a string from C++ WASM requires awful code. My Problem with Rust is
the lack of libraries and generally small ecosystem. My Problem with Typescript is the huge memory consumption and high overhead when passing data to workers.
The language of my dreams compiles to a small WASM file, makes use of multiple cores on a SharedArrayBuffer with a go-like concurrency model or async-await, has a very highlevel modern syntax by default,
but also allows for c++ level of control for some regions of the code and can interopt with the huge c++ and typescript/javascript library ecosystem.
And I believe that you almost made that with your TypeScript2Cxx project.
Imagine the possibilities...
// calculation.txx
cpp {
#include <some_cpp_lib/someheader.h>
class MyCppClass {
public:
int myNum;
string myString;
};
int amazingCppFunction() {
MyCppClass myObj;
myObj.myNum = 15;
myObj.myString = "Some text";
// imagine some weird low level pointer shenannigan stuff
return myObj.myNum
}
}
import {blazinglyFast} from "myTypeScriptLib"
let result = amazingCppFunction();
const obj = new MyCppClass();
// imagine some nice looking multicore code with typescript syntax
fetch("domain.tld").then(res => blazinglyFast(res))
export function wildStuff(){...}
calculation.txx
-> calculation.js
-> calculation.cpp -> include libraries -> calculation.wasm
// App.svelte
<script>
import {wildstuff} from "calculation.js";
let answer = wildstuff();
</script>
<div>
Hello World, the answer is {answer}!
</div>
I would really want to help bringing something like this to live.