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

Lua spike (placeholder) #3290

Open
wants to merge 39 commits into
base: main
Choose a base branch
from

Conversation

voronoipotato
Copy link
Contributor

This is @alexswan10k 's work, though they have decided to prioritize rust, I'd like to keep this PR #2509 available so that work may continue on it, and people interested can contribute to it. I personally would love to contribute, and have played with it some but haven't yet made meaningful contribution. I wasn't able to find the branch @alfonsogarciacaro was referencing in the pr so I just used main as a placeholder for now.

@voronoipotato
Copy link
Contributor Author

voronoipotato commented Dec 9, 2022

My end goal would be semi-human readable lua. Here's the style I'm aiming for for classes.

-- example object
 Account = {balance = 0}
    
    function Account:new (o)
      o = o or {}
      setmetatable(o, self)
      self.__index = self
      return o
    end
    
    function Account:deposit (v)
      self.balance = self.balance + v
    end
    
    function Account:withdraw (v)
      if v > self.balance then error"insufficient funds" end
      self.balance = sel

@voronoipotato
Copy link
Contributor Author

Need to merge and update. Then add objects

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.

None yet

2 participants