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

feat(modules): reload modules and compilation cache #155

Merged
merged 8 commits into from
Jan 16, 2025

Conversation

Samy-33
Copy link
Contributor

@Samy-33 Samy-33 commented Dec 28, 2024

asciicast

@Samy-33 Samy-33 marked this pull request as draft December 30, 2024 18:36
@Samy-33 Samy-33 force-pushed the feat/require-reload branch from 4342f7c to 5379be0 Compare December 31, 2024 21:13
@Samy-33 Samy-33 marked this pull request as ready for review January 1, 2025 07:04
@Samy-33 Samy-33 changed the title feat(modules): reload modules in require feat(modules): reload modules and compilation cache Jan 1, 2025
@Samy-33
Copy link
Contributor Author

Samy-33 commented Jan 2, 2025

@jeaye
asciicast

compiler+runtime/include/cpp/jank/jit/processor.hpp Outdated Show resolved Hide resolved
compiler+runtime/include/cpp/jank/runtime/core/munge.hpp Outdated Show resolved Hide resolved
compiler+runtime/src/cpp/jank/c_api.cpp Outdated Show resolved Hide resolved
compiler+runtime/src/cpp/jank/jit/processor.cpp Outdated Show resolved Hide resolved
compiler+runtime/src/cpp/jank/jit/processor.cpp Outdated Show resolved Hide resolved
compiler+runtime/src/cpp/jank/runtime/core/seq.cpp Outdated Show resolved Hide resolved
Comment on lines +468 to +474
/* While loading an object, if the main ns loading symbol exists, then
* we don't need to load the object file again.
*
* Existence of the `jank_load_<module>` symbol (also a function),
* means that all the required symbols exist and are already defined.
* We call this symbol to re-initialize all the vars in the namespace.
* */
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So this means that it'll be impossible, in jank, to:

  1. Load a module from an object file
  2. Change the source behind that module
  3. Try to require the module again, to reload it
  4. Get the updated source

What does Clojure do here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If the source is more recent than the object file, we will always load from source.

Clojure doesn't load from class files, while reloading in the repl.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let me know, if this makes sense?

@Samy-33 Samy-33 requested a review from jeaye January 16, 2025 19:08
@Samy-33 Samy-33 requested a review from jeaye January 16, 2025 20:07
@jeaye jeaye merged commit 18dd00c into jank-lang:main Jan 16, 2025
2 of 3 checks passed
@Samy-33 Samy-33 deleted the feat/require-reload branch January 17, 2025 07:34
@Samy-33
Copy link
Contributor Author

Samy-33 commented Jan 17, 2025

Handles #139 : Skip module compilation based on timestamp

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.

2 participants