I am going to share my experience using Bridge.Net in the hope that the feedback is helpful to the developers. Overall I have been impressed with the project. I develop a robotics communication software package that I wanted to port to run in web browsers alongside the standard application implementations. I have a large existing C# codebase so the best option was to use a C# to JavaScript compiler. I was able to use Bridge.Net to implement a proof of concept where I was able to drive a robot using the HTML5 gamepad support, which is pretty neat. Eventually I'd like to be able to have a single codebase that runs both in .NET and Bridge.Net with as much shared code as possible. I ran into a few issues that make this difficult:
These suggestions are not necessarily critical but would be nice if they were available.
- The "lock" statement appears frequently in any multithreaded C# code. While it doesn't make sense in a browser it would be helpful if it came up as a warning instead of an error and was simply ignored.
- TaskCompletionSource and CancellationToken are very important to async/await code.
- Structures are not implemented properly for function parameters. For example,
void f(CancellationToken cancel=default(CancellationToken)) {}
is a standard usage. - Various contiguous arrays such as byte[], int[], etc currently use JavaScript arrays. It would be better for my project if they used Uint8Array, Int32Array, etc.
- [DONE] Long types have no support and unpredictable behavior
- The System.IO namespace appears to be unimplemented. At least some basic support should be available as an extension package. Especially the exceptions like System.IO.TimeoutException should be available. While they are in the System.IO namespace they get used elsewhere.
- Some basic support for System.Net would be helpful along with System.Net.Websockets
- A wrapper class for the Gamepad objects would be cleaner than using "dynamic".
- A few general bugs that look like they have been fixed.
These suggestions are not necessarily critical but would be nice if they were available.
Comment