Dustym
Experienced Member
Is/was there a version of Python for the Model 1 ever available.
I've just been asked and I have no idea!!
I've just been asked and I have no idea!!
The other day I was going thought a shoebox of old CD's and found a folded cardboard like guide for "Shanghai", a Mahjongg type game. I did a deep search and could come up the matching CD. I then went online and found the game on some site and downloaded it to my XP gamer (32-bit). As the game was installing, there was a pop-up for a version of Python, which needed an okay, and evidently was part of the game's setup. So the install process continued and it ran as I remembered from long ago. First time I've ever encountered anything visible concerning Python. Hope your coffee didn't get cold reading this.There is nothing 80s in Python. Its development was throughout the 90s. The language that made an impact was Python 2, a 21st century language.
Python 2 does not run on 16 bit platforms.
More the reason to upgrade to TRS-OS and its guest operating systems TRSDOS 6 and soon to come a newer 24 bit version.Micropython does run on at least one 16-bit microcontroller. https://github.com/micropython/micropython/tree/master/ports/pic16bit I think even Micropython is too large for the Model I.
Built to take advantage of eZ80 24 bit addressing and can tear into micropython with power to spare.
I can't even begin to imagine what degree of "glacial" a Python for a 2 MHz 8080 would be.
Aren't most things here?Perhaps the question was merely trivia.
I think in some ways that's fair, but in other ways it's not fair: if you were to compare Python and C source from the same person, I think you'd find the Python code had less "wasted" characters because it doesn't have the braces; the C code would still have the indentation because otherwise the code wouldn't be readable. It'd still have the indentation, right??I think personally I mostly find the idea of using a language that depends on massively wasteful quantities of white space on a limited memory microcontroller mildly bemusing. Say what you will about BASIC, but if it’s a tokenizing interpreter you can at least pack it pretty tightly.
Python internally compiles to a bytecode that is then run on a bytecode virtual machine. You can precompile python code to a '.pyc' file that is quite a bit smaller than the '.py' source. See https://docs.python.org/3/library/py_compile.html for more information.Okay, I get that the difference is you don't need to install the C source onto your microcontroller, but with Python you most likely would because I don't think there's a standard way to do compilation (not that I've spent much time learning about that).
Thanks, I forgot about that. I was aware that they're used as a cache for imported modules, but this stackoverflow question explains how you can compile the main executable scripts too, and then run them via the interpreter. Unfortunately that has the small drawback that you now have to runPython internally compiles to a bytecode that is then run on a bytecode virtual machine. You can precompile python code to a '.pyc' file that is quite a bit smaller than the '.py' source. See https://docs.python.org/3/library/py_compile.html for more information.
python3 foo.pyc
instead of (if your file had a #!/usr/bin/env python3
or similar line) just ./foo.py
.I don't really know anything about Z80s and TRS-80s, but when I wanted an open-source interpreter I could extend that would run natively on Windows 3.1 (not just a DOS one) recently, I found that the Python interpreters available for that platform (all of which were Python 1.x) seemed to all be a bit too big and have dependencies I didn't want. I thought to myself: what small interpreted languages were popular back then? I figured Lisp and Forth (perhaps people here might have had some other/better answers, I'm not an expert there), and from hunting around I found XLISP-PLUS, and although its Windows 3.x support had been inadvertently broken in its most recent release, I fixed that (and one day I'll get around to posting that on GitHub hopefully!). I guess I had the benefit of having some previous knowledge of Lisp from using Emacs, but I think it's a nice, powerful language in its own right, and I'd be tempted to just try to add some modern niceties to it rather than try to change its syntax. Perhaps though it's a terrible language to use if you don't have an editor that helps you match up the parens?Lisp