The specification for how all this works is in the Silverlight - Back to Just-Text paper it is also a great source of documentation for the IronRuby-specific features, over and above what Silverlight already provides. The ability to download the binaries on the first load lets IronRuby stay as a separate project. Note: IronRuby is not currently part of the Silverlight installation because keeping IronRuby open-source is a priority, and Silverlight is a closed-source project. These binaries set up the Silverlight control to process Ruby script-tags and execute them with IronRuby. The IronRuby binaries are downloaded to the browser cache, so they are not re-downloaded for any other application, unless the browser cache is cleared or is invalidated (Fig 2 and 3). The first script-tag runs dlr-.js which sets up a hidden Silverlight control on the page to download IronRuby and run any Ruby script-tags. Let me briefly explain what is going on behind the scenes to make IronRuby work so transparently with Silverlight. That's it! It's very simple to get started with IronRuby in Silverlight, especially versus using ActionScript in Flash, or even the other languages like C# or VB.NET in Silverlight. And this will not run direct from the file system due to Silverlight's security sandbox, so make sure you access it through a Web server. If you're on a slow connection, make sure files aren't still being downloaded (see below). did you already install Silverlight? There is no install detection in these examples. Open the text-editor, place this code into it, and save the file to a convenient location where your Web server can access it I'm saving mine to ~/Sites/ruby.html, since that will let me access it from (IIS users will have to put the file under C:inetpubwwwroot, which will let you access it from When you visit the site in a Web browser, you will see "Ruby says hello!": Here's a simple "Hello, World"-style Ruby application in the browser: See the system requirements page for more details. ![]() Silverlight officially supports IE, Firefox on Windows, and Firefox and Safari on Mac OS, but Opera and Google Chrome on both operating systems are known to work. I'll be using the latest version of Firefox for the Web browser, the Apache Web server (which is part of Mac OS), and TextMate as the text-editor on Windows you can use IIS (or any Web server of your choice) and any text-editor of your choice (notepad.exe is already installed, but I'd suggest E-TextEditor, InType, or even gVim for the more courageous). Set up any Web server, text-editor, and Web browser You'll notice these installers are larger than advertised (7MB Windows, 13MB Mac): these are the "developer" versions since they contain error-message strings rather than just error codes, which is all the "consumer" versions have.Ģ. Download and Install Silverlight for Mac or Windows To develop browser applications with IronRuby, you just need a Web server, text-editor, Web browser, and Silverlight installed for your browser to use:ġ. Note: All code shown in this article can be found on GitHub. basically anything doing vector-graphics, webcam, audio, etc, in the browser. IronRuby also runs in the browser on Silverlight and Moonlight, a fairly-complete-but-tiny runtime which allows you to build "rich internet applications". NET framework (2.0 SP1+) and Mono(2.0+), so IronRuby runs on a ton of platforms, including Mac OS and Linux. To support native-code interop we are planning on supporting FFI in the future (though today you can use the Win32API for Win32 calls, and the platform invoke APIs for the rest). However, certain runtime-specific Ruby features are not supported on IronRuby, like continuations which interact with the runtime, certain performance-bogging parts of ObjectSpace, and the native Ruby C API. The CLI blesses IronRuby with some powerful features like an efficient just-in-time compiler and sophisticated garbage collector. ![]() IronRuby is a Ruby 1.8.6-compatible implementation, with ever-increasing support for 1.9 features that runs on Microsoft's Common Language Infrastructure. ![]() IronRuby enables Web developers to use Ruby to write client-side browser applications and even reuse code between the server and the client. think - yes, it's possible! This walkthrough will get you started with using Ruby in the browser for HTML and vector-graphics-based applications. With Microsoft's IronRuby and Silverlight, Ruby can become a first-class citizen in the browser on Windows, Linux and OS X.
0 Comments
Leave a Reply. |