LoneStarRuby Conf 2008
Ruby Anvil - The Desktop Application Framework
Summarized using AI

Ruby Anvil - The Desktop Application Framework

by Lance Carlson

In this presentation titled "Ruby Anvil - The Desktop Application Framework", Lance Carlson discusses Anvil, a Ruby-based desktop application framework aimed at addressing the fragmentation in the Ruby desktop application space. He begins by engaging the audience with a show of hands to gauge their experience in desktop application development before introducing himself and his consultancy, Ruby Skills. Carlson emphasizes that Anvil serves not only as an application framework but also as an integration framework, aiming to facilitate the development of robust applications.

Key Points Discussed:
- Current Landscape: The Ruby ecosystem currently lacks a cohesive desktop application framework similar to Rails, leading to fragmentation.
- Integration Framework: Anvil is positioned to offer solutions that integrate essential components, streamlining desktop application development.
- GUI Toolkits: Various Ruby GUI toolkits are analyzed, including Shoes, WXRuby, FXRuby, GTK, and QT. Each has its strengths and weaknesses, with Shoes noted for its simplicity and web-like syntax.
- Common Challenges: The speaker points out challenges, including conceptualizing a unified framework and the toolkit identity crisis in Ruby, which limits broader adoption.
- Encouragement for Contributions: Carlson calls for developers to engage with the desktop application community and contribute to the Anvil project to enhance its capabilities.
- Testing and Distribution: He highlights the importance of testing compatibility and effective packaging for application distribution as challenges that need to be addressed.

Carlson concludes by inviting collaboration within the Ruby community, stressing the importance of making Ruby programming appealing again for desktop applications. He believes that by participating and sharing ideas, developers can drive innovation in the Ruby desktop application space, leading to considerable growth and enhanced adoption of Ruby for desktop applications.

The session encourages developers to reach out through the Ruby Anvil IRC channel for further involvement and support.

00:00:06.359 Video equipment rental costs paid for by PeepCode screencasts.
00:00:19.640 Today's talk is about Anvil, a desktop application framework in Ruby.
00:00:26.760 By a show of hands, how many of you have actually done desktop application work? That's quite a few; that's impressive.
00:00:33.360 So, the goal of this talk is to get contributors interested in desktop application work.
00:00:39.160 Before we proceed, I wanted to introduce myself. My name is actually Lancelot—no sir prefix; you can confirm that with my license after the talk. It's not John C., although that's close.
00:00:53.359 This is my consultancy, Ruby Skills. I am currently in the editing phase of a book I'm co-authoring with Bruce Tate, which should be released in October. It's a perfect reference for those new to Rails.
00:01:06.080 Now, back to the real topic. The goal of Anvil is to develop applications. It's common to define it as an application framework; however, its goal extends beyond that. It serves also as an integration framework, combining the necessary components to create a successful application.
00:01:18.680 At the moment, there exists a lot of fragmentation in the Ruby desktop application space. The view component is the only one that has been fulfilled; there are no established connections to the data layer, which is essential for the majority of applications unless you're creating something very simple such as a timer application.
00:01:44.760 Anvil is not just an application framework; it also acts as an integration framework. Let’s look at the various GUI toolkits available in the Ruby ecosystem. How many of you have actually used any of these: Shoes, WXRuby, FXRuby? What do you think of FX's appearance? Cute, or do you pronounce it differently? GTK is another option, and Ruby Cocoa has a similar standing.
00:02:08.399 Shoes is currently very popular within the Ruby space for developing desktop applications. It allows for a Ruby-like syntax while using a web-based layout, resembling HTML syntax. For example, an image is designated simply by stating 'image' and specifying the location. This simplicity and elegance were significant inspirations for me in creating Anvil.
00:02:56.239 Here’s an example of a Shoes application. While it might not be the most exciting one, it demonstrates the capability for handling smaller applications effectively.
00:03:10.920 WXRuby was my starting point for Anvil. However, I found it frustrating, with a syntax reminiscent of C++. Despite some issues, it is progressing. WXRuby is a project that wraps the WXWidgets platform, which primarily uses C++.
00:03:45.479 FXRuby, on the other hand, provided a great development experience from the syntax perspective. Instantiating objects is quite clear, even though the resultant appearance resembles older versions of Windows.
00:04:06.040 QT, another toolkit available, offers a better syntax. However, there are significant challenges to get it running on your machine, especially during manual compilation. Yet, it produces visually appealing applications, like Skype, which serves as a good example of a cross-platform QT application.
00:04:43.279 GTK is more limited, generally confined to Gnome desktop environments. The Ruby bindings, depending on the version of Gnome, can be niche-targeted. Despite some people’s affection for it, the small space it occupies can limit broader adoption.
00:05:21.760 In the Ruby space, we have several issues, not least of which is the absence of a strong framework similar to Rails or Merb. We lack integration pathways and a unified framework that brings the community together, allowing developers to easily dive in and create inspiring applications.
00:06:04.480 Moreover, there's a significant toolkit identity crisis. Ruby does not have its own toolkit but wraps around existing ones. While this is acceptable, it simply isn't sufficient for developers working in this space.
00:06:31.799 Another challenge is the learning curve. Many Ruby developers are focused on web development, particularly with Rails, neglecting the power of client-side software. However, we must recognize the potential of client-side applications.
00:07:01.280 The frustration among Ruby developers is palpable when we see Java and Python having better implementations of tools like WXWidgets. It's about time we catch up and strive for parity in this space.
00:07:28.000 Another notable absence in the Ruby ecosystem is a proper editor built in Ruby. If a Ruby-based editor were created, it would allow Ruby developers to extend it easily.
00:07:55.480 It's about creating a native client experience. Many applications appear to mimic Windows even on OSX, which negates the native feel we should strive for in our applications.
00:08:23.200 While there’s a push towards web applications, we can't overlook the significance of native applications. Distributing certain logic to the client and utilizing its power can lead to amazing developments.
00:09:01.000 For instance, Basecamp’s ability lets you track hours spent working right from your desktop and submit that information directly—it's an impactful use case extending web applications.
00:09:42.639 The framework I envision requires collective input; no single mind can conceptualize everything required. Being database-agnostic is a key to success, and it’s achievable through tools like Active Record and Data Mapper.
00:10:01.760 The concept of toolkit agnosticism is controversial. While a single toolkit could suffice, I argue that we shouldn't restrict ourselves. Every developer has unique desires for how their application should look and function.
00:10:23.040 Why not embrace the power of all toolkits under one framework? This would allow everyone from QT to GTK to Ruby Cocoa to be utilized without compromise.
00:10:49.680 Plugins using Ruby gems are an exciting frontier. Packaging plugins as gems offers flexibility and ease of distribution over incorporating them directly into a vendor directory.
00:11:13.480 The MVC architecture will also play a critical role. The model will need to support various ORMs, while the controller must function seamlessly with the view, not bound by any specific toolkit.
00:12:00.480 Implementing RESTful principles in desktop applications can spark creativity in naming spaces and business logic, which will benefit Rails developers by leveraging familiar concepts.
00:12:35.160 Imagine being able to delegate objects to a view easily, allowing automatic population of widgets with data. This functionality will streamline application development.
00:13:01.920 As for event handling, every button click could fire off events managed by the application. It’s reminiscent of the route conception in Rails, ensuring smooth initialization of desktop applications.
00:13:30.000 In terms of testing, RSpec support will be integrated into the framework. Whether you prefer RSpec or a different testing library, compatibility will be a focus.
00:14:07.320 Packaging and distributing applications poses a real challenge—as highlighted in Rails with its deployment issues. We need to find effective ways to package Anvil applications for distribution, incorporating all necessary components.
00:14:44.640 The talk last night addressed some ideas around packaging Ruby applications in a standalone manner. Building a standard operational DSL around OpenGL features will open new avenues for development.
00:15:36.000 I’ve laid groundwork for configuration and initialization, and though the model is still a work in progress, I have a clear outline of how MVC will function within the framework.
00:16:03.200 Furthermore, QT integration is actively being worked on, and I'm enthusiastic about the potential contributors to join this project.
00:16:34.320 With the desktop application industry booming, it's crucial to have Ruby developers actively participating in creating innovative applications. I encourage anyone interested to get involved.
00:17:00.080 I’ll demonstrate some code now. Running the Anvil command should initialize the environment successfully.
00:17:17.720 This was initially presented at Ubicomp, and I will showcase the demo. If we can develop effective strategies, I believe we can see considerable growth in Ruby adoption within the desktop application sector.
00:18:09.640 Our goal should be to make Ruby programming appealing again for desktop applications, similar to what it has achieved for web development.
00:18:41.560 If you're interested in exploring this further, please connect with me on the Ruby Anvil IRC channel. There’s ample room for participation and collaboration to enhance this framework.
00:19:10.920 Thank you for your time! Does anyone have questions about the Anvil framework?
Explore all talks recorded at LoneStarRuby Conf 2008
+18