Playing aka learning in this profession. Some still care to work towards being able to contribute to the "options" that are in play. This is how those developers and new options are born.
This series of posts is amazingly well-written, it explains the steps involved really well IMO, thoughtfully ordering the code snippets to make understanding each step simple.
As a perl user, I'm also highly biased as it's nice to see a perl article on HN once in a while :)
The next step along this path would be to run Perl inside this VM, and then run the emulator in it...
MIPS is certainly one of the simplest instruction sets. A while ago I decided to write one too, for fun, after having done ones for a few other CPUs (Z80, 6502, 8086), and MIPS was by far the simplest, almost to the point of being boring. Getting the branch delay slots right (see http://www.pagetable.com/?p=313 for some details) was the hardest part.
An interesting idea: instead of fixing a number of branch delay slots (or none), what about splitting branches? That is - you have a branch_commit instruction, and anything between the branch and the branch_commit is treated as (a) branch delay slot(s), with the processor either filling in pipeline bubbles or stalling the branch as necessary. If you want to get fancy about it you can start doing matched branch / commit pairs (like nesting brackets), or potentially even start dealing with general matching.
Although the decreased instruction density may kill the benefits.
Ironic; I put together a MIPS based Linux distro about eight years ago, and Perl was one of the items that wouldn't cross-compile to it.
How you get Perl on MIPS is by compiling on a MIPS machine, or in an emulated chroot environment (QEMU on x86, say). Now Perl can maybe supply that environment.
13 comments
[ 4.6 ms ] story [ 42.8 ms ] threadEmulating a whole processor to run a shell script on Windows.... Seriously??
Strikes me that someone didn't research the options correctly or just wants an excuse to play...
Complaining about hackers being hackers on a site called Hacker News... Seriously??
https://github.com/andrewchambers/cmips
As a perl user, I'm also highly biased as it's nice to see a perl article on HN once in a while :)
MIPS is certainly one of the simplest instruction sets. A while ago I decided to write one too, for fun, after having done ones for a few other CPUs (Z80, 6502, 8086), and MIPS was by far the simplest, almost to the point of being boring. Getting the branch delay slots right (see http://www.pagetable.com/?p=313 for some details) was the hardest part.
An interesting idea: instead of fixing a number of branch delay slots (or none), what about splitting branches? That is - you have a branch_commit instruction, and anything between the branch and the branch_commit is treated as (a) branch delay slot(s), with the processor either filling in pipeline bubbles or stalling the branch as necessary. If you want to get fancy about it you can start doing matched branch / commit pairs (like nesting brackets), or potentially even start dealing with general matching.
Although the decreased instruction density may kill the benefits.
> You want to do X, and you think Y is the best way of doing so. Instead of asking about X, you ask about Y.
If we allow "ask" to include asking oneself, then this seems like a great example :)
How you get Perl on MIPS is by compiling on a MIPS machine, or in an emulated chroot environment (QEMU on x86, say). Now Perl can maybe supply that environment.