Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > Languages Misc > Re: RPN maps to...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 12 of 55 Topic 1073 of 1203
Post > Topic >>

Re: RPN maps to basic mathematic expressions nicely

by "cr88192" <cr88192@[EMAIL PROTECTED] > Nov 17, 2007 at 07:22 PM

"billy" <wtanksleyjr@[EMAIL PROTECTED]
> wrote in message 
news:256020f2-8cde-4d1b-845f-6ac81e832f44@[EMAIL PROTECTED]
> "cr88192" <cr88...@[EMAIL PROTECTED]
> wrote:
>> yes, RPN has uses, but I will argue, is still not the best model for
>> general programming.
>
> Well, you DO assert that, but you don't exactly argue it. But that's
> okay, 'cause I'll concede: RPN isn't a "model for general
> programming", it's just another type of syntax for programming
> languages. I'd even concede that it's not the "best" type of syntax
> (but I'm weasel wording, because I don't think there's an optimum
> syntax type). I do think that RPN is as useful as any other syntax
> type, but simply less studied and formally understood. Oh, and it's
> also useful in different specific areas than the areas in which infix
> or prefix are useful.
>

yes, I will agree to this.

where it works very well, IMO, is in many of the same kinds of places that

assembler works well...


> For an example of an area in which RPN excels over the others, all
> transformations in a pure RPN language can be expressed as direct
> 'textual' replacements on a flat list, rather than pattern matching on
> a tree. This makes some formal theory simpler to work with. In
> practice, of course, nobody works with a pure RPN language (I've only
> ever seen one, and it's a "turing tarpit"), but again in practice,
> even a non-theoretical language like Forth winds up matching so close
> to theory that most of the results wind up being discovered and used
> by most programmers naturally.
>

I will also agree to this.

some of the advantages of RPN, is why I use it, in my lower compiler...

if you want something very simple and powerful, RPN is likely a good bet.


>> I will argue then that natural is not so much what we need concern 
>> ourselves
>> with (much of what is most useful is clearly not 'natural'), but
rather,
>> more obvious problems:
>> complicated expressions in RPN, or manual binary arithmetic (for 
>> non-trivial
>> values), very quickly become unmanageable.
>> so, the downfall of forth is not that it is 'unnatural', but rather
that 
>> no
>> one can really read and follow the code...
>> one has to 'study', even their own code in a language they may know
well,
>> just to figure out what the hell they were doing.
>
> This is not necessarily so in general; and to the extent that it is
> true for specific cases, it's true for all language types.
>

I will disagree, in that I find some forms of syntax to be more easily 
understandable than others, for different arguably subjective reasons.

note though, my views are not based on parsing or processing concerns.
that 
RPN is simple to parse and process, and that something like C or C++ is 
nearly unparsable (absent significant investment), is not really my
concern.


however, we can assert that, failing everything else, there is one
"strong" 
advantage to C style syntaxes (in a general sense, including C, C++, C#, 
Java, JavaScript, ...):
this is a strong preference within both the industry, and within the minds

of many developers.

as far as the languages themselves go, C, C++, and Java, are almost 
universally understood, which means, again, that there is strong reason to

emulate them.

so, IMO:
RPN is really good for low-level processing (and very simple
interpreters), 
but I personally view it as awkward, counter-intuitive, and not terribly 
scalable or readable (also, the syntax itself does not offer much 
'abstraction');
S-Expressions are very good for intermediate processing tasks, and allow a

reasonable level of abstraction, but are ugly and a hassle to work with 
(especially in non paren-counting editors);
more traditional syntaxes (C or Pascal like), are a lot better for human 
editing, primarily because they offer abstraction, use visual
associativity 
(rather than structural associativity).


>> this is not so much a problem with a more C-style syntax...
>
> False. Both computational theory and actual practice indicate that in
> general, it's very easy to write code that can't be easily read later,
> in ANY language.
>

true, but irrelevant.

I will assert that a more C or Pascal style syntax allows greater 
readability.
so, the issue is more one of proving that RPN languages have at least a 
similar, if not greater, readability on average than generally well
written 
code in a language with a more conventional syntax.

one of the major problems I have found before with RPN is the difficulty
in 
breaking and indenting things in a more or less "sane" manner (due in
large 
part to the non block-and-statement style structuring of such languages).


> -Wm
 




 55 Posts in Topic:
RPN maps to basic mathematic expressions nicely
"metaperl.com"   2007-11-11 12:50:24 
Re: RPN maps to basic mathematic expressions nicely
"Paul E. Bennett&quo  2007-11-11 13:06:24 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-12 09:25:56 
Re: RPN maps to basic mathematic expressions nicely
Marco van de Voort <ma  2007-11-12 09:21:48 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-12 21:40:58 
Re: RPN maps to basic mathematic expressions nicely
Marco van de Voort <ma  2007-11-12 11:46:48 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-12 13:51:05 
Re: RPN maps to basic mathematic expressions nicely
Andrew Haley <andrew29  2007-11-12 11:39:14 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-12 13:54:50 
Re: RPN maps to basic mathematic expressions nicely
stephenXXX@[EMAIL PROTECT  2007-11-16 17:49:33 
Re: RPN maps to basic mathematic expressions nicely
Andrew Haley <andrew29  2007-11-16 18:26:39 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-17 19:22:07 
Re: RPN maps to basic mathematic expressions nicely
mhx@[EMAIL PROTECTED] (M  2007-11-17 12:34:02 
Re: RPN maps to basic mathematic expressions nicely
Albert van der Horst <  2007-11-17 16:01:42 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-17 13:37:04 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-18 08:39:07 
Re: RPN maps to basic mathematic expressions nicely
Richard Owlett <rowlet  2007-11-17 17:16:33 
Re: RPN maps to basic mathematic expressions nicely
mhx@[EMAIL PROTECTED] (M  2007-11-18 00:21:13 
Re: RPN maps to basic mathematic expressions nicely
mhx@[EMAIL PROTECTED] (M  2007-11-18 00:54:13 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-18 11:17:04 
Re: RPN maps to basic mathematic expressions nicely
Andrew Haley <andrew29  2007-11-18 17:50:04 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-19 07:48:22 
Re: RPN maps to basic mathematic expressions nicely
Andrew Haley <andrew29  2007-11-19 10:03:11 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-20 06:22:12 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-19 15:39:14 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-20 08:33:48 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-19 17:57:09 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-20 16:56:28 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-20 11:58:40 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-21 07:13:13 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-20 17:55:00 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-21 12:03:34 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-20 21:34:26 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-21 14:24:44 
Re: RPN maps to basic mathematic expressions nicely
Elizabeth D Rather <er  2007-11-17 15:30:04 
Re: RPN maps to basic mathematic expressions nicely
anton@[EMAIL PROTECTED]   2007-11-18 09:48:12 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-21 09:43:55 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-22 13:52:20 
Re: RPN maps to basic mathematic expressions nicely
Elizabeth D Rather <er  2007-11-21 22:48:50 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-24 12:00:16 
Re: RPN maps to basic mathematic expressions nicely
stephenXXX@[EMAIL PROTECT  2007-11-24 14:31:22 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-25 08:20:06 
Re: RPN maps to basic mathematic expressions nicely
stephenXXX@[EMAIL PROTECT  2007-11-24 14:31:22 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-25 08:20:06 
Re: RPN maps to basic mathematic expressions nicely
"slava@[EMAIL PROTEC  2007-11-11 16:14:02 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-12 11:21:04 
Re: RPN maps to basic mathematic expressions nicely
Bernd Paysan <bernd.pa  2007-11-23 11:10:48 
Re: RPN maps to basic mathematic expressions nicely
Andrew Haley <andrew29  2007-11-23 15:49:07 
Re: RPN maps to basic mathematic expressions nicely
Bernd Paysan <bernd.pa  2007-11-23 17:24:16 
Re: RPN maps to basic mathematic expressions nicely
"Rod Pemberton"  2007-11-12 01:16:25 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-12 16:44:53 
Re: RPN maps to basic mathematic expressions nicely
Marco van de Voort <ma  2007-11-12 17:15:35 
Re: RPN maps to basic mathematic expressions nicely
Jerry Avins <jya@[EMAI  2007-11-12 14:17:04 
Re: RPN maps to basic mathematic expressions nicely
Gary Coulbourne <bear@  2007-11-19 11:22:53 
Re: RPN maps to basic mathematic expressions nicely
John Doty <jpd@[EMAIL   2007-11-19 15:11:44 
Re: RPN maps to basic mathematic expressions nicely
"cr88192" <c  2007-11-20 16:59:49 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Sun Jul 20 0:06:22 CDT 2008.