Fouth on the cloud

41 views
Skip to first unread message

John Peters

unread,
Aug 6, 2019, 6:21:01 PM8/6/19
to 4th-co...@googlegroups.com, Dudley Ackerman, the.bee...@gmail.com
Robert Ackerman and I are working forth source code that will send an HTML file to chrome which then opens a window suitable for entering things like 2 2 + .  

That line of code gets sent back to forth for execution. The answer is then reported back In the chrome window.   4

Do you have any interest in this project? The idea is to bring forth onto the cloud where anyone who’s interested can play around with Forth without having to do a download.

We could use another viewpoint. 

The Python version works but very slow and and why the all forth Win32forth version only works half way. 

The source code is on GitHub. Complete instructions on how to find both versions and how to get the code will follow if you’re interested.

John Alan Peters owner 
Brookline Electric
415-239-5393 TEXT/cell

On Aug 6, 2019, at 1:43 PM, The Beez <the.bee...@gmail.com> wrote:

Hi 4tH-ers!

 
That's why you do things like this: uBasic has about 60 keywords and with every single token they are checked. So I applied my binary search patch. About 80 opcodes, clean replace, worked first time, 1.6 times faster (about 40% increase). BAM!

Hans Bezemer

--
You received this message because you are subscribed to the Google Groups "4tH-compiler" group.
To unsubscribe from this group and stop receiving emails from it, send an email to 4th-compiler...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/4th-compiler/8461e114-0dd5-4231-b193-51d7be0e097d%40googlegroups.com.

Ron K. Jeffries

unread,
Aug 8, 2019, 9:08:31 AM8/8/19
to 4th-co...@googlegroups.com
Cool idea. Please make it so.

John Peters

unread,
Aug 8, 2019, 11:50:47 AM8/8/19
to 4th-co...@googlegroups.com
Question – 

visualize the project working. 

How would it benefit you.

What would you use it for?

John Alan Peters owner 
415-239-5393 TEXT/cell

Ron K. Jeffries

unread,
Aug 8, 2019, 2:05:49 PM8/8/19
to 4th-co...@googlegroups.com
I have yet to make peace with any flavor of Forth. Something in the browser is appealing to me. I admire what Hans has created. I might use his .csv mangling tools. But just an interactive Forth with a decent UI would be appealing

thebeez

unread,
Aug 9, 2019, 5:42:17 AM8/9/19
to 4th-co...@googlegroups.com
On 2019-08-08 20:05, Ron K. Jeffries wrote:
>> Question –
>>
>> visualize the project working.
>>
>> How would it benefit you.
>>
>> What would you use it for?
I already use "Forths on the web" (the links I provided) to work out
small routines. Personally, I don't see myself working out entire
programs on the web. It's like 4tH on a tablet or a Nanonote. Yes, it
can be done, but it's not comfortable working. I lack an editor.

A prompt is (to me) very handy for testing, however, "forgetting" your
old code and then type the whole shebang one more time isn't my way of
doing things. That's one of the reasons I wrote 4tH - I liked the
language, but I wanted a conventional compiler, compiling conventional
text files (fast!) and pushing out conventional code.

I don't say there is one single way of working (I mean mine) or even
that there aren't better and more efficient ways of working - it's
simply the way I work and it works for me. It's like people telling me
"why you're still using a shell" - same reason.

So I can't honestly say, "hey, I would be developing on the web". Again,
as I responded:
- There already are Forths on the web;
- I would use Emscripten to compile an already existing Forth to a "web
forth".

You haven't given me more hints than "Forth on the web", so if there are
other properties to your solution I'd like to hear them!

Hans Bezemer

Timur

unread,
Aug 22, 2019, 2:36:14 PM8/22/19
to 4tH-compiler
Hi, my name is Timur.
Please forgive me if there are errors in the English language, since my native language is Russian.

I am not a professional programmer, however, I make programs for cnc machines.
I can tell you something about your question.

To receive a response from the Forth interpreter through the network, it is enough to install this interpreter on the server so that it accepts the incoming word stream.

The mediator for transferring words from the network to the input of the interpreter file can be the inetd program and many similar analogs (both for Linux and for Windows).

Thus, the inetd daemon (service) will listen on the specified port and forward the words to the interpreter.
The interpreter will think that these words are typed from the keyboard (although in reality the word flow will follow the network protocol).

https://en.wikipedia.org/wiki/Inetd
https://en.wikipedia.org/wiki/Xinetd


If you need to use the redirection scheme on the local computer, then I / O redirection commands are used for this.

https://en.wikipedia.org/wiki/Redirection_(computing)

I just did such a test.
I created a com.txt file that contains such content
'S "Hello" TYPE CR 1 2 +.
'(in quotation marks the contents of the file, a dot at the end is necessary and a space after the dot is also necessary, since the Forth system understands words when there is a space after the word, and a carriage return character is also needed at the end)

After that, I created a send.bat batch file with this content
wina.exe <com.txt
pause

And launched send.bat.

The response from the Forth interpreter was displayed on the screen.
D: \ 1> wina.exe 0 <com.txt

80386 ciforth 5.2
Hello
3 OK

I tried this test with 4th, but it was not successful, since apparently 4th.exe is a compiler.

I used ciforth 5.2, there is an implementation for windows and Linux.



http://home.hccnet.nl/a.w.m.van.der.horst/lina.html


I think this will help you.


пятница, 9 августа 2019 г., 12:42:17 UTC+3 пользователь Beestje написал:

The Beez

unread,
Aug 22, 2019, 3:26:44 PM8/22/19
to 4tH-compiler


On Thursday, August 22, 2019 at 8:36:14 PM UTC+2, Timur wrote:
I tried this test with 4th, but it was not successful, since apparently 4th.exe is a compiler.

It's kind of what it name implies ;-)

Hans Bezemer 
Reply all
Reply to author
Forward
0 new messages