Question
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: Question
Basically, No
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein
Re: Question
For an expirienced coder it might, but i doubt that many BASIC programmer has the knowlegde to do it.
You need to get a BASIC compiler that can use extrenal assembly functions, that you have to write for yourself.
http://www.freebasic.net/ might be suitable for it.
You need to get a BASIC compiler that can use extrenal assembly functions, that you have to write for yourself.
http://www.freebasic.net/ might be suitable for it.
Last edited by bubach on Mon Feb 27, 2006 12:00 am, edited 3 times in total.
Re: Question
the biggest problem with BASIC is that it is designed to be interpreted -- not compiled
in fact, most BASIC 'compilers', don't actually compile -- instead they simply combine a tokenized copy of the BASIC source, with a copy of the interpreter, into an executable file (if you don't understand the difference, your not ready for OSdev)
you would need a compiler that truely compiles the code (which, btw, is not easy with BASIC -- the language is designed for a lot of runtime overhead, which is easy to do in an interpreter, but very difficult to compile)
and then you would be stuck writing large parts of code in ASM (much more than you would in another language -- such as C) because BASIC lacks the flexability to control how the code will be generated,
you would be unable to use many parts of the BASIC language (no print, input, get/put, open, write, etc)
all of these statements are designed to interface with the OS (which, of course, you are trying to write) and, in standard BASIC, statements cannot be replaced with your own (you would have to modify the compiler to use your own if you did want to use these statements -- and writing a 'print' handler would be a challenging task indeed -- almost like writing your own compiler)
can you imagine a BASIC program without a print statement? -- the advantage of BASIC is that it can handle a lot of things itself (the programmer doesn't have to) -- but that same simplicity, becomes a liability in OSdev
in fact, most BASIC 'compilers', don't actually compile -- instead they simply combine a tokenized copy of the BASIC source, with a copy of the interpreter, into an executable file (if you don't understand the difference, your not ready for OSdev)
you would need a compiler that truely compiles the code (which, btw, is not easy with BASIC -- the language is designed for a lot of runtime overhead, which is easy to do in an interpreter, but very difficult to compile)
and then you would be stuck writing large parts of code in ASM (much more than you would in another language -- such as C) because BASIC lacks the flexability to control how the code will be generated,
you would be unable to use many parts of the BASIC language (no print, input, get/put, open, write, etc)
all of these statements are designed to interface with the OS (which, of course, you are trying to write) and, in standard BASIC, statements cannot be replaced with your own (you would have to modify the compiler to use your own if you did want to use these statements -- and writing a 'print' handler would be a challenging task indeed -- almost like writing your own compiler)
can you imagine a BASIC program without a print statement? -- the advantage of BASIC is that it can handle a lot of things itself (the programmer doesn't have to) -- but that same simplicity, becomes a liability in OSdev
Re: Question
Does anyone know if there is a basic compiler that "interprets to be compiled"
for example do:
"print "hello"
and it sends a command to a dll in the format
conpiled_print("hello")
which the dll will interpret to compiled instructions and adds it to the buffer to be written to the compiled file
which therefor would let you use the same syntax all the time but be able to change platform simply by changing a dll
if not then that might be something i commit a bit of time to
for example do:
"print "hello"
and it sends a command to a dll in the format
conpiled_print("hello")
which the dll will interpret to compiled instructions and adds it to the buffer to be written to the compiled file
which therefor would let you use the same syntax all the time but be able to change platform simply by changing a dll
if not then that might be something i commit a bit of time to
-
- Member
- Posts: 144
- Joined: Tue Oct 26, 2004 11:00 pm
- Location: Australia
Re: Question
hckr83, are you talking about JIT compiling? (Just-in-time).
This compiling style is used by the JVM for interpreting the java byte code. Instead of interpreting the file, it will compile a chunk of it, and execute the compiled chunk. When that chunk completes it compiles another chunk and executes and so on.
This compiling style is used by the JVM for interpreting the java byte code. Instead of interpreting the file, it will compile a chunk of it, and execute the compiled chunk. When that chunk completes it compiles another chunk and executes and so on.
Two things are infinite: The universe and human stupidity. But I'm not quite sure about the universe.
--- Albert Einstein
--- Albert Einstein