• About TC
  • Affiliate Disclaimer
  • Privacy Policy
  • TOS
  • Contact
Tuesday, July 1, 2025
Techcratic
  • TC
  • AI
    Artificial Intelligence

    EgoDex: Learning Dexterous Manipulation from Large-Scale Egocentric Video

    Artificial Intelligence

    Instruction-Following Pruning for Large Language Models

    Artificial Intelligence

    How to Combine Streamlit, Pandas, and Plotly for Interactive Data Apps

    Artificial Intelligence

    Tailor responsible AI with new safeguard tiers in Amazon Bedrock Guardrails

    Artificial Intelligence

    Automate Data Quality Reports with n8n: From CSV to Professional Analysis

    Artificial Intelligence

    NewDay builds A Generative AI based Customer service Agent Assist with over 90% accuracy

    Artificial Intelligence

    5 Things You Need to Know About Agentic AI

    Artificial Intelligence

    Normalizing Flows are Capable Generative Models

    Artificial Intelligence

    Update on the AWS DeepRacer Student Portal

  • App Zone
    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

  • Apple

    July 1, 2025 – Apple AI rumors, 10 years of Apple Music

    Will the iPhone 17 lineup really have higher refresh rate displays?

    The biggest iPhone 17 mystery left could swing a lot of upgrade decisions

    Apple hit with $110M damages in 3G patents lawsuit

    Apple hit with $110M damages in 3G patents lawsuit

    Photos iOS 26 vs iOS 18: Compared

    Photos iOS 26 vs iOS 18: Compared

    Here’s everything new for Apple Photos in iOS 26

    Here’s everything new for Apple Photos in iOS 26

    Apple gains ground with new Macs despite market challenges

    Apple gains ground with new Macs despite market challenges

    Anker Power Bank, Zolo, MagGo, recall

    Anker Power Bank, Zolo, MagGo, recall

    Developer for Linux on Apple Silicon Macs resigns, citing ‘major failure of leadership’

    New ‘MacBook’ rumor sounds like Apple’s taking the iPad approach

    Apple Music 10 year celebration

    Apple Music 10 year celebration

  • Retro Rewind
    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 57 April 1994

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

  • Tech Deals
    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    Sonic & SEGA All-Stars Racing – Xbox 360

    Sonic & SEGA All-Stars Racing – Xbox 360

    Carnival Games – Nintendo Wii (Renewed)

    Carnival Games – Nintendo Wii (Renewed)

    Transformers Devastation – PlayStation 3

    Transformers Devastation – PlayStation 3

  • Tech Eats
    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

  • Tesla
    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

  • UFO
    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Alien 3's Workprint: What Else Was Cut From the Film?

    Alien 3's Workprint: What Else Was Cut From the Film?

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

