hostname, mailhost

djberg96 on 2002-04-23T18:00:39

Today I wrote another Ruby extension. This one was a simple module to get the hostname (ala Sys::Hostname), with the idea of adding a 'mailhost' method later. It's not portable yet, but I haven't a clue as to how you get the hostname in Windoze (via a C extension, anyway). Someone also pointed out that you could get the hostname using the socket module, but that seemed like overkill.

I'm really getting into extensions, as I'm starting to get back into C a little bit. I've also been seriously looking at XS code for the first time and stealing what I can for Ruby's sake. This has also made me see just how much cleaner and easier Ruby's C extensions are compared to Perl's (though Perl's Inline.pm is probably slightly easier still).

Now I'm wondering what extensions will be like in Perl 6, and if/how Parrot plays into all that.