More Graphical Language!

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!
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: More Graphical Language!

Post by Combuster »

Brendan wrote:Please note that the combination of i) and j) make it easy for the IDE to work in tokens rather than text. For example, you might select 4 lines of source code and click the "while" icon, and the IDE would insert the tokens for "while" and "end_while" into your source code and display them according to user preferences (e.g. "terwijl () { }" for Dutch programmers, "wahrend() {}" for German, "alors que () { ... }" for French, "mentre () { ... }" for Italian, and maybe an animation of a mouse on a treadmill for children).
My variation of logo contains both English and Dutch keywords and will try to parse keywords in either. That comes with the added feature that some programs start doing completely different things when the language is changed because the same word in English happened to mean something different in Dutch.

But in general, writing code in something other than English makes it less maintainable anyway...
"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 ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: More Graphical Language!

Post by Brendan »

Hi,
Combuster wrote:
Brendan wrote:Please note that the combination of i) and j) make it easy for the IDE to work in tokens rather than text. For example, you might select 4 lines of source code and click the "while" icon, and the IDE would insert the tokens for "while" and "end_while" into your source code and display them according to user preferences (e.g. "terwijl () { }" for Dutch programmers, "wahrend() {}" for German, "alors que () { ... }" for French, "mentre () { ... }" for Italian, and maybe an animation of a mouse on a treadmill for children).
My variation of logo contains both English and Dutch keywords and will try to parse keywords in either. That comes with the added feature that some programs start doing completely different things when the language is changed because the same word in English happened to mean something different in Dutch.

But in general, writing code in something other than English makes it less maintainable anyway...
Your problem is that you store text, rather than tokens.. ;)

I could even have a multi-user IDE (so that a team can be editing the same source code at the same time), where each person sees keywords in different languages. While someone is editing in Dutch, someone else could be watching the edits in real-time in Spanish.


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.
OSwhatever
Member
Member
Posts: 595
Joined: Mon Jul 05, 2010 4:15 pm

Re: More Graphical Language!

Post by OSwhatever »

About this that keywords in programming languages should be in a native language, I don't think this feature is something programmers really are looking for. My mother tongue is not English but despite that I don't want keywords to be in my language. Maybe Brendan was just using it as an example. Also if I remember correctly, having keywords in English didn't prevent me from learning the language either and most people who wants to learn computer programming do know that languages use English keywords.

The only problem I see is if the alphabet so different so that it cannot be typed on the keyboard. For example, I don't know how easy or difficult it is for a Chinese keyboard layout to type an English word.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: More Graphical Language!

Post by Combuster »

You missed that automatic translation does not solve the original problem of antonyms at all. The other end might occasionally end up with two functions having identical names but doing completely different things. The other logical alternative of manual translation is well, manual and obviously counterproductive.

Not to mention that if you're having a live conversation you're literally talking about two different terms for everything code-related.

I fail to see "all code in English" disappearing from a company's manual of style for a really long time.
I don't know how easy or difficult it is for a Chinese keyboard layout to type an English word.
Having toyed with Japanese in bits, there's typically a shortcut that switches the input method. You pretty much switch to and from a latin keyboard with a short keysequence - after all even in regular writing foreign names are typically rendered in latin so it's pretty much standard issue.

That said, getting IME properly done is a complete discussion of it's own right.
"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 ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: More Graphical Language!

Post by Brendan »

Hi,
Combuster wrote:You missed that automatic translation does not solve the original problem of antonyms at all. The other end might occasionally end up with two functions having identical names but doing completely different things. The other logical alternative of manual translation is well, manual and obviously counterproductive.
What problem with antonyms? From the compiler's perspective, token 0x1234 is very different to the variable/function name "while". From the user's perspective (for an example), token 0x1234 displayed as a green shiny box with the text "while" written on it in bold font will look very different to a yellow box with "while" written in an italic font.

Even without any graphical hints at all, people are good at figuring things out from context. For example:

Code: Select all

