Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add readline support to HPC-GAP #467

Open
ssiccha opened this issue Jan 15, 2016 · 5 comments
Open

Add readline support to HPC-GAP #467

ssiccha opened this issue Jan 15, 2016 · 5 comments
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: HPC-GAP Issues and PRs related to HPC-GAP

Comments

@ssiccha
Copy link
Contributor

ssiccha commented Jan 15, 2016

I installed HPC-GAP on two of my machines that have readline installed. On both machines GAP is using readline without any problems, but my HPC-GAP builds can't.

The path to the library is just /lib/libreadline.so.6.

@fingolfin fingolfin added the topic: HPC-GAP Issues and PRs related to HPC-GAP label Jan 15, 2016
@fingolfin
Copy link
Member

This is a known issue, HPC-GAP currently does not have readline support, for technical reasons

@ssiccha
Copy link
Contributor Author

ssiccha commented Jan 15, 2016

Okay thanks. I thought I heard somewhere that it already supports readline. My mistake.

@ssiccha ssiccha closed this as completed Jan 15, 2016
@fingolfin fingolfin reopened this Jan 15, 2016
@fingolfin
Copy link
Member

No need to apologize, you couldn't have known this -- and in fact I am reopening this issue, as I think it's good to document this issue this way.

@fingolfin fingolfin changed the title readline support for HPC-GAP HPC-GAP is missing readline support Jan 15, 2016
@fingolfin
Copy link
Member

See also issue #39

@rbehrends
Copy link
Contributor

There are currently two practical issues that are getting in the way.

  1. The easier, but still slightly tedious issue, is that of configuring readline. Autoconf normally grabs the information off the ./configure argument and then writes the necessary entries in config.h and Makefile. Here, scons will need to replicate figuring out the -L and -I options in a way that mirrors what autoconf does (so that the two don't disagree and we suddenly have readline enabled in config.h, but don't actually provide the include path or link in the library. This still shouldn't be too painful, outside of obscure configurations (and even then we can default to no to make sure that the default build doesn't break).
  2. Internally, both GAP's line editor and readline have the problem that they aren't designed for HPC-GAP's use case, where the editor constantly runs in the foreground, while output is being generated and prompts may change spontaneously (remember, there is only one readline instance serving multiple threads that is even alive when the main thread is busy computing something); in general, most commandline editing facilities were designed for a sequential world. The prompt changes are easy to address in principle, and so is output that always comes in complete lines (you'll change the prompt if necessary and force a redraw). This still requires a fair amount of busywork, but is not impossible. The biggest problem is the output of partial lines, which requires more control over the terminal than we currently have and which may be difficult to reconcile with either line editor (or somebody could jump through the necessary hoops to implement it). A possible work around is to suppress the output of partial lines and add a notification symbol to the prompt when that happens. Such a notification as part of the prompt could also show information about output being available in other threads (the lack of such a notification is an ongoing source of confusion for users).

An alternative would be to not try and build a line editor into HPC-GAP (other than as a basic fallback version), but to create a smart protocol for a frontend (based on the current multi-threaded UI) that can interact with an external editor (for example, GAP could fork itself and exec such an editor if it is run in an interactive fashion/with the proper command line option). It so happens that lib/consoleui.g already has the necessary functionality, but would have to send/receive messages that could be parsed across pipes instead. This would also facilitate the use of more advanced frontends (including GUIs).

@fingolfin fingolfin added the kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements label Jun 22, 2017
@fingolfin fingolfin changed the title HPC-GAP is missing readline support Add readline support to HPC-GAP Jun 22, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind: enhancement Label for issues suggesting enhancements; and for pull requests implementing enhancements topic: HPC-GAP Issues and PRs related to HPC-GAP
Projects
None yet
Development

No branches or pull requests

3 participants