Friday, February 4, 2022

Internationalized Programming

 PigeonTalk will be exploring the idea of graphical programming using drag and drop without translating from a text form using a compiler.  This idea gives us the ability to extend the idea of programming into areas never before available.

Suppose that the names we use in our programs (class names, variable names, strings to display, reserved words, etc.) aren't just Symbols or Strings but are Translatable objects which can store a "default" version but can also store versions of that name in other languages (English, French, Japanese, etc.) and even using the unicode characters for those languages.

In your development environment, then, you would choose which language you want to use and the code would appear in your language.  If a word doesn't have a translation for your language, you can add one.   We could (as a first attempt), use Google Translate to translate the names for us to give a first rough translation of a name.  This becomes even more feasible when we allow spaces in class and method names rather than depending on camelCase names.

Why should programming be English-specific? Let's let people who speak other languages program in their own language and allow programmers from one language be understandable by people in another language.  I'd like to see a wider world of sharing and cooperation in programming.


Realms of Programming

One of the ideas I'm tossing around for PigeonTalk is the concept of a Realm.  In a Smalltalk environment, when you're using a debugger if you keep hitting "Send" to follow the message send into the called method, you'll eventually find yourself in the "weeds" inside collections code, window frameworks, exception handling, and more.  Although this may be interesting, and useful at times, it can be distracting and confusing for kids who are new to programming.

On top of that, your stack trace in the debugger is filled with low level framework methods that usually don't help you understand the problem at hand.

To address this, I'm considering the concept of a Realm.  A Realm is a group of classes and methods.  It has some similarity to the concept of a Package in Store or an Application in Envy.  On top of the grouping of classes and methods, however, it controls what you see when you debug through your code and when you browse senders, implemented, class references, etc.

Users can turn realms on or off.  If a realm is on, then its classes and methods will show up in the IDE tools allowing you to see and step through the code.  If a realm is off, you don't see the code inside it.  Stack frames called by that code are hidden. Senders, implementers and references from the realm are hidden.  You see the code you're working on and only that code.

It will certainly take some experimentation and trial implementations, but I believe it can help control the complexity of the system and hide the irrelevant parts from the programmers so they can focus on what they're doing.