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

Program transformation to uncurry functions for which all applications are fully saturated. #24

Open
Unisay opened this issue Apr 26, 2024 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@Unisay
Copy link
Owner

Unisay commented Apr 26, 2024

local add = function(x) 
  return function(y) 
    return x + y 
  end 
end

is two times slower than

local add = function(x, y) 
  return x + y 
end

The idea is to rewrite former to latter but only for functions that are always fully-applied, e.g. a partial application

add(i)

never happens in the program being compiled;

The applications need to be rewritten too:

add(x)(y) ===> add(x,y)
@Unisay Unisay added the enhancement New feature or request label Apr 26, 2024
@Unisay Unisay self-assigned this Apr 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant