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

macros -> lambdas #279

Open
2 of 15 tasks
yakra opened this issue Feb 25, 2024 · 0 comments
Open
2 of 15 tasks

macros -> lambdas #279

yakra opened this issue Feb 25, 2024 · 0 comments

Comments

@yakra
Copy link
Owner

yakra commented Feb 25, 2024

macros

Every macro you write makes you less 1337.

-Some random person on the internet.

While not 100% the case across the board, there's some truthiness to it.
Lambdas will work in many cases. Advantages include:

  • Safer
  • Smaller program size
  • Speed? Instruction cache?

Can't get rid of all of them, but here are some candidates:


other stuff

  • datacheck boilerplate
    A couple examples are above already, but in general, look for Datacheck::add.
  • sorting
    grep -n 'sort([^)]' \`find . -name \*.cpp`
    • Sorting regions.csv lines & eliminating the 1 use of sort_1st_csv_field reduces binary size 144 B.
    • sort_route_updates_oldest
    • What if a function is used multiple times, i.e. sort_root_at_label (5x)?
  • splitregion.cpp
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant