~sforman

Igo, California

https://sforman.srht.site/

Weirdo, computer nerd, aspiring ecosystem co-creator, I've lead a strange and unlikely life. I dropped out of highschool and was homeless for several years. During that time I learned Reiki, and how to operate and program Linux computers. I decided to get a job as a programmer, so I created a project and presented it at CodeCon 2004. That led to a career as a computer programmer. I worked at several startups (including Etsy) and eventually as a TVC at the Google campus in Mountain View. Since then I have been semi-retired, and I've turned my attention to my other passion: gardening and ecology.

Trackers

~sforman/python-oberon

Last active 6 months ago

~sforman/thun-der

Last active 9 months ago

~sforman/FlowKarmaLive

Last active 9 months ago

~sforman/Xerblin

Last active 10 months ago

~sforman/Ghm

Last active 1 year, 2 months ago

~sforman/ronrhea

Last active 1 year, 8 months ago

~sforman/MagnusMotive

Last active 2 years ago

~sforman/SpaceGame

Last active 4 years ago

~sforman/lilbox

Last active 4 years ago

#35 Rewrite docs to reflect UI changes a month ago

Comment by ~sforman on ~sforman/Xerblin

In the user guide it says, "You can edit the thun.config file to change these." but it doesn't explain where that file is, nor that you have to restart Xerblin for changes to it to take effect., Etc.. Fix it.

#7 It doesn't work. 6 months ago

Comment by ~sforman on ~sforman/python-oberon

#8 That one bug... 6 months ago

Comment by ~sforman on ~sforman/python-oberon

I set the pai command just before the ( command and just traced execution in the IDE until I saw something fishy.

#8 That one bug... 6 months ago

Comment by ~sforman on ~sforman/python-oberon

REPORTED RESOLVED FIXED

#8 That one bug... 6 months ago

Comment by ~sforman on ~sforman/python-oberon

It seems that equality is failing here: https://git.sr.ht/~sforman/PythonOberon/tree/456864dd2a7ad635b31b5e100e1c61def2cab2d5/item/forth/oberonforth.py#L367

In the emulator IDE I can see that the Z flag is set but after the above instruction the R0 register is zero!

#8 That one bug... 6 months ago

Ticket created by ~sforman on ~sforman/python-oberon

So I reviewed the code to get back up to speed. It turns out it was more like a year and a half since I last worked on this (sub-)project.

The problem is that I have a simple Forth binary & code that works correctly on the C emulator but not on my Python emulator.

This should be an ideal test case for the PythonOberon project, as the only reason to use such a slow language/emu is for ease of debugging. (I'm more familiar with Python than any other language, and it's well-suited to this sort of thing (Rapid Application Development (RAD) 'member that?).)

What I would really like is a tool that runs the same binary & serial input in lockstep on both the C and Python emus at the same time and stops as soon as they diverge. That would make it trivial to locate the defective instruction in my emu (I am assuming that that has to be the problem: I fucked up one of the implementations of the CPU instructions.)

Unfortunately I don't want to mess around with C enough to do that. Back in the day, sure, but now it's a huge PITA.

The problem manifests somewhere in the processing of the Forth code, which is in three stages: first the flow-control Forth words are defined, then immediately they are used to define the '(' comment word (which counts '(' and ')' so that the programmer can write comments with nested parentheses in them. (Woo!) Once the flow-control and comment words are defined they are immediately used for a comment. After that the next call to the Hi word fails to write to the screen. :(

I think what I want to do is somehow stop the emu after the control-flow and comment words have been defined and just before the comment word is used. I have a breakpoint set at the end of the pai word (that copies the font data to the screen for display), so I guess the way to proceed is to put the pai call just before the comment...

It would be lovely to have a little tool that can examine RAM and write out the Forth dictionary structure to a file or something.

#7 It doesn't work. 6 months ago

Comment by ~sforman on ~sforman/python-oberon

It's because there's no subcommand, so the subparser never adds the default attr. Running with emulate allows it to proceed:

PythonOberon$ python -m oberon emulate
/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/__main__.py:26: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import resource_filename
Unable to import pygame.
('Using disk image file', '/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/disk.img')
0
LEDs 10000000
LEDs 10000010
10000
20000
30000
40000
50000
60000

#7 It doesn't work. 6 months ago

Ticket created by ~sforman on ~sforman/python-oberon

I tried to run the CLI command from the README and "It doesn't work."

PythonOberon$ python -i -m oberon
/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/__main__.py:26: DeprecationWarning: pkg_resources is deprecated as an API. See https://setuptools.pypa.io/en/latest/pkg_resources.html
  from pkg_resources import resource_filename
Unable to import pygame.
Traceback (most recent call last):
  File "/usr/lib/python3.10/runpy.py", line 196, in _run_module_as_main
    return _run_code(code, main_globals, None,
  File "/usr/lib/python3.10/runpy.py", line 86, in _run_code
    exec(code, run_globals)
  File "/home/spf/Desktop/bock/sforman/src/PythonOberon/oberon/__main__.py", line 99, in <module>
    print(('Using disk image file', args.disk_image.name))
AttributeError: 'Namespace' object has no attribute 'disk_image'
>>> 

There are at least three things wrong here:

1 DeprecationWarning: pkg_resources

I'm annoyed by what I see as the hijinx of Python's deploy story these days (PyPA is out of Brazil IMO) but that's neither here nor there. In any event, I gotta stop using resource_filename.

2 Unable to import pygame.

I thought I had it install? Easy fix.

3 AttributeError: 'Namespace' object has no attribute 'disk_image'

I'm guessing that's because I didn't put a 'disk_image' in the Namespace? args.disk_image.name suggests that this is a CLI option that is now required.

#6 A simple 8x13 pixel font. 6 months ago

Comment by ~sforman on ~sforman/python-oberon

REPORTED RESOLVED IMPLEMENTED

#33 Use "linenoise" to give C interpreter editing and history. 8 months ago

Comment by ~sforman on ~sforman/thun-der

REPORTED RESOLVED IMPLEMENTED