Releases: s-celles/Giac.jl
v0.14.1
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 extensionGiacMCPExtonModelContextProtocol.jl. The server advertises two tools —giac_eval(Giac/Xcas expression in → textual result out, withCallToolResult(isError=true, ...)for genuine Julia exceptions) andgiac_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 MCPinitializehandshake'sserverInfo.versiondefaults to the running Giac.jl version so clients always see the right number. Users who do not loadModelContextProtocol.jlare unaffected — no transitive dependency, no precompilation cost. Seedocs/src/extensions/mcp.mdfor the full setup guide. -
Example MCP prompts in the documentation:
docs/src/extensions/mcp.mdnow 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 togiac_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 separategiac_searchblock shows catalogue-discovery prompts ("which commands deal with matrices?"). -
Direct
Genfast path forinvoke_cmd/giac_cmd(spec 069): the generic command dispatcher now bypasses the GIAC parser when all arguments have a directGenrepresentation (GiacExpr,Int32, Int32-fittingInt64, finiteFloat64). The path resolves arguments through_get_gen_or_eval/Gen(Int32(x))/Gen(Float64(x))and routes toapply_func0/apply_func1/apply_func2/apply_func3(positional, zeroStdVectorallocation) for arity 0–3 andapply_funcNwith aStdVector{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 forRational,Complex,AbstractIrrational,AbstractVector,GiacMatrix,±Inf/NaN,Symbol,String,DerivativeCondition,DerivativePoint,Function,BigInt,Int128, and out-of-Int32-rangeInt64— all existing call shapes continue to work unchanged. Beyond the speed-up, the fast path structurally eliminates theGen → string → parse → Genround-trip class of bug that motivated_giac_subst_vec_tier1(spec 065). SetGIAC_INVOKE_CMD_STRING_PATH=1to 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 originalGiac.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
-
Doperator now accepts Unicode identifiers:D(ϕ)on a function variable defined as@giac_var 𝑧 ϕ(𝑧)previously failed withArgumentError: 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 withD(u),D(u, n), and chained forms. Reported by @tduretz. -
is_constantnow recognizes the GIACinfinityandundefatoms. Previously,is_constant(giac_eval("inf"))returnedfalsebecauseinfinitywas treated as a free identifier. After this fix, any expression built from these atoms — includinginf,+inf,-inf,+infinity,-infinity,unsigned_inf,1/0(which GIAC evaluates to+infinity), and0/0(which evaluates toundef) — is correctly classified as a constant.Giac.Constants.is_giac_constantpicks up these atoms via a name-based fallback, since GIAC's internal==reportsinfinity == infinityasfalse. As a follow-on fix,to_juliano longer infinitely recurses on these irreducible atoms (evalfis a no-op on them); it returns theGiacExprunchanged, matching the prior public behavior. Closes #19.Note: names like
nan,NaN,unsigned_infinity, andundefinedare not GIAC atoms — GIAC parses them as ordinary free identifiers (e.g.nan + 1yieldsnan+1exactly likexyz + 1yieldsxyz+1), so they remain non-constant.
v0.14.0
Giac v0.14.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 aGiacExprinto a native Julia callable in
one named call.f = build_function(expr, x, y)returns a closure
satisfyingf(a, b) == to_julia(substitute(expr, x => a, y => b)),
suitable as a drop-in argument toPlots.plot,Plots.surface,
broadcasting (f.(xs)), and matrix comprehensions. Closes #17 Tier 1.
(066-build-function) -
build_function:symbolicsbackend — newbackend::Symbol = :giac
keyword. The default is unchanged. Withusing Symbolics,
backend = :symbolicsround-trips throughto_symbolicsand compiles
viaSymbolics.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.
Symbolicsremains in[weakdeps]. - Tier 2 (in-house Julia codegen) remains intentionally out of scope.
- Tier 1 default is frozen — callers without the
backendkeyword 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
Giac v0.12.0
Breaking changes
to_julia(::GiacExpr)now reduces free-variable-free expressions to numbers
viaevalf(resolves issue #3); useevalf(expr)if you want a numericGiacExpr
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 likecombine(…, 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 toNumber,GiacMatrixiteration + 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
GiacTermInterfaceExt—using TermInterfaceenables Metatheory.jl / SymbolicUtils.jl interop Base.isfinite(::GiacExpr)CommonSolve.jlintegration —Giac.Commands.solve === CommonSolve.solve
Changed
to_julia(::GiacExpr)now reduces free-variable-free expressions to numbers
viaevalf(resolves issue #3); useevalf(expr)if you want a numericGiacExpr
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
Giac v0.11.2
add symbolic comparison operators (<, >, <=, >=) and logical operators (&, |) for GiacExpr
Merged pull requests:
v0.11.1
v0.11.0
Giac v0.11.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
Full Changelog: v0.8.0...v0.9.0
v0.8.0
Full Changelog: v0.4.0...v0.8.0