thomasokken / free42

Free42 : An HP-42S Calculator Simulator
https://thomasokken.com/free42/
GNU General Public License v2.0
286 stars 54 forks source link

Feature Request: command line support #16

Closed daitangio closed 3 years ago

daitangio commented 3 years ago

I am interested in a command line version, able to read & run program provided on standard input. Can you drive me for this extension/modification?

thomasokken commented 3 years ago

I agree that a command-line version would be useful, but I haven't yet managed to come up with a design for the user interface for one. I'd have to have a workable idea for this before I can even consider implementing it.

JensGrabner commented 3 years ago

I use these here: https://www.chiark.greenend.org.uk/~sgtatham/spigot/

thomasokken commented 3 years ago

The devil is in the details. Could you give some examples of what an interaction with a hypothetical command-line Free42 would actually look like? In interactive use, and invoked from a script?

daitangio commented 3 years ago

Let me give some ideas. We can provide a command line interface which works in this way:

  1. It reads on standard input an HP42S Program
  2. After a"END" is hit, it start executing the first program called "AUTOBOOT" if any. Otherwise proceed reading data. In this way you can read a set of programs which can call each other.
  3. Printing commands will provide output on standard output. We can consider also to output "VIEW" / "AVIEW" command but printing API is more precise and can also print out programs and so on

The (2) can be simplified to start executing at the end of the input the first program, but I'd like to provide a "straming" service if possible, to interact with a command line pipe. Limitations:

No graphics No sound

How it is difficult to create a interface of this kind? (By the way I am a bit rusty on C/C++ but I can try to provide some code help :) in form a small Pull Requests)