• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Can you write a program in any language?

chrstrbrts

Senior member
Hello,

If you had an idea for a program that you wanted to create, there probably would be a language that pops into your mind as being a good language in which to write that program.

But would it be possible to write that same program in any other language?

Thanks.
 
Last edited:
Some languages are more efficient than others; however, they all end up manipulating the 0/1s on a platform to accomplish the intended goal
 
In general, much of the time, yes.

But a particular combination of language and its run-time environment might not include access to the resources you need to do something with the operating system or hardware.

For example running JavaScript in an older browser it would not have the rights needed to let you browse files on the disk and rename them or copy them to a USB drive. It would also not have the access needed to ask the operating system what webcam (if any) is connected to the computer.

For newer browsers and versions of HTML, more and more functions have been added to let you do things like draw in hardware-accelerated 3D. But that's only by going through the library that is built into the browser, you aren't talking directly to the OS.
 
In general, much of the time, yes.

But a particular combination of language and its run-time environment might not include access to the resources you need to do something with the operating system or hardware.

For example running JavaScript in an older browser it would not have the rights needed to let you browse files on the disk and rename them or copy them to a USB drive. It would also not have the access needed to ask the operating system what webcam (if any) is connected to the computer.

For newer browsers and versions of HTML, more and more functions have been added to let you do things like draw in hardware-accelerated 3D. But that's only by going through the library that is built into the browser, you aren't talking directly to the OS.

This is the practical, and most useful, answer.

For a more academic answer, look to Turing completeness. As long as the languages you consider are all Turing complete (and most programming languages are considered to be so), then any program you can implement in one you can (in principle) implement in the other. But this sets aside the practicality of doing so (you might need millions of lines of code in a particular language to do something that is simple in another, or you might need virtually infinite amounts of memory or time).
 
This is the practical, and most useful, answer.

For a more academic answer, look to Turing completeness. As long as the languages you consider are all Turing complete (and most programming languages are considered to be so), then any program you can implement in one you can (in principle) implement in the other. But this sets aside the practicality of doing so (you might need millions of lines of code in a particular language to do something that is simple in another, or you might need virtually infinite amounts of memory or time).

Interestingly enough, turing completeness is almost something that is hard to avoid. It comes up in the most bizarre places. CSS, for example, could be argued to be turing complete.
 
The language you write in needs to be able to compile on the intended host system.

So no, you can't, unless you can compile what you wrote. (Or interpret, or convert, or ...)
 
Back
Top