6

Does any Python port run on any Speccies or Commodores? I am hopeful about QL, since:

Based on a Motorola 68008 processor clocked at 7.5 MHz, the QL included 128 KB of RAM, which was officially expandable to 640 KB and in practice, 896 KB. Memory: 128 KB (896 KB max.)

That's plentiful and there's MicroPython.

Yet it is compact enough to fit and run within just 256k of code space and 16k of RAM.

But a fully expanded QL could even run JS code, I believe.

8
  • 8
    But to truly be retro shouldn't you run Forth instead?
    – Jon Custer
    Feb 8, 2022 at 14:45
  • 2
    I created a MicroPython port to run on a Tube-interface connected ARM CPU (actually, RPi Zero) for the BBC Micro a couple years ago. It seemed promising.
    – Brian H
    Feb 8, 2022 at 15:37
  • 2
    @user1095108 I doubt that you can write a web server in a few lines in a Python implementation running on such limited hardware. You need to distinguish the language Python and the seemingly omnipresent libraries. Feb 9, 2022 at 9:04
  • 2
    The problem is that the libraries you think of will not fit into the limited resources, depending on the expectations. A library for a super simple server providing a handful of HTML-only files and some images might work. People have done this, even not in Python. Anyway, someone needs to write or incorporate the hardware drivers to access the specific network hardware. This is a far from simple task. -- I'm afraid that you never tackled such a task and therefore you are kind of blinded by the simplicity of Python on modern desktops. Feb 10, 2022 at 7:01
  • 2
    Sure. And where are the Python libraries that know how to access them? Or at least Python wrappers for the existing drivers? -- Oh, and I did not say that it is impossible. It is just hard. Feb 10, 2022 at 15:04

2 Answers 2

15

Python 2.4 runs on 68000 Commodore Amigas.

The actual port relies on a Unix emulation library called ixemul. This should allow it to run equally well with accelerated Amigas (68020/68030/68040/68060).

12
  • Neat - almost a reason to pull out an Amiga.
    – Raffzahn
    Feb 8, 2022 at 15:43
  • 2
  • 7
    @BruceAbbott the article itself is bad and sounds like a personal rant. Python is good for many purposes and won't fit for everything. C#, Java, Basic and Matlab languages are also good for many purposes but not fit for everything. They are all just for different use cases and purposes - you would not move a piano with a bicycle or use a long haul truck as a taxi either.
    – Justme
    Feb 9, 2022 at 10:29
  • 1
    @Tommy ixemul docs say: "The library itself needs about 200 Kb, but if you want to do some useful work, such as compiling programs (with gcc), I advise at least 4 Mb." So, maybe, MicroPython as smaller, cleaner, newer, more portable option...
    – Brian H
    Feb 10, 2022 at 16:23
  • 1
    @Tommy "Would the Amiga port run in the QL's limit of 896kb?" - No. Python 2.4 takes 2MB to run a trivial script. Feb 12, 2022 at 3:15
10

Python, and even MicroPython, needs a modern C compiler to target the host processor. Such a thing does not exist for the Z80 or 6502. Sure, there are C compilers for those processors, just not ones that have the language features that MicroPython needs.

This is a fairly common trope on the MicroPython forum: someone shows up, says "I'm going to port MicroPython to the (insert name of 8-bit computer)!", posts a couple of times, fails to find a decent C compiler, and is never heard from again.

Even Snek - the smaller Python than MicroPython - relies on avrgcc to target 8-bit micro-controllers.

Another reason is that - while MicroPython might appear to run in tiny amounts of memory - it usually needs substantial flash/ROM (> 128 K) and at least 32 K of contiguous RAM. Most home computers didn't have that.

6
  • 1
    Great point - the curse of a time when the art of porting is reduced to recompile an existing source with the always same (existing) tool set, but noone able to adapt the tools.
    – Raffzahn
    Feb 10, 2022 at 3:19
  • Yes, a great point, but not a sufficient one. clang has (unfinished) backends targeting z80 and 6502. I have no idea why none of these were ever finished. Feb 10, 2022 at 4:16
  • 3
    @user1095108 It might well be that the few souls being capable of doing this don't have time to do so or have too many other things with higher priority on their to-do list. Go ahead, be the first to contribute! Feb 10, 2022 at 7:19
  • just a few souls? Our ancestors ate mammoths for lunch. Feb 10, 2022 at 17:58
  • 1
    an entirely sufficient one, @user1095108: no toolchain, no python. There's been well thrashed-out discussion here why making good compilers for Z80/6502 is extremely hard: I won't revisit it.
    – scruss
    Feb 10, 2022 at 23:58

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .