HN user

tenderlove

2,473 karma

ruby-core member. rails-core member. <3 <3

Posts26
Comments141
View on HN
railsatscale.com 1mo ago

A new register allocator for ZJIT

tenderlove
55pts6
byroot.github.io 1y ago

Optimizing Ruby's JSON, Part 5

tenderlove
7pts0
blog.testdouble.com 3y ago

The looming demise of the 10x developer

tenderlove
13pts2
github.com 3y ago

Initial V: a BMW shifter turned Bluetooth Keyboard

tenderlove
4pts0
tenderlovemaking.com 4y ago

Writing Cross Platform Machine Code

tenderlove
2pts0
analogterminalbell.com 5y ago

Analog Terminal Bell

tenderlove
265pts62
www.theverge.com 7y ago

The EU has approved Microsoft’s $7.5B GitHub acquisition

tenderlove
3pts0
www.blue.sky.or.jp 8y ago

Grass: a functional grass planting programming language

tenderlove
38pts3
tenderlovemaking.com 8y ago

Speeding Up Ruby with Shared Strings

tenderlove
194pts37
tenderlovemaking.com 8y ago

Visualizing Your Ruby Heap

tenderlove
3pts0
www.atdot.net 9y ago

Proposal of a new concurrency model for Ruby 3 [pdf]

tenderlove
188pts87
weblog.rubyonrails.org 10y ago

Rails 5.0: Action Cable, API mode, and more

tenderlove
664pts219
lwn.net 10y ago

Managing heterogeneous environments with ManageIQ

tenderlove
49pts7
tenderlovemaking.com 12y ago

Making ActiveRecord 2x faster

tenderlove
158pts44
blade.nagaokaut.ac.jp 13y ago

Ruby 2.0.0-preview1 is out

tenderlove
115pts62
gist.github.com 13y ago

Evaluate Scheme in Ruby's virtual machine

tenderlove
24pts2
tenderlovemaking.com 13y ago

Live Streaming in Rails 4.0

tenderlove
141pts38
www.biwascheme.org 14y ago

BiwaScheme is a Scheme interpreter written in JavaScript.

tenderlove
3pts0
www.youtube.com 15y ago

I've been working on infinite streaming in Rails 3.1, here is my work so far.

tenderlove
34pts13
lists.macosforge.org 15y ago

MacRuby is moving to Github

tenderlove
89pts17
tenderlovemaking.com 15y ago

I suck at web design, so I made a contest to design rubycommitters.org.

tenderlove
55pts40
tersesystems.com 15y ago

Where Pair Programming Fails for Me

tenderlove
70pts38
engineering.attinteractive.com 15y ago

I wrote an article about writing a code coverage tool in Ruby 1.9. :-D

tenderlove
35pts15
engineering.attinteractive.com 15y ago

The Wonderful World of Graphs

tenderlove
22pts1
tenderlovemaking.com 16y ago

I put rails docs on my Internet pad. Thought I would share

tenderlove
35pts11
www.youtube.com 16y ago

Phuby on Phails demo video from RubyConf

tenderlove
2pts2

RubyGems.org backfilled older releases with `created_at` fields, so theoretically you could still do the cooldown with very old gems (though I don't know why you would). It's only private / alternative gem servers that may not provide `created_at` fields.

Gem.coop 10 months ago

This absolutely happened and is not speculation. I can't find the emails from the individuals that emailed me, but I did find my email to the board of directors asking that the website language be changed because people had pinged me thinking I would be getting money, or that the money would go to fund rubygems.org.

At the time I'd sent the email I was unaware Ruby Together was on HN front page (and that's why people were pinging me)

As I said in my blog post, it imports both and combines them in the UI. Also as I said in my blog post, I switched to shooting only in raw, and it still exhibited file corruption.

That's a mistake no mater what application you're importing to, else we'll be graced with another blog post, "Darktable app Corrupts Photos"

Thanks dad.

This is also my guess. It's really a bummer, and I'd report it to Apple but since it's nondeterministic I have no idea how to provide repro steps.

Here you go!

  https://gist.github.com/tenderlove/25853f50ab46a58738ff2cc22d682f2b
I ran both files through xxd then diffed them. I've literally changed every piece of hardware (at no small cost). "premature to immediately blame Apple" seems a bit off.

Yes, but if it ends up creating any ephemeral objects in the process of determining those returned objects, then the allocation sequence is still not homogeneous.

