Skip to content

feat: Add Wolfram Language / Mathematica support #416

@Juddd

Description

@Juddd

What problem are you trying to solve?

Hi, thanks for building Understand Anything. The idea of turning a codebase into an interactive knowledge graph is very useful, especially for large scientific and symbolic-computing projects.

I would like to request first-class support for Wolfram Language / Mathematica projects.

Currently, it seems that the built-in language configs do not include Wolfram Language / Mathematica. Common Wolfram project files include:

  • .wl — Wolfram Language source/package files
  • .m — legacy Mathematica/Wolfram package files
  • .wls — WolframScript files
  • .nb — Mathematica notebook files

For Wolfram projects, it would be very helpful if Understand Anything could detect these files and extract meaningful graph relationships such as:

  • package/module structure, especially BeginPackage, Begin, End, EndPackage
  • symbol definitions, for example f[x_] := ..., g = ..., Options[f] = ...
  • dependencies from Needs, Get, <<, and package contexts
  • public API symbols declared through usage messages, such as Foo::usage = "..."
  • function calls and symbol references
  • notebook-to-package relationships, when .nb files are present

A minimal first step could be:

  1. Add a wolfram / wolfram-language language config.
  2. Recognize .wl, .m, .wls, and maybe .nb.
  3. Treat .wl, .m, and .wls as source-like text files.
  4. Extract basic imports/dependencies from Needs[...], Get[...], and <<.
  5. Extract symbol definitions from common patterns such as name[args___] := ..., name = ..., and name::usage = ....
  6. Optionally add deeper parsing later.

Potential implementation references:

  • LumaKernel/tree-sitter-wolfram provides an unofficial Tree-sitter grammar for Wolfram Language.
  • WolframResearch/codeparser provides an official Wolfram Language parser that can produce AST/CST output.
  • Wolfram’s official documentation lists Wolfram Language file formats such as .wl, .m, and .nb.

I understand that full notebook support may be harder than plain .wl / .wls support, so even source-file-only support would already be very valuable.

Thanks again for the project!

Proposed solution (optional)

No response

Alternatives you've considered

No response

Which part of the project?

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions