Well, it turns out that I'm far from the only person to think it would be great if there were some sort of pseudocode translator... I mean, the first three hits of the Google search for that phrase are people on Stack Overflow wondering about the logistics of such a thing! And the more I think about it the less sure I am of what I actually want to create.
On the one hand, I could make a "pseudocode language", which to me would kind of defeat the point of my original intention... But it would be something like Perl or Ruby, in that "there's more than one way to do it!" I would just write the language such that the user is allowed to write many different forms of pseudocode and still have it work. The downside of that, to me, is that the user still has to learn some syntax, and the compiler would be MASSIVE! In short, less work for the user (although more than I had hoped) and more work for me! Alternatively in the same vein, I could allow the user to define macros, in order to make the language extremely customizable.
On the other hand, I could forget the idea of pseudocode pretty much altogether and just focus on a compiler. Python is pretty similar to pseudocode already, so I could write a compiler from Python to Java or C++ instead. If I'm going to make the user learn some syntax, it might as well be for a language that is already well established. Plus, I think writing just a compiler, rather than designing a new language and then a compiler for it, would be less work for me.
No comments:
Post a Comment