Comments (15)
How, specifically, would this issue be resolved?
from jsil.
Probably adding a Wiki page with list of supported APIs will be a good start point.
As the next step, while assembly decompiling is already present in project, it seems reasonable to provide some migration analysis tool (just like MoMA for Mono) which will analyze assemblies against unsupported API calls. Maybe this can be implemented like an extension for existing analysis tool, like FxCop.
Maybe it will be a good idea (I'm really not sure) to implement some Windows.Forms compatibility layer, built on top of some JavaScript UI framework. And vice versa, provide fake WinForms controls to be mapped to real JS ones, to draw on canvas and so on.
Referencing XML/SOAP web-services (ASMX/WCF) is also very-very interesting. LINQ is not must have, but it will be cool to have LINQ: linq2xml and linq2objects.
It seems very promising to debug all business logic with strongly types language like C#, with powerful IDE like VS. I'm not a JS expert, so this project looks very promising for me :-)
from jsil.
Supporting the full set of .NET libraries is not directly in scope for JSIL, actually, though I can see how you got that impression. Perhaps it would be best to clarify this in the documentation.
Right now the set of JS 'stubs' provided exists merely so that the compiler itself can be tested. In practice I may continue expanding the stubs, but it's equally likely that I will investigate alternate solutions - for example, having you compile the Mono version of mscorlib, and then translate that to .js files alongside your application. In that case, the feature support would not be directly part of JSIL.
I will also note that if you generate 'stubs' for your libraries, you automatically get warnings about uses of any methods that haven't been implemented when running the output javascript. You can see this in the live demos, since my stubs only implement a small set of methods/properties.
from jsil.
I do not think there is a need to support full set of libraries. I see this project as a better way to write 3-tier applications with JavaScript/WebBrowser as a rich, but still thin, client tier. A lot of logic, like data validation, is duplicated in client and server, so this approach may help in DRY. So, it looks more realistic to talk about just some part of client being generated from .Net assembly, not whole one.
from jsil.
I rather agree with the bit about supporting the full set of libraries. Porting all of mscorlib, for example, may prove very heavy. Not only that, but there will always be questions about "Why doesn't this work like I expect? Is feature X supported?" When I think about using JSILc, I think about having a few core pieces of functionality that I can port over into the web: basic C# syntax (so IEnumerable, etc. for baked in interfaces), string manipulation (also possible w/o "using System" - how core are strings?), arrays, List, and Dictionary<K,T>. Beyond that, I don't think a whole lot more should come in the starter libs and I think the starter libs should have different namespaces. What's your take on that?
Personally, my ultimate goal is not to port existing .NET apps to the web as-is, but to provide a solid OO base for coding on the web and still use a server backend to do the heavy work. Security always has to be server side, so the amount that can stay client side in most practical code bases (IMO) doesn't go that far beyond the UI layer; games are a different matter but I'd be willing to have a restricted library if it guaranteed portability.
from jsil.
Types like String, List, Dictionary, and Array are definitely considered 'core', so I intend to support apps that use them, either through providing full implementations in Bootstrap or by making it possible to translate Mono's implementation (in the case of List/Dictionary).
from jsil.
IMHO, if we're talking about developing UI, binding infrastructure is must have too.
from jsil.
I've never used any of the stock binding systems. Are you referring to WPF's?
from jsil.
No, I mean observable model: INotifyProperyChanging, INotifyProperyChanged, IBindingList, INotifyCollectionChanged, ICancelAddNew, IRaiseItemChangedEvents.
from jsil.
WPF does hook into the observable model interfaces, but supplies its own binding implementations. I think semantically the binding may work a little differently if the binding exists across the network. If it exists solely client side, then yeah, they'd probably work fine but once you go over the intarwebs I think the usual threading model inherent in those (at least in WPF+UI thread land) may break down. Maybe I'm the only one wanting to do view models on the server, if so, ignore me...
I guess that brings up a good question: what is the end goal of this framework?
#1 Client side only JS translated from .NET, no specified UI framework
#2 Client side only JS translated from .NET, stock UI framework targeting some web standard
#3 Client side JS + server side C# and some stock communication mechanisms.
#4 Client side JS + server side C#, stock communication, stock UI on client + bindings
... or some combination of the above, etc.
Kevin, it sounds like #1 was much more of your original design but the demos you're putting out seem like you've definitely toyed around with #2. I think if #3+ were ever hit, it could very much change the way web apps are developed today for not only standalone apps but also for full-fledged business apps etc.
from jsil.
I want to throw in my five cents here.. I think it would be wise to keep JSIL as compiler/translator+runtime (#1 by jtrana, above) only and build a UI framework as a separate project with JSIL as a dependency. That way, if one UI approach does not take off, there might be another that does and JSIL won't get bad rep for the fail.
Regarding libraries, I would think that translating mono assemblies to js is the way to go. But there are probably several types that need to exist in the runtime, and not be compiled from those assemblies.
Anyway, this is a fun project, have been playing with it over the weekend and I think I will continue to do so and contribute code too.
from jsil.
kevingadd: on the subject of translating mono assemblies, have you given it more though?
I want to give it a try, but I'm stuck at how to organize the code from the two projects:
- Should mono be added as a submodule to JSIL?
- Should we fork mono so that we can use the mono build scripts and add JSIL specific code to framework classes?
- Should we do this in a separate project/repository independent from both JSIL and mono?
It would also be nice to have NUnit running on JSIL so that we can run mono's test suite..
from jsil.
The current biggest obstacle to using the Mono mscorlib is that it doesn't translate into fully working code yet. I have some improvements into the pipeline that should fix that, but they aren't ready.
Edit: Running NUnit inside JSIL is unlikely to happen; NUnit relies on threads and appdomains, and neither of those features are feasible to translate to JS.
from jsil.
Oh, of course, never thought it would be translatable at this point. My plan was to get a build going to help find test-cases where JSIL need improvements.
On NUnit: ok, running NUnit is probably not doable, but perhaps a subset, like most of Assert.*?
from jsil.
For anyone interested, my work on building a mono-based corlib with jsil can be found in my fork (github.com/markusjohnsson/JSIL), in the branch jsil_corlib.
Right now, a small subset of the corlib compiles (using VS) and translates (using JSIL), but it crashes during load for various reasons. I will file separate issues for those problems.
from jsil.
Related Issues (20)
- DCE works incorrectly for derived interface implementation
- Content Not Being Generated XNA HOT 1
- Assembly.GetType is not working for generics.
- Unsigned comparisons work incorrect
- Type.FullName is not returning correct name for generic dictionary
- Async state machine incorrect translation HOT 6
- Calling External Library From C# HOT 2
- string.IndexOf(String value, StringComparison comparisonType) not available HOT 2
- Support netstandard assemblies
- ulong math is incorrect HOT 2
- Installing JSIL on Linux HOT 2
- Support pascalabc
- InvalidCastException when using Newtonsoft.Json.dll (10.0.1 .NET 4.0) HOT 1
- Delegate.Method fails when called in constructor. HOT 3
- C# 7.2 "in" keyword in interfaces
- DateTime Object does not implement public functions
- load file
- Attribute properties are missing HOT 1
- How to Convert a CSharp Project to JavaScript on a Mac? HOT 2
- where do I find the namespace and game?
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsil.