Skip to content
This repository has been archived by the owner on Aug 24, 2022. It is now read-only.

Std lib replacement support like in Script# #5

Closed
lanwin opened this issue Jun 14, 2011 · 5 comments
Closed

Std lib replacement support like in Script# #5

lanwin opened this issue Jun 14, 2011 · 5 comments

Comments

@lanwin
Copy link

lanwin commented Jun 14, 2011

In Script# it is possible to replace a std lib with the one from Script#. With that it is only possible to access function in c# which are supported in Script# and also the intellisens only show classes and function which are supported not the whole thing which the clr offers.

@kg
Copy link
Member

kg commented Jun 14, 2011

This should already work if you compile your app against their replacement libraries, but I haven't ever used Script#. Am I missing specific features you need in order to do this? It sounds like you want modified behavior in Visual Studio, and JSIL currently has no interaction with VS.

@lanwin lanwin closed this as completed Jun 16, 2011
@lanwin lanwin reopened this Jun 16, 2011
@lanwin
Copy link
Author

lanwin commented Jun 16, 2011

Sorry for my previous deleted entry. Used the wrong tab.

In every C# project you can disable the automatic referencing of mscorelib via Build->Advanced->"Do not reference mscorelib.dll". If you do that you get a lot errors, since the C# compiler needs some basic classes like object, string, int32 to work. No you could provide your own JSILCoreLib which provides a basic impl/proxying for that. If you do that you make sure that VS could only provide intellisens for classes which are existing not for something like AppDomain which can not exist in JS.

@markusjohnsson
Copy link
Contributor

Is there a specific feature JSIL has implement for this issue?

I guess what is needed is to replace/extend JSIL.Bootstrap.js & proxies with a C# assembly that would replace mscorlib?

@markusjohnsson
Copy link
Contributor

I've started hacking on a mscorlib replacement. It does not work yet, but if anyone is interested it can be found at https://github.com/markusjohnsson/JSIL/tree/jsil_corlib
At least you can build everything (only the Meta & Proxies assemblies reference JSIL.Corlib), but I've not got too far with actually running anything. My initial thought was to merge the Proxies, Meta and (parts of) JSIL.Bootstrap.js and requiring JSIL projects to link to JSIL.Corlib instead of mscorlib... however, there are some things I haven't really thought about yet: how to handle cases where we actually want to provide a proxy to a third party assembly that links to mscorlib, like Kevin is doing with XNA?
Please post any thoughts or comments, will probably hack some more on this during the weekend.

@kg
Copy link
Member

kg commented Jul 21, 2011

Meta needs to be a separate assembly because it contains attributes used by JSIL itself. It's possible to have those attributes be within the proxy library, I suppose, but that makes it a heavier dependency and means that JSIL can never actually reference the attribute types directly. Making it heavier is also bad since any native .NET app that uses the attributes would still have to ship that library in its native form.

@kg kg closed this as completed Nov 5, 2012
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

3 participants