+ 2
How computer languages are developed ... why all the languages r different when they can do the same task ....
Do they follow some universal laws of electronics or they r simply man made ....
6 Antworten
+ 2
In order to answer your quesion you need to understand how a processor works.
A processor executes instructions; A set of these instructions is what we call a program.
The instructions your processor can perform is defined by the developer of your processor. They use electrical pathways to send electrons through logic gates that will perform the desired operation.
The architecture such as 32bit/64bit usually defines the amount of data can flow through a single gate per cycle. This is why we measure data in bits.
So instruction sets define what logical operations we can do. Instructions are used to create programs and programming languages are converted into instructions.
We have the problem that not all processor have the same instructions so we need a way to utilise each processor at its fullest potential and that is what people try to adress and at the same time to make developer's lives easy.
+ 2
c#, java and some other languages are intermediary languages they are half compiled. This is done so that a just in time compiler can optimise the code for my processor at run time utilising the instructions that not everyone has. For example i can run my program on both 64bit and 32 bit systems with the performance benefits.
Python, ruby, perl and javascript these languages are scripting languages their goal is to give you the ability to produce a small program quickly to perform a task. They are meant to be disposal or to changed and interchanged often. They run on interpreters this works in a similar fashion as intermediary languages but tend to be slower and more resource intensive because they lack the indepth optimisation and validation of coupling of code since we don't know what code can jump in and declare things. They make for good binding languages. Binding languages are used to integrate with a program that performs a multitude of tasks that need to be optimised or obscured for protection. Games may use a binding language to make development easier and more flexable, javascript makes Web development safer by obscuring the users personal system, and tensorflow uses python to give optimised integration with cpu and gpu processing and still provide flexibility to developers.
c, c++ and assembly are low level which is awesome when working on embedded systems where program need to be small or on programs that require us to do optimisation that just cannot be automated. We also get access to those instructions that have not been mapped at all. You can always check which instructions are supposed on these low level languages but you still need to be able to branch back to the general instructions.
+ 2
Hope this answers your questions. TLDR; Languages have different levels of integration and optimisation. Some language in the level is just cosmetic and for ease of use others are to focus on a specific task.
+ 2
nicely explained brother ... thanks
+ 2
mean to say different languages perform better according to the processor they r executed through ...am i correct
+ 2
I would rather say they run better for certain tasks but some languages may be restricted on certain processors because the compiler of that language doesn't have the full instruction set of that processor. Also scripting languages can only run on processor that have an interpreter compiled for it.