Huey
October 23, 2024

ivo's awfully random tech blog

Backtracie and the quest for prettier Ruby backtraces

A backtrace is one of those Ruby features that is extremely useful, but we never think about it. They’re just always there in our time of need — be it when an error happens, when exploring our code inside a irb or a debugger, or even when profiling our app. For a while now, I’ve been thinking about, and working on, possible improvements for Ruby’s backtraces — I’ve blogged about it [1, 2], and even ended up creating the backtracie Ruby gem to be...

8 months ago

ivo's awfully random tech blog

Look out! Gotchas of using threads in Ruby

Threads (along with fibers and ractors) are all extremely powerful and useful tools for Ruby developers. Yet, they often seem to be surrounded by this aura of mystery, as if they are something for wizards to employ in their magicks and not for mere mortals to make use of. I recently spoke at EuRuKo 2023 about this topic with the aim of demystifying Ruby threads. You can find the video and slides for my "Look out! Gotchas of using threads...

8 months ago

ivo's awfully random tech blog

Understanding the Ruby Global VM Lock by observing it

The Global VM Lock (GVL), also known as Global Interpreter Lock (GIL), is an implementation detail of the Ruby VM. At a high-level, it prevents Ruby code across multiple threads from running in parallel (while still allowing concurrency!). The GVL is an extremely important implementation detail, as it can have a big impact on the performance and responsiveness of any Ruby application that uses more than a single thread to do its work. I’ve previously blogged (see bottom of the...

over 1 year ago

ivo's awfully random tech blog

Ruby's unexpected I/O vs CPU unfairness

Recently, while benchmarking a test application, I observed that if I mixed threads doing input/output (such as reading files or network/database requests) and threads doing CPU work, the I/O work would be slowed down massively. It took me a while to realize this was caused by how (and when) Ruby switches between threads. For instance consider querying a web server (here I’m using google as an example) as fast as possible: require 'net/http' require 'benchmark/ips' def perform_request Net::HTTP.start('www.google.com', open_timeout: 0.5,...

over 1 year ago

ivo's awfully random tech blog

Talking Ruby Performance Tooling at the Ruby Rogues podcast

I was recently invited to the Ruby Rogues podcast for a second time. We talked about the pitfalls of Ruby performance, when and why you should profile, and the tools I’ve been working on to better explore and optimize Ruby performance. P.s.: This blog is now brought to you by Ruby 3.2 with YJIT ;)

over 1 year ago

ivo's awfully random tech blog

Ruby reuses native OS threads after Ruby Threads die

Since Ruby 1.9, each Ruby Thread gets executed on its own native operating system thread. But, as a performance optimization, Ruby will try to reuse native operating system threads if it can. When a Ruby Thread terminates, Ruby will not immediately terminate the operating system thread that was hosting it. Instead, it will keep it around for a few seconds, and if in that time period the application starts a new Thread, then Ruby will reuse an existing operating system...

almost 2 years ago

ivo's awfully random tech blog

Hunting production memory leaks at RubyKaigi 2022

Existing Ruby tooling is quite helpful when investigating memory leaks if and when we can reproduce them on our development machine or staging environment. But what about those cases when the memory leak only really shows up in Production? Perhaps over a long time period? Together, they can be used to provide low-overhead heap sampling, enabling the investigation of Ruby memory leaks in production. You can find the video and slides for the talk below! And as always, feedback is...

almost 2 years ago

ivo's awfully random tech blog

Tracing Ruby's (Global) VM Lock

Recently, @_byroot (Jean Boussier) introduced an amazing new Ruby VM feature that gives users access to the state of the GVL. He called it the GVL Instrumentation API, and with it we can observe in detail what is happening with the GVL: when threads grab it, when they release it, how long they hold on to it, and how long other threads spend waiting for it. Update, 2023: I feel awful that I failed to notice that the GVL Instrumentation...

over 2 years ago

ivo's awfully random tech blog

Talking Ruby Ractors and Concurrency at the Ruby Rogues podcast

I was recently invited to the Ruby Rogues podcast to talk about Ractors (the new Ruby concurrency primitive added in Ruby 3), as well as Ruby concurrency in general. As usual, all feedback is welcome! Get in touch if you’d like to talk about Ractors and Ruby concurrency — I can literally talk for hours about it :)

almost 3 years ago

ivo's awfully random tech blog

The unexpected cost of Ruby's NoMethodError exception

The NoMethodError exception is how Ruby signals that the code tried to call a method that does not exist. class Example end Example.new.foo # => NoMethodError: undefined method `foo' for #<Example:0x00005636879ce398> Now, raising and rescuing exceptions is known to be slow (due to, among other things, expensive stack trace generation) and thus it’s pretty common knowledge that you should avoid having triggering too many of them in your production code. But…​ have you ever considered that after you rescue an...

almost 3 years ago

ivo's awfully random tech blog

Sunday Lol: Embedding images in commit logs

Recently, I discovered the notcurses library, the latest in a long line of weird ways of abusing a terminal emulator. It provides a tool called ncplayer which can be used to preview images and videos from the terminal. And then — I decided to see if I could pipe its result into git, and turn it into a commit message. Turns out that it works! (P.s.: You’ll need a recent version of ncplayer) Of course, this is an awful thing: it won’t...

over 3 years ago

ivo's awfully random tech blog

Ruby Ractor Experiments: Safe async communication

(This post is also available in 🇯🇵 Japanese thanks to @hachi8833.) From the point of view of a Ractor that wants to send some information to another, communication can either be: asynchrous (or non-blocking): a Ractor can send information to another using Ractor#send, placing it into an infinite queue that can be read by the destination Ractor with Ractor.receive synchronous (or blocking): a Ractor can use Ractor.yield to block until another Ractor calls Ractor#take Let’s consider the async case: Let’s...

over 3 years ago

ivo's awfully random tech blog

Looking into Array memory usage in Ruby

require 'objspace' puts "Size of array of size 4: #{ObjectSpace.memsize_of(['a', 'b', 'c', 'd'])}" puts "Size of array of size 5: #{ObjectSpace.memsize_of(['a', 'b', 'c', 'd', 'e'])}" ## Output: # Size of array of size 4: 72 # Size of array of size 5: 80

over 3 years ago

ivo's awfully random tech blog

What I've been reading: December+January 2021 Edition

This blog post is a continuation of my ongoing experiment with collecting and summing up the best technical (with a bit of non-technical) stuff I’ve read and watched recently. (P.s.: You can now receive my blog as a newsletter!) Inigo Quilez is a master computer graphics artist, and in this video he paints a picture of a girl taking a selfie, using only code. Even cooler, the code is available on the Shadertoy website, where you can play with it...

over 3 years ago

ivo's awfully random tech blog

What I've been reading: November 2020 Edition

This blog post is a continuation of my ongoing experiment with collecting and summing up the best technical (with a bit of non-technical) stuff I’ve read and watched this past month. This month I’ve gone a bit down the rabbit hole of the GDC (Game Developers Conference) youtube archives. Even if you’re not interested in the gaming industry, there’s amazing engineering and design efforts going on there, and there’s a lot to be learned from the top companies in that...

almost 4 years ago

ivo's awfully random tech blog

Creating a newsletter!

I’ve been listening to “Company of One” (which I do recommend) and that got me thinking that it may be cool to allow readers to subscribe to the blog via e-mail. So I’ve decided to setup a newsletter! You can sign up by clicking here.

almost 4 years ago

ivo's awfully random tech blog

What I've been reading: October 2020 Edition

A few years ago, I acquired the habit of regularly collecting and sharing with my work colleagues the highlights of what I was reading from week to week. As I’m preparing to start working at a new company soon, I’ve been wondering if it would be useful to share this with a wider audience, and how I would do it. I’ve decided that the easiest way to start is to use this blog. I’m not sure how often I’ll do...

