How grzegorzmazur/yacas works
Main Components
• Core Computation Engine:
• The core is implemented in modules such as the “libyacas” (cyacas/libyacas) that contains the basic data types, the symbolic manipulation functions, the infix parser, and other core routines.
• Multi-precision support is provided by “libyacas_mp.”
• The “yacas” and “yacas-kernel” directories likely include the main engine code for command-line processing, function evaluation, and rule-based symbolic computations.
• Interpreter & Parser:
• Components like the “infixparser”, “lispparser”, and associated evaluation modules appear in the source directories.
• These components translate user input (via command-line or scripts) into operations for the core engine.
• User Interfaces:
• Yacas supports a GUI front end visible in “yacas-gui” which integrates with the core engine.
• The command-line interface is part of the “yacas” component (as seen by files dealing with various command-line handling).
• There is a “jyacas” module providing Java binding and potentially additional interoperability.
• “xeus-yacas” likely provides integration with interactive computing environments, such as Jupyter.
• Scripting and Built-in Functions:
• The “scripts” directory provides numerous example scripts and domain-specific files (.ys and corresponding definitions) that show how the CAS language can be extended.
• Documentation, Tests, and Packaging:
• The “docs” directory contains detailed reference manuals, tutorials, and developer guides.
• The “tests” directory contains a suite of automated tests verifying core functionality.
• Packaging subdirectories (deb, rpm, flatpak, etc.) indicate how the software is built and deployed across platforms.
Relationships and Interactions
• The User Interfaces (GUI, command-line, Java, Jupyter integration) serve as the front ends. They capture user requests and pass them to the interpreter.
• The Interpreter processes user commands using the parser(s) to convert text input into a symbolic representation.
• The Core Engine (libyacas and its related modules) then performs symbolic evaluation, applying user-defined as well as built-in mathematical rules.
• For advanced numerical work, the multi-precision module augments the core’s capabilities.
• Scripting components allow for complex computations and are directly interpreted by the engine.
• Testing, packaging, and documentation components are auxiliary but critical for validation and distribution.
Architectural Patterns and Principles
• Modularity: The project is clearly divided into smaller submodules (e.g., different libraries for core and multi-precision arithmetic, separate UI implementations) that encapsulate specific responsibilities.
• Separation of Concerns: The computational engine, interpreter, and UI layers are clearly separated. This makes the system easier to extend (e.g., by adding a new front end) and maintain.
• Extensibility: The presence of script-based user functions and a well-documented API indicate that the architecture facilitates user modifications and extensions.
Relevant Technologies and Frameworks
• Core language is C++ (with extensive use of CMake for building).
• Java-based interface is provided in the “jyacas” component.
• GUI likely uses Qt (as indicated by CMakeLists and qrc files) and further JavaScript libraries (e.g., CodeMirror, MathJax) for interacting with web-based or hybrid components.
• Testing and continuous integration tools are referenced (like Appveyor, Codecov, and Codacy).
Elements
• Clear labels for each major component:
• "User Interfaces": Command Line, GUI (yacas-gui), Java Binding (jyacas), Jupyter Integration (xeus-yacas)
• "Interpreter/Parser": Infix Parser, Lisp Parser modules
• "Core Engine": libyacas, yacas, yacas-kernel
• "Multi-Precision Module": libyacas_mp
• "Scripting & Function Libraries": scripts directory modules, which also serve as examples and functional enhancements
• "Testing & Packaging": tests, packaging directories, and docs
• From UI layers to the Interpreter
• From Interpreter to Core Engine
• Feedback flow or error reporting back to UI layers
• Annotations for dependency/integration:
• Demonstrate how the GUI interacts with the kernel (possibly via a server or a direct library call).
• Integration points for external libraries (e.g., third_party vis, MathJax for visualization).
• For instance, use rectangles for core modules, ellipses for interfaces, and clouds for external or third-party dependencies.
• Build and deployment pipelines:
• An additional “Build/Packaging” component (CMake, scripts, test suites) that prepares the software for different platforms.
Additional Advice
• Both logical interactions (e.g., modular dependency) and physical/textual interactions (e.g., CMake build process).