Question:
Can you make your own programming lenguage form the ground up that can run on any computer?
Blake
2012-11-27 19:17:41 UTC
I have always wanted to make a computer from pretty much the ground up but for now I want to make a program that can run on any windows or maybe even just any computer. Maybe a way to program in just machine code or something? I want to make my own simple programming language based off some old ones but I want it to run on as many computers as possible.
Five answers:
husoski
2012-11-27 20:31:04 UTC
You could take the approach that a couple of projects at Bell Labs (back when it was still Bell Labs) did with a couple of projects. Brian Kernighan and P. J. Plauger developed their own "Rational Fortram" language, called "ratfor" with a translater that took ratfor programs and converted them into standard Fortran. Since high-quality Fortran compilers were (and still are) available for every significant machine and OS, so that ran in more places than C did.



Later, Bjarne Stroustrup did the same thing with early versions of his C++ language. The "AT&T C++" compilers translated C++ into C and then used the Unix C compiler to create executable code.



C or C++ would be good languages these days, since ISO standard compilers exist everywhere, usually with pretty good code generators.



Another way to get a "run anywhere" language is the ones used by Jython and Iron Python to implement compiled versions of the Python language. Jython compiles for Java's JVM, and Iron Python compiles a different dialect of Python to the .NET "CLI" (or on non-Windows systems using the Mono platform). That would be more involved...but I believe those are both open source so there are working examples to look at.



In the "computer from the ground up" department, you might be interested in the Raspberry Pi project. It's a small-but-complete ARM computer system, including an OpenGL-compatable GPU, on a tiny board for $25. That doesn't include the SD card used for the boot device, nor the power supply, keyboard, mouse or monitor.



http://www.raspberrypi.org/
Kaydell
2012-11-27 20:05:30 UTC
Java is cross-platorm. Instead of generating machine code like a C compiler would, a Java compiler generates byte-code that is the same for all platforms. Then there is a Java Runtime Environment (JRE) that is installed onto each platform so that the byte-code will work on any platform.



C can be written to be platform-independent, however, it would mean a recompile and different binaries for each different system.
C J
2012-11-27 19:26:12 UTC
when you're talking about machine language , then you should know that almost every machine has its own language , so you can't write a program in a machine language and expect it to run on many machines ... if we're talking about upper level programming , then it depends on the operating system and the compiler .. the best you can achieve is compiling the program on every single operating system and then it "will work on all of them"
anonymous
2016-05-18 02:25:46 UTC
Ctrl,Alt ,Del at the same time it will show you what your looking for and your comp is running slow not enough memory or hard drive is to old for your system your running or you have too many programs downloaded
FatGuy
2012-11-27 19:27:22 UTC
this has pretty much already been done. the language is called C.


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...