Discussions on more advanced topics such as monolithic vs micro-kernels, transactional memory models, and paging vs segmentation should go here. Use this forum to expand and improve the wiki!
jnc100 wrote:Will you insist on safe access to data or allow dereferencing abritrary pointers? If the former, you will need a concept of an object model at the bytecode level, and support for instructions such as loading and storing to array locations, fields of an object and static data, and creation and deletion of objects and arrays. If the latter, I don't see that there is anything to be gained from an additional level of interpretation/compilation where each instruction basically has a 1:1 mapping with the relevant machine code anyway.
For the latter; it allows a closed source executable to be portable, and also allows the compiler to generate native code optimised for the specific computer (possibly including techniques like profile-guided optimisation).
For example, imagine a closed source 3D game. You install it on an old Pentium III and (as part of installing the game) the OS compiles the byte-code into 32-bit native code that uses MMX; then you install the same executable on an modern Ivy Bridge and the OS compiles the byte-code into 64-bit native code that uses AVX.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
jnc100 wrote:Will you insist on safe access to data or allow dereferencing abritrary pointers? If the former, you will need a concept of an object model at the bytecode level, and support for instructions such as loading and storing to array locations, fields of an object and static data, and creation and deletion of objects and arrays. If the latter, I don't see that there is anything to be gained from an additional level of interpretation/compilation where each instruction basically has a 1:1 mapping with the relevant machine code anyway.
For the latter; it allows a closed source executable to be portable, and also allows the compiler to generate native code optimised for the specific computer (possibly including techniques like profile-guided optimisation).
For example, imagine a closed source 3D game. You install it on an old Pentium III and (as part of installing the game) the OS compiles the byte-code into 32-bit native code that uses MMX; then you install the same executable on an modern Ivy Bridge and the OS compiles the byte-code into 64-bit native code that uses AVX.
Actually I intended managed object oriented code which doesn't have access to the pointer information, making it more difficult to produce viruses, but converting it at install time to native machine code to increase portability is also a plus.
As for the Pentium III, I'm starting with x86-64 only. Later I will add support for 32-bit and arm. Depending on how those do, I may look into other processors as well.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
m12 wrote:My questions are do you have any suggestions, and what resources are their for making the compiler? (books, tutorials, ...)
Listen to the voice of wisdom.
Enroll in Compilers course at Coursera. This is the best tutorial. The current run is almost finished but if you don't need certificate you may learn in self study version of this course.
Read the Dragon book.
Enroll in Computer architecture course at Coursera. It will start in September and will teach how to build most powerful and efficient processor architectures in the world. Most aspects of this course are also applicable to the virtual machines.
After that you'll be able (at least in theory) to design efficient bytecode and support it with the compiler.
m12 wrote:My questions are do you have any suggestions, and what resources are their for making the compiler? (books, tutorials, ...)
Listen to the voice of wisdom.
Enroll in Compilers course at Coursera. This is the best tutorial. The current run is almost finished but if you don't need certificate you may learn in self study version of this course.
Read the Dragon book.
Enroll in Computer architecture course at Coursera. It will start in September and will teach how to build most powerful and efficient processor architectures in the world. Most aspects of this course are also applicable to the virtual machines.
After that you'll be able (at least in theory) to design efficient bytecode and support it with the compiler.
I can't do the courses because videos use up a lot of bandwidth. The dragon book I've heard of, and I will be taking a look at it - just not at that link. Wikipedia is blocked due to being an online forum.
Programming is 80% Math, 20% Grammar, and 10% Creativity <--- Do not make fun of my joke!
If you're new, check this out.
m12 wrote:The dragon book I've heard of, and I will be taking a look at it - just not at that link. Wikipedia is blocked due to being an online forum.
If you want another book recommendation, check Engineering a Compiler by Cooper et al., which I think is nicer to read and handles some things, eg. SSA, better than the dragon book.
JamesM probably eats us because of our horrible recommendations if he reads this, but what ever.
Wikipedia is blocked due to being an online forum.
I think his host is much more lame than that particular excuse.
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]
m12 wrote:I can't do the courses because videos use up a lot of bandwidth.
The lectures are about 1Gb for the whole 11-week course and may be downloaded and viewed offline. This is lame excuse.
Maybe he doesn't have a whole gigabyte to spare? Oddly enough that's my monthly limit on my smartphone...
Different countries are different. For example, someone in (e.g.) a European country might be used to "fibre to home", while someone in (e.g.) China might be used to something very very different.
Cheers,
Brendan
For all things; perfection is, and will always remain, impossible to achieve in practice. However; by striving for perfection we create things that are as perfect as practically possible. Let the pursuit of perfection be our guide.
Wikipedia is blocked (...) texas (...) school's internet
Are you sure it's not North Korea?
*puts the states back on the list of developing countries*
"Certainly avoid yourself. He is a newbie and might not realize it. You'll hate his code deeply a few years down the road." - Sortie
[ My OS ] [ VDisk/SFS ]