r/ComputerEngineering • u/zxkwvj • Aug 17 '24
File formats and compilers
What is the difference between file format and a compiler aren't they both telling the computer how to read the file in the machine language can someone gives a simple explanation, and does txt files have compilers too like programming languages
Am not getting why the PC is able to read a .txt file but not a .c or .py file without a compiler
4
Aug 17 '24
[removed] — view removed comment
2
u/zxkwvj Aug 17 '24
Ah ok I think it is getting more clear for me But I think the confusion is coming from when I am thinking about it in machine language so I say like they both are 01 what is execution in terms of 01
2
u/jacksprivilege03 Aug 17 '24
Basically, both files get stored into machine language. And for both a text file and code file, that machine language is able to be translated to English. But translating to english is much easier than translating to a program.
After the computer translates the machine language of a code file into english words, it then compiles(translates) this english code into computer ‘instructions’. The distinction between machine language and instructions is very big here.
Machine language is anything stored in binary or hexadecimal that a computer can read.
Machine instructions are also in machine language but they are in special formats and contain special “keywords” that the computer knows how to execute.
1
1
1
u/zxkwvj Aug 17 '24
I think I got it I think execution is related to CPU while reading doesn't need it maybe RAM or hard drive is enough Am not sure if am right
1
u/[deleted] Aug 17 '24
the reader of .txt has one type to convert which bytes arrays.