-
-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
C# Code Generation Design
Pros
- Fast to implement
- C# code optimizations
- Easy to visualize code
- Better debugging, we can use dotnet debugger directly.
- We can reuse c# default type checker, literals can be used as it is without creating JavaScript object.
- Precompilation, JS can be compiled as dll and shipped.
- We can use embedded source for debugging.
Cons
- No Tail Call optimizations
- Generate C# code -> Parse C# Code to generate Assembly.
let a = 3;
return () => a++;public static JSValue Method(JSContext context, JSValue @this, in Arguments a) {
var a = 3;
return new JSFunction((_c, in _args) => a = a.Add(1));
}Persistent Assembly Generation
Pros
- Tail call optimizations
- Smaller storage
- Faster code generation
Cons
- Compilated logic
- Will require rewrite of most of logic
- Deal with IL generation complications such as block scope etc, you cannot jump in and out of block.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels