Can Poor Syntax Hinder Computer Language Use?

  • Thread starter Thread starter Avichal
  • Start date Start date
  • Tags Tags
    Computer Language
Click For Summary

Discussion Overview

The discussion revolves around the question of whether poor syntax in computer languages can hinder the ability to express certain algorithms or instructions. Participants explore the implications of syntax limitations, the potential for creating new languages, and the relationship between syntax and computational capabilities.

Discussion Character

  • Debate/contested
  • Technical explanation
  • Conceptual clarification

Main Points Raised

  • Some participants propose that poor syntax could limit the expressibility of certain algorithms in a computer language, suggesting that new languages might be created with improved syntax.
  • Others argue that any algorithm that can be expressed in one computer language can also be expressed in another, regardless of syntax, although it may take different amounts of time to execute.
  • One participant highlights that certain algorithms may never terminate on finite-memory devices, indicating that syntax changes alone cannot resolve fundamental computational limitations.
  • There is mention of specific language features and extensions that allow access to processor-specific instructions, which can mitigate some limitations imposed by high-level languages.
  • A participant references the Halting Problem to illustrate that some computational issues are inherent and cannot be resolved merely by changing syntax.

Areas of Agreement / Disagreement

Participants express differing views on the impact of syntax on computational expressibility. While some believe that syntax can hinder algorithm expression, others maintain that all algorithms can be represented across different languages, suggesting a lack of consensus on the issue.

Contextual Notes

Limitations discussed include the inherent constraints of finite-memory and processing time in computational devices, as well as the implications of the Halting Problem on algorithm completion.

Avichal
Messages
294
Reaction score
0
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?
 
Technology news on Phys.org
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.
 
Avichal said:
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?

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.
 
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:

http://en.wikipedia.org/wiki/Halting_problem
 
Sorry if the question was not clear as i received a warning regarding so. Anyways you guys did give me the answers. Thank you
 

Similar threads

  • · Replies 15 ·
Replies
15
Views
4K
  • · Replies 102 ·
4
Replies
102
Views
4K
  • · Replies 2 ·
Replies
2
Views
3K
Replies
4
Views
3K
  • · Replies 6 ·
Replies
6
Views
4K
Replies
7
Views
4K
  • · Replies 31 ·
2
Replies
31
Views
3K
Replies
16
Views
3K
  • · Replies 8 ·
Replies
8
Views
3K
Replies
65
Views
5K