惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

博客园 - Franky
N
Netflix TechBlog - Medium
Google Online Security Blog
Google Online Security Blog
月光博客
月光博客
量子位
酷 壳 – CoolShell
酷 壳 – CoolShell
V
V2EX
腾讯CDC
OSCHINA 社区最新新闻
OSCHINA 社区最新新闻
博客园 - 聂微东
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
M
MIT News - Artificial intelligence
Vercel News
Vercel News
The GitHub Blog
The GitHub Blog
Hugging Face - Blog
Hugging Face - Blog
博客园 - 【当耐特】
Apple Machine Learning Research
Apple Machine Learning Research
aimingoo的专栏
aimingoo的专栏
博客园 - 三生石上(FineUI控件)
CTFtime.org: upcoming CTF events
CTFtime.org: upcoming CTF events
MongoDB | Blog
MongoDB | Blog
H
Help Net Security
The Cloudflare Blog
Blog — PlanetScale
Blog — PlanetScale
F
Full Disclosure
G
Google Developers Blog
罗磊的独立博客
Jina AI
Jina AI
钛媒体:引领未来商业与生活新知
钛媒体:引领未来商业与生活新知
Y
Y Combinator Blog
H
Hackread – Cybersecurity News, Data Breaches, AI and More
J
Java Code Geeks
A
About on SuperTechFans
IT之家
IT之家
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
有赞技术团队
有赞技术团队
GbyAI
GbyAI
雷峰网
雷峰网
T
The Blog of Author Tim Ferriss
The Register - Security
The Register - Security
U
Unit 42
D
Docker
Martin Fowler
Martin Fowler
L
LINUX DO - 热门话题
NISL@THU
NISL@THU
阮一峰的网络日志
阮一峰的网络日志
C
Cybersecurity and Infrastructure Security Agency CISA
博客园_首页
Google DeepMind News
Google DeepMind News

博客园 - RicoRui

【转让】看看有你喜欢的书籍嘛?--都是我翻过的。 TFS --- GrantBackup Plan Permissions Error 用户界面草图设计工具-工具包和资源 IIS URL Rewrite Model & ASP.NET Route Component ‘s Diff Entity Framework 4 & 4.1 [转] LINQ Method cannot be translated into a store expression. C# + Html5 =C3 [转]qUIpt:JavaScript Cache Library Project Calculation Rules Proposal for Delayed Script Execution 10个有用的网站访问分析工具 20个免费的seo页面分析工具 网站流量统计定义 Minify JavaScript On the Fly Agile -- Scrum Resource UML with VS2010 Ultimate [转]探究TFS 2010中的测试功能 技术债务 Windows Phone 7 Jump Start
Script#
RicoRui · 2011-04-28 · via 博客园 - RicoRui

At MIX11 last week, I presented the Script#: Compiling C# to JavaScript using Visual Studio.

As full-fledged script-based development becomes widespread with the HTML5 wave, a couple set of interesting questions emerge - what are the development tools you and your team uses to productively author and manage a code base? Shouldn’t you write code in a model that is optimized for development and productivity and let a compiler do its magic and produce code that is optimized for deployment and runtime?

Script# allows you to write your code in C# and compile it down to deployable JavaScript, it also unlocks the power of C#, Visual Studio and existing .NET tools for scripting scenarios.

Development with Script#

The Script# Project

Productivity and better tooling are primary motivators behind Script#. At the same time, a fundamental design tenet and driving philosophy behind the design of Script# is to produce script that resembles hand-written script that is aware and faithful to the script runtime environment found in browsers. Specifically the compiler does not introduce unnecessary layers of abstraction or indirection. The idea is you’re simply writing script in a better and pragmatic way, rather than trying to port a .NET application to the browser, which is more likely to produce impractical results.

Script# allows programming against the DHTML DOM APIs and JavaScript APIs, as well as Silverlight 1.0 script API. The compiler itself isn’t coupled to any one particular framework. You can use Script# to program against Microsoft ASP.NET Ajax as well as other 3rd party frameworks such as ExtJS (via Ext#). At the same time, the compiler is complemented by an optional ScriptFX framework, which is a small framework built using Script# itself. Finally, if you have existing scripts, they can be imported and then used from new C# code so you don’t have to rewrite everything from scratch to start using Script#.

Scripts generated using Script# are honest-to-goodness plain old JavaScript files, that you can freely deploy into your applications, and there is no runtime dependency on the Script# compiler. This is further explained in the Understanding Script# page. You will need .NET 2.0+ and/or Visual Studio on your development machine. You can also use Visual C# Express which is available for free.

Script# is an evolving project, but is quite mature and ready for use in real-world projects such as those listed in the showcase. Script# is being used both internally within Microsoft as well as external applications. It was first released in May 2006 (introductory blog post). Over the course of the last two+ years, it has been regularly updated with new features and bug fixed based on actual usage and feedback from developers like you. You can read about the latest release on the release history page. Please do continue sending any feedback on Script# that you might have.

The content on this site will be updated periodically to include additional concepts and tutorials. Please subscribe to the Script# feed to stay up-to-date or check this page often.

What you can build with Script# Project

  • Ajax Applications – Script# allows you to implement the Ajax code for your pages and mashups using a choice of frameworks. (see tutorial)
  • Ajax Frameworks and Components – Script# allows you to create reusable script libraries and components that can be consumed during further application development using either Script# or via direct JavaScript as well.
  • ASP.NET Ajax Server Controls – Script# can be used to develop script libraries containing components such as controls and behaviors that can then be embedded into server controls and control extenders. (see tutorial)
  • Sidebar Gadgets – Script# can be used to program gadgets for Windows Vista by referencing the Gadget APIs, RSS Feed APIs and File System APIs in addition to the default DHTML DOM APIs. (see tutorial)

A set of samples available with the Script# install demonstrate some of these uses of Script# further. Read the topic on What's in Script# to understand more about what is currently available.

An in-depth list of how C# constructs are mapped to JavaScript is described on the topic From C# to Script. On the flip side, an in-depth list of how script constructs are modeled in C# is described on the topic Achieving Script’isms in C#.

Script# Roadmap

The Script# project has been an on-going piece of work. The following are on the list for a v1 release during 2009 beyond what is available in the current and latest build:

  • Unit testing support
  • jQuery support
  • High priority bug fixes and improved Visual Studio integration

Longer term, there are a number of additional features on the roadmap such as:

  • Support for generics
  • Support for static linking and other script optimizations
  • Support for additional script APIs and scenarios