[ruby-talk:444139] [ANN] Learning by Reversing: Native Gems, Parts 1 and 2

Hi Everyone, For a long time, I wanted to do a series of posts called "Learning by Reversing" where I look at something that exists and is useful, and try to work back and explain it. For this, my first series is about Native Gems in Ruby. So, I've picked a simple native Ruby gem called fast-polylines and am looking at all the code, how to develop it, how to test it, how it loads, how it works, etc. with the aim of helping people understand Native Ruby gems better. The first 2 parts are now online on my blog: * Part 1 - This covers the background to the gem we explore Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e1-native-gems/ * Part 2 - This goes into the details of how ruby loads the native gem and extension (and includes a nice sequence diagram of how all the bits happen together) Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e2-native-gems/ Future posts are planned to go into details like: * The interface between Ruby and C * The Makefile * A Makefile that also works on Windows * Running the specs * Running the performance benchmark * Enhancements: - Providing an executable - A gem that also works on JRuby - Making the gem ractor friendly - Patching an existing gem rather than a new module Comments on the posts or the plans welcome. Best regards, Mohit.

💪 On Sun, Feb 19, 2023, 08:41 Mohit Sindhwani via ruby-talk < ruby-talk@ml.ruby-lang.org> wrote:
Hi Everyone,
For a long time, I wanted to do a series of posts called "Learning by Reversing" where I look at something that exists and is useful, and try to work back and explain it.
For this, my first series is about Native Gems in Ruby. So, I've picked a simple native Ruby gem called fast-polylines and am looking at all the code, how to develop it, how to test it, how it loads, how it works, etc. with the aim of helping people understand Native Ruby gems better.
The first 2 parts are now online on my blog: * Part 1 - This covers the background to the gem we explore Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e1-native-gems/ * Part 2 - This goes into the details of how ruby loads the native gem and extension (and includes a nice sequence diagram of how all the bits happen together) Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e2-native-gems/
Future posts are planned to go into details like: * The interface between Ruby and C * The Makefile * A Makefile that also works on Windows * Running the specs * Running the performance benchmark * Enhancements: - Providing an executable - A gem that also works on JRuby - Making the gem ractor friendly - Patching an existing gem rather than a new module
Comments on the posts or the plans welcome.
Best regards, Mohit.
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...

+1 This is great, please do keep going! :) On Wed, Feb 22, 2023 at 6:15 AM ara.t.howard via ruby-talk < ruby-talk@ml.ruby-lang.org> wrote:
💪
On Sun, Feb 19, 2023, 08:41 Mohit Sindhwani via ruby-talk < ruby-talk@ml.ruby-lang.org> wrote:
Hi Everyone,
For a long time, I wanted to do a series of posts called "Learning by Reversing" where I look at something that exists and is useful, and try to work back and explain it.
For this, my first series is about Native Gems in Ruby. So, I've picked a simple native Ruby gem called fast-polylines and am looking at all the code, how to develop it, how to test it, how it loads, how it works, etc. with the aim of helping people understand Native Ruby gems better.
The first 2 parts are now online on my blog: * Part 1 - This covers the background to the gem we explore Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e1-native-gems/ * Part 2 - This goes into the details of how ruby loads the native gem and extension (and includes a nice sequence diagram of how all the bits happen together) Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e2-native-gems/
Future posts are planned to go into details like: * The interface between Ruby and C * The Makefile * A Makefile that also works on Windows * Running the specs * Running the performance benchmark * Enhancements: - Providing an executable - A gem that also works on JRuby - Making the gem ractor friendly - Patching an existing gem rather than a new module
Comments on the posts or the plans welcome.
Best regards, Mohit.
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...

Nice work! +1 j Στις Τετ 22 Φεβ 2023 στις 12:48 μ.μ., ο/η Ivo Anjo via ruby-talk < ruby-talk@ml.ruby-lang.org> έγραψε:
+1 This is great, please do keep going! :)
On Wed, Feb 22, 2023 at 6:15 AM ara.t.howard via ruby-talk < ruby-talk@ml.ruby-lang.org> wrote:
💪
On Sun, Feb 19, 2023, 08:41 Mohit Sindhwani via ruby-talk < ruby-talk@ml.ruby-lang.org> wrote:
Hi Everyone,
For a long time, I wanted to do a series of posts called "Learning by Reversing" where I look at something that exists and is useful, and try to work back and explain it.
For this, my first series is about Native Gems in Ruby. So, I've picked a simple native Ruby gem called fast-polylines and am looking at all the code, how to develop it, how to test it, how it loads, how it works, etc. with the aim of helping people understand Native Ruby gems better.
The first 2 parts are now online on my blog: * Part 1 - This covers the background to the gem we explore Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e1-native-gems/ * Part 2 - This goes into the details of how ruby loads the native gem and extension (and includes a nice sequence diagram of how all the bits happen together) Link: https://notepad.onghu.com/2023/learning-by-reversing-s1-e2-native-gems/
Future posts are planned to go into details like: * The interface between Ruby and C * The Makefile * A Makefile that also works on Windows * Running the specs * Running the performance benchmark * Enhancements: - Providing an executable - A gem that also works on JRuby - Making the gem ractor friendly - Patching an existing gem rather than a new module
Comments on the posts or the plans welcome.
Best regards, Mohit.
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...
______________________________________________ ruby-talk mailing list -- ruby-talk@ml.ruby-lang.org To unsubscribe send an email to ruby-talk-leave@ml.ruby-lang.org ruby-talk info -- https://ml.ruby-lang.org/mailman3/postorius/lists/ruby-talk.ml.ruby-lang.org...
-- j

On 2023-3-1 6:30 pm, ΙΩΑΝΝΗΣ ΜΑΡΟΥΝΤΑΣ via ruby-talk wrote:
Nice work! +1 j
Στις Τετ 22 Φεβ 2023 στις 12:48 μ.μ., ο/η Ivo Anjo via ruby-talk <ruby-talk@ml.ruby-lang.org> έγραψε:
+1 This is great, please do keep going! :)
On Wed, Feb 22, 2023 at 6:15 AM ara.t.howard via ruby-talk <ruby-talk@ml.ruby-lang.org> wrote:
💪
Thanks all! Stay tuned for the next few sections :) - Mohit twitter: https://twitter.com/onghu mastodon: https://ruby.social/@onghu blog: notepad.onghu.com (including RSS)
participants (4)
-
ara.t.howard
-
Ivo Anjo
-
Mohit Sindhwani
-
ΙΩΑΝΝΗΣ ΜΑΡΟΥΝΤΑΣ