Dismiss Notice
Join Physics Forums Today!
The friendliest, high quality science and math community on the planet! Everyone who loves science is here!

Computer language

  1. Aug 6, 2012 #1
    Is it possible that a set of instructions is impossible to be written in computer language because the language's syntax is not very good? So in that case what people do? - create another language which has better syntax?
  2. jcsd
  3. Aug 6, 2012 #2


    User Avatar
    Homework Helper

    For some languages, processor specific instructions can be accessed by using extensions made to the language, such as some intrinsic functions for C. For example, Microsoft C has a _popcnt() instrinsic function to utilize the popcnt X86 instruction, which counts the number of 1 bits in a value.

    Some super computers add system specific extensions to the Fortran language to take advantage of parallel or vector processing.

    Some languages deliberately limit what a programmer can access, such as Python not having assignable pointer variables.

    For languages that can be compiled (versus interpreted), usually assembly modules can be linked with high level language modules to get around any limitations of a high level language.
  4. Aug 7, 2012 #3


    User Avatar
    Gold Member

    No. Not with any computer now in existence, nor with any that is ever likely to be built. Turning proved about 60 years ago that any algorithm that can be written for any computer can be written for any other computer, it just might take a lot longer (or possibly shorter) time to execute.

    EDIT: Hm ... I see that my statement didn't actually address your question. Let me rephrase: If you can WRITE an algorithm as a step of logical procedures and you can express it in any computer language on any computer, then you can express it in any other language on any other computer. That still doesn't quite answer your question but it's as close as you're likely to get. I still think in any case the answer is no.
  5. Aug 7, 2012 #4


    User Avatar
    Science Advisor

    Hey Avichal and welcome to the forums.

    There are some kinds of algorithms that will never ever finish that are written on computational devices with finite-memory and finite-processing time (for each instruction that is).

    For example if wanted to calculate pi in its binary form using the arc-tan series formula, then you would never ever complete the calculation (even if you had infinite-memory) using the instruction set of a normal modern PC (arithmetic and so on).

    Problems like this can't be changed simply by syntax if the underlying computation is unchanged: if the computation is unchanged, then changing the syntax doesn't change anything.

    But if you change the nature of the computation and show that you can do this kind of thing in finite time (and you will end up most likely changing the data structures and what they represent in the process), then this is a different issue.

    If you want to look at the formal definition of these kinds of problems look at this:

  6. Aug 8, 2012 #5
    Sorry if the question was not clear as i received a warning regarding so. Anyways you guys did give me the answers. Thank you
Share this great discussion with others via Reddit, Google+, Twitter, or Facebook