D
D
Deka0072017-07-03 20:31:21
C++ / C#
Deka007, 2017-07-03 20:31:21

Why don't they create computers with machine language in C/C++?

Why can't a computer be designed whose machine language is C or C++? And if so, why isn't anyone doing it? Is it really a question of money...

Answer the question

In order to leave comments, you need to log in

4 answer(s)
D
devalone, 2017-07-03
@Deka007

It is possible, of course, but it is not profitable, it is much easier to execute machine instructions, which are usually represented by several bytes, than C ++.

1
15432, 2017-07-03
@15432

The processor is a dumb piece of iron made of transistors. Well, not so stupid, in modern x86 processors, machine codes are translated on the fly to an even lower level by the firmware. But anyway, let's assume that this is a stupid piece of iron like Intel 8086. How the program is executed - the processor reads the next byte of code and sees what it considered. By the value of the byte, it determines what kind of command it is (addition, subtraction) and how many more bytes of this particular machine word need to be read (and they can be of different lengths in x86). All this happens at the hardware level, that is, something like "the fifth bit is 0, the third bit is 1, yeah! This is a command to add two eight-bit registers, you need to switch the data line to the arithmetic logic unit and read two more bytes there on the data bus. That is operations are very, very simple, at the level of bits, signals and data reading, no code analysis and even more so no variable names. You propose to parse the sish code at the hardware level, in which, during sequential reading, it is sometimes impossible to determine what to do at the moment !! And the processor at this time will be idle and read a bunch of unnecessary text from memory.
I have no idea how at the level of iron and transistors you can do a syntactic and lexical analysis of a sish file. Is it possible to make a real electronic brain with a billion neurons. It certainly won't be fast, it won't work at all. Study the structure of the computer, how exactly the processor works, learn to think in assembly language, and understand the absurdity of your proposal.

K
Konstantin Kitmanov, 2017-07-03
@k12th

Well, ok, why? Do you want to speak to the machine in its native language? So if you mastered C, then you will figure it out with assembler. Want to win in performance? Rest against the fact that the processor considers parentheses in the source code, instead of doing tasks. Want to avoid the compilation step? Again, why? Right now, I’ll say it in a shitty coding way, but now the power of computers allows you to quickly write code in python and spend your free time on things that are more useful and pleasant for yourself and for humanity than calculating bytes. It's the same with compiling, I pressed F5 and went to pour some tea or just warm up.
Plus, this task will require the creation of some completely new architecture, unlike anything and incompatible with anything, and all for the sake of some illusory benefits.

Z
Ziggy Pop, 2017-07-03
@ZiggyPop

Hm, why don't they? There is an opinion of very respected people that C (the one without pluses) is a mashcode wrapped in a human-understandable form)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question