10

I'd like to create my custom front-end for Mathematica. I know there's a console interface (launched as math), which mostly works great, but it can't really provide functionality of e.g. interactive (rotatable) Plot3D or Manipulate, although one can show 2D plots with JavaGraphics package.

Is there an official way of interacting with the kernel so as to be able to show the manipulator, 2D/3D plots etc. and provide the user feedback to the kernel, getting back updated results?

Karsten7
  • 27,448
  • 5
  • 73
  • 134
Ruslan
  • 7,152
  • 1
  • 23
  • 52
  • 2
    Yes. The kernel communicates with the front end through MathLink. See chapter 2 of the old MathLink tutorial, as well as the MathLink (now WSTP) reference in the documentation. – Szabolcs Apr 01 '17 at 19:10
  • 1
    If you want to use Java instead of C, J/Link comes with an simple example front end, see MathSessionPane http://reference.wolfram.com/language/JLink/tutorial/Overview.html under "Some Special User Interface Classes". – Szabolcs Apr 01 '17 at 19:11
  • @Szabolcs is it not an answer? – Ruslan Apr 01 '17 at 20:11
  • I felt that a proper answer should give more references, including a link to an example front end. I am sure that there is one out there. I thought mash worked like this, but it doesn't seem to be the case. – Szabolcs Apr 01 '17 at 20:15
  • @Szabolcs I see the MathLink tutorial you linked to mentions frontend.c on MathSource. – Ruslan Apr 01 '17 at 20:17
  • It seems that file is very hard to find though... – Ruslan Apr 01 '17 at 21:29
  • 1
    Maybe here? http://library.wolfram.com/infocenter/Demos/174/ – Szabolcs Apr 01 '17 at 22:23
  • Using webMathematica with a local server could be another option. – Karsten7 Apr 01 '17 at 23:34
  • 1
    This is a project that tries to make Mathematica available through a Jupyter notebook as a front-end. Based on this comment, dynamic objects aren't supported currently, though. – Karsten7 Apr 02 '17 at 03:10
  • 1
    I did not read your question carefully. Getting Dynamic stuff to work (including Manipulate) would require a lot of work, and implementing undocumented interfaces. I do not think that it is a reasonable project to attempt. Just showing text and graphics is another matter. That is entirely doable. – Szabolcs Apr 02 '17 at 18:12
  • Also the Wolfram Cloud products can be viewed as JavaScript based front-ends that are rendered in your browser and connect to a Mathematica installation running on a server. From what I have seen, it looks like React is used for the dynamic things. In principle the same code could be used to create a desktop app. – Karsten7 Apr 03 '17 at 19:04
  • 3
    Apropos what Karsten just said, this answer of mine shows how to set up an HTTP server in Java that could take input from the browser and forward it to Mathematica, in case you want to build the frontend in HTML/JavaScript. – C. E. Apr 03 '17 at 19:42

1 Answers1

3

Now there are 2 ways AFAIK.

  1. https://jerryi.github.io/wljs-docs/ amazing work.

  2. A much more rudimentary solution, not a "front end", but meets your need.

Is there an official way of interacting with the kernel so as to be able to show the manipulator, 2D/3D plots etc.

use wolfram player. And a simple vscode plugin.

Manipulate[
    Plot3D[x + y a,{x,0,5},{y,0,5}],{a,0,5}
]

enter image description here

https://github.com/asukaminato0721/mmaplayer

Which will almost 100% be like origin mathematica style.

AsukaMinato
  • 9,758
  • 1
  • 14
  • 40