6502.org Forum  Projects  Code  Documents  Tools  Forum
It is currently Sun Nov 24, 2024 6:22 pm

All times are UTC




Post new topic Reply to topic  [ 4 posts ] 
Author Message
PostPosted: Sun Jan 29, 2023 7:05 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
I found this an interesting adventure, albeit with a negative result. It might be that there are other nearby approaches which would have more successful - as it stands, it looks like a case of could be good in theory but didn't work out in practice.

Blog post, by own own Druzyek:
6507 Graphing Calculator: Forth Virtual Machine

Related forum thread:
6507 Calculator


Last edited by BigEd on Mon Jan 30, 2023 12:30 pm, edited 1 time in total.

Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 30, 2023 12:24 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
Thanks for posting. I'll read through it and the thread today.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 30, 2023 5:38 pm 
Offline

Joined: Wed Jan 08, 2014 3:31 pm
Posts: 578
OK, I read through that page on his site, as well as his optimizing assembler. I previously read through his calculator thread on this forum. There are a lot of good ideas on his site to borrow, and my thoughts in no particular order.

I admire his ingenuity and industriousness.

A token threaded Forth to save space in exchange for speed was good thinking.

Using the BRK instruction and handler to start Forth execution is a smart idea.

I am not surprised that Forth is slower than C or assembly. When I wrote my Brainf*** interpreter and reworked it into subroutine threaded code, the compiled version that Phil Dennis wrote blew it away. But there was a code expansion with each version.

All that work only to have it not work made me a bit sad.

His optimizing assembler is impressive.


Top
 Profile  
Reply with quote  
PostPosted: Mon Jan 30, 2023 8:28 pm 
Offline
User avatar

Joined: Thu Dec 11, 2008 1:28 pm
Posts: 10986
Location: England
Yes, it's a pity it's a negative result (for now anyway.)

(I'll try to summarise my understanding of the story...) The challenge, I think, is to squeeze the desired calculator functionality into 8k - assembly code comes out too big. So, by adding a Forth VM (or any other tokenised execution engine) one incurs the cost of the engine, but gets the benefit of better density from that part of the code which can be interpreted. A more complex VM will soak up more functionality into fewer tokens, but the VM will be larger. Quite a complex optimisation problem!

One thing I find interesting here, is that I usually see tradeoffs of speed for memory as being a question of adding speed by spending memory. But here we're trying to save memory, and paying in speed.


Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 4 posts ] 

All times are UTC


Who is online

Users browsing this forum: No registered users and 4 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to: