Skip to content

enhance argument parsing#5120

Closed
jepler wants to merge 5 commits into
adafruit:mainfrom
jepler:enhance-mp-arg-parse-all
Closed

enhance argument parsing#5120
jepler wants to merge 5 commits into
adafruit:mainfrom
jepler:enhance-mp-arg-parse-all

Conversation

@jepler
Copy link
Copy Markdown

@jepler jepler commented Aug 9, 2021

This is a start to implementing micropython#7633 for those who want to snoop on the code. I'll be adding uses of the new API functionality, and we'll see how it changes code size.

@jepler jepler closed this Aug 28, 2021
@jepler
Copy link
Copy Markdown
Author

jepler commented Aug 28, 2021

I took a second stab at this, first implementing MP_ARG_FLOAT and then MP_ARG_FUNC, MP_ARG_TYPE and MP_ARG_ARRAY_OF. This is at https://github.com/adafruit/circuitpython/compare/main...jepler:arg-parse-2?expand=1

I found that

  • There weren't as many places as I thought to validate ranges
  • On non-express m0 boards, there weren't enough uses of MP_ARG_FLOAT to justify the code bloat
  • Even on express m0 boards (specifically circuitplayground_express) there weren't enough uses of MP_ARG_FUNC & MP_ARG_TYPE to justify the code bloat.

This is disappointing, I expected there to be small but real wins on the low end. Looks like that is not the case.

Perhaps I made some errors in implementation, but those are my findings.

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.

1 participant