Skip to content

Releases: s-celles/Giac.jl

v0.14.1

13 May 12:55
681f1ad

Choose a tag to compare

Diff since v0.14.0

Added

  • MCP server integration: giac_mcp_server() exposes Giac's CAS engine to MCP-aware LLM clients (Claude Desktop, Claude Code, Cursor, …) through a new weak-dependency package extension GiacMCPExt on ModelContextProtocol.jl. The server advertises two tools — giac_eval (Giac/Xcas expression in → textual result out, with CallToolResult(isError=true, ...) for genuine Julia exceptions) and giac_search (keyword in → matching command names out, with a prefix-then-substring fallback so LLM-style queries like "matrix" or "prime" surface relevant commands). The MCP initialize handshake's serverInfo.version defaults to the running Giac.jl version so clients always see the right number. Users who do not load ModelContextProtocol.jl are unaffected — no transitive dependency, no precompilation cost. See docs/src/extensions/mcp.md for the full setup guide.

  • Example MCP prompts in the documentation: docs/src/extensions/mcp.md now ships a curated "Example prompts" gallery — French and English direct-style prompts (factorise avec giac x²-1, with giac, factor x^4 - 1) plus natural-language, story-style prompts that exercise the LLM's judgement when routing to giac_eval (e.g., "between which two integers does the real root of x^3 + x - 1 = 0 lie?", "my password is the prime just after one billion — what is it?"). A separate giac_search block shows catalogue-discovery prompts ("which commands deal with matrices?").

  • Direct Gen fast path for invoke_cmd / giac_cmd (spec 069): the generic command dispatcher now bypasses the GIAC parser when all arguments have a direct Gen representation (GiacExpr, Int32, Int32-fitting Int64, finite Float64). The path resolves arguments through _get_gen_or_eval / Gen(Int32(x)) / Gen(Float64(x)) and routes to apply_func0/apply_func1/apply_func2/apply_func3 (positional, zero StdVector allocation) for arity 0–3 and apply_funcN with a StdVector{Gen} for arity ≥ 4. Geometric-mean speed-up across the standard workload mix is ≈ 1.5× with per-workload wins up to ≈ 2× on commands whose result is a long symbolic expression (factor, expand). The existing string-concatenation path is preserved as a fallback for Rational, Complex, AbstractIrrational, AbstractVector, GiacMatrix, ±Inf/NaN, Symbol, String, DerivativeCondition, DerivativePoint, Function, BigInt, Int128, and out-of-Int32-range Int64 — all existing call shapes continue to work unchanged. Beyond the speed-up, the fast path structurally eliminates the Gen → string → parse → Gen round-trip class of bug that motivated _giac_subst_vec_tier1 (spec 065). Set GIAC_INVOKE_CMD_STRING_PATH=1 to disable globally.

  • CONTRIBUTORS.md: a top-level acknowledgements file listing the people who built, reviewed, and inspired this package — Giac authors (Bernard Parisse & Renée De Graeve), the original Giac.jl (Harald Hofstaetter), Julia ecosystem reviewers (Viral B. Shah, Mosè Giordano, Max Horn), code contributors (John Verzani), feature/bug-report contributors (Thibault Duretz), and methodology inspiration (Sam Abbott). Linked from the README.

Fixed

  • D operator now accepts Unicode identifiers: D(ϕ) on a function variable defined as @giac_var 𝑧 ϕ(𝑧) previously failed with ArgumentError: D() requires a function expression like u(t). The internal parser regex (_parse_function_expr) only matched ASCII letters, even though GIAC C++ and Julia both accept Unicode names. The regex now uses Unicode letter/number classes (\p{L}, \p{N}), so Greek letters, mathematical italics, and other Unicode identifiers work with D(u), D(u, n), and chained forms. Reported by @tduretz.

  • is_constant now recognizes the GIAC infinity and undef atoms. Previously, is_constant(giac_eval("inf")) returned false because infinity was treated as a free identifier. After this fix, any expression built from these atoms — including inf, +inf, -inf, +infinity, -infinity, unsigned_inf, 1/0 (which GIAC evaluates to +infinity), and 0/0 (which evaluates to undef) — is correctly classified as a constant. Giac.Constants.is_giac_constant picks up these atoms via a name-based fallback, since GIAC's internal == reports infinity == infinity as false. As a follow-on fix, to_julia no longer infinitely recurses on these irreducible atoms (evalf is a no-op on them); it returns the GiacExpr unchanged, matching the prior public behavior. Closes #19.

    Note: names like nan, NaN, unsigned_infinity, and undefined are not GIAC atoms — GIAC parses them as ordinary free identifiers (e.g. nan + 1 yields nan+1 exactly like xyz + 1 yields xyz+1), so they remain non-constant.

v0.14.0

02 May 19:53
84d569d

Choose a tag to compare

Giac v0.14.0

Diff since v0.12.0

v0.14.0

Warning

Pre-1.0 minor bump → treated as breaking by Pkg's compat resolver.
Downstream packages with Giac = "0.11" or "0.12" will need to widen
their [compat] bound (e.g. Giac = "0.11 - 0.14") to pick up this release.
No public API was removed or renamed — the bump is mechanical, not behavioural.

