On Friday 30 September 2005 06:07, [EMAIL PROTECTED] wrote:
> > For just about everything you can do with a pointer in C there is
> > a better, easier, less error prone way to do the same thing in
> > O'caml and write less lines of code to do it.
>
> How about writing a network protocol stack. You get a packet and all
> you know about it is that here is a block of memory. You then have
> to figure out what sort of packet it is, how long it is and what
> structure to give it. C handles this very nicely with pointers to
> structures that can be cast into whatever you need.
>
> > The one exception
> > I can thing of is writing devices drivers and operating systems
> > where you need to direct access to harware.
>
> If you are talking about I/O ports, you can always write a pair
> of functions to write and read from I/O and these can be added to
> any language (possibly even as inlines if the language supports that).
>
> There is no native I/O port access in C.
>
> Consider how useful functions like memcpy() and memcmp() are for
> writing an O/S. Consider also that an O/S is actually a form of self
> modifying code which strict type checking is designed to prevent.
> I isn't about direct hardware access, it is about having the flexibility
> to do what needs to be done. Try the simple exercise of writing an
> O'caml program that reads in a chunk of binary code from a file,
> and then executes that code to get a result. Less lines of code than C?

Horses for courses! most of my programming would be much harder to do if I had 
to put up with wosname from the compiler. So I love pointers and arrays and 
not having to touch the hardware through thick felt gloves, but I conceed 
that in the middle of encrypted fpos transactions you proddly (probably :-) 
don't want to worry about them.

if O'caml works for you <yay>, but don't presume that C is a bad option for 
me! I know how to write bullet-proof C. eg SPTA (NSW) train transponder 
system 5000 lines very complex C (digital filtering etc) several 1000 
transponders every train every day 10 years BUGS Found: 0 QED
James

James
-- 
SLUG - Sydney Linux User's Group Mailing List - http://slug.org.au/
Subscription info and FAQs: http://slug.org.au/faq/mailinglists.html

Reply via email to