I took a journey into the heart of Ruby to learn the secrets of the /o regex modifier, and I emerged wiser, but also so deeply tired.
When you look at this class - does anything stick out to you? Any red flags?
If you run these lines - is it what you expected? It definitely was _not_ what I expected!
It turns out the tiny /o modifier has an outside influence on how your program runs. It creates a permanent, immutable version of your regex after the _first_ time it runs. My advice now is to never use this modifier. Ever. I dig alot deeper in the article, give it a read!
Over on the blue place, @tenderlove brought up some really valid points about Fibers in Ruby. I wrote up some of my thoughts over there, and figured i'd share them here too. This is pretty long, sorry 😂
Very fair! They don’t! And I think it’s valuable to make that clear to people. However, unlike threads, fibers have clear, deterministic seams of where race conditions could happen. They swap in well defined ways (blocking operations), and never at the instruction level.