Why Garbage Collectors Should Avoid the Use of Reference Counts

I made a comment in one my posts some time ago that I thought SPITBOL was superior to Python in that it contains a compacting mark-sweep garbage collector with recognition of sediments.

Python uses reference counts to detect unreachable memory. SPITBOL was written in the 1960’s, so the use of compacting garbage collectors was a well known technology when Python was created in the 1980’s.

For example, I one wrote a small Python program that ran in quadratic time due to the use of reference counts.

A user commented that they thought this was a snide remark, and that the use of reference counts was perfectly fine.

I just downloaded Remarkable, a markdown editor and viewer, written in Python.

I just used it to process a markdown format file, and got the following error message:

 

java version "1.7.0_121"
OpenJDK Runtime Environment (IcedTea 2.6.8) (7u121-2.6.8-1ubuntu0.14.04.3)
OpenJDK 64-Bit Server VM (build 24.121-b00, mixed mode)
/usr/lib/python3/dist-packages/remarkable/__init__.py:53:
 Warning: g_object_ref: assertion 'object->ref_count > 0' failed
  Gtk.main()
/usr/lib/python3/dist-packages/remarkable/__init__.py:53:
 Warning: g_object_unref: assertion 'object->ref_count > 0' failed
  Gtk.main()
*Spellchecking not enabled.
*To enable spellchecking install pygtkspellcheck
*https://pypi.python.org/pypi/pygtkspellcheck/

 

 

 

As a young child one of my favorite comic strips was Snuffy Smith.

 

Snuffy often ended a conversation by saying, “‘Nuff Said.'”

Well, this is for the snide commenter:

‘NUFF SAID.

 

 

 

I

 

 

All the Computer You Need, for Under $240

I am writing this on a computer I got for under $240. It’s an Acer Chromebook 14 (CB3-431). I paid $220 to Newegg for a refurbished model, and $20 for an extra year of warranty coverage.

By the way, the Wirecutter speaks highly of Acer Chromebooks, saying they are the best budget models.

I am also writing this post using Xubuntu Xfce. This is thanks to the program Crouton from Google. It lets you run Linux as a tab in the Chrome browser, so you can easily drop from ordinary Chrome mode into Linux, and back! It is a brilliant use of Linux’s “chroot” capability.

I find this magical. If not magical, it’s certainly cheap.

I do all my coding on Linux and publish it via Github, so I don’t need much local storage.

A couple of years ago I paid about $1300 for a Google Chromebook Pixel LS (Ludicrous Speed). I just sold it for about a $1000 on ebay. I think I got more than I expected because Google recently announced they won’t be making any more Chromebooks with the word Google in the name. (I think this to protect the brand association of Chrome with Google’s phones.)

What I definitely find magical is that when I got the Pixel LS, I got three years free use of 1 terabyte of storage for Google Drive. I took advantage of this by uploading ALL of Mozart’s music from a set of 120 CD’s I got a few years back.

I use the Clementine music player on Linux. I just opened it up, and noticed that I can connect to my Mozart music on Google Drive.

Open Source is wonderful. It provides a way for we programmers to take care of each other, from operating system kernels to compilers to browser tabs to Mozart.

And all for free.

Enjoy!

On Porting SPITBOL to the Raspberry Pi

In a recent e-mail Craig Wright asked:

Finally, I am thinking of attempting to port your Spitbol implementation so that it can be run on a Raspberry Pi 3. I assume there would be significant effort required. I would like your thoughts on this?

After resonding to Craig, I realized others might be interested, so here is what I said.

Craig,

Thanks for the man page! I just checked it into spitbol/x32 and spitbol/x64

Re OSX, the latest is at github/spitbol/x64.

I’ll look at the problem with underline you mentioned.

Re port to PI 3.

Native port would be a lot of work.

Quick workaround would be use to use a DOS emulator to run the Windows version (spitbol/windows-nt) on the PI. A quick search for ‘run dos on PI ‘ turned up, for example

Run DOS on the Raspberry Pi – Use rpix86 to turn your Pi into a 1980s super-computer.

By the way, the Windows version is the same as the Unix version, except its only 32-bit, while we have 32 and 54 bit versions for x86-64. It also has some other features such as graphics support, ability to load assembly language functions, ability to load modules, that have yet to be ported to any other version.
Only problem is that it has upper case as the default, while Unix version uses lower case as the default.

I think the next step would be to port gobol to the PI and complete the port.

Gobol, github.com/daveshields/gobol, is a prototype with a MINIMAL interpreter written in Go.

The next step would be to flesh out the OSINT (OS interface) part of SPITBOL with one written in Go.

