3
$\begingroup$

Is is possible to have an autocomplete feature in the CLI of Wolfram Language kernel?

I use the Raspberry Pi edition.

$\endgroup$
  • $\begingroup$ You don't have to accept my answer just yet. If you manage to compile JMath and you find that it works well, why not post an answer and explain how you did it? People will find it useful. I do not have the time to put my RPi into working order at this moment, so I cannot try. $\endgroup$ – Szabolcs Sep 1 '16 at 18:10
  • $\begingroup$ @Szabolcs That would be a very interesting thing to do, however I haven't got enough time for tinkering with JMath at the moment :smile:. This is why I accepted your answer as soon as I read that I cannot have auto-completion in vanilla wolfram. $\endgroup$ – Mateusz Piotrowski Sep 1 '16 at 18:19
4
$\begingroup$

No, the standard command line interface doesn't support auto-completion. Mathematica is really meant to be used with the notebook interface, and I do not recommend the command line except if it is really necessary.

If you are using a Raspberry Pi, then I agree that it is indeed really necessary. On an RPi 1 I find the front end unusably slow.

So you might try JMath, an alternative command line based front end which claims to provide auto-completion. I have never used it and I do not know if it works well. I also do not know if it still works with Mathematica 10 and 11, but there's a good chance that it would only need minor modifications.

Here are some hints on compiling it with recent Mathematica versions on Linux (I haven't actually tried this!):

  • Use -DMLINTERFACE=3 and link with -lML32i3. The key is i3. The 32 stands for 32-bit, which I think should be the case on the Raspberry Pi. This is necessary because the MathLink API is now at "interface version 4" ("i4", the default), but JMath may require "interface version 3" ("i3"). You may need to use gcc instead of the mcc tool which automates some things such as linking and may force -lML32i4 instead ... (not sure)

  • It may be necessary to link to -luuid (wasn't needed with older versions)

  • If you read the documentation on this, you'll find that MathLink is now renamed to WSTP and all function names changed from the old ML prefix to the new WS one. Do not worry about this, as Mathematica still ships with the ML-prefixed libraries as well as the new WS-prefixed one. There's no functional difference between the two and you do not need to be concerned with the WS ones.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.