Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Implement python builtin functions #44

Open
27 of 82 tasks
nielstron opened this issue Feb 6, 2023 · 1 comment
Open
27 of 82 tasks

Implement python builtin functions #44

nielstron opened this issue Feb 6, 2023 · 1 comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed

Comments

@nielstron
Copy link
Contributor

nielstron commented Feb 6, 2023

Builtin functions simplify usage of Eopsin to build contracts, and can improve performance at the same time through native implementations.

Below is a list of builtins that python offers and should be supported by Eopsin as well. Striked through functions are not planned.

  • all (8b7ac91)
  • any (8b7ac91)
  • abs (2edc636)
  • bin
  • bool
  • breakpoint (a no-op) (added in 42a75d3)
  • bytearray (synonym for bytes?)
  • bytes (constructor with list of integers)
  • callable
  • chr
  • classmethod
  • compile
  • complex (with rationals and integers)
  • delattr
  • dict
  • dir
  • dict
  • divmod
  • enumerate
  • eval
  • exec
  • filter
  • float
  • format
  • frozenset
  • getattr
  • globals
  • hasattr
  • hash
  • help
  • hex
  • id
  • input
  • int
    • str (base 10)
    • fraction
    • int
  • isinstance (to distinguish elements of Union types)
  • issubclass
  • iter
  • len
    • bytes
    • list
    • str
  • list
  • locals
  • map
  • max
  • min
  • next
  • object
  • oct
  • open
  • ord
  • pow
    • with negative exponents -> fractions?
    • with modulo -> for anyone wanting to implement efficient modulo exponentiation in UPLC
  • print
  • property
  • range
  • reversed
  • round (for fractions)
  • set
  • setattr
  • slice
  • sorted
  • staticmethod
  • str
    • int
    • fraction
    • str
    • bytes
    • list
    • tuple
    • data?
  • sum (added in 23bdda5)
  • super
  • tuple
  • type
  • vars
  • zip
  • import

Reference:

https://docs.python.org/3/library/functions.html

@nielstron nielstron added enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed labels Feb 6, 2023
@nielstron
Copy link
Contributor Author

Since the introduction of the pairtype with #36 we can also implement zip

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

1 participant