Yes! People might do `map` transformations, but it's very common to do other stuff at the same time. Any other allocations during that transformation would ruin cache hit rate.

At the same time, the callsite for any given `.new()` invocation will almost always be creating an instance of the exact same class. The target expression is nearly always just a constant name. That makes it a prime candidate for good inline caching at those callsites.

Yes again!

One reason is that we think we can make better use of registers. Since LBBV doesn't "see" all blocks in a particular method all at once, it's much more challenging to optimize register use across basic blocks. We've added type profiling, so ZJIT can "learn" types from the runtime.

It's not being abandoned, we're just shifting focus to evaluate a new style of compiler. YJIT will still get bug fixes and performance improvements.

ZJIT is a method based JIT (the type of compiler traditionally taught in schools) where YJIT is a lazy basic block versioning (LBBV) compiler. We're using what we learned developing and deploying YJIT to build an even better JIT compiler. IOW we're going to fold some of YJIT's techniques in to ZJIT.

And if so, will these YJIT features likes Fast Allocations be brought to ZJIT?

It may not have been clear from the post, but this fast allocation strategy is actually implemented in the byte code interpreter. You will get a speedup without using any JIT compiler. We've already ported this fast-path to YJIT and are in the midst of implementing it in ZJIT.

libffi can't know how to unwrap Ruby types (since it doesn't know what Ruby is). The advantage presented in this post is that the code for type unboxing is basically "cached" in the generated machine code based on the information the user passes when calling `attach_function`.

Thank you!

Ya, I really enjoy pattern matching. I think new language features just take a long time to percolate through the community. I remember when `->` was controversial, but that's the only way I write lambdas today. :D

While RUM is out of date, I still think it's an excellent resource. Some of the information in the book may be out of date, but I think it's an excellent place to start when you want to jump in to Ruby's source. Basically, after reading RUM the best place to go is to start reading the source.

That said, it would be really great if Pat (or someone besides me) published an update version of RUM

Kenny Log-Ins 3 years ago

Use a password manager with autofill so you'll make no mistakes where you are

I've seen different people mean different things by this, do you mean the IR is a list of bytecode handler addresses, and then the end of every handler is a load+indirect jump? Or is there also a dispatch table? In my experience the duplication of the dispatch sequence (i.e. no dispatch "loop") is worth 10-40% and then eliminating the dispatch table on top of that a bit more.

It's the former. Each bytecode is the handler address and every handler does a load + jump. There's no dispatch table (though there are compilation options that allow you to use a dispatch table, but I doubt anybody does that since you'd have to specifically opt in when you compile Ruby).

Sure, the question is always about the dynamic frequency of such call sites. What kind of ICs does YARV use? Are monomorphic calls inlined?

In one of our production applications, the most popular inline cache sees over 300 different classes and ~600 shapes (this is only for instance variable reads, I haven't measured method calls yet but suspect it's similar).

The VM only has a monomorphic cache (YJIT generates polymorphic caches), and neither the VM nor the JIT do inlining right now.

I'll take a stab at this.

YARV (Ruby's VM) is already direct threaded (using computed gotos), so there's no dispatch loop to eliminate. YARV is a stack based virtual machine, and the machine code that YJIT generates writes temporary values to the VM stack. In other words, it always spills temporaries to memory. We're actively working on keeping things in registers rather than spilling.

Ruby programs tend to be extremely polymorphic. It's not uncommon to see call sites with hundreds of different classes (and now that we've implemented object shapes, hundreds of object shapes). YJIT is not currently splitting or inlining, so we unfortunately encounter megamorphic sites more frequently than we'd like.

I'm sure there's more stuff but I hope this helps!

I wrote it because I can never remember what the `test` instruction does to the zero flag. Every time I use the instruction I have to look up the docs. Looking up docs is fine, but running code in a REPL helps me remember things better.

Hi!

Yes, that is one of my goals. I'll be presenting this project at RubyConf and I hope that I can get the compiler to compile itself by then. Breaking the circular dependencies is somewhat tricky, and you'll see some frankly ridiculous code inside TenderJIT that is meant to break those cycles.

It's x86-64 specific right now. I'm interested in adding ARM support so I'll do that at some point in the future. My desktop is x86-64 and our production machines are as well, which is why I started with it.

Thanks for the interest!