Repository navigation
feat(rf): c64/c128 complex types, DFT + IQ mixer examples - #395
Merged
Merged
Conversation
Add C99 _Complex-backed complex number types for the RF/SDR beachhead (W0 on the roadmap). c64 maps to float complex, c128 to double complex. Parser: new C64/C128 tokens and keywords, parse_type support, c64()/c128() as constructor calls in primary position. Type checker: C64/C128 TypeKinds, _is_complex helper, numeric promotion (c64 + c128 -> c128, c64 + f64 -> c128), complex builtins (creal, cimag, cabs, carg, conj, cexp, clog, csqrt, cpow). C generator: float complex / double complex type mapping, CMPLXF/CMPLX constructor emission, complex.h include, printf as (re + im j), zero defaults, byte sizes (8/16). Examples: examples/rf/dft.flow (8-point DFT with spectral peak check), examples/rf/iq_mixer.flow (quadrature mixer). Tests: tests/unit/test_complex_types.py (15 tests, all passing). Docs: types.md, overview.md, CHANGELOG, ROADMAP updated. 1224/1224 tests pass. Generated with [Devin](https://devin.ai) Co-Authored-By: Devin <158243242+devin-ai-integration[bot]@users.noreply.github.com>
Contributor
|
Bugbot is not enabled for your account, so this pull request was not reviewed. Enable Bugbot in the Cursor dashboard to get automatic reviews on future PRs. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
c64andc128complex number types backed by C99_Complex(float complex / double complex)c64(re, im),c128(re, im),c64(x)for real-onlycreal,cimag,cabs,carg,conj,cexp,clog,csqrt,cpowc64 + c128->c128,c64 + f64->c128#include <complex.h>emitted in all generated C(re + im j)since C has no complex format specifierexamples/rf/dft.flow(8-point DFT),examples/rf/iq_mixer.flow(quadrature mixer)tests/unit/test_complex_types.py(15 tests)types.md,overview.md,CHANGELOG.md,ROADMAP.mdupdatedThis is the first piece of W0 (RF/SDR beachhead) on the roadmap. Next steps: quantity literals, IQ type alias, rate-typed
Signal.Test plan
examples/rf/dft.flowcompiles and runs, prints correct spectrumexamples/rf/iq_mixer.flowcompiles and runs, mixer output verifiedThis pull request includes code written with the assistance of AI.
The code has not yet been reviewed by a human.
Generated with Devin