We closed this forum 18 June 2010. It has served us well since 2005 as the ALPHA forum did before it from 2002 to 2005. New discussions are ongoing at the new URL http://forum.processing.org. You'll need to sign up and get a new user account. We're sorry about that inconvenience, but we think it's better in the long run. The content on this forum will remain online.
IndexProcessing DevelopmentCore,  Processing Development Environment (PDE) › do changes in the programming language
Page Index Toggle Pages: 1
do changes in the programming language (Read 3497 times)
do changes in the programming language
Jun 16th, 2009, 3:02am
 
Hello, this may sound a little bit stupid, but it is very seriously to my. For an art project I will change Processing to my own dialect witch is swiss german. I prefeer to do this with a processing library but a friend told me that this would not wort with a library. So I took a look to the Processing source code but did not understand how it works.
My main question is:
Do I have to change the processing source code or is it possible to do this with a library? And if not, where in the Processing source code can this be manipulated? I tok a look to PdeEmitter.pde and did some changes but it didn't works.

The result should look for example like this:

Code in Processing language

  if( a > b){
       println(a);
  }
  else{
       println(b);
  }


Code in my language

  falls (a grösser isch als b) bitte
       schrib (a);
  danke

  suscht bitte
       schrib (b);
  danke

You can see, it is a simple replacement,

{ => bitte
} => danke
if => falls
> => grösser isch als
...

I am very thankful for replies.

Re: do changes in the programming language
Reply #1 - Jun 16th, 2009, 3:45am
 
Ouch!
Changing the functions names (as shown in Reference) isn't so hard.
But changing the language itself, like the if/else/for/class/etc. and even worse the symbols, is very hard, next to impossible (I wouldn't try it, unless paid for that! Smiley).

If you are courageous, knowledgeable and have lot of free time, I would recommend to take a look at the .g files in the source: these are grammar files processed by the Antlr library and used by Processing to pre-process the .pde files to transform them to .java files. Perhaps you can modify and extend them to do the job...

An alternative is to have your own pre-processor, less smart, but with more risks: if you change the occurrences of falls in the source, you have at least to take care of not changing them in strings (and in comments if you want).

Beside, that's just my opinion, but I think translating a programming language is often a bad idea, unless you target a very young, amateur public. Microsoft translated Visual Basic to some language and it led to lot of issues. And in an era where Internet is so widespread, making a nice language from an existing one cuts off your public from available resources (this forum, existing code everywhere, etc.).
Re: do changes in the programming language
Reply #2 - Jun 16th, 2009, 5:16am
 
Thank you for reply.

Of course it is not sense full to create such a programming language. This project is part of an art wok witch brought up for discussion of globalization and postmodern identity. It is part of the content that a language that is such a way standardized like programming language get back transformed to a personalized language that nobody then the author can write it anymore.

I thought it is much easier. I plant to put a small program at the beginning of the pre processor software which analyses the text and simply replaces some words or signs. After that the Processing program does the same thing like normal. So the standard instruction are not lost but extended. Is this not possible?
Re: do changes in the programming language
Reply #3 - Aug 13th, 2009, 6:01am
 
That's certainly possible, the easiest method to do it with a Tool would be to have the tool grab the text of the code, then have the tool do the conversion from your dialect before sending it to the preprocessor. Then call the compile and run commands internally. It's a little tricky, but not nearly as difficult as writing a preprocessor for your language. Wink
What a wonderful thing to say {bitte und danke} !
Reply #4 - Sep 18th, 2009, 12:44pm
 
Hello balte,
i just wanted to tell you that i had a really happy minute reading about your idea. I like your thesis about language defining identity for a collective in a globalized world.
Honestly, i find that your project would end up as a proof for the dissolving of geographical identity for languages (and especially dialects) are merging, say globalizing.
Go ahead, others may also find it wonderful to say bitte and danke all day when programming! Cheesy
Re: do changes in the programming language
Reply #5 - Sep 21st, 2009, 8:05am
 
Thank you, Fry and blausand.

I just finished the project. After some Help of a few people the Editor works fine. There are still some bugs and the editor for Windows and Linux is not jet finished, but on Mac it works fine.
It is also possible to manipulate the new language with just a text editor.
Here is the link to the project.
http://stefanbaltensperger.ch/
Page Index Toggle Pages: 1