SIGN IN SIGN UP
exaloop / codon UNCLAIMED

A high-performance, zero-overhead, extensible Python compiler with built-in NumPy support

0 0 2 Python
2021-09-27 14:02:44 -04:00
def multiply(a,b):
return a*b
def print_args(a,b,c,d,e):
t = (a,b,c,d,e)
if t != ((4, 5), {'a': 3.14, 'b': 2.123}, True, {'ACGT'}, [['abc'], ['1.1', '2.2'], []]):
raise ValueError('TEST FAILED!')
return ({'a': 3.14, 'b': 2.123}, (222, 3.14))
def print_args_var(a,b,c=1,*args,**kwargs):
return 'a={}, b={}, c={}, args={}, kwargs={}'.format(a, b, c, args, kwargs)
def throw_exc():
raise ValueError('foo')
return 0
Inheritance/polymorphism fixes (#715) * Fix #681; Fix class_dist * Add method decorator support * Refactor __internal__ module; Make RTTI types references (wip); Add type.__mro__; Add Any type support * Initial async/await support in Codon IR * Move TypeInfo to ByRef Type * Move TypeInfo to ByRef Type * Move TypeInfo to ByRef Type * Move TypeInfo to ByRef Type * Fix polymorphic class codegen * Add TypeInfo.mro; Plug async to IR * Fix async flag * Fix async types * Fix paths * Refactor GPU kernel * Fix Coroutine IR mappings and NoneType handling * Update async * Add Task * Add await typechecking; Fix await IR node creation * Fix class variable typechecking order; Add static.vars(Cls) iteration support * Remove exception checks * Add Cache helpers for RTTI types * Disable BaseException requirement * Support polymorphic exceptions in runtime * Update exception handling logic * Fix static.range issue * Update exception header * Update docs * Update asyncio module * Update await lowering * Update await lowering * Update asyncio module * Update work queue * Fix bugs with try/throw and scoping; Add polymorphic isinstance (just static part); Fix datetime module and ClassVar scoping (make it like Python) * Update asyncio module * Update await lowering * Fix tests * Update exception handling in asyncio * Add asyncio.sleep() * Make await expression * Make isinstance RTTI-aware * Add ThreadLocal handling * Update sleep() to match Python's asyncio * Add codegen support for thread-local vars * Make event loops thread-local * Fix exception handling * Add asyncio.gather() * Add cancellation logic * Update await lowering * Update asyncio module * Support callback cancellation * Fix Static[] base initialization; fix ThreadLocal handling; Add 'await x' expression typechecking * Add cancellation checkpoints to await lowering * Update EventLoop fields * Fix await type * Update await lowering * Fix asyncio.gather() * Fix await implementation * Add asyncio tests * Update docs * Add additional runtime checks to event loop * Fix AsyncGenerator * Remove unused CoroHandleInstr from IR * Add async-for lowering to IR * async with support; async for support; Bugfixes * Fix async for; Add __getitem__/__setitem__ support * Fix ir::types::FuncType::doGetGenerics(); Fix plugin compile warnings * Add int.bit_length() * Fix tests * Remove unused class * Fix JIT RTTI * Make builtin.object RTTI by default * Fix pyext * Fix pyext exception handling * Fix Python bridge * Fix pybridge * Use specialized call functions in PyBridge * Support __await__ * Add __await__ methods * Add debug logs * Support async __await__ * Add generator flag to await instruction * Add AwaitExpr flag * Fix reversed() * Fix await instruction in IR * Fix GPU codegen if no kernels present * Fix and/or side effects and static short-circuit * Fix reversed * Fix stride checks * Add assertion to LLVM codegen * Fix GPU name cleaning * Add GPU target selection flags * Fix dict.get() * Fix ForFlow initialization * Fix dict test * Fix docs build --------- Co-authored-by: A. R. Shajii <ars@ars.me>
2026-02-06 01:05:50 +01:00
def test_call_no_args():
return 42
def test_call_one_arg(x):
return x**2