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

Fixing evaluators #3

Merged
merged 5 commits into from
Sep 5, 2019
Merged

Fixing evaluators #3

merged 5 commits into from
Sep 5, 2019

Conversation

teofr
Copy link
Contributor

@teofr teofr commented Aug 16, 2019

Close #1

Things done:

  • Changed the Box<> around the closures for a Rc<Refcell<>>, so we can have cheap copies + mutability [More on the bottom].
  • Implemented the Let evaluator rule, (not recursive, at least for now).
  • Changed the main so it parses the input from stdio, it's useful for fast testing for now.
  • Added Clone traits to most datatypes, this should change in the future, and some shouldn't be ever copied (specially Terms).
  • Added a .gitignore file.
  • Wrote 3 very simple NCL files so we can test.
  • Run cargo fmt on the whole source code.

[More on the Rc<RefCell<>>]
I'm pretty convinced I'm not generating any reference cycle by doing this (notice that I'm only keeping weak pointers on the Thunks), and unless we find a case were this doesn't work, I think is a better solution than naked pointers.

@teofr teofr requested a review from mboes August 16, 2019 11:51
@teofr teofr self-assigned this Aug 16, 2019
@teofr teofr marked this pull request as ready for review August 16, 2019 11:52
.gitignore Outdated Show resolved Hide resolved
Endline at .gitignore

Co-Authored-By: Arnaud Spiwack <[email protected]>
@teofr teofr merged commit be6e75e into master Sep 5, 2019
@teofr teofr deleted the teofr/fixing-pointers branch September 9, 2019 08:39
@mboes mboes unassigned teofr Mar 20, 2020
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.

Replace Box with a naked pointer type
2 participants