I haven't done much programming in pure C, but I thought this article was interesting. It says C is the most efficient programming language as far as power consumption, speed, and memory usage:
They actually have Python over C in regards to memory usage. (!?!)
serious contender for similar reasons that C is not a serious contender for a lot of software development tasks - because there are other very important factors such as development time, verification and validation, extensibility and maintenance.
I like and use C a lot, but it's not "the most efficient programming language" for all forms of efficiency. Depending on the job, some other forms of efficiency matter more than eeking out that extra 1% of performance or resource optimization.
Re: C is the most efficient programming language
By: Digital Man to Nightfox on Tue Nov 02 2021 05:04 pm
They actually have Python over C in regards to memory usage. (!?!)
? C is #3 on their memory list, and Python is #12 on the list for memory usage.
I haven't done much programming in pure C, but I thought this article was interesting. It says C is the most efficient programming language as far as power consumption, speed, and memory usage:
Digital Man wrote to Nightfox <=-
@MSGID: <6181D1FD.5354.dove-prg@vert.synchro.net>
@REPLY: <61816B3D.3316.dove_dove-prg@digitaldistortionbbs.com>
Re: C is the most efficient programming
language
By: Nightfox to All on Tue
Nov 02 2021 09:45 am
I haven't done much programming in pure C, but I thought this article was interesting. It says C is the most efficient programming language as far as power consumption, speed, and memory usage:
They actually have Python over C in regards to memory usage. (!?!)
Assembly language could beat C in those same categories, but it's not a serious contender for similar reasons that C is not a serious contender for a lot of software development tasks - because there are other very important factors such as development time, verification and
validation, extensibility and maintenance.
I like and use C a lot, but it's not "the most efficient programming language" for all forms of efficiency. Depending on the job, some other forms of efficiency matter more than eeking out that extra 1% of performance or resource optimization. --
digital man
I wouldn't call Assembly a Language. There isn't really a language per so, just mnemonics and instructions to the assembler itself. It is more a system to assembly machine code, and the efficiency of assembly is heavily dependent on the ability of the programmer.
I wouldn't call Assembly a Language. There isn't really a language per so, just mnemonics and instructions to the assembler itself. It is more a system to assembly machine code, and the efficiency of assembly is heavily dependent on the ability of the programmer.
Nightfox wrote to Boraxman <=-
@MSGID: <6186CB4C.3331.dove_dove-prg@digitaldistortionbbs.com>
@REPLY: <61863E0B.2745.dove-prg@bbs.mozysswamp.org>
Re: C is the most efficient p
By: Boraxman to Digital Man on
Sat Nov 06 2021 07:33 pm
I wouldn't call Assembly a Language. There isn't really a language per so, just mnemonics and instructions to the assembler itself. It is more a system to assembly machine code, and the efficiency of assembly is heavily dependent on the ability of the programmer.
I always thought assembly was a language, in that it consists of statements you can use to control logic and program flow. Assembly has
a 'vocabulary' of keywords (or instructions) that make up the language.
But every CPU has its own assembly.
Nightfox
---
= Synchronet = Digital Distortion: digitaldistortionbbs.com
That code is defined by a language, a specification. What "for" and "int" mean are defined by the language. The structure of the code is defined by the language. That is to say, C is actually a set of rules, a formal language that then gets converted to machine code.
But with Assembler, there is not formal Assembler specification, no Assembly keywords, etc, they are all implementation specific.
Nightfox wrote to Boraxman <=-
@MSGID: <61C60A0E.3336.dove_dove-prg@digitaldistortionbbs.com>
@REPLY: <61C5AF39.2749.dove-prg@bbs.mozysswamp.org>
Re: C is the most efficient p
By: Boraxman to Nightfox on
Fri Dec 24 2021 10:17 pm
That code is defined by a language, a specification. What "for" and "int" mean are defined by the language. The structure of the code is defined by the language. That is to say, C is actually a set of rules, a formal language that then gets converted to machine code.
But with Assembler, there is not formal Assembler specification, no Assembly keywords, etc, they are all implementation specific.
But still, assembler for each processor is defined by the operations
that the processor understands, and there is a specific syntax for each operation.
Nightfox
---
= Synchronet = Digital Distortion: digitaldistortionbbs.com
But still, assembler for each processor is defined by the operations
that the processor understands, and there is a specific syntax for
each operation.
Have you ever used AT&T syntax?
Nightfox wrote to Boraxman <=-
@MSGID: <61C6BCF6.3338.dove_dove-prg@digitaldistortionbbs.com>
@REPLY: <61C649CF.2751.dove-prg@bbs.mozysswamp.org>
Re: C is the most efficient p
By: Boraxman to Nightfox on
Sat Dec 25 2021 09:12 am
But still, assembler for each processor is defined by the operations
that the processor understands, and there is a specific syntax for
each operation.
Have you ever used AT&T syntax?
I haven't.
Nightfox wrote to Boraxman <=-
@MSGID: <61C6BCF6.3338.dove_dove-prg@digitaldistortionbbs.com>
@REPLY: <61C649CF.2751.dove-prg@bbs.mozysswamp.org>
Re: C is the most efficient p
By: Boraxman to Nightfox on
Sat Dec 25 2021 09:12 am
But still, assembler for each processor is defined by the operations
that the processor understands, and there is a specific syntax for
each operation.
Have you ever used AT&T syntax?
I haven't.
It's an alternative syntax for assembler, used by GAS and I guess other assemblers for Unix too.
An example from a program I wrote is below
movl %eax, BRK_Start
movl %eax, BRK_End
movl (%esp), %ecx
cmp $1, %ecx
je clifail
cmp $3, %ecx
jg clifail
movl 8(%esp), %ebx
jl success
movb (%ebx), %al
As you can see, the syntax is familiar, but different. Source and destination are the other way around for MOV commands, the offset notation is different, immediate values are prefixed with a $.
Digital Man wrote to Boraxman <=-
@MSGID: <61C89E1F.5377.dove-prg@vert.synchro.net>
@REPLY: <61C84490.2753.dove-prg@bbs.mozysswamp.org>
Re: C is the most efficient p
By: Boraxman to Nightfox on
Sun Dec 26 2021 09:27 pm
Nightfox wrote to Boraxman <=-
@MSGID: <61C6BCF6.3338.dove_dove-prg@digitaldistortionbbs.com>
@REPLY: <61C649CF.2751.dove-prg@bbs.mozysswamp.org>
Re: C is the most efficient p
By: Boraxman to Nightfox on
Sat Dec 25 2021 09:12 am
But still, assembler for each processor is defined by the operations
that the processor understands, and there is a specific syntax for
each operation.
Have you ever used AT&T syntax?
I haven't.
It's an alternative syntax for assembler, used by GAS and I guess other assemblers for Unix too.
An example from a program I wrote is below
movl %eax, BRK_Start
movl %eax, BRK_End
movl (%esp), %ecx
cmp $1, %ecx
je clifail
cmp $3, %ecx
jg clifail
movl 8(%esp), %ebx
jl success
movb (%ebx), %al
As you can see, the syntax is familiar, but different. Source and destination are the other way around for MOV commands, the offset notation is different, immediate values are prefixed with a $.
Motorola 68K assemblers used the "move source, destination" as well (opposite of Intel/x86 assemblers).
Basically, there's no real "standard" when it comes to assembly
languages. --
Exactly, which is why I don't consider a language, because there isn't actually a standard to construct a language. Each author of an assembler can make up whatever they like. FASM is a language. MASM is a language, AT&T Intel is a language, NASM is a language, etc etc
Nightfox wrote to Boraxman <=-
I see what you mean about assembler. But I'd think you could also
argue that each processor's assembler is its own language, even though there is no standard for assembler.
Dr. What wrote to Nightfox <=-
@MSGID: <61CDB562.2970.dove-program@dmine.net>
@REPLY: <61CC93F1.3342.dove_dove-prg@digitaldistortionbbs.com>
Nightfox wrote to Boraxman <=-
I see what you mean about assembler. But I'd think you could also
argue that each processor's assembler is its own language, even though there is no standard for assembler.
There sort of is. Back in the 80's they had macro assemblers.
Think of these as in between something like C and assembler. It looked like assembly language, but it was "generic" (to a point). The
compiler (that's what it was) would convert your generic assembler into the specific assembly code for your procssor.
So, in theory, you could write one set of code for a family of
processors (Intel 80x or Z80) that could be compiled across all the processors in the family.
I don't know if they had one that would let you write for something
like the Z80 and the 6502, though.
Boraxman wrote to Dr. What <=-
Was HLA (High Level Assembly) one of those? I did look into it, but I always preferred to be explicit about the instructions I used. When I
use assembler, it is because I am targetting an explicit instruction
set and want to make the decisions about which instructions to use
myself. The one time I thought a "generic" solution would be useful is when I want assembler that runs on both 32bit and 64bit Intel natively.
Dr. What wrote to Boraxman <=-
Boraxman wrote to Dr. What <=-
Was HLA (High Level Assembly) one of those? I did look into it, but I always preferred to be explicit about the instructions I used. When I
use assembler, it is because I am targetting an explicit instruction
set and want to make the decisions about which instructions to use
myself. The one time I thought a "generic" solution would be useful is when I want assembler that runs on both 32bit and 64bit Intel natively.
I never really got into assembly language other than to know it was
there. I've learned much more as I've been doing more research into the history of PCs.
I went from BASIC as a kid, straight to FORTRAN, Pascal, LISP, C and
more.
I think I did one class in Univac assembly in college. But it was
mainly to know what was happening "under the hood" when we worked in
the higher level languages.
I did work on some FORTRAN programs for GM 20+ years ago that used an assembly language subprogram that was self-modifying. The computer had
a fancy instruction they needed to use, but the assembler didn't
support it, so they wrote their subprogram to modify itself to use the fancy instruction the first time it was called.
Assembler was mostly frowned upon in my work because of the time and resources it took to use it. People time was more expsensive than computer time.
Sysop: | Kurt Hamm |
---|---|
Location: | Columbia, SC |
Users: | 8 |
Nodes: | 20 (0 / 20) |
Uptime: | 135:37:48 |
Calls: | 2,804 |
Calls today: | 1 |
Files: | 64 |
Messages: | 854,509 |