No Result
View All Result
  • TC
  • AI
    Artificial Intelligence

    EgoDex: Learning Dexterous Manipulation from Large-Scale Egocentric Video

    Artificial Intelligence

    Instruction-Following Pruning for Large Language Models

    Artificial Intelligence

    How to Combine Streamlit, Pandas, and Plotly for Interactive Data Apps

    Artificial Intelligence

    Tailor responsible AI with new safeguard tiers in Amazon Bedrock Guardrails

    Artificial Intelligence

    Automate Data Quality Reports with n8n: From CSV to Professional Analysis

    Artificial Intelligence

    NewDay builds A Generative AI based Customer service Agent Assist with over 90% accuracy

    Artificial Intelligence

    5 Things You Need to Know About Agentic AI

    Artificial Intelligence

    Normalizing Flows are Capable Generative Models

    Artificial Intelligence

    Update on the AWS DeepRacer Student Portal

  • App Zone
    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Apple: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Launcher Apps for Android: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Card Game Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Medical Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Travel Apps of 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Casual Game Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Food Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Sport Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

    Top 3 Productivity Apps for 2025: Features, Pros, and Cons

  • Apple

    July 1, 2025 – Apple AI rumors, 10 years of Apple Music

    Will the iPhone 17 lineup really have higher refresh rate displays?

    The biggest iPhone 17 mystery left could swing a lot of upgrade decisions

    Apple hit with $110M damages in 3G patents lawsuit

    Apple hit with $110M damages in 3G patents lawsuit

    Photos iOS 26 vs iOS 18: Compared

    Photos iOS 26 vs iOS 18: Compared

    Here’s everything new for Apple Photos in iOS 26

    Here’s everything new for Apple Photos in iOS 26

    Apple gains ground with new Macs despite market challenges

    Apple gains ground with new Macs despite market challenges

    Anker Power Bank, Zolo, MagGo, recall

    Anker Power Bank, Zolo, MagGo, recall

    Developer for Linux on Apple Silicon Macs resigns, citing ‘major failure of leadership’

    New ‘MacBook’ rumor sounds like Apple’s taking the iPad approach

    Apple Music 10 year celebration

    Apple Music 10 year celebration

  • Retro Rewind
    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Games April 1995

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 57 April 1994

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: Blast from the Past – 35 Iconic Commercials of 1988!

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: PC World Magazine August 1998

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: Computer Shopper Magazine September 1997

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: PC Magazine December 2015

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: EDGE Magazine RETRO #1: The Guide to Classic Videogame Playing and Collecting

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Computer Gaming World Magazine Issue 73 December 1998

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

    Retro Rewind: Electronic Gaming Monthly Magazine Number 55 February 1994

  • Tech Deals
    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    Skytech King 95 Gaming PC Desktop, Intel i7 14700F 2.1 GHz (5.3GHz Turbo), NVIDIA RTX…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    ASRock – B550M PRO SE – ASRock B550M Pro SE Gaming Desktop Motherboard – AMD PRO565…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    Soundcore A30i by Anker, Smart Noise Cancelling Earbuds, Lipstick-Shaped Stylish Design,…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    ADATA Premier 256GB MicroSDHC/SDXC UHS-I Class 10 V10 A1 Memory Card with Adapter Read…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    acer Wireless Mouse for Laptop, 2.4GHz Computer Mouse 3 Adjustable DPI Office Cordless…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    STGAubron Gaming PC Computer Desktop, GeForce GTX 1660 Ti 6G, Intel Core I7 up to 3.9…

    Sonic & SEGA All-Stars Racing – Xbox 360

    Sonic & SEGA All-Stars Racing – Xbox 360

    Carnival Games – Nintendo Wii (Renewed)

    Carnival Games – Nintendo Wii (Renewed)

    Transformers Devastation – PlayStation 3

    Transformers Devastation – PlayStation 3

  • Tech Eats
    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Cheesy Broccoli Rice Mug: 5-Minute Super Comfort Food

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Top 10 Vegetarian Recipes for 2025: Easy and Nutritious Meals for Busy People

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Mug Lasagna: 5-Minute Microwave Meat Lover’s Dream

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon Fried Rice Mug: 5-Minute Microwave Meal

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Bacon & Cheddar Mug Biscuit: 2-Minute Savory Comfort

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Loaded Bacon Cheesy Potato Mug: 5-Minute Comfort Food

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Peanut Butter Banana Mug Muffin: 5-Minute Protein Snack

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Oreo Mug Cake: 2-Minute Cookie & Cake Combo!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

    Tiramisu Mug Cake: Coffee Lover’s Dream in 2 Minutes!

  • Tesla
    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Airpod Holder for Tesla MagSafe Wireless Charger- Fits All Airpods and All Model 3, X,…

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Tesla unveils its LFP battery factory, claims it’s almost ready

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Garmin GPS Mount – Ultra-Sticky Dash Holder for Car & Truck Dashboard & Windshield,…

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    Elon Musk goes from sleeping on Tesla’s factory floor to sleeping in sales office

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    2 PCS H13/9008 Car LED Light Canbus Error-free Decoder, Plug-and-play Retrofit Radio…

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Tesla fires Musk’s chief of staff who became head of North America and Europe

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Wireless Charge Mat for 2024 2025 Tesla Cybertruck,Center Console Wireless Charger…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Truck Bed Cargo Mesh Net for Tesla Cybertruck 2024,with 6 Carabiners Stretchable Storage…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

    Motor Trend Premium FlexTough Deep Dish Rear Rubber Floor Mat Liners, Heavy Duty…

  • UFO
    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    Funny Bigfoot Sasquatch Alien Spaceship UFO Introvert Bruh T-Shirt

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    The Most Terrifying Unsolved UFO Mysteries | Best of Close Encounters

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    FINALLY! Biggest ALIEN SEARCH OPERATION's Results are Out | Breakthrough Listen Project Results

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    CINOTON 160W UFO LED High Bay Light, Aluminum LED Shop Lights with 24000LM, 5000K Commercial Bay Lighting for Warehouse Garage Workshop Factory Hall, 6′ Cable & Safety Rope, ETL Listed 2 Pack

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    MindBlowing Alien Encounter Giant Mouse Discovered on Mars

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Franco Collectibles Adventure Time Bedding Super Soft Cozy Plush Throw, 46 in x 60 in, (Officially Licensed Product)

    Alien 3's Workprint: What Else Was Cut From the Film?

    Alien 3's Workprint: What Else Was Cut From the Film?

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    Simple Area 51 Minimal UFO Tattoo Line Art Graphic Tee UFO T-Shirt

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

    UFO hearing: Pentagon shows declassified photos and video, clip of unexplainable floating object

No Result
View All Result
Techcratic
No Result
View All Result
Home Hacker News

Lightstorm: minimalistic Ruby compiler – The LLVM Project Blog

Hacker News by Hacker News
December 30, 2024
in Hacker News
Reading Time: 11 mins read
129
A A
0

2024-12-30 17:58:00
blog.llvm.org

Some time ago I was talking about an ahead-of-time Ruby compiler.
We started the project with certain goals and hypotheses in mind, and while the original compiler is at nearly 90% completion, there are still those other 90% that needs to be done.

In the meantime, we decided to strip it down to a bare minimum and implement just enough features to validate the hypotheses.

Just like the original compiler we use MLIR to bridge the gap between Ruby VM’s bytecode and the codegen, but instead of targeting LLVM IR directly, we go through EmitC dialect and targeting C language, as it significantly simplifies OS/CPU support. We go into a bit more details later.

The source code of our minimalistic Ruby compiler is here: https://github.com/dragonruby/lightstorm.

The rest of the article covers why we decided to build it, how we approached the problem, and what we discovered along the way.

Motivation and the use case

Our use case is pretty straightforward: we are building a cross-platform game engine that’s indie-focused, productive, and easy to use. The game engine itself is written in a mix of C and Ruby, but the main user-interface is the Ruby itself.

As soon as the game development is done and the game is ready for “deployment,” the code is more or less static and so we asked ourselves if we can pre-compile it into machine code to make it run faster.

But given all the dynamism of Ruby, why would a compilation make it faster?

So here comes our hypothesis. But first let’s look at some high-level implementation details to see where the hypothesis comes from.

Compilers vs Interpreters

While a language itself cannot be strictly qualified as compiled or interpreted, the typical implementations certainly are.

In case of a “compiled” language the compiler would take the whole program, analyze it and produce the machine code targeting a specific hardware (real or virtual), while an interpreter would take the program and execute it right away, one “instruction” at a time.

The definition above is a bit handwavy: zoom our far enough and everything is a compiler, zoom in close enough and everything is an interpreter. But you’ve got the gist.

Most Ruby implementations are interpreter-based, and in our case we are using mruby.

The mruby interpreter is a lightweight register-based virtual machine (VM).

Let’s look at a concrete example. The following piece of code:

is converted into the following VM bytecode, consisting of various operations (ops for short):

LOADI R1 42
LOADI R2 15
ADD R1 R2
HALT

The VM’s interpreter loop looks as follows (pseudocode):

dispatch_next:
  Op op = bytecode.next_op();
  switch (op.opcode) {
    case LOADI: {
      vstack.store(op.dest, mrb_int(op.literal));
      goto dispatch_next;
    }
    case ADD: {
      mrb_value lhs = vstack.load(op.lhs);
      mrb_value rhs = vstack.load(op.rhs);
      vstack.store(op.dest, mrb_add(lhs, rhs));
      goto dispatch_next;
    }
    // More ops...
    case HALT: goto halt_vm;
  }

halt_vm:
  // ...

For each bytecode operation the VM will jump/branch into the right opcode handler, and then will branch back to the beginning of the dispatch loop.
In the meantime, each opcode handler would use a virtual stack (confusingly located on the heap) to store intermediate results.

If we unroll the above bytecode manually, then the code can look like this:

  goto loadi_1;

loadi_1:
  // LOADI R1 42
  mrb_value t1 = mrb_int(42);
  vstack.store(1, t1);
  goto loadi_2;

loadi_2:
  // LOADI R2 42
  mrb_value t2 = mrb_int(15);
  vstack.store(2, t2);
  goto add;

add:
  // ADD R1 R2
  mrb_value lhs = vstack.load(1);
  mrb_value rhs = vstack.load(2);
  mrb_value t3 = mrb_add(lhs, rhs);
  vstack.store(1, t3);
  goto halt;

halt:
  // shutdown VM

Many items in this example can be eliminated: specifically, we can avoid load/stores from/to the heap, and we can safely eliminate gotos/branches:

  mrb_value t1 = mrb_int(42);
  mrb_value t2 = mrb_int(15);;
  mrb_value t3 = mrb_add(t1, t2);
  vstack.store(1, t3);
  goto halt;

halt:
  // shutdown VM

So here goes our hypothesis:

Hypothesis

By precompiling/unrolling the VM dispatch loop we can eliminate many load/stores and branches along with branch mispredictions, this should improve the performance of the end program.

We can also try to apply some optimizations based on the high-level bytecode analysis, but due to the Ruby’s dynamism the static optimization surface is limited.

Approach

As mentioned in the beginning, building a full-fledged AOT compiler is a laborious task which requires time and has certain constraints.

For the minimalistic version we decided to change/relax some of the constraints as follows:

  • the compiled code must be compatible with the existing ecosystem/runtime
  • the existing runtime must not require any changes
  • the supported language features should be easily “representable” in C

Unlike the original compiler, we are not targeting machine code directly, but C instead.
This eliminates a lot of complexity, but it also means that we only support a subset of the language (e.g., blocks and exceptions are missing at the moment).

This is obviously not ideal, but it serves important purpose – our goal at this point is to validate the hypothesis.

A classical compilation pipeline looks as follows:

Classical compilation pipeline

To build a compiler one needs to implement the conversions from the raw source file all the way down to machine code and the language runtime library.
Since we are targeting the existing implementation, we have the benefit of reusing the frontend (parsing + AST) and the runtime library.

Still, we need to implement the conversion from AST to the machine code.
And this is where the power of MLIR kicks in: we built a custom dialect (Rite) which represents mruby VM’s bytecode, and then use a number of builtin dialects (cf, func, arith, emitc) to convert our IR into C code.

At this point, we can just use clang to compile/link the code together with the existing runtime and that’s it.

The final compilation pipeline looks as follows:

Lightstorm compilation pipeline

With the benefit of MLIR we are able to build a funtional compiler in just a couple of thousands lines of code!

Now let’s look at how it performs.

Some numbers

Benchmarking is hard, so take these numbers with a grain of salt.

We run various (micro)-benchmarks showing results in the range of 1% to 1200% speedups, but we are sticking to the aobench as it is very close to the game-dev workloads we are targeting.

mruby also uses aobench as part of its benchmark suite, though we slightly modified it to replace Number.each blocks with explicit while loops.

Next we used excellent simple-kpc library to capture CPU counters on Apple M1 CPU, namely we collect total cycles, total instructions count, branches, branch mispredictions, and load/stores (FIXED_CYCLES, FIXED_INSTRUCTIONS, INST_BRANCH, BRANCH_MISPRED_NONSPEC, and INST_LDST respectively).

Naturally, we also collect the total execution time.

All the benchmarks compare vanilla bytecode interpretation against the “unrolled” compiled version.

We are using mruby 3.0. While it’s not the most recent version at the time of writing, it was the most recent version at the time we’ve build the compiler.

The following chart shows the results of our measurements.
The three versions we compare are the baseline on the left, compiled version without optimizations in the middle, and the compiled version plus simple escape analysis and common subexpression elimination (CSE) on the right side.

The raw data and the formulas are here.

Benchmarks

With all the current optimizations in place both the number of cycles and the total execution time went down by roughly ~30%.

We are able to eliminate ~17% of branches and ~28% of load/stores, while the branch misses were cut in half with ~55% decrease.

The numbers look promising, although the amount of load/stores and branches will certainly go up as we implement all the language features due to the way blocks and exceptions are handled.

On the other hand, we didn’t touch the runtime implementation which together with LTO will enable some more improvements due to more inlining.

Where to next?

As mentioned in the beginning, some parts of the engine itself are written in C with and some of them are purely due to performance reasons. We are looking into replacing those critical pieces with compiled Ruby. While we may still pay performance penalty, we hope that ease of maintenance will be worthwile.

In the meantime, do not hesitate to give it a shot, and if you have any questions reach out to Alex or Amir!

Some links

Source Link


Keep your files stored safely and securely with the SanDisk 2TB Extreme Portable SSD. With over 69,505 ratings and an impressive 4.6 out of 5 stars, this product has been purchased over 8K+ times in the past month. At only $129.99, this Amazon’s Choice product is a must-have for secure file storage.

Help keep private content private with the included password protection featuring 256-bit AES hardware encryption. Order now for just $129.99 on Amazon!


Start your free Amazon Prime trial
today and unlock unlimited streaming and more!

Support Techcratic

If you find value in Techcratic’s insights and articles, consider supporting us with Bitcoin. Your support helps me, as a solo operator, continue delivering high-quality content while managing all the technical aspects, from server maintenance to blog writing, future updates, and improvements. Support Innovation! Thank you.

Bitcoin Address:

bc1qlszw7elx2qahjwvaryh0tkgg8y68enw30gpvge

Please verify this address before sending funds.

Bitcoin QR Code

Simply scan the QR code below to support Techcratic.

Bitcoin QR code for donations

Please read the Privacy and Security Disclaimer on how Techcratic handles your support.

Disclaimer: As an Amazon Associate, Techcratic may earn from qualifying purchases.

Tags: Hacker News
Share162Share28ShareShare4ShareTweet101
Previous Post

Senior Manager of DevOps and Site Reliability

Next Post

The Callisto Protocol – Review

Hacker News

Hacker News

Stay updated with Hacker News, where technology meets entrepreneurial spirit. Get the latest on tech trends, startup news, and discussions from the tech community. Read the latest updates here at Techcratic.

Related Posts

Graph Theory Applications in Video Games
Hacker News

Graph Theory Applications in Video Games

July 1, 2025
1.3k
Snake Keyloggers Exploit Java Utilities to Evade Detection by Security Tools
Hacker News

Snake Keyloggers Exploit Java Utilities to Evade Detection by Security Tools

July 1, 2025
1.3k
topling/toplingdb: ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction
Hacker News

topling/toplingdb: ToplingDB is a cloud native LSM Key-Value Store with searchable compression algo and distributed compaction

July 1, 2025
1.3k
RP2350pc Open Source Hardware all in one computer with RP2350B, 8MB PSRAM, 16MB Flash, Four USB host, DVI/HDMI output and Audio Codec for retro computer emulation and education
Hacker News

RP2350pc Open Source Hardware all in one computer with RP2350B, 8MB PSRAM, 16MB Flash, Four USB host, DVI/HDMI output and Audio Codec for retro computer emulation and education

July 1, 2025
1.3k
New C4 Bomb Attack Breaks Through Chrome’s AppBound Cookie Protections
Hacker News

New C4 Bomb Attack Breaks Through Chrome’s AppBound Cookie Protections

July 1, 2025
1.3k
stan-smith/OpenFLOW: Make beautiful isometric infrastructure diagrams
Hacker News

stan-smith/OpenFLOW: Make beautiful isometric infrastructure diagrams

July 1, 2025
1.3k
Public Signal Backups Testing – Call for Testing
Hacker News

Public Signal Backups Testing – Call for Testing

June 30, 2025
1.3k
The New Skill in AI is Not Prompting, It’s Context Engineering
Hacker News

The New Skill in AI is Not Prompting, It’s Context Engineering

June 30, 2025
1.3k
Load More
Next Post
The Callisto Protocol – Review

The Callisto Protocol - Review

Your Tech Resources

  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Forbes
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo
  • Google News
  • Hacker News
  • Harvard Tech
  • I Like Cats ™
  • I Like Dogs ™
  • LifeHacker
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • PC World
  • Photofocus
  • Physics
  • Random Tech
  • Retro Rewind ™
  • Robot Report
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Art
  • Tech Careers
  • Tech Deals
  • Techcratic ™
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Tech News

  • 30 Second Tech ™
  • AI
  • Apple Insider
  • Ars Technica
  • CNET
  • ComputerWorld
  • Crypto News
  • Cybersecurity
  • Endgadget
  • ExtremeTech
  • Fossbytes
  • Gaming
  • GeekWire
  • Gizmodo

Tech News

  • Harvard Tech
  • MacRumors
  • Macworld
  • Mashable
  • Microsoft
  • MIT Tech
  • Physics
  • PC World
  • Random Tech
  • Retro Rewind ™
  • SiliconANGLE
  • SlashGear
  • Smartphone
  • StackSocial
  • Tech Careers

Tech News​

  • Tech Art
  • TechCrunch
  • Techdirt
  • TechRepublic
  • Techs Got To Eat ™
  • TechSpot
  • Tesla
  • The Verge
  • TNW
  • Trusted Reviews
  • UFO
  • VentureBeat
  • Visual Capitalist
  • Wired
  • ZDNet

Site Links

  • About Techcratic
  • Affiliate Disclaimer
  • Affiliate Link Policy
  • Contact Techcratic
  • Dealors Discount Store
  • Privacy and Security Disclaimer
  • Privacy Policy
  • RSS Feed
  • Site Map
  • Support Techcratic
  • Techcratic
  • Tech Deals
  • TOS
  • 𝕏
Click For A Secret Deal

Techcratic – Your All In One Tech Hub © 2020 – 2025
All Rights Reserved
∞

No Result
View All Result
  • 30 Second Tech ™
  • AI
  • App Zone ™
  • Apple
  • Ars Technica
  • CNET
  • Crypto News
  • Cybersecurity
  • Endgadget
  • Gaming
  • I Like Cats ™
  • I Like Dogs ™
  • MacRumors
  • Macworld
  • Tech Deals
  • Techcratic ™
  • Techs Got To Eat ™
  • Tesla
  • UFO
  • Wired