tell you something
Feb. 1st, 2017 03:15 pm![[personal profile]](https://www.dreamwidth.org/img/silk/identity/user.png)
A couple of days ago I spent half of the day working with some c code. Not a beautiful one, regular. Plain c.
Well, it fast like a lightning. It's been a while; and I remember compiling c in two compilers for 4 memory models; I did remodel my apartment while this was going on. It was 25 years ago, well, the world has changed, but c has not.
So maybe I should use it from time to time, I don't know. Forth must be fast too.
Or is it just me.
I know, neither is scalable. Or it could be, could it?
Well, it fast like a lightning. It's been a while; and I remember compiling c in two compilers for 4 memory models; I did remodel my apartment while this was going on. It was 25 years ago, well, the world has changed, but c has not.
So maybe I should use it from time to time, I don't know. Forth must be fast too.
Or is it just me.
I know, neither is scalable. Or it could be, could it?
no subject
Date: 2017-02-02 07:15 am (UTC)Во-во
Date: 2017-02-02 09:08 am (UTC)"все" операционки
no subject
Date: 2017-02-02 04:25 pm (UTC)My impression in 2008 was - not only it was not scalable, the only way to refactor with them was to rewrite them. I believe they did. Also, Google had an advantage of mass usage of distributed processing and parallelization. I believe, small C programs that talk to other C programs is not a big deal; this may be the solution.
no subject
Date: 2017-02-02 10:59 am (UTC)no subject
Date: 2017-02-02 12:04 pm (UTC)no subject
Date: 2017-02-02 04:21 pm (UTC)no subject
Date: 2017-02-02 10:05 pm (UTC)no subject
Date: 2017-02-02 11:41 pm (UTC)no subject
Date: 2017-02-03 07:27 am (UTC)To be exact -- even crowd of poor workers can achieve great result if set them in narrow conditions and under big and shine goal. ;)
no subject
Date: 2017-02-03 10:25 am (UTC)no subject
Date: 2017-02-04 08:06 am (UTC)Просто попытки грокнуть тему Генерал ИИ ;)
Как оказывается, там все крутится вокруг призрачной оси с лейбочкой "мотивация". ;)
no subject
Date: 2017-02-06 02:59 am (UTC)Мао очень любил танцы :)
no subject
Date: 2017-02-07 07:46 am (UTC)no subject
Date: 2017-02-06 03:46 am (UTC)This is because stack machine is not well suited for modern architectures with large pipelines.
Forth is just don't use pipeline length - Forth works with extremely short commands chains, and makes pipeline reload on every word of data.
Pipelines prefer to work with long command chains and these chains should not contain jumps (yes, pipeline hate goto's, and prefer vectors of fundamental machine type).
Other minor issue, that Forth uses only one index register for any single step (good optimized C compiler use absolute access, and sure could use registers for variables, and even could vectorize programs automatically).
So typical Fort on old CPU (before pipelined) is magnitude slower than C, and on modern architectures may be 2 magnitudes.
Good thing, Forth may be the best, when need to make some assembler includes (better than C).
So if fast mean, that you could make assembler includes - Forth is best choice.
Example of asm optimize could be something like compare two vectors of 32-bit integers with vector commands - this is at least 4 times faster than classic C.
But it is not well suited for Unicode data (because need conversion or some sort of one-symbol per step work).
To be honest, I have not looked under the hood of Unicode processing, may be things better.
For scalable, the main issue with Forth is that it is tightly coupled to fundamental machine types (not Scala types).
But as I hear, exists few groups, which used some sort of functional programming with Forth. And they said, Forth is very well suited for functional :)
So may be new people could make things much better.
no subject
Date: 2017-02-06 04:19 am (UTC)Yes, the pipeline is very short.
But no, we can compile a pretty cool and efficient code using all the registers.
I remember writing an FPP simulator, and since it was in Forth (macro), I managed to keep they code remember what was in the registers like 1000 instructions ago.
Well, I got a feeling we agree on all this already.