Re:Mono and WebAssembly – Updates on Static Compilation
by yodon on Tuesday January 16, 2018 @02:00PM
(#16161062)
Does anyone know if there is work being done to add JSX syntax to C# (either into the language directly or as part of a pre-processor)?
[ Parent
| on HN ]
Re:Mono and WebAssembly – Updates on Static Compilation
by zastrowm on Tuesday January 16, 2018 @02:17PM
(#16161276)
The CSharpLang github[1] repository would be where to look for this. I didn't find anything that mentioned adding language support for it, and IIRC, in the past they rejected the idea of inline XML or JSON support.
Going the other way of C# inside HTML, you have Razor[2] and Blazor[3], the latter of which is a prototype of Razor running in the browser via web assembly.
[1]: https://github.com/dotnet/csharplang [2]: https://docs.microsoft.com/en-us/aspnet/core/mvc/views/razor [3]: http://blog.stevensanderson.com/2017/11/05/blazor-on-mono/
Re:Mono and WebAssembly – Updates on Static Compilation
by yodon on Tuesday January 16, 2018 @02:37PM
(#16161502)
Blazor is pretty amazing, but my coder fantasies mostly revolve around a React-JSX-in-C# vision - the syntax and approach just feel so natural and so right. Your point about rejecting inline XML is probably a pretty good data point that I shouldn’t expect what I’m hoping for to happen.
Re:Mono and WebAssembly – Updates on Static Compilation
by pjmlp on Wednesday January 17, 2018 @01:04AM
(#16165823)
Well, if you would use VB.NET instead, it supports XML literals.
Re:Mono and WebAssembly – Updates on Static Compilation
by j_s on Tuesday January 16, 2018 @03:23PM
(#16162067)
Investigate a possibility to support JSX | https://github.com/bridgedotnet/Bridge/issues/808
Bridge.NET translates C# to JavaScript, but JSX is not currently supported.
Re:Mono and WebAssembly – Updates on Static Compilation
by yodon on Tuesday January 16, 2018 @03:47PM
(#16162363)
I like Bridge.NET but I’m not sure how they will survive once the current Mono WebAssembly tech hits release.
Re:Mono and WebAssembly – Updates on Static Compilation
by kevingadd on Tuesday January 16, 2018 @07:41PM
(#16164433)
WebAssembly does not cover use cases that require a ton of C#<->JS interop, and it may never adequately cover it. You end up needing a very complex interop bridge similar to C<->JS interop. A solution like Bridge can compile to JS, making interop near-zero-cost.
Re:Mono and WebAssembly – Updates on Static Compilation
by yodon on Tuesday January 16, 2018 @09:40PM
(#16165028)
Thanks for fantastic answer to my concern (for those who might object that kevingadd didn’t cite his sources, given his background he pretty much -is- a primary source)
Re:Mono and WebAssembly – Updates on Static Compilation
by polskibus on Tuesday January 16, 2018 @02:24PM
(#16161353)
Why would you pick jsx instead of TSX?