[cap-talk] Confessions of a C programmer
Ben Kloosterman
bklooste at gmail.com
Tue Sep 22 18:19:02 PDT 2009
>
>
>> What I really should do is act my age, be retired, and avoid
>> writing any more programs.
>
>What're you talking about! Just entering middle age is a fine time to be
>writing programs!
>
>Every point made by every person in this discussion reinforces my belief
>Ocaml is the way for you to go for your next generation of programming.
>There might be a problem somewhere (does the memory manager have to make
>syscalls? Eeek), but that is the place to start.
For F# this is not a big issue , in IL this is a single instruction NewObj ,
you can change it to point at your own GC or you change the Mono GC to point
to your malloc code.
I think the .NET libs are best for a number of reasons for OS support ( it
doesn't matter whether its C++.Net , Java.NET , Object Caml/F# , C#.NET ,
Iron Python)
- .NET /CLR can run Java and Caml apps the reverse is not true
- Java and Camel go straight to the Runtime , with the .NET apps they go to
IL hence you can modify the IL and compiler it to suit your needs.
- Application developers are less and less likely to have good C skills and
demand high quality tools
- When Linux was released C was the dominant language hence it could rely on
a large pre-existing base and port them. This is no longer the case since C
is not one of the top languages anymore and some new OS are not Unix
compatible ( Singularity, the Capability OS etc) so porting something like
X11 is not trivial. Application developer languages are diverging. Even an
OS like Minix3 has struggled with no Java and .NET. Hence an OS really needs
to support multiple languages to be successful.
In terms of implementation Mono really helps
- You still need to change the Mono runtime ( which is C) to hook into your
OS ( Or pull out the GC and use the AOT compiler and implement your own
Dynamic loader)
- You can use the partial classes to hook into your existing c libs easily.
Hello world will prob take 4-8 hours , The whole Lib 1-2 weeks. If something
is not supported you will get an error only when that feature is called.
- You can use the nice free Visual Development tools and then deploy the
assembly to your OS for execution.
In terms of verification you are no worse off than C and are relying on a
huge user base MS does have a verification program for IL but it only really
works at present with Sing# which has verification checks in the code.
Some libs are not going to be Capability friendly but you can develop new
libs for this
.NET normally doesn't really on any existing libs in fact Singularity has a
very basic set of libs and don't use the .NET libs.
Regards,
Ben
More information about the cap-talk
mailing list