Re: How do you do this?



Alex McDonald wrote:
Like all OS based Forths, Win32Forth can use the underlying facilities
of the OS or use external function libraries. Applications written for
it may do what you say; out of the box, Win32Forth does not.

Sure. If you can paste in someone's code written for win32Forth
that does email then win32Forth can do it. Yes. I understand
that that is not the win32Forth box. I do think the stuff I asked
about is already in tForth and iForth so no extension should
be needed there.

Even a hello world program is an extension that doesn't come
'in the box' but that doesn't prevent people from writing a
hello world program.

I didn't ask about JavaScript.

Neither did you point out that security is an issue; I did. JavaScript
is designed to run in a sandbox; Forth is not. There is one system I
know of that does provide a sandbox Forth environment;
http://forthfreak.net/jsforth.html. Amusingly, it's written in
JavaScript. Don't go there, you'll have apoplexy.

ok, I don't want to go off on your need for a sandbox.

I was talking about Forth anyway. Good old cooperative, solid
trusted, good, comprehensible Forth software. So I didn't want
to spin this thread off into a discussion of java or you need
for sandboxes.

We have considered the possibility of offering a web based
Forth simulator environment, like the sandboxed forth,
sandboxed java, safe for non-programmers on the web
to hack.

For the sake of the 'How do you do this thread?" thread
we will have to assume that you are willing to accept that
the one line of Forth code that I gave an example is
going to be a 'safe' thing to do.

But then again, if you really think you have to have
sandbox to execute that line of code great. Please
give me the estimate on how big that part of your
solution is relative to the other parts.

That's exactly why I asked. Different people see the
problem differently. I asked how you would do and you
gave me an explanation that I hadn't thought of before
and you see problems that you have to solve in the
way you would do that you have explained. Thanks.

I just asked how you would do something simple. I am
getting the idea that you want to talk about other things
because the short answer is that it seems like too
hard a problem for you to solve.

It's so poorly specified, it's unanswerable.

Ok, maybe you could solve it, but you think it is way too
complex to even be able to give a ballpark estimate
of what it would take. For you it would take things I didn't
imagine being needed like sandboxes.

But what isn't clear about the specification of the problem to you?

1. the forth program sent in the example?
2. the idea that one send and another executes?

http://en.wikipedia.org/wiki/Shared_nothing_architecture
http://en.wikipedia.org/wiki/Federated_database

ok, share nothing but a wire if that's what is between
the computers. Share a parallel port, share a network
whatever. Some connection is needed for messages
and it must be shared.

The stated problem can't exist if the two computers
don't at least share a wire.

I was asking about the computer that you use.

A PC with a spell checker.

Great. All I asked was for the numbers for your computer.
Please also include the cpu speed with the speed of
the benchmark. PC covers a pretty wide range.

That's a very abstract and complicated explanation of why you see
it as inherently an extremely complicated problem.

Really? I'd like to see how you propose scaling your solution.

You will. I asked how you would do it first.
You answer my question and then I will answer your question.
Dialog.

The
problem you pose is certainly very difficult indeed to scale on
multiple processors.

Of course I didn't ask about if you think that there are other
difficult problems in the universe.

But, of course, you're not interested in scaling;

S in SEAforth stands for Scalable, scalable embedded arrays.

And sure, I will be very happy to talk about that in another
thread but would like to keep this thread on the subject
of "how do you do this?" in this thread.

I want to start with something easy, but not as trival
as a hello world. I don't want to start with the harder
problems or other problems to solve. I want to
keep it focused in this thread on the stated problem
of how you send this program from this computer
to that computer to get it to run.

We can address your fear of scaling in anther thread.

you're interested in a number that's so small,
it's unbeatable! Yeah!

I am interested in whatever honest numbers you have,
but more importantly I want to know what the problem
looks like in other people's minds. Do they see it
as something simple and easy or as something
with complications that I haven't thought of?

So I am looking for 'how do you do this?'
If I don't understand your explanation of how
you would or do do it then I will ask you more questions.
Dialog.

Go Jeff!

Go Alex!

Thanks for the questions and answers.

: do-demo
['] demo task-block run-task ;

ok, nice. So you have defined task-block
and run-task to look up the compiled code
for demo and send it to the other computer?

What does that code look like?

OK, with a multitasked Win32Forth V6.10.04 running on a Pentium M 2.3
GHz uniprocessor under Windows XP the answer is the same one to "how
long is a piece of string".

Well I can accept that multitasking is sort of close to
multiprocessing.
The definitions can overlap and the same syntax can support both
as in your above example.

So to bring it back into the context of the the problem
1. over + dup ;
2. execute on the other computer

Let's pretend that you have two processors or a dual-core processor
and that the tasks are running on different nodes. Now how long
is the string for your compiled "over + dup exit" sequence?
What does the code to do part 2 look like?



If you can't give an answer and need to guess because it seems
too complicated to you to actually do it I would understand.

Hmm... what was the problem again? Measuring communications latency, I
think.

1. over + dup ;
2. execute on the other computer

commuication latency is part of the time needed as is any other
overhead. You say you can compile the code and count the code
and treat it like a string, and have the other computer call its
throttle up routine, and read the string, and execute the code.
If you need any other steps like cleaning the sandbox that must
be included. The problem is simple, but more than just
measuring communication latency. Maybe I wasn't clear enough
for you the first time.

That's funny! Let's say I'd used SOAP over SMTP; would 2 days elapsed
be embarrassing?

Yes. I would think so.

I asked how you would do it. If you choose a method to do the
stated problem that took two days you made it a LOT more
complicated that I would have imagined.

But that's why I asked. I wanted to know how big a problem it
was to you. Yeah, a two day program would be a bigger
interpretation of the problem than I ever imagined.

Not for the results of the function you chose, that's
for sure. Or 16ns per invocation in a multitask uniprocessor
environment?

OK, your getting closer to an estimate for how long it
would take for the task switch part in your environment.
That helps to estimate what all the other parts might be
to send the short program from computer 1 to computer 2.

How about a mainframe,

Great! If that's how you would do it on your computer
then please show it to me.

or a Linux cluster?

Even greater! If that's how you would do it on your computer
then please, please show it to me.

What number would be you find "embarrasing"?

It would depend on what computer you have.
I don't know either what computers each person has
or how they would solve the problem, that's why I asked.l

But two days, sure, embarrasing unless your computer
unbelievably slow in the first place. If it runs at
0.0000000000001 mips then two days might not be
too embarrasing.

Look, one of the things I do for a living is benchmarking on real
systems with real applications.

Great. Then you can be very helpful.

Your question is unanswerable to anyone's satisfaction except yours,

translation: you understand the question, you know the answer,
you are too embarrased to talk about it because if you do you
think I will be the only person who will be satisfied by what you say.

ok, that's sort of an answer I guess.

But it seems like a very simple problem to me but this is the
sort of thing I have been working on for the last twenty years so
it probably does look more like a hello world problem to me
and more like a fabulously complex and difficult to solve
problem for you. And you have concluded that you cannot
give a reasonable answer.

as you're trying to get a comparison of completely unlike systems
with a function that's not worth shipping in an unstamped envelope,
never mind across a network.

ok, but hello world example programs are not meant to be as
complex as real applications. I wouldn't ask anyone to show
their code for a DVD player written from scratch. But when
we discuss programming syntax we often use simple examples
like hellow world.

I have a hard time writing a good real world program that I
can use an example that will be as short as "over + dup ;"
but it was meant to be like a 'hello world' example.

I wanted it to be simple enough that everyone could clearly
understand part 1. the Forth phrased used as example and
part 2. the idea that compter 1 send and computer 2 executes.

I think that it was clear enough for everyone to understand.
I think you understand.

And sure, if you think that a hello world program is too
difficult to understand, so you couldn't write it because
it isn't a big enough and complicated enough program
to represent a real world problem, then look past the
'hello world' string at the idea that a program reads
this string and displays it. Hello world examples are
about that, not just the hello world string itself.

And the problem is part 2, sending part 1.

I picked something simple and clear so that we wouldn't
get bogged down with a question like, how would a
professional programmer hand this complicated problem
and solve it if he was paid enough, and please give
me the code for free. No what I asked was more akin
to what would your 'hello world' program look like?

I've pointed out that the time cost of communicating the function is
several orders of magnitude greater than the cost of executing it, but
that hasn't got through, obviously.

OK. I got that much, in your solution, on your computer the
waking up and powering up and decoding the message and
executing the message will be a tiny fraction compared to
sending the message.

That's a bit more than we got before.

If your time will be dominated by the size of the message
great. I asked how big the message would be in your
solution. When you compile the code and count the
code and produce a string, how big will it be?

Then the straight answer is; Win32Forth has multiple ways of talking to
copies of itself.

Right. And I am asking about one win32forth on one machine and
one win32forth on another machine. simple idea. multiprocessing
not multitasking on one machine only.

Multitasking, multiprocessing, communicating via TCP,
HTTP etc, and all courtesy of the OS.

Yes, you clearly understand the question that I asked and
you are clearly saying that in win32Forth you might use TCP
and OS sockets etc. Got it.

I've given an example for the first above, but I don't think that's
what you're interested in.

Right. I think I have been pretty clear about two computers.

Your "specific" is comparing oranges and apples.

not fruit, computers and programs. We don't all have the same
computers or the same approach to writing software. I am
trying to compare how you see this problem differently than
I.

Sure you can argue that nothing can ever be compared to
anything that is not exactly the same as the other thing.
And we can conclude from that that all comparisons in
the universe are equal by definition.

If two things have any differences no comparison is valid.
If you go to the store and there are two products that are
completely equivalent except for brand name and price
some people would say, well of course they are different
and so I compare how they are different, and see it
is only in price so I buy the one that is cheaper.

I wonder what someone would do if they were in that
situation and said to themselves well, these things
are not the same, they have a different price so I
must not compare one to the other. They are not
"exaclty" the same so it would be like comparing
apples to oranages.

They would appear to be trapped in a logical dilemma
of their own construction and would probably stand
there and starve unable to make a decision because
they were unable to make comparisons where the
two things were not absolutely and completely
identical. And since that isn't possible, they could
never make any decisions at all.

This whole thread smells of another Fox speciality; the strawman. I
should have known better.

I asked how big a problem it looked to you. You told me some
of how it looks like a big problem to you and that the size of
the message is what it is all about to you. I can work with
that. I can can compile the code in win32forth myself and
get a size number for your message.

But I suspect that if you use TCP that the size of the code
is going to be a much much smaller factor than the latency
of the protocol. So I doubt if the size of the string is as
big of a factor as you seem to think it is.

Thanks for the answers that gave.

.



Relevant Pages

  • Re: How do you do this?
    ... either user impersonation or some form of sandbox. ... I don't think that is what ANS says, but I will let you ANS folks ... arbitrary strings or code to execute. ... I thought that Win32Forth supported serial and didn't care if it was ...
    (comp.lang.forth)
  • Re: RfD: XCHAR wordset
    ... Win32Forth to automatically identify which parameters would be require ... malformed Unicode; to throw an error in all such cases. ... standard should be explicit about which Unicode processing standard it ... Function Call Interface), with extensions to identify string pointers, ...
    (comp.lang.forth)
  • Re: /STRING with negative n
    ... the character string. ... Positive values of n will exclude characters from ... Win32forth since Moses was a boy. ... I'm not quite sure what guard you're referring ...
    (comp.lang.forth)
  • Re: How do you do this?
    ... either user impersonation or some form of sandbox. ... I don't think that is what ANS says, but I will let you ANS folks ... I thought that Win32Forth supported serial and didn't care if it was ... could do SMTP and HTTP protocols and didn't care if the ...
    (comp.lang.forth)
  • Re: eof
    ... Anyone knows how to detect an EOF while reading from file? ... I'm using Win32Forth. ... Compare the file position to the size of the file. ...
    (comp.lang.forth)