Added

  • build_function — convert a GiacExpr into a native Julia callable in
    one named call. f = build_function(expr, x, y) returns a closure
    satisfying f(a, b) == to_julia(substitute(expr, x => a, y => b)),
    suitable as a drop-in argument to Plots.plot, Plots.surface,
    broadcasting (f.(xs)), and matrix comprehensions. Closes #17 Tier 1.
    (066-build-function)

  • build_function :symbolics backend — new backend::Symbol = :giac
    keyword. The default is unchanged. With using Symbolics,
    backend = :symbolics round-trips through to_symbolics and compiles
    via Symbolics.build_function, returning a native Julia callable that
    is autodiff-friendly (ForwardDiff, SciML solvers) and ~140× faster on
    hot-loop workloads. Closes #17 Tier 3. (067-build-function-tier3)

Naming caveat

Symbolics also exports build_function. With both using Giac and
using Symbolics in scope, the bare name is ambiguous and Julia raises
UndefVarError — qualify as Giac.build_function(...) (or
Symbolics.build_function(...)). This is the standard Julia convention for
name conflicts and is documented in the docstring and in
docs/src/julia_functions.md.

Notes

  • No new strong dependency. Symbolics remains in [weakdeps].
  • Tier 2 (in-house Julia codegen) remains intentionally out of scope.
  • Tier 1 default is frozen — callers without the backend keyword see zero
    behavioural change vs v0.12.

**Merged pull requests:**
- build_function tier1 & tier3 (#18) (@s-celles)

**Closed issues:**
- Add `lambdify` or `build_function` for converting `GiacExpr` into native Julia callables (#17)

v0.12.0

01 May 17:12
9ce43b7

Choose a tag to compare

Giac v0.12.0

Diff since v0.11.2

Breaking changes

  • to_julia(::GiacExpr) now reduces free-variable-free expressions to numbers
    via evalf (resolves issue #3); use evalf(expr) if you want a numeric GiacExpr

Note: per Julia SemVer, all 0.x minor bumps are considered breaking.

[0.12.0] - 2026-05-01

Added

  • Direct-binding substitute (1.5–2× faster, simultaneous semantics, varargs + call-syntax)
  • _arg_to_giac_string(::Function), accepts Julia functions in commands like combine(…, log)
  • Math operations on GiacExpr: sind/cosd/sinpi/cospi/asind/acosd/atand/secd/cscd/cotd,
    sincos (tuple-returning), deg2rad/rad2deg, exp2/exp10/log1p, log(b, x), adjoint, zero, one, ^ widened to Number, GiacMatrix iteration + linear/Cartesian indexing (length, iterate, LinearIndices, CartesianIndices, M[i], M[CartesianIndex(i, j)])
  • Introspection helpers: is_constant, unwrap_const, free_symbols, hasmatch,
    iscall, operation, arguments, maketerm, Constants.is_giac_constant, GiacExpr(::GiacExpr)
  • Weak-dep extension GiacTermInterfaceExtusing TermInterface enables Metatheory.jl / SymbolicUtils.jl interop
  • Base.isfinite(::GiacExpr)
  • CommonSolve.jl integration — Giac.Commands.solve === CommonSolve.solve

Changed

  • to_julia(::GiacExpr) now reduces free-variable-free expressions to numbers
    via evalf (resolves issue #3); use evalf(expr) if you want a numeric GiacExpr

Merged pull requests:

  • add arg to string method for Function (#6) (@jverzani)
  • add introspection methods (#8) (@jverzani)
  • add in some mathops (#9) (@jverzani)
  • iteration, linear indexing for GiacMatrix (#10) (@jverzani)
  • test: enable doctests for Giac docstrings via Documenter (#12) (@s-celles)
  • feat(substitute): direct giac_subst binding, varargs, and call-syntax (#13) (@s-celles)
  • feat: finalize Issue #3 — to_julia auto-evalf, isfinite, TermInterface ext, subsume PR #8 (#14) (@s-celles)
  • feat: integrate CommonSolve.jl (subsume PR #7) (#15) (@s-celles)
  • Mathops (#16) (@jverzani)

Closed issues:

  • unwrap_const? (#3)

v0.11.2

16 Apr 08:43
2956948

Choose a tag to compare

Giac v0.11.2

Diff since v0.11.1

add symbolic comparison operators (<, >, <=, >=) and logical operators (&, |) for GiacExpr

Merged pull requests:

  • feat: add symbolic comparison operators (<, >, <=, >=) and logical operators (&, |) for GiacExpr (#4) (@s-celles)

v0.11.1

12 Apr 10:21
7cb8000

Choose a tag to compare

Giac v0.11.1

Diff since v0.9.0

Merged pull requests:

  • fix: handle symbolic literal numbers in to_giac for Symbolics v7 (#2) (@s-celles)

Closed issues:

  • TypeError when squaring things (#1)

v0.11.0

12 Apr 10:21

Choose a tag to compare

Giac v0.11.0

Diff since v0.9.0

This release has been identified as a backport.
Automated changelogs for backports tend to be wildly incorrect.
Therefore, the list of issues and pull requests is hidden.

v0.9.0

20 Feb 21:38

Choose a tag to compare

v0.9.0 Pre-release
Pre-release

Full Changelog: v0.8.0...v0.9.0

v0.8.0

18 Feb 19:44

Choose a tag to compare

v0.8.0 Pre-release
Pre-release

Full Changelog: v0.4.0...v0.8.0

v0.4.0

16 Feb 18:33

Choose a tag to compare

v0.4.0 Pre-release
Pre-release
chore: update version to 0.0.4 and clean up docs heading

v0.0.3

15 Feb 18:18
92fd6f9

Choose a tag to compare

v0.0.3 Pre-release
Pre-release
Update copyright year and author in LICENSE