Script# Update and Addition to Projects List

I have added an entry for Script# to my projects page, for better tracking of updates... starting with v0.1.1.0 update that I have placed online today.

Reading all the comments resulting from my Script# posting has been great!

I have gone ahead and added an entry for Script# on my projects page. Each project has a dedicated RSS feed for communicating updates, so I encourage you to check it out and subscribe. Speaking of updates, I have put out the first update today: v0.1.1.0. You can download it from the page referenced above.

I have factored in some of the feedback in the comments I recieved (eg. being able to generate global methods to use for CustomValidator scenarios, or the inability to perform a typeof in script, or the use of minimized scripts for the runtime etc)... so keep sending it. I mentioned couple of posts back that a group within Microsoft experimented with this. Dogfooding is always useful and great. This effort involved converting a significant body of script from a real running online app into C# and in the process a lot of things surfaced that have subsequently been fixed. In addition to the fixes, I've added a VS template for Class Library projects, and the included sample shows using it to create script components. Finally I've added a conceptual doc, which explains the technology and various aspects of using it. The document contains the full list of changes.

Posted on Sunday, 6/4/2006 @ 6:00 PM | #Script#


Comments

14 comments have been posted.

Adnan Siddiqi

Posted on 6/4/2006 @ 10:28 PM
Dear Nikhil

first of all accept my congratulations for coming up such wonderful thing.I have two queries.

1)is Script# bound to aSp.net only?
2)how tightly is it integrated with VS IDE?

Thanks

Johan Danforth

Posted on 6/4/2006 @ 11:48 PM
Nikhil,

Amazing stuff you're producing - even though you say it's a hobby kind of thing, the first release got quality stamped all over it. Even the 22 page PDF documentation looks better than some stuff you have to pay lotsa $$$$ for :)

Keep up the wonderful work - I'm just about to test the new version.

/Johan

Karel Frajtak

Posted on 6/5/2006 @ 12:27 AM
Dear Nikhil, your Script# is a very great project. I know that the class library sscorlib is not complete, but can you please add Microsoft Atlas classes. So it will be possible to create classes that derive from e.g. Sys.UI.Behavior class to create own behaviour.
Thanks

Steve

Posted on 6/5/2006 @ 5:15 AM
Thanks again Nikhil - trememdous work - I look forward to seeing more from you - you make things look easier than they are :)

Neal Pandey

Posted on 6/5/2006 @ 12:10 PM
Hello Nikhil,

Is 10 min video at http://www.nikhilk.net/Content/Video/ScriptSharpIntro.wmv still available? I am getting "Page cannot be found" error.

I would like to see Script# along with WPF/E help me in creating a cross platform/browser RIA. Developers like me using C# for web applications will definitely have productivity gain but it would be interesting to see how these technologies evolves and compares with Macromedia Flex in building RIA.

Thanks

www.paketim.com

Posted on 6/5/2006 @ 12:59 PM
Script# is great... Thank you.

Paketim
http://www.paketim.com

Dhany

Posted on 6/5/2006 @ 6:31 PM
Wow,.. did you ever sleep at all ?

Johan Danforth

Posted on 6/8/2006 @ 12:36 AM
I'm having some problems installing and getting the latest bits to work properly. I followed the documentation but section 2.4 on installation is a bit unclear, especially the second part about the Script# directory.

I got the templates installed and that, but when I compile the sample project it complains about type string existing twice:

Error 39 The type 'string' exists in both 'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\mscorlib.dll' and 'c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\site\08866bdd\41f60ccd\assembly\dl3\d88bd4f5\00ac010b_2087c601\sscorlib.DLL' C:\Program Files\nStuff\ScriptSharp\v0.1.1.0\Samples\Site\Hello.ashx 18 34 C:\...\Site\

Nik Donets

Posted on 6/13/2006 @ 12:00 AM
Hey Nikhil,

On this weekend I tried to port some of my Virtual Address Book code to Script# and here are the bugs that I found and some suggestions:

First of all, one of the most critical bugs: DOMElement does not have a RemoveChild method. Current workaround: Type.InvokeMethod( parentElement, "removeChild", childElement ). Although addition of this method to this class would suffice, a more elegant solution can be infered from my comment below.

Second of all, I have a few comments on the general structure of your DOM classes. I noticed that neither you nor GWT implement the W3C standard fully/correctly. In your case, I do understand that this whole project was developed by you alone on your own free time, but implementing the W3C DOM correctly (at least a subset of the DOM Core specifications) in the next versions of the compiler would be of a very great benefit to us, developers. For example, addition of such interfaces as Node and Element, as well as proper implementation of their relationships with your existing Classes, such as Document (which should implement a Node interface), DocumentFragment (also should implement a Node interface) and DOMElement (which probably should be replaced by an Element interface which implements a Node interface) would simplify and streamline how Script# interacts with the DOM. To understand how difficult it currently is to interface with the DOM capabilities of most browsers from Script#, consider the following scenario that I had to go through during my experimentation:

All I needed was a documentFragment object to which I could add/remove Nodes. First of all, I tried the following:

Document myDocFrag = Document.CreateDocumentFragment();

The problem with this was that the Document class did not implement the Node interface described in W3C standard. This meant that I have no access to methods such as AppendChild and RemoveChild. "Why not cast to a DOMElement?" would be the next logical step. That's what I tried next:

DOMElement myDomElement = (DOMElement)Document.CreateDocumentFragment();

The problem with this code is that the C# compiler does not allow the cast to happen (and it's a good thing that it doesn't allow this because a Document is not a DOMElement logically, it should be a Node). So after some frustration, I got away with this ugly hack:

DOMElement myDomElement = (DOMElement)Script.Eval("document.createDocumentFragment()");

As you can see, interfacing with native/standard DOM APIs implemented by most modern browsers is a real pain in the .<insert body part of your liking here>...

Although I would like to help I can't simply because the source to the compiler is closed (and yes, I could write add-on Interfaces with meta-data and use them instead but this would just defy the purpose of having the existing classes in the System namespace, which would get included with each of your applications anyway).

Thanks again for giving us this tool. Now if we could collectively make it better, I couldn't be happier.

Nikhil Kothari

Posted on 6/17/2006 @ 12:42 PM
Nik, thanks for the feedback. The DOM classes are definitely incomplete and need significant work. I think all of the things you bring up here should be fixed as these classes get more completed.

The way I'd like to approach fleshing out this area is to enable the set of things possible in IE/Firefox, and sticking to the W3C spec where possible - but if there is some existing scenario that is already enabled but not covered by the spec, I'd rather go ahead and enable that. I've been busy trying to get a definitive list of APIs and class relationships as they manifest themselves in the browsers, and find the right intersection/union, but haven't found anything concrete. Yes, I could brute force check on each API... any pointers? Also, I am thinking of targeting DOM Level 1 to start with, or should it be DOM Level 2?

Nik Donets

Posted on 6/18/2006 @ 11:02 PM
Hey Nikhil,

I agree that finding the greatest common denominator of APIs amongst different browsers is not an easy task. I guess it all depends on whether you are trying to create a framework that would hide / iron out browser differences from developer's view or a framework that would give the developer support for most of the browsers' APIs and leave the browser compatibility coding up to him/her or a framework capable of both, low level support and high level abstraction. Most probably, the best way to start about this would be to add support for DOM Level 1 as you mentioned and then grow support for browser specific quirks on top of that (I think that basing a DOM framework on a standard would be the best way to guarantee compatibility with future versions of browsers and DOM specifications). As for DOM API references for browsers, I found this page useful for Mozilla development: http://mozref.com/reference/ . I'm sure Microsoft's knowledge base has a similar page for IE.

Linda

Posted on 6/19/2006 @ 12:10 AM
Wow Nikhil, such a wonerful information you have provided.

Script# is great. Thanks alot.

mad.earth

Posted on 6/25/2006 @ 8:26 AM
Great Work!
I was wondering how difficult would it be to convert Atlas into dummy class library for use in Script#. That will definitely make it easier for many folks to play around with Atlas.

John

Posted on 6/27/2006 @ 12:30 AM
Hi Nikhil

Nice work you have uploaded on your site. It really feels great to see that.

Thnx for that information that I have been looking in from a long time.

Keep up the good work buddy!!
The discussion on this post has been closed. Please use my contact form to provide comments.