Quantcast
Channel: ClearScript
Viewing all articles
Browse latest Browse all 2297

New Post: Praise and a couple questions

$
0
0
Wow, this is an awesome project! I wrote a home automation system and implemented a simple rules system in XML (essentially If-Then-Else statements). As I wanted to do more complex things in my rules, I decided to look around for a way to host a scripting language directly so that I don't end up writing one over time. ClearScript does this so easily that I am just amazed. Thank you for releasing the project and for all the support you give in these forums; they have been a great resource for me.

So, 2 questions:

1) I noticed that when calling (from .NET) a JavaScript function that talks to .NET objects, it seems to take about an extra 100ms on the first call. Is this because the proxies are set up on demand? Just curious.

2) I want to have an implementation of some XmlHttpRequest features. As discussed previously in some topics here, this can easily be done by wrapping WebClient and I see how to do this on both sides of the fence. Is there a performance or garbage collection contrast between these 2 approaches:
  • Expose WebClient and URI (for the async method) to JavaScript and write a JS wrapper that creates .NET objects, subscribes to events, and performs the callback.
  • Write a C# wrapper around WebClient and URI and expose that 1 object to JavaScript.
Really this is a specific example of a general question - is it better to do such work on the C# side and expose simpler objects and interfaces to JavaScript?

Viewing all articles
Browse latest Browse all 2297

Trending Articles