PythonCard scriptlets
Kevin Altis on scripting applications written in PythonCard:
The entire object model of a PythonCard application is exposed, so if an app doesn’t have the feature you want, you can probably extend it with a short “macro” in Python. All scripts are run in the shell, so they share the shell namespace and thus scripts can share variables since the namespace doesn’t go away until the application is closed.
Kevin calls these scripts “scriptlets” and has posted an example scriptlet that can insert the current date and time straight in to any text file opened with the PythonCard codeEditor.
Sam Ruby was recently quoted as stating the following over on Jon Udell’s blog:
While Java and C# battle over who is the rightful successor to C++, it is quite possible that a language like Python (or, dare I say it, Ruby) will ultimately be the one that wins out.
This is an interesting train of thought. Scripting languages such as Python undeniably lead to faster development times (no compile cycle, less book keeping syntax to worry about) and as computers continue to get faster and cheaper the overhead associated with these languages becomes less and less important. Kevin’s concept of an application with an exposed object model that can be tweaked by the user is a powerful idea, and one that could bring real benefits; Python is not a difficult language to program in, and applications which can be scripted easily can become very popular (just look at the mIRC community for an example of that). Unfortunately the ability to script an application also leads to inherent security flaws, as have been seen with VBScript and Microsoft Office—although in the case of Office most of the problems stem from the ability to add macros to individual documents (there are surprisingly few mIRC security alerts despite the in built scripting engine).
More recent articles
- Weeknotes: Parquet in Datasette Lite, various talks, more LLM hacking - 4th June 2023
- It's infuriatingly hard to understand how closed models train on their input - 4th June 2023
- ChatGPT should include inline tips - 30th May 2023
- Lawyer cites fake cases invented by ChatGPT, judge is not amused - 27th May 2023
- llm, ttok and strip-tags - CLI tools for working with ChatGPT and other LLMs - 18th May 2023
- Delimiters won't save you from prompt injection - 11th May 2023
- Weeknotes: sqlite-utils 3.31, download-esm, Python in a sandbox - 10th May 2023
- Leaked Google document: "We Have No Moat, And Neither Does OpenAI" - 4th May 2023
- Midjourney 5.1 - 4th May 2023
- Prompt injection explained, with video, slides, and a transcript - 2nd May 2023