int void(void) { int for; int while = 0; int do = 999; do {
for = while; while++; } while(for != do); return for; }
Note: sane source code formatting is a graphical hint too.
Combuster wrote:Not to mention that if you're having a live conversation you're literally talking about two different terms for everything code-related.
Well, you're right there - if people are talking about code on forums or something (outside the IDE), then it would be a bit confusing when people start using unfamiliar names for keywords. I think people are smart enough to use a common language when talking to others though.
Combuster wrote:I fail to see "all code in English" disappearing from a company's manual of style for a really long time.
A company's manual of style is another thing that is stupid and unnecessary. Even with the normal languages that we're all used to, I fail to see why IDEs don't automatically format the code for the user whenever a file is loaded, and then automatically reformat it when saving changes to disk (so that the IDE's user never needs to see whatever the "manual of style" says source code should look like on disk). Of course in this case the company's manual of style could just say "strip all unnecessary white space".

As far as I can tell, the purpose of most "manuals of style" is to make sure there's no problem if people get sucked into a time warp that takes them back to 1975, and they need to work on the source code using a crappy 80 column terminal running ed. 8)


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.
User avatar
dozniak
Member
Member
Posts: 723
Joined: Thu Jul 12, 2012 7:29 am
Location: Tallinn, Estonia

Re: More Graphical Language!

Post by dozniak »

bewing wrote:Beyond that, there are many computer languages out there. To learn how to program, you need to basically learn how to work with all of them. If you create an artificial situation that makes programming trivially simple -- then your victims will still have completely failed to learn how to program, because they won't have a clue how to use any other language. To learn how to do a task, that task needs to be at least a little difficult. Otherwise you won't pay attention, and you won't learn anything.
This may be true for your today's definition of "programming". However, Bret (and Seymour for that matter) speak about redefining programming to be more available and creative activity. Try to stretch your imagination a bit.
Learn to read.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: More Graphical Language!

Post by Combuster »

Brendan wrote:Even without any graphical hints at all, people are good at figuring things out from context.
Well, if I try the following in basic, can you tell me if it is a translated keyword or a variable?

Code: Select all

Now = Val
Am I setting the system clock or not?
Combuster wrote:I fail to see "all code in English" disappearing from a company's manual of style for a really long time.
A company's manual of style is another thing that is stupid and unnecessary. (...)
You only covered the religious subjects, not the remaining two-thirds that actually matter, nor have you provided any argument against the opening point in particular. To add another example, certain questionable (anti)patterns specific to my area of expertise are punishable by mandatory piebaking where I come from.
"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 ]
User avatar
Owen
Member
Member
Posts: 1700
Joined: Fri Jun 13, 2008 3:21 pm
Location: Cambridge, United Kingdom
Contact:

Re: More Graphical Language!

Post by Owen »

OSwhatever wrote:For example, I don't know how easy or difficult it is for a Chinese keyboard layout to type an English word.
Chinese keyboards use the US layout, and an input method switch is used to enable/disable the writing of Chinese ideographs and to select the various (structural or phonetic) methods.

Japanese is generally typed using one of two methods: Either entering the text phonetically in the Latin alphabet (using one of the Romaji systems) or directly in Hiragana/Katakana directly by switching to that mode. An input method editor translates the Romaji to Hiragana/Katakana, and the Hiragana to Kanji as appropriate (with a disambiguation selection mechanism).

The Korean alphabet has unambiguous grouping, so users type the base Jamo and the IME can automatically translate these into the more complex compound Hangul.

You can pretty much rely on every keyboard having some reasonable method of entering the Latin alphabet, because, fundamentally, users want to be able to enter URLs, and IDN is a recent thing.
User avatar
bewing
Member
Member
Posts: 1401
Joined: Wed Feb 07, 2007 1:45 pm
Location: Eugene, OR, US

Re: More Graphical Language!

Post by bewing »

dozniak wrote:
bewing wrote:...
This may be true for your today's definition of "programming". However, Bret (and Seymour for that matter) speak about redefining programming to be more available and creative activity. Try to stretch your imagination a bit.
ASM will always exist -- because that is how the machine thinks, and that will always therefore be the most efficient way to code the machine. It will also always be the primary form of disassembler output. And therefore something like C will always exist, too -- the first order HLL above ASM. Bret and Seymour need to stop living in vaporous idealistic dreamworlds. One way of programming the machine will always be to think like the machine. So despite all the whining, at least a part of true programming will always involve learning how to think like the machine.
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: More Graphical Language!

Post by Brendan »

Hi,
Combuster wrote:
Brendan wrote:Even without any graphical hints at all, people are good at figuring things out from context.
Well, if I try the following in basic, can you tell me if it is a translated keyword or a variable?

Code: Select all

Now = Val
Am I setting the system clock or not?
In (some dialects of?) BASIC, "Now" is a function that breaks the language's syntax rules for functions. To set the time it should be "Now(Val)" and to get the time it should be "Val = Now()". Your example only shows that BASIC is a bad language.
Combuster wrote:
Combuster wrote:I fail to see "all code in English" disappearing from a company's manual of style for a really long time.
A company's manual of style is another thing that is stupid and unnecessary. (...)
You only covered the religious subjects, not the remaining two-thirds that actually matter, nor have you provided any argument against the opening point in particular. To add another example, certain questionable (anti)patterns specific to my area of expertise are punishable by mandatory piebaking where I come from.
You're right - the manual of style would still have to say things like "All comments should be in English" and "All function and variable names should be in English" (or French or Klingon or whatever). This has nothing to do with how keywords are displayed to users, or how keywords can be displayed differently to different users.

Here's an example:

Code: Select all

    assert(x > 0);

loop:
   if(y == 1) {
        y = x / 123;
        x++;
        goto loop;
    }
  • :!: (x > 0)
loop:
  • :?:(y == 1)
    • y = x / 123
      x++
      :arrow: loop
It's a bit clunky (misusing the forum's smileys didn't give me a very wide range of icons to choose from and I couldn't do nested boxes with different background colours), but if a user chooses to set their IDE's preferences to "smileys" (instead of "English") then why not.


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.
User avatar
Combuster
Member
Member
Posts: 9301
Joined: Wed Oct 18, 2006 3:45 am
Libera.chat IRC: [com]buster
Location: On the balcony, where I can actually keep 1½m distance
Contact:

Re: More Graphical Language!

Post by Combuster »

Brendan wrote:"Now" is a function
Keyword, thank you. And in the context it follows all syntax rules of variables, just like errno does in C (and there are many more constructs across languages where setter and getter functions have assignment syntax).
"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 ]
User avatar
Brendan
Member
Member
Posts: 8561
Joined: Sat Jan 15, 2005 12:00 am
Location: At his keyboard!
Contact:

Re: More Graphical Language!

Post by Brendan »

Hi,
Combuster wrote:
Brendan wrote:"Now" is a function
Keyword, thank you. And in the context it follows all syntax rules of variables, just like errno does in C (and there are many more constructs across languages where setter and getter functions have assignment syntax).
Ok - I'll change my original statement to "Even without any graphical hints at all, people are good at figuring things out from context (where "good at" doesn't imply "100% infallible in all cases")."


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.
User avatar
trinopoty
Member
Member
Posts: 87
Joined: Wed Feb 09, 2011 2:21 am
Location: Raipur, India

Re: More Graphical Language!

Post by trinopoty »

Maybe we should stop fighting. Everyone has different preferences and thoughts. We should try to develop software to suit everybody's preference and style.
I some person A likes a certain style X and a person B do not like X, it does not mean that the style X is useless. If it helps person A, it is useful.

If someone want to use icons for keywords or even a different language, let him use it; but, it must not cause any problem to some other person reading the code.
Nable
Member
Member
Posts: 453
Joined: Tue Nov 08, 2011 11:35 am

Re: More Graphical Language!

Post by Nable »

cxzuk
Member
Member
Posts: 164
Joined: Mon Dec 21, 2009 6:03 pm

Re: More Graphical Language!

Post by cxzuk »

A talk by Bret Victor, Before he wrote the site mentioned on this thread;

http://www.youtube.com/watch?v=PUv66718 ... tube_gdata
Post Reply