📜 ⬆️ ⬇️

Fine (about language interaction)

Our project we write with the Indians.

I asked for a common architecture as a project architect — Java, Spring, etc.
But in those areas in which they had to write, they themselves decided what and how it would be.
And they are used to doing everything in C / C ++.

As a result, such a monster was born:
')
Our program has a command line client.
He works with commands and scripts on Tcl (because clients are so used to).
The native Tcl Interpreter (and not JTcl) is used (because our Indians decided this).
Commands are implemented in Java, but some commands refer to C ++ code (legacy code)
However, the system of error and warning messages is implemented in Java.
Hindus wrote using JNI, and I did a Java connection with C on JNA

How does the work of the command typed in the command line look like?

Java command line (jline) reads a line
calls C (to call TCL Interpreter) via JNI
TCL processes a string, executes if it is its command or
Call C (if the command is implemented by us) to call Java
C calls Java via JNI
Execute java command if need be
Calls C through JNI, if there is a warning about invalid data, it
Call Java via JNA

Now the code from the Indians was transferred to us and in the next version we will replace Tcl with JTcl (which is in the system and it works)

Source: https://habr.com/ru/post/143970/


All Articles