Skip to content

Explain how to manipulate C# (CLR) objects from js and vice versa #93

Closed
@MappingSteve

Description

@MappingSteve

I can’t determine from the limited documentation what interchange of information is possible between CLR objects and js objects.

Where does this project sit, along a spectrum of “no coupling”: two independent domains, using json (or whatever) to communicate back and forth, to “fully coupled”: where js and c# can directly manipulate objects from the other domain?

  1. Can js hold a handle to a C# (CLR) object?
  2. Can js use .net reflection to discover properties and functions useable on a c# object? And read/write properties, invoke functions with parameters?

And similar questions in the other direction, where c# manipulates js objects.

FWIW: Investigating whether this project would be any help towards a larger goal: A super-strict subset of typescript, removing (hiding) some of js loose-typing functionality, with 1:1 translation between it and c#, calling .net 5 libraries. Then a static analyzer that determines all possible data flow in the CLR representation, for better debugging. Then all needed code is (optionally) translated back into ts/js, so there is an option to run in js without WASM compilation of c#. Just in case / or as in interim solution. Assuming WASM ultimately becomes capable of doing everything js can, without performance issues, this also becomes a path for moving super-strictly-typed ts/js code forward into a pure C#/WASM implementation.

—————————————

UPDATE:

I just discovered Jurassic which is more suitable for my purpose. Compiles js into .NET bytecodes (CIL). Nevertheless, answers to questions above might be useful to add to your read me page.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions