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: Ruby Learning by Reversing: Native Gems, Part 1
* 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: Ruby Learning by Reversing: Native Gems, Part 2
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.
+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:
Ruby Learning by Reversing: Native Gems, Part 1
* 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:
Ruby Learning by Reversing: Native Gems, Part 2
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 --
Info | ruby-talk@ml.ruby-lang.org - 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 --
Info | ruby-talk@ml.ruby-lang.org - 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:
Ruby Learning by Reversing: Native Gems, Part 1
* 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:
Ruby Learning by Reversing: Native Gems, Part 2
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 --
Info | ruby-talk@ml.ruby-lang.org - 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 --
Info | ruby-talk@ml.ruby-lang.org - 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 --
Info | ruby-talk@ml.ruby-lang.org - ml.ruby-lang.org
--
j
Thanks all! Stay tuned for the next few sections 
- Mohit
twitter: https://twitter.com/onghu
mastodon: Mohit Sindhwani (@onghu@ruby.social) - Ruby.social
blog: notepad.onghu.com (including RSS)
···
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:
💪