Hi, Alan,
Programming language interpretor you suggested sounds very interesting
though I not that ambitious myself :) I am trying to give J body a Chinese
dress so it looks much more in home to me and I can write as I think.
The topic is interesting so I'd nag a little more on it.
Chinese language has many features that are forgotten or ruined, as well as
the culture it carries, in particular the last 60 years that will harm
generations of people forever.
In fact local students nowadays would spend 10 times or much of time in
learning English than Chinese, for no reason since they turn out to not use
it any way. In the meantime, Chinese literature teachers in China seldom
have read through 說文解字 so they cannot even understand the meaning of
Characters they write everyday not to say teach their students about
anything that generates from the reality of the language.
One may know, that sometime ago, Chinese text is read from right to left
just as J does, and when I'm coding in Chinese I'm find it amusing to read
my code in Chinese Character from right to left.
In my tiny scaled example above, I have something like: 均增首行, which means
fetch the first somewhat add one to it then calculate the average, now how
about reading it as 行首增均? I intend to use a terse style that similar to
ancient Chinese poem here, and 行 is not needed at all so the real code is
just 均增首(=首增均, from right to left), which one can also use 取均數 加一 取首 which
is ugly to me but still is fun to read from right to left.
This is only one of those interesting things. I would post more if only I
have enough time.
A famous ancient master of Zen would always say the same two words to every
visitors to him, 'drink tea', he would say. That means much. One of them
may be 'taste it, the truth is within you'.
Alan K. Stebbens wrote:
>
>
>> It's very late into night here in East of the Earth. I'd answer
>> shortly.
>
> Jim,
>
> I appreciate your reply, and better understand some of your motivation.
>
> I see some value in applying your ideas to create "wizards" that will
> help practitioners of other computer languages to learn J. For
> example, taking the most common idioms from other languages and
> providing a semi-automatic translator, it may be possible to help
> transition curious programmers of other languages into the World of J?
>
> As you did with Smalltalk, perhaps a good excuse for better learning J
> might be to write a J program for converting idioms from popular
> languages (eg: ruby, python, C) might be useful?
>
> eg: (Ruby idioms -> J)
>
> where v is a vector, s, s1, s2 are strings, n, n1, n2 and l are
> numbers, and e is an arbitrary type element.
>
> Ruby J
> v.map{|e| f(e)} --> f v
>
> s1+s2 --> s1,s2
> s1<<s2 --> s1=.s1,s2
> s[n] --> n{s
> s[n1..n2] --> (n1+i.>:n2-n1){s
> s[n, l] --> (n+i.l){s
>
> etc.
>
> This might help convert entire methods into functionally equivalent J
> code.
>
> Of course, J is sufficiently different that this won't work for large
> bodies of code -- only small, relatively simple algorithms. But, it
> might be interesting to see what such a translator spits out for
> increasingly larger code fragments.
>
> Kind of a bottom-up translator.
>
>> While your concern reads reasonable to me, and some authors of
>> Smalltalk
>> dialects such as Smalltalk/X even not permit any code except ascii
>> ones,
>> there is some goodness in trying to programming natively and then
>> define
>> language alias for cross culture interexchange. That is men do it
>> natively,
>> machines do the translation.
>> Have those said, however, I'm fond of native J code since they do
>> not depend
>> on any Human Language.
>> So in time I'll be coding directly in J while I getting more
>> confidence.
>> Though, I may also find it even more interesting coding in Chinese,
>> which
>> unfortunately is less understandable to other people. Since Chinese
>> tastes
>> differently. Translate the code into J is fundamental since
>> otherwise the
>> code won't run so there can be any damage to others as I could see.
>> You may
>> think I would better write code comment in English, yes, and the
>> Chinese
>> comments in my example is just for show the translator features. And
>> if any
>> code would go under a public license, I agree English still is the
>> choice
>> today.
>>
>> On the other hand, most local people who can afford to go to school
>> often
>> spend life time learning English but never get it done here in
>> China. I
>> think that could be a huge waste of time. I myself love different
>> cultures
>> and learned Japanese, English and Esperanto when I was young. Now I'm
>> finding myself reading more and write less in foreign languages if
>> ever and
>> most other local Chinese people will never speak a single word after
>> years
>> of very hard learning.
>>
>> Best Regards,
>>
>> Jim
>>
>>
>> Alan K. Stebbens wrote:
>>>
>>> Emptist,
>>>
>>> I'm glad that you are satisfying your need to an easier path to
>>> productivity in your native language.
>>>
>>> If this is your only requirement, then on that basis, your work is
>>> fine, and I'm guessing that you are sharing because you think there
>>> are others who need to read (and think) in Chinese in order to write
>>> and use J?
>>>
>>> While your work is admirable from a purely technical point of view,
>>> it's actually a step backwards in part of the broader view of what
>>> programming is about: sharing algorithms.
>>>
>>> IMHO, there are two reasons to write readable programs -- to help you
>>> get things done more easily later, or to help others get things done
>>> later.
>>>
>>> If your sole concern is yourself, or those few people who read
>>> Chinese
>>> AND can read and parse J, then perhaps this work is useful.
>>>
>>> If you have any concern for others being able to read and understand
>>> your algorithms, as you have expressed them, then it really becomes
>>> important to use a common language -- that of J expressed in ASCII.
>>>
>>> J is hard enough to parse, even for J-ers, and comprehend, as it is
>>> in
>>> ASCII. But it becomes even more obscure for much of the world if you
>>> write J in Chinese.
>>>
>>> If you contribute an interesting algorithm and it is written in J/
>>> ASCII then more people will be able to read, comprehend, appreciate,
>>> and perhaps use that algorithm than if you write it in J/Chinese.
>>>
>>> I realize that the number of people speaking Chinese in the world
>>> is a
>>> very, very large number, but it is not quite the international
>>> language that English currently is. Of course, this may change, and
>>> perhaps someday, my descendants may be speaking one of the Chinese
>>> dialects, and perhaps writing the common Chinese language. But,
>>> until that day arrives, if you have any belief that your algorithms
>>> have a life of utility for others, then you should reconsider
>>> expressing them in Chinese -- unless you do not care if they are ever
>>> useful to others.
>>>
>>> Alan
>>>
>>> PS: Just so you don't think that I do not appreciate other human
>>> languages, I have studied and speak with varying degrees of fluency
>>> Spanish, Russian, and Japanese. I even studied a semester of Chinese
>>> to better learn the origins of Japanese kanji.
>>>
>>> para mí, el lenguaje es una ventana a la cultura
>>>
>>>
>>> On Sep 14, 2009, at 8:48 AM, emptist wrote:
>>>
>>>>
>>>> Hi,
>>>> Those are defined in a class instance viriable as dictionary named
>>>> 字
>>>> 典, which
>>>> will ask for exact J translation when a word is absent and then add
>>>> the one
>>>> from user answer.
>>>>
>>>> Now as to 首行 and 末列, those are splitted first and then each
>>>> try to find
>>>> itself in dictionary.
>>>> I'm using the following entries to define (might be on fly):
>>>>
>>>> 行
>>>> 加一 >:
>>>> 列 "1
>>>> 首 {.
>>>> 末 {:
>>>> 試讀四八數據檔 _8]\ _2(3!:4) 1!:1
>>>> 均 (+/%#)
>>>> 求均 +/%#
>>>> 增 >:
>>>> : :
>>>> = =
>>>>
>>>> so, 行 is in fact a empty string, as you've guessed it.
>>> ----------------------------------------------------------------------
>>> For information about J forums see http://www.jsoftware.com/
>>> forums.htm
>>>
>>
>> --
>> View this message in context:
>> http://www.nabble.com/finally%2C-I%27ve-made-tiny-Smalltalk-program-for-ChineseJ-tp25435672s24193p25440731.html
>> Sent from the J Chat mailing list archive at Nabble.com.
>>
>> ----------------------------------------------------------------------
>> For information about J forums see http://www.jsoftware.com/forums.htm
>
> ----------------------------------------------------------------------
> For information about J forums see http://www.jsoftware.com/forums.htm
>
--
View this message in context:
http://www.nabble.com/finally%2C-I%27ve-made-tiny-Smalltalk-program-for-ChineseJ-tp25435672s24193p25446028.html
Sent from the J Chat mailing list archive at Nabble.com.
----------------------------------------------------------------------
For information about J forums see http://www.jsoftware.com/forums.htm