#!/usr/bin/perl
while(<>)
{
s/\bfinal//;
s/\b(int|long) (\w+)/ var $2:int/;
s/\bboolean (\w+)/ var $1:Boolean/;
s/\bString (\w+)/ var $1:String/;
s/System.out.println/trace/;
s/ (void|int|String) (\w+\(.*?\))/ function $2:$1/;
print;
}
The Commodore 1541 disk drive is a computer, with a 6502 microprocessor and its own RAM. It talks to the Commodore 64 via a hastily-built proprietary serial variant of the IEEE488 bus.
And it's a pain to emulate.
Luckily, it's a solved problem, more or less, if your chosen programming language is C++ or Java. If you want to do it in, say, ActionScript, then you are out of luck.
...unless you know Perl.
ActionScript, as you may know, has a fuzzy relationship with Java. Its compiler is written in Java. Its VM may very well be based on the JVM. So it is no surprise that ActionScript source is in many ways a cipher of Java.
I wrote a very small Perl script to convert Java source to ActionScript source. It doesn't do a 100% job, but in all things the best is the enemy of the good, and the Burrito Principle holds (80% of the meat is in 20% of the burrito). So this gets me most of the way there, leaving small scraps to deal with (instead of facing a complete and more tedious rewrite).
Wednesday, March 28, 2012
Saturday, March 24, 2012
I like Objective C
So far. I'm not sure if it's as accessible as ActionScript, but I really appreciate its strict adherence to Design Patterns. Just a few lessons in, and we've already done MVC and Delegates.
And, of course, I always loved the Smalltalk syntax.
And, of course, I always loved the Smalltalk syntax.
Friday, March 2, 2012
Time for a new internet browser
Time to be an old grump for a moment.
I've said it before, I'll say it again. It's time to rewrite the browser. Invent, create, realize a new way of browsing the internet.
Forget HTML, JavaScript, FlashPlayer et al. Computers are powerful; why aren't browsers? Why can't you develop on the browser the same way you develop directly onto the operating system? Why isn't there a virtual machine to which you may directly target compilers? That way, you have your cake and can eat it, too.
I'm not saying the browser should be an operating system; it's an application. However, it should integrate with operating systems. For example, security is an OS problem; it should not be an application's problem. Why solve the same problem over and over again? There are realtime impacts to this: HTTP and HTTPS are heavy compared to TFTP.
I am saying that HTML is annoying. I don't think HTML5 will solve that problem - at least, it won't solve it anytime soon. HTML is to the browser like Java is to the OS: it's a language, a display and layout language. It defines the View.
I've said it before, I'll say it again. It's time to rewrite the browser. Invent, create, realize a new way of browsing the internet.
Forget HTML, JavaScript, FlashPlayer et al. Computers are powerful; why aren't browsers? Why can't you develop on the browser the same way you develop directly onto the operating system? Why isn't there a virtual machine to which you may directly target compilers? That way, you have your cake and can eat it, too.
I'm not saying the browser should be an operating system; it's an application. However, it should integrate with operating systems. For example, security is an OS problem; it should not be an application's problem. Why solve the same problem over and over again? There are realtime impacts to this: HTTP and HTTPS are heavy compared to TFTP.
I am saying that HTML is annoying. I don't think HTML5 will solve that problem - at least, it won't solve it anytime soon. HTML is to the browser like Java is to the OS: it's a language, a display and layout language. It defines the View.
Subscribe to:
Comments (Atom)