[ feature ] embed native language support #56
Replies: 3 comments
-
Have a look at project |
Beta Was this translation helpful? Give feedback.
-
FYI: TypeScript compiles code in the same way as any C compiler. so u can reference any function in C code and any C function in TypeScript Native Compiler ... as all code will be compiled into OBJ files LINKER will resolve names. |
Beta Was this translation helpful? Give feedback.
-
second option can be to use ''import "./dll.dll"'' and then you can provide function names with "@dllimport" attributes for example. if you have dll with function "point" type Point = { x: number; y: number; };
import "./<any_dll_file_without_extention_name>"
@dllimport
declare function point (x: number, y: number): Point;
function main() {
const p = point (1.0, 2.0);
print(`x=${p.x}, y=${p.y}`);
print("done.");
} |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
It would be cool if there's a way to directly use native languages in typescript!
Take rust as an example ( as it's also using LLVM, it would probably be easier to implement )
This would not only bring the great stdlib and other libraries of the language to this TSC but also take advantage of the language's strong points!
Beta Was this translation helpful? Give feedback.
All reactions