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

garbage collector & hoisting #1

Open
somucheffort opened this issue Jan 7, 2023 · 0 comments
Open

garbage collector & hoisting #1

somucheffort opened this issue Jan 7, 2023 · 0 comments
Labels
enhancement New feature or request refactor Refactoring main code

Comments

@somucheffort
Copy link
Owner

  1. garbage collector
    currently, coco has some type of scoping with hashmap stored variables (which is probably great for toy interpreter), but it'll be better if there was a garbage collector.

  2. hoisting
    js has function hoisting.

// sort of arrow functions will be introduced later, because those `let sum = (a, b) => a + b` is horrible and cannot be hoisted.
let preHoist = hoistedSum(1, 2)

fun hoistedSum(a, b) -> a + b

let postHoist = hoistedSum(3, 4)

log(preHoist, postHoist) // 3 7
@somucheffort somucheffort added the enhancement New feature or request label Jan 7, 2023
@somucheffort somucheffort added the refactor Refactoring main code label May 19, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request refactor Refactoring main code
Projects
None yet
Development

No branches or pull requests

1 participant