Skip to content

Unify CVector/CMatrix as CArray{T,N} aliases#41

Merged
timholy merged 2 commits into
mainfrom
teh/nd-array
May 25, 2026
Merged

Unify CVector/CMatrix as CArray{T,N} aliases#41
timholy merged 2 commits into
mainfrom
teh/nd-array

Conversation

@timholy

@timholy timholy commented May 24, 2026

Copy link
Copy Markdown
Member

Introduces CArray{T,N} <: AbstractArray{T,N} with dims::NTuple{N,Int32}; data::Ptr{T} as the canonical N-D buffer descriptor for crossing a @ccallable boundary, and keeps the familiar names as type aliases (const CVector{T} = CArray{T,1}, const CMatrix{T} = CArray{T,2}), mirroring Julia's own Vector{T} = Array{T,1} relationship. This extends the JLWInterop vocabulary to arbitrary rank and exposes higher-D buffers to binding targets (numpy, Fortran-iso_c, plain C) that already speak them.

This is queued behind #31 and can't be merged until that is.

Introduces `CArray{T,N} <: AbstractArray{T,N}` with
`dims::NTuple{N,Int32}`; `data::Ptr{T}` as the canonical N-D buffer
descriptor for crossing a `@ccallable` boundary, and keeps the familiar
names as type aliases (`const CVector{T} = CArray{T,1}`,
`const CMatrix{T} = CArray{T,2}`), mirroring Julia's own
`Vector{T} = Array{T,1}` relationship. This extends the JLWInterop
vocabulary to arbitrary rank and exposes higher-D buffers to binding
targets (numpy, Fortran-iso_c, plain C) that already speak them.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Julia's bundled `share/julia/juliac/juliac.jl` is being removed
upstream (per Gabriel on Slack), so the in-tree script the `:script`
backend wrapped no longer has a future. JuliaC.jl already covers
everything we need; remove the dead branch.

Specifically:

- `src/build.jl`: drop `:script` from the `backend` kwarg, the
  bundle/script incompatibility check, the `julia::Cmd` kwarg (only
  used by `:script`), and the `_locate_juliac_script` /
  `_build_library_script` helpers. `backend = :auto` and
  `backend = :juliac` remain as synonyms so the call surface stays
  open for additional future backends.
- `test/test_build_library.jl`: drop the `backend = :script` arm of
  the end-to-end test, and the bundle-incompatible-with-script test
  case.
- `docs/src/concepts.md`: drop the sentence about opting into the
  in-tree script.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@codecov-commenter

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 98.41270% with 1 line in your changes missing coverage. Please review.
✅ Project coverage is 95.01%. Comparing base (b1e2e03) to head (15272fc).

Files with missing lines Patch % Lines
src/python.jl 98.33% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##             main      #41      +/-   ##
==========================================
+ Coverage   94.78%   95.01%   +0.22%     
==========================================
  Files           5        5              
  Lines         901      822      -79     
==========================================
- Hits          854      781      -73     
+ Misses         47       41       -6     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@timholy
timholy merged commit 411f734 into main May 25, 2026
3 of 4 checks passed
@timholy
timholy deleted the teh/nd-array branch May 25, 2026 18:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants