Talks
Speakers
Events
Topics
Sign in
Home
Talks
Speakers
Events
Topics
Leaderboard
Use
Analytics
Sign in
Suggest modification to this talk
Title
Description
Have you ever had to implement the same validation logic twice: once in JavaScript for the browser and once in Ruby for the server? Has there ever been a JavaScript library like handlebars.js that you'd love to use server side, but can't because well... it's in JavaScript and not Ruby? Or perhaps a time or two you've been tempted to eval() some anonymous Ruby code, but you didn't dare because it's an unspeakably dangerous thing to do? The solutions to these and many other problems are suddenly and elegantly within your grasp when you've got the power of a JavaScript interpreter right there with you in your ruby process. Sound crazy? difficult? It's easier than you might think. This talk will focus on The Ruby Racer: a gem that brings the superb V8 interpteter to Ruby. We'll see how to call JavaScript functions directly from Ruby; how to call Ruby methods directly from JavaScript; how to extend Ruby classes with JavaScript; how to extend your JavaScript objects with Ruby, and a slew of other ways of managing their interaction that will bend your mind. Help us caption & translate this video! http://amara.org/v/FG9d/
Date
Summarized using AI?
If this talk's summary was generated by AI, please check this box. A "Summarized using AI" badge will be displayed in the summary tab to indicate that the summary was generated using AI.
Show "Summarized using AI" badge on summary page
Summary
Markdown supported
In the video titled "The Ruby Racer: Under the Hood," Charles Lowell introduces viewers to the Ruby Racer, a gem that integrates the V8 JavaScript engine into Ruby applications. - **Introduction**: Lowell begins by explaining the use and capabilities of the Ruby Racer for embedding JavaScript within Ruby processes, encouraging audience interaction throughout his presentation. - **Purpose of Ruby Racer**: He outlines various motivations for using Ruby Racer, particularly in a Rails 3.1 context where CoffeeScript is prevalent. He emphasizes the ability to test JavaScript environments, leverage JavaScript tools, and share code between server and client applications. - **Core Features**: - The Ruby Racer allows executing JavaScript within a hermetically sealed environment, where developers can evaluate JavaScript code and manipulate JavaScript objects as if they are Ruby objects. - He demonstrates creating a V8 context, evaluating JavaScript, and managing object references, which resemble Ruby hashes. This interaction includes calling JavaScript functions within Ruby codes seamlessly. - **Ruby to JavaScript Interaction**: Lowell showcases how JavaScript can directly call Ruby methods and access Ruby properties. He highlights the importance of lambdas over procs due to their more predictable behavior in the V8 engine. - **Performance Insights**: He notes the possibility of optimizing performance by executing heavy logic in JavaScript instead of Ruby. This potential for speed enhancement, along with the convenience of calling across languages, demonstrates the Ruby Racer's prowess. - **Future Development**: Lowell discusses plans for improving the Ruby Racer, focusing on implementing a 'safe eval' feature, enhancing multithreading capabilities, and managing memory more efficiently. By addressing garbage collection challenges, he aims to create a smoother developer experience. - **Call to Action**: He invites interested individuals to contribute to the project, signaling that his efforts are ongoing and collaborative. - **Conclusion**: The video concludes with a Q&A session where Lowell answers audience questions about integration and performance comparisons, sharing insights on available resources such as slides for further learning. The overarching takeaway is the transformative potential of the Ruby Racer to merge Ruby and JavaScript capabilities, signaling a shift towards more integrated and efficient web development practices.
Suggest modifications
Cancel