Of course there are things you can do to help clarity. Like actually displaying a tree of sorts, not a linear sequence. Then you wouldn't have to scan through the linear sequence to find where sub-expressions begin (which you have to do with RPN just as with infix/prefix notation).MSimon wrote:If you are used to reading RPN it is pretty clear. And there are things you can do to help clarity.Teahive wrote:PN/RPN may have the benefit of not having to type parentheses, but the visual representation should still have a clear grouping of sub-expressions.
Go Forth And Prosper
Re: Go Forth And Prosper
Re: Go Forth And Prosper
Well OK you don't like RPN. HP sold quite a few calculators with that model.Teahive wrote:Of course there are things you can do to help clarity. Like actually displaying a tree of sorts, not a linear sequence. Then you wouldn't have to scan through the linear sequence to find where sub-expressions begin (which you have to do with RPN just as with infix/prefix notation).MSimon wrote:If you are used to reading RPN it is pretty clear. And there are things you can do to help clarity.Teahive wrote:PN/RPN may have the benefit of not having to type parentheses, but the visual representation should still have a clear grouping of sub-expressions.
In the computer you have to have the two arguments before you can do anything with them. Every single compiler is RPN. Forth just does you the favor of making that explicit. You don't like it? Don't use it. However you are then at the mercy of the compiler writer. I can't tell you how many times that has caused me problems in the real world.
It is one of the reasons I will only write C if paid for it.
In Forth we just write the sub expressions as another fragment. That is not encouraged in C because of the stack thrash every time you invoke a new routine.
Computer science tells you that small short easily tested routines is the way to go. Real time C encourages the opposite because the stack thrash is a time waster.
But as I said - don't like it - don't use it. I like competing against projects coded in C.
Engineering is the art of making what you want from what you can get at a profit.
Re: Go Forth And Prosper
I've been following a CPU in development where that's not a problem, http://millcomputing.com/MSimon wrote:In Forth we just write the sub expressions as another fragment. That is not encouraged in C because of the stack thrash every time you invoke a new routine.
Being a fan of stack based architectures you might start with http://millcomputing.com/docs/belt/
The daylight is uncomfortably bright for eyes so long in the dark.
Re: Go Forth And Prosper
http://millcomputing.com/docs/belt/hanelyp wrote:I've been following a CPU in development where that's not a problem, http://millcomputing.com/MSimon wrote:In Forth we just write the sub expressions as another fragment. That is not encouraged in C because of the stack thrash every time you invoke a new routine.
Being a fan of stack based architectures you might start with http://millcomputing.com/docs/belt/
- typical misprediction penalty is five cycles - in Forth machines the pipeline penalty is zero or one cycle and there is no prediction. Prediction and long pipelines add significant silicon.
But I can see that as a way to improve "C".
Engineering is the art of making what you want from what you can get at a profit.
Re: Go Forth And Prosper
You're comparing apples to oranges. That's cache access prediction miss penalty, which also applies to a FORTH machine running at clock speeds needing a modern cache. No prediction of branches would make the FORTH machine strictly a great deal slower as it has to access memory for the instruction =after= seeing the branch.MSimon wrote:http://millcomputing.com/docs/belt/
- typical misprediction penalty is five cycles - in Forth machines the pipeline penalty is zero or one cycle and there is no prediction. Prediction and long pipelines add significant silicon.
But I can see that as a way to improve "C".
The pipeline described for the Mill is pretty short by modern standards. The prediction mechanism is very simple by modern standards, described elsewhere.
The daylight is uncomfortably bright for eyes so long in the dark.
Re: Go Forth And Prosper
Us Forth guys get around all that by putting 144 cores on a chip. The cores are async so if they have nothing to do they do nothing. You only pay for power that is doing useful work. $20 a pop in lots of 10. 86.4GIPS peak. IIRC ~100ma @ 1.8 V when all the cores are computing. Nothing else even come close in MIPS/W. MIPS/$ or any other metric you like.hanelyp wrote:You're comparing apples to oranges. That's cache access prediction miss penalty, which also applies to a FORTH machine running at clock speeds needing a modern cache. No prediction of branches would make the FORTH machine strictly a great deal slower as it has to access memory for the instruction =after= seeing the branch.MSimon wrote:http://millcomputing.com/docs/belt/
- typical misprediction penalty is five cycles - in Forth machines the pipeline penalty is zero or one cycle and there is no prediction. Prediction and long pipelines add significant silicon.
But I can see that as a way to improve "C".
The pipeline described for the Mill is pretty short by modern standards. The prediction mechanism is very simple by modern standards, described elsewhere.
So why am I doing what I'm doing with ARM? I'm in the process of training up an Army so I can get a battalion capable of using the GA144.
And BTW you can buy the GA144. The Mill is vaporware.
Engineering is the art of making what you want from what you can get at a profit.
Re: Go Forth And Prosper
BTW the Forth machines don't use prediction. The pipeline is one deep. The penalty is 0 or 1 instruction depending on the last instruction.
You are trying to think of it as if it was a "normal" machine. It is not. The Mill is more normal than the GA144.
You are trying to think of it as if it was a "normal" machine. It is not. The Mill is more normal than the GA144.
Engineering is the art of making what you want from what you can get at a profit.
Re: Go Forth And Prosper
Compilers don't use human readable notations internally. (And if you meant stack machine instead of RPN, it's still not true.)MSimon wrote:Well OK you don't like RPN. HP sold quite a few calculators with that model.
In the computer you have to have the two arguments before you can do anything with them. Every single compiler is RPN. Forth just does you the favor of making that explicit. You don't like it? Don't use it. However you are then at the mercy of the compiler writer. I can't tell you how many times that has caused me problems in the real world.
You need both operation and operands at the same time. In fact, without operation you don't know how many operands to fetch.
I don't dislike RPN, I just think that it's at best a minor improvement over infix notation.
I have no love for C, but the compiler can inline simple functions and you can use a calling convention that passes most arguments via registers. And the cost of a stack operation isn't a feature of the language.In Forth we just write the sub expressions as another fragment. That is not encouraged in C because of the stack thrash every time you invoke a new routine.
Computer science tells you that small short easily tested routines is the way to go. Real time C encourages the opposite because the stack thrash is a time waster.
Re: Go Forth And Prosper
Any metric? I like FLOPS and memory bandwidth.MSimon wrote:Us Forth guys get around all that by putting 144 cores on a chip. The cores are async so if they have nothing to do they do nothing. You only pay for power that is doing useful work. $20 a pop in lots of 10. 86.4GIPS peak. IIRC ~100ma @ 1.8 V when all the cores are computing. Nothing else even come close in MIPS/W. MIPS/$ or any other metric you like.
It's 650mW peak according to
Re: Go Forth And Prosper
you can use a calling convention that passes most arguments via registersTeahive wrote:Compilers don't use human readable notations internally. (And if you meant stack machine instead of RPN, it's still not true.)MSimon wrote:Well OK you don't like RPN. HP sold quite a few calculators with that model.
In the computer you have to have the two arguments before you can do anything with them. Every single compiler is RPN. Forth just does you the favor of making that explicit. You don't like it? Don't use it. However you are then at the mercy of the compiler writer. I can't tell you how many times that has caused me problems in the real world.
You need both operation and operands at the same time. In fact, without operation you don't know how many operands to fetch.
I don't dislike RPN, I just think that it's at best a minor improvement over infix notation.
I have no love for C, but the compiler can inline simple functions and you can use a calling convention that passes most arguments via registers. And the cost of a stack operation isn't a feature of the language.In Forth we just write the sub expressions as another fragment. That is not encouraged in C because of the stack thrash every time you invoke a new routine.
Computer science tells you that small short easily tested routines is the way to go. Real time C encourages the opposite because the stack thrash is a time waster.
And when you run out of registers? And then there are the "calling conventions". Usually clumsy and another thing to learn.
Engineering is the art of making what you want from what you can get at a profit.
Re: Go Forth And Prosper
Thanks! It has been a while since I looked. So what would that make it? 132.9 GIPS/W not too shabby. And you only pay (in power) for the GIPS you are using. Automatically. No power control code required.Teahive wrote:Any metric? I like FLOPS and memory bandwidth. :DMSimon wrote:Us Forth guys get around all that by putting 144 cores on a chip. The cores are async so if they have nothing to do they do nothing. You only pay for power that is doing useful work. $20 a pop in lots of 10. 86.4GIPS peak. IIRC ~100ma @ 1.8 V when all the cores are computing. Nothing else even come close in MIPS/W. MIPS/$ or any other metric you like.
It's 650mW peak according to
Engineering is the art of making what you want from what you can get at a profit.
Re: Go Forth And Prosper
Engineering is the art of making what you want from what you can get at a profit.