Liste des Groupes | Revenir à cl c |
Bart <bc@freeuk.com> wrote:
You're doing a fine job of it!Then you no longer have a language which can be implemented in a few KB.First, it is not my goal to advocate for Forth use.
You might as well use a real with with proper data types, and not have
the stack exposed in the language. Forth code can be very cryptic
because of that.
: 2*3 =>This sounds like one of my bytecode languages.
** 6
: 2, 3, *() =>
** 6
the first line is infix form, '=>' oprator prints what is on
the stack (but you cat treat it as "print current result").
In the second line two numbers are pushed on the stack and
then there is call to multiplication routine. Parser knows
that '*' is an operator, but since there are no argument
'*' is treated as ordinary identifer and as result you
get multiplication routine. Like in other languages parentheses
mean function call. Up to now this may look just as some
weirdness with no purpose. But there are advantages. One
is that Pop11 functions can return multiple values, they just
put as many values as needed on the stack. Second, one can
write functions which take variable number of arguments.
And one can use say a loop to put varible number of arguments
on the stack and then call a routine expecting variable
number of arguments. In fact, there is common Pop11 idiom
to handle aggregas: 'explode' puts all members of the aggregate
on the stack. There are also constructor function which build
aggregates from values on the stack.
Coming back to Forth, you can easily add infix syntax to ForthAround that time I was working on several languages that were low level and with small implementations, which included running directly on 8-bit hardware. They all looked like proper HLLS, if crude and simple.
but Forth users somewhat dislike idea of using infix for most
of programming. My personal opinion is that Fort was good
around 1980. At that time there was quite simple implementation,
language offered interactive developement and some powerful
feature and there were interesting compromise between speed
and size.
My exposure before I first looked at C was to Algol, Pascal, Fortran (and COBOL).What started the subthread was the question of which HLL goes betweenWell, for me important question is how much work is due to tools
ASM and C (since someone suggested that C was mid-level).
(basically overhead) and how much deals with problem domain.
Since computers are now much heaper compared to human work
there is desire to reduce tool overhead as much as possible.
This favours higher level languages, so probably most recently
created languages is at higher level than C. However, in
sixties and seventies there were pack of so called algorithmic
languages or somewhat more specifically Algol family. I would
say that C is close to the middle of this pack.
As a devils...
advocate let me compare typical implementation of early Pascal
of early languages were at lower level than Pascal.You're taking all those, to me, chaotic features of C as being superior to Pascal.
Syntax IS superficial! But it's pretty important otherwise we'd be programming in binary machine code, or lambda calculus.People suggested ones like BLISS and Forth.You are looking at superficial things.
>
I remarked that a proper HLL would let you write just A to either read
the value of variable A, or write to it. Eg. A = A, without special
operators to dereference A's address.
I am not going to write substantial programs in Bliss or ForthSo, what would a non-HLL look like to you that is not actual assembly?
but I have no double they are HLL-s.
Les messages affichés proviennent d'usenet.