Commit Graph

21 Commits (dcb41dcfc9438698c8372392160362251f1bd6a3)

Author SHA1 Message Date
A. R. Shajii c1dae7d87d Update OpenBLAS 2025-04-04 14:59:13 -04:00
A. R. Shajii 984974b40d Support CMake 4.0 2025-04-04 11:27:35 -04:00
A. R. Shajii b8c1eeed36
2025 updates (#619)
* 2025 updates

* Update ci.yml
2025-01-29 15:41:43 -05:00
A. R. Shajii 3c4272d92a
Fix out-of-range float parsing (#579) 2024-08-14 16:13:29 -04:00
A. R. Shajii ffeeca274a
Use fast_float library for str-to-int/float (#561)
* Use fast_float library for str-to-int/float

* Fix str-to-int conversions
2024-05-22 10:22:50 -04:00
A. R. Shajii 5613c1a84b
v0.16 (#335)
* Add Python extension lowering pass

* Add DocstringAttribute

* Add extension module codegen

* Handle different argument counts efficiently

* Add warnings to extension lowering

* Fix module name

* Fix extension codegen

* Fix argument check

* Auto-convert Codon exceptions to Python exceptions

* Fix #183

* Fix #162; Fix #135

* Fix #155

* Fix CPython interface in codegen

* Fix #191

* Fix #187

* Fix #189

* Generate object file in pyext mode

* Convert Codon exceptions to Python exceptions

* Fix vtable init; Fix failing tests on Linux

* Fix #190

* Fix #156

* Fix union routing

* Remove need for import python

* Automatic @export and wrapping for toplevel functions

* Reorganize API

* Add Python extension IR structs

* Add special calls for no-suspend yield-expr

* Add special calls for no-suspend yield-expr

* pyextension.h support [wip]

* pyextension.h support [wip]

* pyextension.h support

* pyextension.h support for toplevel functions

* clang-format

* Add PyFunction::nargs field

* Update pyextension codegen (WIP)

* SUpport nargs

* Add support for @pycapture

* PyType codegen (WIP)

* Py method codegen (WIP)

* Add type ptr hook

* Add getset codegen

* Add type alloc function

* Add type pointer hook codegen

* Re-organize codegen

* Add member codegen

* Update module init codegen

* Update module init codegen

* Add support for typePtrHook and new to/from_py hooks

* Fix extension codegen

* Fix init codegen

* Fix init codegen; add "tp_new" slot

* Fix type hook

* Add extra flags

* Specialized wrappers (PyType specs)

* Add static Python link option

* Fix C imports

* Add guards

* Remove unused field

* Python mode only when pyExt set

* Update python module

* Fix assert

* Update codegen/passes

* Fix tuple parsing in index expression

* Fix empty tuple unification

* Do not Cythonize underscore fns

* clang-format

* Fix switch

* Add Py support for cmp/setitem

* Add Py support for cmp/setitem

* Add type is support

* GetSet support

* clang-format

* GetSet support (fixes)

* Avoid useless vtable alloc

* Add iter support

* Fix size_t capture bug

* clang-format

* Fix POD type unification with tuples

* Add __try_from_py__ API

* Fix annotation

* Add static reflection methods (setattr; internal.static.*); refactor PyExt to python.codon; handle errors and kwargs in PyExt

* Python compat fixes

* Update Python object conversions

* Fix PyErrors

* clang-format; add copyright

* Add PyFunction::keywords field

* Fix JIT MRO handling; Refactor out Jupyter support

* Refactor out Jupyter support

* Add support for custom linking args (link=[]) to TOML plugins

* Fix tests

* Use g++ instead of gcc

* Fix Jupyter CMAKE

* Fix Jupyter CMAKE

* Add _PyArg_Parser definition

* Add complex64 type

* Add extra complex64 tests

* Fix Python calls; add staticenumerate

* Fix call

* Fix calls

* Update pyext wrappers

* Fix staticenumerate; Support static calls in tuple()

* Fix pyext routing

* Add add/mul for tuples

* clang-format

* Fix pyext codegen

* Fix wrap_multiple

* Add seq_alloc_atomic_uncollectable

* Fix default generics issue

* Add binary/ternary ops

* Fix missing generic issue

* Fix number slots

* Update pow

* Remove unnecessary pyobj

* Fix allocation

* Refactor errors

* Add test extension

* Fix formatting

* clang-format

* Fix getitem/setitem/delitem in pyext

* Fix pyext iterators

* Add builtin pow() (fix #294)

* Fix #244

* Fix #231

* Fix #229

* Fix #205

* Update docs

* Fix error message

* Add pyext tests

* Add pyext support for @property

* Add pyext support for toplevel fns and @tuple classes

* More pyext tests

* More pyext tests

* Fix file error checking

* More pyext tests

* Update pyext tests

* Update docs

* Add pyext test to CI

* Add pyext support for @tuple.__new__

* Add pyext support for @tuple.__new__

* Fix hetero-tuple issue with fn_overloads

* More pyext tests

* Bump versions

* Fix del magic in pyext

* Fix init magic for tuples in pyext

* Have test-pypi only run on develop branch

* Make exception type indices unnamed-addr

* Fix #316; Fix #317 (slash issue)

* Use uncollectible-alloc for vtable

* Fix #249

* Add pyext docs

* Fix #249; Fix clashing vtables; Fix super() and class_copy

* Add content-atomic type property instruction

* __contents_atomic__ support

* Update internal functions

* Use PIC when generating Python extension

* Cleanup

* Add Dockerfile & fix -fPIC

* Cleanup

* Fix setup.py

* Fix pyext fn iteration

* Fix CI

* clang-format

* Update long conversions in Py bridge

* Support wide-int to str conversions

* Fix test

* Add pow for arbitrary-width ints

* Fix Linux backtraces

* Cleanup

* Add more tests

* Fix docs; Remove tuple.__add__ for scalars

* Update docs

---------

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2023-04-12 18:13:54 -04:00
Ibrahim Numanagić f4feee23a4
Plugin loading fixes (#66)
* Add INSTALL target; Plugin loading fixes

* Use ast::executable_path to get exec path

* Update README.md

Co-authored-by: A. R. Shajii <ars@ars.me>
2022-12-07 22:42:29 -05:00
Ibrahim Numanagić 5de233a64e
Dynamic Polymorphism (#58)
* Use Static[] for static inheritance

* Support .seq extension

* Fix #36

* Polymorphic typechecking; vtables [wip]

* v-table dispatch [wip]

* vtable routing [wip; bug]

* vtable routing [MVP]

* Fix texts

* Add union type support

* Update FAQs

* Clarify

* Add BSL license

* Add makeUnion

* Add IR UnionType

* Update union representation in LLVM

* Update README

* Update README.md

* Update README

* Update README.md

* Add benchmarks

* Add more benchmarks and README

* Add primes benchmark

* Update benchmarks

* Fix cpp

* Clean up list

* Update faq.md

* Add binary trees benchmark

* Add fannkuch benchmark

* Fix paths

* Add PyPy

* Abort on fail

* More benchmarks

* Add cpp word_count

* Update set_partition cpp

* Add nbody cpp

* Add TAQ cpp; fix word_count timing

* Update CODEOWNERS

* Update README

* Update README.md

* Update CODEOWNERS

* Fix bench script

* Update binary_trees.cpp

* Update taq.cpp

* Fix primes benchmark

* Add mandelbrot benchmark

* Fix OpenMP init

* Add Module::unsafeGetUnionType

* UnionType [wip] [skip ci]

* Integrate IR unions and Union

* UnionType refactor [skip ci]

* Update README.md

* Update docs

* UnionType [wip] [skip ci]

* UnionType and automatic unions

* Add Slack

* Update faq.md

* Refactor types

* New error reporting [wip]

* New error reporting [wip]

* peglib updates [wip] [skip_ci]

* Fix parsing issues

* Fix parsing issues

* Fix error reporting issues

* Make sure random module matches Python

* Update releases.md

* Fix tests

* Fix #59

* Fix #57

* Fix #50

* Fix #49

* Fix #26; Fix #51; Fix #47; Fix #49

* Fix collection extension methods

* Fix #62

* Handle *args/**kwargs with Callable[]; Fix #43

* Fix #43

* Fix Ptr.__sub__; Fix polymorphism issues

* Add typeinfo

* clang-format

* Upgrade fmtlib to v9; Use CPM for fmtlib; format spec support; __format__ support

* Use CPM for semver and toml++

* Remove extension check

* Revamp str methods

* Update str.zfill

* Fix thunk crashes [wip] [skip_ci]

* Fix str.__reversed__

* Fix count_with_max

* Fix vtable memory allocation issues

* Add poly AST tests

* Use PDQsort when stability does not matter

* Fix dotted imports; Fix  issues

* Fix kwargs passing to Python

* Fix #61

* Fix #37

* Add isinstance support for unions; Union methods return Union type if different

* clang-format

* Nicely format error tracebacks

* Fix build issues; clang-format

* Fix OpenMP init

* Fix OpenMP init

* Update README.md

* Fix tests

* Update license [skip ci]

* Update license [ci skip]

* Add copyright header to all source files

* Fix super(); Fix error recovery in ClassStmt

* Clean up whitespace [ci skip]

* Use Python 3.9 on CI

* Print info in random test

* Fix single unions

* Update random_test.codon

* Fix polymorhic thunk instantiation

* Fix random test

* Add operator.attrgetter and operator.methodcaller

* Add code documentation

* Update documentation

* Update README.md

* Fix tests

* Fix random init

Co-authored-by: A. R. Shajii <ars@ars.me>
2022-12-04 19:45:21 -05:00
A. R. Shajii e1016f9e9a
Upgrade to LLVM 15 (#56)
* Upgrade to LLVM 15 (WIP)

* Call `setPresplitCoroutine()` on coro LLVM funcs

* Use new pass manager

* Update deps

* Update docs

* Fix exceptions on M1

* Add libunwind

* Use Orc and JITLink for "codon run"

* JITLink integration

* Fix callback

* Fix strbuf, fix GC root registration

* Fix test init

* Fix llvm function

* Fix pickle, float atomics

* Add TargetLibraryAnalysis

* Use new LLVM pass manager in GPU codegen

* Fix libunwind linking

* Fix libunwind

* Fix GPU passes

* Don't link libunwind explicitly

* Bump version

* Update plugins for new pass manager

* Fix bash error

* Fix GPU GV extraction

* Move simd module to experimental folder

* Update file read

* Add benchmark programs

* Add dynamic tuple

* Fix parser tuple slicing bug

* Make DynamicTuple interoperable with Tuple

* Fix DynamicTuple GPU interop

* Dockerize builds

* Simplify CMake

* Revert "Simplify CMake"

This reverts commit 08d2920349.

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2022-10-14 09:31:10 -04:00
A. R. Shajii 7f7810eb95 Turn off TLS when building with Jupyter support 2022-07-27 09:15:14 -04:00
A. R. Shajii f6bffa50a2
Full regex implementation (#38)
* IR escape analysis (WIP)

* Handle calls (WIP)

* Fix argument tracking (WIP)

* Cleanup

* Fix function caching

* Add annotations

* Add capture analysis

* Fixes

* Add tests

* More tests & fixes

* Refactor

* Add escape interface

* Fix consts

* Fix throw side effect

* Fix case for vararg C functions

* Add IR pass timing

* Fix internal func capture status

* Avoid warning on exe build

* More tests

* Fix var tracking & more tests

* Fix derived computation and more tests

* Optimization

* Better derived set generation

* More tests

* Cache reaching-def results

* Fix pass group repeat

* Fix use-after-free issue

* Initial re functions

* Cleanup

* Add parseCode

* Add parseCode

* Fix IR realization

* Allow for NumPy conversions

* Update re

* clang-format

* Add pattern methods

* Add more functions

* More functions

* Fixes

* Cleanup

* Add more functions

* Add groups()

* Add flags

* Use optionals where needed

* Support errors

* Fix replacement

* Fix sub

* Fix unescape

* Add tests

* Fix expand

* More tests

* More tests

* More tests

* Add remaining tests

* Revert Python changes

* Use atomic alloc

* Fix test

* Fix errors

* Fix unescape

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2022-07-08 23:17:50 +00:00
A. R. Shajii 9b73bc0da3
OpenMP updates (#30)
* Support task-based reductions (wip)

* Fix task-based reductions (wip)

* Fix local reduction var reference

* Fix shared info access

* Fix reductions

* Add more tests for float reductions

* Update test

* Update test

* Add corner case tests

* Add nested par tests

* Add barrier to match clang's codegen

* Refactor to remove duplicated code

* Fix GC root registration via OpenMP patch

* Update deps.cmake

* Debug

* Debug

* Update thread registration with GC

* Update OpenMP

* Update OpenMP to new master
2022-06-06 19:31:48 -04:00
A. R. Shajii b47a9a844b
Jupyter quanto fixes (#22)
* Add methods to check for passes/analyses

* Fix xeus build

* clang-format

* Optimize JIT

* Allow jit mode to take data from file

* Fix OpenMP in JIT mode

* Update JIT main

* Update cloning

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2022-03-19 10:29:41 -04:00
A. R. Shajii a3be465ae5 Use patched OpenMP 2022-02-27 07:52:43 -05:00
Ibrahim Numanagić c8b757859a Fix OpenMP 12+ issue 2022-02-25 18:25:29 -08:00
Ibrahim Numanagić 1ec5cd2958 Merge branch 'jupyter-fixes' into auto-class-deduction 2022-02-25 09:22:56 -08:00
A. R. Shajii 4452367c1f Update OpenMP 2022-02-22 10:17:50 -05:00
Ibrahim Numanagić 2506cb849e Use @overload for top-level function overloads; Partial function bugfixes 2022-02-18 17:27:24 -08:00
Ibrahim Numanagić fd06afaa61 Fix linux build [wip] 2022-01-25 13:17:37 -08:00
A. R. Shajii 166e1ad455
JIT (#6)
* Add JIT engine

* More engine updates

* Fix takeModule()

* Parser JIT support [wip]

* Fix class definition

* Parser JIT support [wip]

* Parser JIT support [wip]

* Fix LLVM context conflict

* Parser JIT support [wip]

* Fix JIT engine

* Parser JIT support [wip]

* Doc fix

* JIT fix

* Fix JIT exceptions

* Refactor

* Add JIT status codes

* Add compiler class

* Better logging

* Better logging

* Update .gitignore

* Add Jupyter Xeus support

* Update JIT

* Remove print

* Update errors

* Fix assert

* Fix asserts

* Update docgen signature

* Update file system interface

* Update plugin errors

* Use numeric_limits

* JIT refactor [wip]

* Set JIT flag on LLVMVisitor

* Update module opt

* JIT imports

* First Jupyter integration

* Update JIT API to return outputs as string

* Capture runtime exception output

* Fix libbacktrace build

* Initial Jupyter support

* Format

* Fix print

* Support run-mode backtraces

* Fix multithreaded backtrace

* Update backtraces

* Upgrade OpenMP

* Add libunwind

* Fix build

* Fix build

* Fix build

* Fix build

* Fix OpenMP & tests

* Use libbacktrace instead of libunwind

* Add debug listener

* Remove unused include

* Remove unused class

* Fix backtraces

* Update backtrace config

* Fix debug info generation

* Refactor backtraces

* Fix ASAN flag

* Fix JIT

* Fix JIT backtraces

* Fix JIT backtrace

* Fix Jupyter, fix xeus build flags

* Fix JIT output capture

* Fix Jupyter

* Fix Jupyter Python support

* Add __repr_pretty__ support

* Update JIT output capturing

* Better backtrace method names

* Support plugins in JIT mode

Co-authored-by: Ibrahim Numanagić <ibrahimpasa@gmail.com>
2021-11-30 11:50:28 -05:00
A. R. Shajii e121e2b9db Refactor build files 2021-10-10 01:02:11 -04:00