Skip to content

Has anyone written an app or script that uses this to convert TypeScript to CIL? #196

@MappingSteve

Description

@MappingSteve

I think this means using VSCode to compile TS to JS, and then using this library to compile JS to CIL.

But I’m not sure how to put those two steps together into an automated process. Something like:

A post-build action that calls a small C# app that invokes this library?

Pointers to any example code that would fit into such a solution would be great. (I’ve never written a post-build action, so I’m fuzzy on details.)

I see examples in wiki that show how to execute a script. But I don’t want to immediately execute - I want to create CIL, that could be executed later, BUT might instead be fed into a static code analyzer. How do I store that CIL as an assembly? Goal is static analysis as if it were C# originally, including symbol references to/from existing C# code or libraries.

OR conversion from CIL into C# might also be a solution. An extra step, but then I could make a traditional C# project, so existing tools would all work.

(The big picture is for a dev shop that is mainly .NET, to write TS code for browser today, but be able to elevate it into .NET code, once .NET -> WASM is fully mature, assuming WASM eventually can do everything JS can, without performance issues. Might also allow us to use that code in our Xamarin apps, without maintaining two independent sources. The reason to not use C# to ts/js solutions, is that we are hiring/contracting js-stack web-trained devs for web projects. TS is acceptable to mandate, but dependence on .NET is not - I’m trying to loosely integrate the web work with ongoing C# mobile/tablet work. Would love .NET to be universal solution, but that isn’t viable yet. TS code is closer in style and robustness to our c# code base.)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions