C is fake, assembly is real

Programming, for all ages and all languages.
Locked
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

C is fake, assembly is real

Post by Muazzam »

max wrote: 1. I use assembly to develop OS.
Why not C/C++?
3. My first language was vb.net.
Hehe, that was the next thing I started after BlitzBasic, really cool to start out.
4. I think Microsoft Small Basic is easiest, most interactive language, Every one should learn.
Why should we learn it? What do you mean with "most interactive"?
1. I use Assembly no C/C++ because:
*C/C++ are fake assembly is real.
*Assembly is easier for me.
*It is ugly for me to use inline assembly within C.
*C/C++ are languages of UNIX for UNIX and I don't want any UNIX part. I don't need UNIX clone.
*I use assembly due to learning machine, operating system size and speed.

4. I said Small Basic is easiest, because it is easier for beginners due to its most interactive, Intelligent IDE and
Good build-in functions that beginners want. Another advantage, Small Basic is not interpreted like other BASICs.
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: Your languages?

Post by Bender »

Don't know what did I just fread() but:
*C/C++ are fake assembly is real.
Assembly is fake. I use butterflies to toggle each bit in the memory and write my program.
Invalid point.
*Assembly is easier for me.
Alright, I wouldn't argue on this one, everyone is different and assembly seems easier to many people than other high level languages.
Point Noted.
*It is ugly for me to use inline assembly within C.
Please don't limit the entire C/C++ programming language to a few compilers like GCC whose inline assembler may be challenging to work with.
Under MSVC you can do this:

Code: Select all

...
int function(int arg1)
{
 int number = 5;
 __asm {
  mov eax, number
  mov ebx, arg1
 }
}
How's that? :)
And there's a term called linker (if you didn't know about it), you can write your assembler functions in your preferred assembler and then compile it to an object format, and use "extern"s from your C code.
Hence Invalid.
*C/C++ are languages of UNIX for UNIX and I don't want any UNIX part. I don't need UNIX clone.
I'm being honest here, this was the worst one. =D> Many (or most) OSes that we know and have reached a stage of sufficient popularity (both UNIX and non-UNIX) are written in C or C++. Alright we have a few of assembler OSes but I don't think they'll ever (and yes I'm sure) be as good as their HLL written counterparts. Is Windows UNIX? I don't think so.
The reason why most of us use C is that it's a language that requires very less (actually no) runtime support if you're ignoring the stack and trivial environment setup, and with that you can access memory, low level I/O and whatnot. Most of us don't like working with assembly, because we aren't comfortable with it.
Hence, Invalid.
*I use assembly due to learning machine, operating system size and speed.
Compilers today aren't just translation machines they are optimization freaks too. I feel it depends, compilers are designed to (and this is one of the major reasons for their existence) to produce better and efficient code than assembly programmers.
Citation needed.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: Your languages?

Post by Muazzam »

reply to Bender:
My mean of ugly inline assembly language is "not" difficult embed But code became
mixture of assembly and C/C++ and I don't like mixture of languages.
I hate C/C++ because these are developed by UNIX programmers.

Very Very invalid point:
You said: compiler's generated assembly is better and efficient.
Remember: Computers are not intelligent as human being.
Please write a same program in assembly and C than compare your assembly code with compiler generated assembly.
Assembly code will be definitely efficient and smaller.
User avatar
Rusky
Member
Member
Posts: 792
Joined: Wed Jan 06, 2010 7:07 pm

Re: C is fake, assembly is real

Post by Rusky »

The thing about compiler optimization is that it's automated. A human can in some cases figure out better code than the compiler, but in many cases the compiler will remember things the human doesn't or perform transformations too complicated for the human to do manually. Further, automated optimizations only need to be implemented once and then they're automatically and correctly applied everywhere, while human optimizations have a (large) chance of being wrong or being missed every time there's a chance to use them.

Using a language like C or C++ will likely give you better performance overall than writing in plain assembly, but there will still be cases that will benefit from hand-optimization. There's no reason not to use both, even with an irrational dislike of C- people with a rational dislike of C have created other languages you can use in the same niche. Rust, D, Ada, etc- untainted with the evil of Unix, but with the higher-level advantages of C, and as a bonus, with actual improvements over C!
User avatar
Bender
Member
Member
Posts: 449
Joined: Wed Aug 21, 2013 3:53 am
Libera.chat IRC: bender|
Location: Asia, Singapore

Re: C is fake, assembly is real

Post by Bender »

The main thing here is, you're fighting with a compiler and it's standard libraries (if you like me consider that a part of the language).

Sure, humans are and will be, in the near future, more "clever" and not intelligent than computers. But the question is will the creation of hundreds of geniuses over a large period of time be faster and efficient than a single computer hobbyist?

Every time a new version of GCC is released there is bound to be an optimization patch. They've been doing this for years. The routines in widely used standard libraries have gone through years of optimisation.

The part to know is: "You can't beat the compiler unless you know more than the compiler". When you're working with things the compiler doesn't know about or knows less is where your hand written assembly can be faster than the compiler.

Compilers are like machines, they can quickly scan your code, detect possible optimisations, much faster than an average human can. However the compiler is a machine, so it's "cleverness" is limited. That's where you get up from your feeling that mixing assembly are C is bad, and do some optimisations yourself.

I'd like to know what makes a lot of people feel UNIX is flawed by design. Personally, I feel UNIX has it's problems but it's current implementation also yields solutions to a lot of existing problems an OS may encounter which is why it tends to be an inspiration to others in the system development field.
"In a time of universal deceit - telling the truth is a revolutionary act." -- George Orwell
(R3X Runtime VM)(CHIP8 Interpreter OS)
User avatar
Muazzam
Member
Member
Posts: 543
Joined: Mon Jun 16, 2014 5:59 am
Location: Shahpur, Layyah, Pakistan

Re: C is fake, assembly is real

Post by Muazzam »

All of C/C++ programmers are *not* real programmers. They program operating system or applications but they can not program computers. Who think C/C++ are easy is an idiot.
Please don't hate assembly. If there was no assembly there were also no C no C++ no Java and also no Programs no Programmable computes anymore.
You said: Windows,OS X,UNIX etc. are in C/C++.
These OSs are in C because of protabality, not for relibleity or Speed of development.
User avatar
thepowersgang
Member
Member
Posts: 734
Joined: Tue Dec 25, 2007 6:03 am
Libera.chat IRC: thePowersGang
Location: Perth, Western Australia
Contact:

Re: C is fake, assembly is real

Post by thepowersgang »

Locking before this thread degenerates into a full-blown flamefest.

@muazzam - You are entitiled to your opinion, but please refrain from making statements that are provably wrong.
Kernel Development, It's the brain surgery of programming.
Acess2 OS (c) | Tifflin OS (rust) | mrustc - Rust compiler
Currently Working on: mrustc
Locked