Hacker News new | ask | show | jobs
by pjmlp 1947 days ago
JavaScript[0] isn't what I would call a fast storage repository, but I guess it works out for prototyping.

On the context of porting to C and C++, or make it execute faster, I can see two options with minor rewrites.

Use AssemblyScript and generate native code via WebAssembly AOT compilers.

Try to adapt TypeScript to C++ compiler from Microsoft's MakeCode project.

Implement your own C++ code generator.

It would be much easier than keep using multiple code bases in parallel, plus any memory corruption issues would be most likely bugs on the code generator.

[0] - Yes I know the source code is Typescript.

1 comments

Indeed, TS/JS is great for its quick turnaround times for prototyping. But the I/O performance is executed by the underlying C/C++ layer. For the rest TS/JS is fast enough. But a full C++ backport is still on the horizon