almost 4 years ago

ivo's awfully random tech blog

Better backtraces in Ruby using TracePoint

That got me thinking of a few things: What information would I want to show in backtraces? What format would I display that information in? Is it possible (and reasonable?) to extract the needed information during backtrace collection? To allow me to iterate faster, I’ve implemented my next prototype for better backtraces using Ruby’s TracePoint API. This means that the current prototype can be run on regular unmodified Ruby, although having it loaded will have a performance impact (so I...

over 4 years ago

ivo's awfully random tech blog

Snippet: Getting a dynamically-generated method name on the Java stack using Javassist

#!/usr/bin/env kscript //DEPS org.javassist:javassist:3.24.1-GA import javassist.ClassPool import javassist.CtMethod import java.util.function.Function import java.util.function.Supplier val classPool = ClassPool.getDefault() val generatedClasses: MutableMap<String, Function<Supplier<Any>, Any>> = mutableMapOf() fun dynamicFrameNamed(name: String): Function<Supplier<Any>, Any> { val dynamicClass = classPool.makeClass("dynamic.$name").apply { addInterface(classPool.get("java.util.function.Function")) addMethod(CtMethod.make(""" private Object $name(java.util.function.Supplier block) { return block.get(); } """, this)) addMethod(CtMethod.make(""" public Object apply(Object o) { java.util.function.Supplier block = (java.util.function.Supplier) o; return $name(block); } """, this)) } return dynamicClass.toClass().newInstance() as Function<Supplier<Any>, Any> } inline fun withFrameNamed(name: String, crossinline block: () -> Unit) { generatedClasses...

over 4 years ago

ivo's awfully random tech blog

Ruby Experiment: Include class names in backtraces

As a weekend experiment, I decided to write a few prototypes to answer the following question: Is it possible to improve Ruby backtraces by including the class where a given method was defined, similar to how Java and other languages do it? This allows the following example: module A class Super1 def classes_example print_stack_trace(Thread.current.backtrace_locations) end end end module B class Super2 < A::Super1 def classes_example super end end end module C class Super3 < B::Super2 def classes_example super end end...

over 4 years ago

ivo's awfully random tech blog

Quick tip: Unsafe concurrent Ruby hash access

I just bumped into another such example! This specific one seems not to affect MRI Ruby (aka the default Ruby implementation), but I was able to clearly trigger it on both JRuby and TruffleRuby using The trigger above is very simple — having different threads writing to the same Hash concurrently. Just writing, they don’t even need to be reading. puts RUBY_DESCRIPTION PER_THREAD_LIMIT = 1000000 THREADS = 8 THE_HASH = {} (1..THREADS).to_a.map do |thread_id| Thread.new do PER_THREAD_LIMIT.times do THE_HASH[rand(PER_THREAD_LIMIT)] = thread_id end...

about 5 years ago

ivo's awfully random tech blog

Kotlin Hack: Transparently replace class with interface

Anywhere on my codebase where a FooInteractor was created via val fooInteractor = FooInteractor(repository = someRepository) was now failing, because FooInteractor just became an interface. To solve this transparently, we can make use of the Invoke operator. The invoke operator allows writing an expression such as someObject(…​) as an alias of someObject.invoke(…​). And funnily enough, constructors look exactly like that! So yeah, a bit unexpectedly, we can use the invoke operator to make our new interface into a factory of...

about 5 years ago

ivo's awfully random tech blog

Kotlin for Rubyists

Although I’ve never seen Ruby cited as an inspiration for Kotlin, ever since I first ran into it, I couldn’t but notice how closely it resembles Ruby. Kotlin shares many of Ruby’s niceties: you can do a lot with a very small amount of code; its standard library includes many useful tools that help you express your intent clearly; it can be used to create beautiful domain specific languages; it has an interactive shell; and it includes a number of...

over 5 years ago

ivo's awfully random tech blog

Spotting unsafe Ruby patterns - Talk recording

Writing Ruby code that uses multiple threads is a great way to get better performance and to take advantage of modern laptops and servers. It can also be quite daunting due to the often-feared “concurrency bugs”. In this talk, recorded at the Fullstack LX Ruby meetup, I introduce a number of pitfalls to watch out for, presenting correct (and fast!) alternatives for each.

about 6 years ago

ivo's awfully random tech blog

Writing to a Java TreeMap concurrently can lead to an infinite loop during reads

import java.util.*; import java.lang.reflect.*; import java.util.Map.Entry; @SuppressWarnings("unchecked") public class ConcurrentTreeMapLoopReproducer { public static void main(String ... args) throws Exception { System.out.println("Running on Java " + System.getProperty("java.version")); int insertUpTo = 20; if (args.length > 0) { insertUpTo = Integer.parseInt(args[0]); } System.out.println("Using insertUpTo=" + insertUpTo); new ConcurrentTreeMapLoopReproducer(insertUpTo).call(); } TreeMap<Integer,Integer> brokenMap = null; int insertUpTo; ConcurrentTreeMapLoopReproducer(int insertUpTo) { this.insertUpTo = insertUpTo; } static class LoopStep { Entry<Integer,Integer> entry; String direction; LoopStep next; LoopStep(Entry<Integer,Integer> entry) { this(entry, null, null); } LoopStep(Entry<Integer,Integer> entry, String direction,...

over 6 years ago

ivo's awfully random tech blog

TIL: Java hides lambda frames in stack traces

While playing around with Java stack traces today, I noticed something that I had never noticed before: lambda frames do not show up in stack traces! For instance, consider the following pre-Java 8 example: public class VisibleLambda { public static void main(String[] args) { foo(new Runnable() { public void run() { bar(); } }); } static void foo(Runnable lambda) { lambda.run(); } static void bar() { throw new RuntimeException(); } } In the main method, we create an anonymous inner...

over 6 years ago

ivo's awfully random tech blog

My thoughts on, and how I approach code reviews

A few weeks back while I was having very interesting conversations with colleagues about code reviews I sat down and wrote some topics on how (and why) I take them on. There are already a lot of awesome articles online on what you should be on the look out when reviewing code — such as this great one by thoughtbot — but my objective on this exercise is to focus on improving the code reviews themselves, not on specific code patterns. Furthermore, most of...

over 6 years ago

ivo's awfully random tech blog

Is this ok…​? Or, spotting unsafe concurrent Ruby patterns

The past weekend I had the enormous pleasure to speak at the Ruby on Ice 2018 conference in Tegernsee, Germany. Figure 1. All Ruby conferences should have a view like this 😁 I decided to give the talk I wish I had seen about four years ago before I joined Talkdesk, on a number of gotchas and common mistakes one can do when working with Ruby and concurrency. You can find the video for this talk, as well as the...

over 6 years ago

ivo's awfully random tech blog

Lightning Talk - Warm-Blanket: Goodbye crappy after-boot performance

Back in September, at the EuRuKo 2017 Ruby conference, I decided to submit a lightning talk on the warm-blanket gem. If you’re curious for a bite-sized introduction and motivation on why you should care about it, you can find the presentation and slides below 😁

almost 7 years ago

ivo's awfully random tech blog

persistent-💎: a new ruby gem for beautiful immutable data structures

After a few weeks of work, I’ve just released version 1.0 of my new gem: persistent-💎! The objective of this gem is to make programming with immutable data structures in Ruby as joyful and frictionless as using the built-in Array and Hash classes. So easy, in fact, that using immutable structures becomes the norm, rather than the exception. Ruby has no immutable data structures in the standard library, but it is flexible enough that we can add such functionality as...

almost 7 years ago

ivo's awfully random tech blog

asciidoc: an awesome markdown alternative

So if you already are comfortable with Markdown, why should you care? Here are some of the features that really impressed me: Generating a table of contents: A table of contents can be automatically generated based on your document structure. You can control where a ToC is placed, how many subsection levels to include, and even its title.

about 7 years ago

ivo's awfully random tech blog

Why I always use attr_reader to access instance variables

Ruby’s attr_reader method can be used to automatically generate a “getter” for a given instance variable. In simple terms, doing is the same as writing I’ve adopted a programming style where I always try to use attr_reader to access instance variables (or getters, if you prefer to call them that 😁). I’ve been asked about the reasons that led me to adopt this style in several PRs, so I wanted to write a quick post motivating my choice. As a...

about 7 years ago

ivo's awfully random tech blog

Introducing the WarmBlanket gem

Optimizing runtimes are a very hot topic for Ruby development right now: Historically, both JRuby and Rubinius dynamically optimized Ruby code as they ran it, but soon they will soon be joined by the likes of TruffleRuby, ruby+omr, mjit, llrb and topaz. Furthermore, it’s common for Ruby web services to lazily load classes and open connections to dependent systems. This allows for faster system start-up time, and reduces memory usage: unused code is not loaded, and unused connections are not...

about 7 years ago

ivo's awfully random tech blog

Ninjas’ guide to getting started with VisualVM

VisualVM is a free Java/JVM tool that ships with most Oracle JDK/OpenJDK installs (if you’ve used Erlang’s observer previously, it’s a similar tool). It can be used to both profile and debug applications running on the JVM—including Java, JRuby, and many others. I’ve mentioned it several times before on this blog as part of my JRuby voyages, as it’s my go-to tool to start investigating any kind of issue in a JVM application. Recently, I’ve written a thorough guide on...

about 7 years ago

ivo's awfully random tech blog

adopting tls

Just a quick note: If you can read this, it means this blog has finally left the internet stone age and is now being successfully served using https/tls via amazon cloudfront. Thanks to Oliver Pattison for his great guide on how to do so. Join us! We have cookies! P.s.: Next step is getting HSTS and other recommended security headers going.

over 7 years ago

ivo's awfully random tech blog

rubies: a look at ruby's shiny future

I’m a huge fan of the Ruby programming language, but in terms of implementation Ruby still lags behind other dynamic languages such as Javascript, which have powerful optimizing runtimes capable of delivering blazing performance. Yet I think Ruby in 2017 is closer to that goal than ever: it seems like everyone in the Ruby runtime game is looking at techniques such as JIT compilation and speculative optimization. Recently, on the 7th of March, I gave a presentation at the 4th...

over 7 years ago

ivo's awfully random tech blog

quickies: heroku exec and deploying jruby

A few months back on my “another round of jruby goodness” post I wrote about a heroku buildpack that, combined with a reverse proxy like ngrok would allow connecting to a heroku node, and that could even be used to open up Java VisualVM and connect to it, live. This week I was pleasantly surprised to see heroku introduce this functionality out of the box with the heroku exec add-on. After setting up the add-on, opening up VisualVM on a...

over 7 years ago

ivo's awfully random tech blog

why you should be using jruby in production

On February 23rd I gave a presentation at the Fullstack LX meetup detailing why you should use JRuby and how it helped my team at Talkdesk identify complex bugs and hit our performance goals. You can find the presentation and slides below, enjoy! Update: Video went down and I did not have a copy 😢. I’ll update this if I can restore a copy. (Or you can just invite me over to your meetup to present it live 😅)

over 7 years ago

ivo's awfully random tech blog

benchmarking jruby invokedynamic with a production application

As you read JRuby blog posts and other resources around the web, you may find references to JRuby’s compile.invokedynamic option, that as of 9.1.7.0 continues to ship turned off by default. So, why is it off? I asked the JRuby developers and here’s what they had to say about it: @KnuX @tom_enebo Primarily startup and warm-up time: both increase. It has improved somewhat in Java 8.— Charles Nutter (@headius) January 26, 2017 @knux @headius It is only for warmup reasons....

over 7 years ago

ivo's awfully random tech blog

pry-debugger-jruby gem now on rubygems!

As a followup from my psa: you can now debug with pry on jruby I have finally uploaded my fork of pry-debugger — the pry-debugger-jruby gem — onto rubygems! The original post has been updated, but as a reminder, using it is as simple as adding to your gemfile, and then starting pry on JRuby. Feedback and issues are very welcome! :)

almost 8 years ago

ivo's awfully random tech blog

weekend hacking: enviado gem

On friday I started reading up on lyft’s recently-announced envoy proxy/communication bus/general awesome piece of kit. Envoy can be used in many different ways: As a reverse proxy in front of some service As a service-to-service communication provider (including service discovery) As a local proxy to some remote service This last configuration piqued my interest, as I have been interested in solutions for doing circuit breaking ever since I learned of netflix’s hysterix library. But retrofitting a circuit breaking onto...

almost 8 years ago

ivo's awfully random tech blog

jruby's Charles Nutter on the jvm as a language platform

I just finished listening to a recent episode of the Software Engineering Radio podcast: SE-Radio Episode 266: Charles Nutter on the JVM as a Language Platform In this podcast Charles Nutter—one of JRuby’s maintainers—discusses the relationship between non-Java languages that run on the JVM and Java/the Java platform; some history on JRuby and on the recently-released 9k version, and even touches a very interesting programming language which I’d never heard about: Mirah. If you’re interested on the JVM platform or...

almost 8 years ago

ivo's awfully random tech blog

peek and pick at mri's heap, part 2

In part 1 of this overview I looked at a gui tool to monitor and analyze a live application’s memory usage. This time, let’s turn to a command-line tools that can look at things after-the-fact: the heapy gem. Ruby version 2.1 introduced the ability to take heap memory dumps using the ObjectSpace module. To do so, just add: require 'objspace' ObjectSpace.trace_object_allocations_start …to your application boot. Later on, when you want to take a heap memory dump, you can use: GC.start...

almost 8 years ago

ivo's awfully random tech blog

finding dead ruby code with debride

My recent web adventures led me to the debride gem: debride statically analyzes your ruby code, trying to find methods which are never referenced. As ruby is a very dynamic language, you’ll get some amount of false positives, but I was successful in finding several unused methods on several of our years-old codebases at Talkdesk. The output of running debride is a list of methods (and which class or module they belong to) that debride cannot find a reference to...

almost 8 years ago

ivo's awfully random tech blog

psa: you can now debug with pry on jruby

I’ve been wanting to write this blog post for about a month now, but amongst the fixes for JRuby version 9.1.3.0 are a pair of fixes to backtrace line generation during debugging. Why is this relevant? Because it means that you can now debug interactively from a pry console on JRuby too! To do so, you can use either my fork of the pry-debugger gem, pry-debugger-jruby or the slightly simpler pry-nav gem. You can include either of them in your...

about 8 years ago

ivo's awfully random tech blog

peek and pick at mri's heap, part 1

While I’ve been spending a lot more time on JRuby-land, over the past year a number of very interesting tools have sprung up to analyze and debug MRI memory usage which are not very known but are rather kick-ass. So without further ado, here is the first of three tools you can use to look at your MRI heap, rather than just banging your head against the table when you have to investigate memory problems: Rbkit. Rbkit is composed of...

about 8 years ago

ivo's awfully random tech blog

why you should regenerate your spec_helper

If your project is like most ruby projects, your spec_helper.rb looks something like this: # encoding: utf-8 if RUBY_ENGINE == 'rbx' require 'codeclimate-test-reporter' CodeClimate::TestReporter.start end require 'dry/container' require 'dry/container/stub' Dir[Pathname(__FILE__).dirname.join('support/**/*.rb').to_s].each do |file| require file end Pretty straightforward, and also missing on a lot of cool rspec features. Modern rspec versions (as I’m writing this, the latest version is 3.5.4) have a lot of cool features that are not enabled by default, so as not to break backwards compatibility. What this...

about 8 years ago

ivo's awfully random tech blog

explaining git

Recently I have a quick presentation on how git works during Talkdesk’s TGIF presentation slot. I find that knowing some of these details really makes git “click” and easy to understand, as most (very awesome) git functionality can be simply mapped a bunch of operations on commit graphs and on plain text files that store commit hashes. Here it is, in all its badly-illustrated glory: Feel free to leave some kick-ass git tool suggestions in the comments. Or not :)

about 8 years ago

ivo's awfully random tech blog

another round of jruby goodness

That was fast! Another? Indeed. I have to confess that I spent the weekend reading through “Deploying with JRuby 9k” by Joe Kutner and following some of the links in the book, which led to a lot of cool discoveries. If you’re looking at JRuby for more than a small test app, I do recommend it, although as it has a lot of examples and commands I fear may become outdated fast as tools evolve. So that’s why you should...

over 8 years ago

ivo's awfully random tech blog

down the jruby rabbit hole

So recently at work we finally decided (after some prodding from me) to go with JRuby for a new production system. I had no real experience with JRuby other than looking at some documentation and playing with it for five minutes, so here’s some JRuby-related topics I bumped into and I’ve been wanting to write about. start-up time during development Since the system hasn’t yet been deployed, I don’t have deployment stories to share, but for development I have some...

over 8 years ago

ivo's awfully random tech blog

did_you_know.ruby?

Yesterday I did a small presentation on some awesome ruby tricks and tools, touching a bit on why and when to use keyword arguments splat and double splat rspec’s verified doubles rspec --bisect and random spec ordering pry ruby 2.3 dig and safe navigation ruby threading and implementations as part of talkdesk’s TGIF engineering presentations. Nothing groundbreaking, but still interesting, I’d say ;) You can find the slides below:

over 8 years ago

ivo's awfully random tech blog

asciinema: shell recording done right!

ivo anjo • december 1st, 2015 • 🕘 1 minute read

almost 9 years ago

ivo's awfully random tech blog

Whoa! Java has a REPL now!

As part of my weekend reading I just discovered that an official REPL is planned for Java 9! It’s spec’d in JEP 222, and there’s a very neat demo by Alex Zhitnitsky: Even better, there’s even a docker image for testing it. Just run $ docker run -it ensignprojects/javarepl And before long you’ll be staring at the new jshell REPL!

almost 9 years ago

ivo's awfully random tech blog

Ruby meets weak memory models

I just finished watching a very interesting presentation from RubyConf 2015 entitled “Writing concurrent libraries for all Ruby runtimes” by Petr Chalupa. This presentation explores the challenges of implementing a Future in ruby VMs that offer true concurrency, such as JRuby and Rubinius, and how the concurrent-ruby gem can make your life easier in this point. If you’re interested in low-level concurrency and what happens to ruby code when run under these alternative VMs, it’s a great watch, even if...

almost 9 years ago

ivo's awfully random tech blog

Ruby features i'm looking forward to

I’ve been exploring what’s next for ruby, and now that ruby 2.3.0-preview1 is out, here’s a quick look at what caught my eye. $ ruby --version ruby 2.3.0dev (2015-11-11 trunk 52540) [x86_64-linux] The safe navigation operator was inspired by groovy, and allows you to simplify code such as zoo = Zoo.new zoo && zoo.animals && zoo.animals.first into If any of the return values in the “chain” are nil, then nil is returned, otherwise, ruby continues sending the next message. Simple,...

almost 9 years ago

ivo's awfully random tech blog

starting a new blog

I haven’t really blogged in a big while, and my old blog at blogspot seems to be more and more boring to maintain, so I finally decided to put jekyll to work and added a blog to ivoanjo.me. I’m currently exploring Ruby and other programming languages, so my plan is to document some of my cooler findings for the larger internets. Thank you and have an awesome day!

almost 9 years ago