Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

The methods are not constant:

    def foo
      Array.send(:define_method, :sort) do; [100, 200]; end
    end

    puts eval([1, 2, 3].inspect).sort[1] * 2
    foo
    puts eval([1, 2, 3].inspect).sort[1] * 2
But, anyway, my points isn't about partial-evaluation of values specifically (although JITs can and do do that); instead of int and 2 you can consider a type with 4 billion subtypes. JITs do specializations that an AOT simply cannot possibly do (not without code explosion).

Now, as I wrote in the original comment, I'm definitely not saying that JIT compilation is "better" than AOT. I am saying that the "zero-cost abstraction" philosophy of C++/Rust and the "zero-cost use" philosophy of JITs are two extremes that are each perfectly suited to two very different software domains.



Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: