Angus Lees wrote:
But you are choosing awkward examples around trivial numerical
operations. Basic numeric operations and branching are things C can
do quite easily (provided the numbers fit within C's types). Try
common coding needs that C can't handle easily, like string
manipulation or memory management during error recovery. Oscar, I
suggest you actually use a high level language for a while and then
try going back to C. Doing anything in C (or even java for that
matter) is just so much tedious typing.
Ok, I'd like to learn another High Level Language, specifically perl6.
And I'd like to make a living from it.
I'd like to write a Linux Version 2.6 kernel module.(Linux Version 2.4
kernel is different.)
This is quite easy with C-language should I do it. As an illustration I
have a very simple
kernel module for Linux V2.6. as follows:
/*
* hello.c - The simplest kernel module.
*/
#include <linux/module.h>
#include <linux/kernel.h>
int init_module(void)
{
printk(KERN_INFO "Hello world.\n");
return 0;
}
void cleanup_module(void)
{
printk(KERN_INFO "Goodbye world.\n");
}
My Makefile is as follows:
obj-m += hello.o
all:
make -C /lib/modules/$(shell uname -r)/build M=$(PWD) modules
I do,
# make
# insmod hello.ko
# lsmod (I check that my hello module is loaded.)
# rmmod hello.ko (I unload my hello module)
And I got things working and perhaps I get paid for the job.
Simple with C, isn't it ?
How can I do this in Perl6 ?
--
O Plameras
http://www.acay.com.au/~oscarp/tutor
--
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html