Close

Pampered Bovids

A project log for Gigatron Forth

Attempting to implement Forth on the Gigatron

peterPeter 12/07/2019 at 11:592 Comments

Well it happened: I went down a yak-shaving rabbit hole.

The thinking went like this:

I actually shaved yaks 1 to 3. The git script was fun, and has proved useful, and taught me a lot. The Python 3 port is also nice - and is useful to the wider Gigatron project.

I spent a lot of time vacillating between the "compiler" and the asm.py changes, and worrying that both are a waste of time. On the one hand it's kinda stupid to fee guilty about wasting time when the whole project is just for fun; why not follow an impulse to write some code if I want to? On the other hand, I would actually like to complete this at some point!

I think a big problem for me right now is that I don't really know how hard it's going to be to get this finished without shaving the yaks, I don't know how much work these side-lines would be, and so I don't know how much benefit they'll provide. But if I push on without them and it turns out that they would have been useful, I have missed an opportunity to benefit from the effort.

For now I've put both projects to one side, and am trying to make progress on implementing more words. More on this in the next update. I think I might well come back to the instruction counting work soon, but I'm going to go without the stack operation optimiser. I think this may come back in the form of an inliner and peep-hole optimiser to convert words written in Forth to Gigatron code. I've had an itch to write a compiler for a year now, and this might be the opportunity to scratch it.

Discussions

Marcel van Kervinck wrote 12/24/2019 at 18:30 point

For almost 2 years I'm resisting the urge to add cycle counting support. But so far, my manual methods still work.

BTW: one trick to keep track of what's in X and Y is to use the "X/Y carbon copy mode" when storing something into zero-page: https://hackaday.io/project/20781-gigatron-ttl-microcomputer/log/60384-undefined-opcodes

  Are you sure? yes | no

Peter wrote 12/23/2019 at 22:26 point

Apologies for the dead links, I can't seem to prevent HaD from processing them.

  Are you sure? yes | no