I want to try and create my own very basic language, with it's very basic compiler. All using Java.
For now, it will only need to enable to 'programmer' to print things to the screen.
I had an idea for how to do this, and what I wanted to know is: Will this be considered an actual 'compiler', an actual 'language', and an actual 'virtual machine'? (All very, very basic of course).
My idea was to create a program which will serve as the 'IDE' (editor and compiler), and another one which will serve as the 'virtual machine'.
This means that the IDE will not compile the written code to some existing machine code, like the Java Bytecode, but will actually compile to some kind of compiled code made up by me.
This compiled code will only be understandable by my 'virtual machine' program, and will only be able to run inside this program. The 'virtual machine' program, will use high-level Java operations in order to understand and execute the compiled code.
The 'virtual machine' program will be a Java program, running on the JVM.
My question is: Conceptually, is this considered a virtual machine, and 'machine code'? If not, is this still considered a 'programming language', even though it's compiled bytecode can only run inside a specific program?
It would be considered an interpreter, and the compiled code would be byte code.
To be a "virtual machine" you'd need to create ways of interacting with "everything" on the PC that it runs. Giving your users/developers a "print to screen" feature is not a virtual machine.
http://en.wikipedia.org/wiki/Virtual_machine
Edit: You asked: "Also: Conceptually, would you say that a programming language that is only able to create programs that can run inside another program, is still considered a programming language?"
That depends on the features of this "other program". If you're asking about the JVM: yes. The wikipedia definition of programming language can be found here:
http://en.wikipedia.org/wiki/Programming_language
A programming language is an artificial language designed to communicate instructions to a machine
And we say that a virtual machine fulfills this property. So yes, Java (and other languages that compile to bytecode run by a proper virtual machine) is a programming language.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With