intelligent compiler that interprets a .squiggle
file ending in expression as a partial of one binding
#895
Replies: 1 comment
-
Note: A new compiler interface is on the way
Highlights:
I am switching to a simple project structure instead of source evaluation because I will continue further futures with multi pass compilation. Because supporting compilation related information in runtime is becoming a mess. When I release this interface, we won't be able to merge it to develop. Instead, other components will need to be upgraded in the same branch. |
Beta Was this translation helpful? Give feedback.
-
Currently, we have a divide between
.squiggle
files which culminate in expressions and partials which are.squiggle
files that exist only to export assignments/bindings.I think ideally squiggle would say "If the file you give me ends in an expression
x
that is not a record, and I'm being asked to use it in the context of being a partial, then I append the single element record{x: x}
to the end of the file automatically".Really ending a file with a single element record is exactly like
export default ...
in javascript, right? Though we want a file to be multiple-use; we want it to render the culminating expression when loaded up as a top-level file, but we want it to export that single expression when imported.Also to keep in mind: for python file
x.py
, I can hide code that will run in the context ofpython x.py
but will not run in the context ofimport x
(throughif __name__ == "__main__":
). That sort of thing may be useful as well.Beta Was this translation helpful? Give feedback.
All reactions