Path: utzoo!attcan!uunet!mcvax!philmds!leo From: leo@philmds.UUCP (Leo de Wit) Newsgroups: comp.lang.c Subject: Re: C vs. FORTRAN Message-ID: <553@philmds.UUCP> Date: 5 Jul 88 22:22:39 GMT References: <3136@phoenix.Princeton.EDU> <225800038@uxe.cso.uiuc.edu> <797@garth.UUCP> <5173@ihlpf.ATT.COM> <852@garth.UUCP> <546@philmds.UUCP> <30305@cca.CCA.COM> <872@garth.UUCP> Reply-To: leo@philmds.UUCP (Leo de Wit) Organization: Philips I&E DTS Eindhoven Lines: 31 In article <872@garth.UUCP> smryan@garth.UUCP (Steven Ryan) writes: >Actually, the real discussion is why does C have such a crippled argument >list? It is possible to pass a list of argument descriptors. The descriptor >list can be staticcally created and the overhead is just a register load >of a relocated address. What's the big deal? You can do that already in C. Just pass a list of pointers to structs, they are equivalent to your 'descriptors'. Both the structs and the pointers can be either statically allocated (so no arguments are pushed on the stack) or pushed onto the stack (the pointers, or even the structs themselves). About the overhead: you forgot to mention assignment to the data elements; for instance an actual parameter that is an expression - often calculated first into a register - has to be stored first into the static area before the function can be called; there are a lot of architectures that store much faster using stack pointer indirection than using an absolute address (or even address register with offset). And the data register still has to be loaded (I'm entitled to call this overhead if the Fortran crew calls adjusting a stack pointer or setting up a stack frame overhead; the last two instructions being even faster than loading registers). C has such a crippled argument list? I find it perfectly ok if you don't like C - that's all on your account - but if you shout 'C has bad this - C has bad that' you should argue that; things you take for granted could well be less self-evident for C programmers. As far as I can C (8-) - but you're of course free to correct me - C has at least as many ways of passing parameters as Fortran. Leo.