The current one is written in C. It was great stuff when it was put together in the 80’s, but I now find it a bit crufty, since it shows the wear and tear of having been adapted so it can be compiled on five or so different architectures (ancient MAC, Solaris, MIPS, Windows, …)

Once we have an OSINT written in GO, we would have a great teaching tool. By the way, the Go OSINT needn’t have all the capabilities of the C version, at least not at the start. Not much is needed to get simple file i/o, time, date, and such up and running.

SPITBOL for teaching is to me the main point. If people want performance they can always use the Windows or UNIX (Linux, OSX) versions.

Given OSINT in Go, then could then attempt translator to direct ARM code, getting rid of the Minimal interpreter written in go.

Note that the version with interpreter and OSINT both in Go could be ported anywhere Go runs, and that seems to be almost everywhere these days.

Thanks again for you interest in, and help on, SPITBOL

dave

SPITBOL Man page now available

Craig Wright kindly submitted a Unix manual page, spitbol.1, that I have just added to the x32 and x64 repositories at http://github.com/spitbol.

Thanks Craig!

Using VirtualBox to Run SPITBOL on OSX

I just resumed work on maintaining SPITBOL since the release of the OSX version in June 2015.

Turns out that was more than enough time for Apple to change the basic C-compiler/library tool chain so SPITBOL can no longer be built.

Though I will try to fix this as time permits, in the interim I suggest OSX users try VirtualBox, which supports running Linux on OSX. For example, I was able to install Linux Mint, my preferred Linux distort, on OSX in a short time, with no glitches. I was also able to compile the latest version of SPITBOL with fixes for DATE() and the elapsed time function (systm.c)

 

PS: I also tried Parallels Desktop for Mac. It works, but offers only limited graphics resolution for OSX. VirtualBox does a much better job, and it is free, while Parallels Desktop isn’t.

 

 

 

FRIBBLE wins two games against expert player

I just used the FRIBBLE program to play two games of words with friends against an expert player, my friend Phil.

Fribble won one by a score of 428 to 381, the other by one point, 477 to 476.

That FRIBBLE was able to score more than 400 points in each game is also good news.

Can you tell which moves were made by Fribble, and which were not?

FRIBBLE, a SPITBOL program to play word games such as Word With Friends, now available

The FRIBBLE project is pleased to announce its first release V17.1.30, available at Fribble Project.

FRIBBLE is written in SPITBOL, and uses a brute-force approach, trying all possible moves, to play WWWF.

Fribble can be run in three ways: to play against itself, to play against you, or to help you play a game with a foe, with Fribble finding your moves.

The code speaks for itself. Speaking for my self, I can say that I have never had more fun writing a program than I have had writing FRIBBLE.

FRIBBLE is also my first program inspired by an election.

I was an obsessive follower of the recent presidential election, spending more time than I care to admit on Twitter, reading blogs, listening to podcasts, and so on.

After the election, looking for a more productive and entertaining form of amusement, I started playing Words With Friends, an online version of Scrabble. My foe was a fellow IBMer and friend who said he was quite good at WWF.

Indeed he is. We have played many games and I have yet to beat him. Often his score is 50% higher than mine.

Soon after I realized I was unlikely to ever win a game against him, I though of using my programming skills to see if I would write a program that could play WWF.

Fribble, representing just over two months of the most fun I have yet had writing a program, is the realization of that goal.

What has made the writing of Fribble such fun is the realization that it is as close to an ideal demonstration of SPITBOL as I have yet seen. Everyone knows about games such as Scrabble and WWF, and dealing with strings, words, lines of text, dictionaries, and all that such games involve, is the perfect grist for SPITBOL’s mill.

Though the program is largely done, I plan to continue work on it by using it as a way to teach SPITBOL as a first, or at least early, programming language.

Dave

SPITBOL Featured in “This 70-Year-Old Programmer Is Preserving an Ancient Coding Language on GitHub”

Jordan Pearson has written an article for Vice’s Motherboard site about my work on SPITBOL:
“This 70-Year-Old Programmer Is Preserving an Ancient Coding Language on GitHub”

It makes reference to an article about SPITBOL that appeared on Hacker News a couple of weeks ago: Hacker News.

  • Pages

  • July 2017
    M T W T F S S
    « Apr    
     12
    3456789
    10111213141516
    17181920212223
    24252627282930
    31  
  • RSS The Wayward Word Press

  • Recent Comments

    mrrdev on On being the maintainer, sole…
    daveshields on On being the maintainer, sole…
    James Murray on On being the maintainer, sole…
    russurquhart1 on SPITBOL for OSX is now av…
    dave porter on On being the maintainer, sole…
  • Archives

  • Blog Stats

  • Top Posts

  • Top Rated

  • Recent Posts

  • Archives

  • Top Rated