Still I like the idea. This is something that should be covered in a CS 102 type course. I know way to many cs guys who have no idea how to debug, let alone how their is being implemented.
Still I like the idea. This is something that should be covered in a CS 102 type course. I know way to many cs guys who have no idea how to debug, let alone how their is being implemented.
Many linux developers believe "code is portable" means "can run on different linux distros".
Edit: To be fair, he said architectures, and i think he meant CPU architectures, i.e. AMD64 and i386.
The BSDs are all exactly the same for every architecture, sane.
I discovered a little book by him after wading thru recursive descent parsers chapter by Herb Schildt... I don't want to get down on Schildt, I enjoyed that too, he showed some cool stuff..
but Plauger had me thinking that programming could be a craft, an art, a noble intellectual pursuit.
You get the same sorts of benefits though.
You can get reduced executable size and a lack of dependencies on various msvc*.dlls, without giving up much of the functionality of the C standard library and without having to write it all yourself.
So you can't really go without it.
Of course, if your target archs are all supported by libc, porting is much easier with libc.
This is why lots of embedded, secure and defense software doesn't use standard libraries, and printf will instead be called sio04583 or something....
Also.. Don't forget that you can get gcc to get rid of unused code when compiling static executables, and use sstrip (yes, two 's' - it's a different program) to strip even more, if it's an ELF binary...
That's not portable even across versions of the same OS, many OS don't support raw syscalls and don't make any guarantees about them. That's why you can't statically link libc on OSX for instance, libSystem is literally the system's interface and necessarily dynamically linked.
The proper abstract interface on non-linux systems is the standard library.
POSIX only specifies a set of C library functions. Once you stop using them, you are on your own.
These are nowadays supported by Windows and few BSDs too, who needs more portability than that :)
Well, it is hard to see an alternative to that outside supplying your own OS with the library...