Skip to content

Livelits #1465

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

Merged
merged 90 commits into from
May 8, 2025
Merged

Livelits #1465

merged 90 commits into from
May 8, 2025

Conversation

gcrois
Copy link
Contributor

@gcrois gcrois commented Jan 17, 2025

This merge brings a implementation of Livelits, proposed by https://hazel.org/papers/livelits-pldi2021.pdf, with some built-in examples.

Examples:

  1. Emotion
  2. Timestamp (Can't keep up)
  3. Slider
  4. JS

Issues:

  • Look up livelit in the context
  • Show the livelits in scope in the context inspector
  • Livelit names are showing errors
  • When you press space after a livelit name, it should initialize the model argument
    • and turn on the livelit projector immediately
  • Only displaying correct view in smiley face projector every other update (may also affect other livelits?)
  • ExplainThis sidebar should show information about livelit applications when relevant
  • Create a documentation slide showing how livelits work
  • Separated browser tests and URL encoding (currently they are already merged in here)
  • Backspace should break projection, remove default model
  • Fix livelit ap term -- consider modifying MakeTerm (similar to deferred Ap)
  • Unbound livelit error state
  • Documentation slide
  • Statics off error formatting
  • Remove parenthesis requirement for invocation
  • add Livelit.md file to docs to explain to someone what they need to do to add a new livelit

Limitations of projectors, to be fixed in separate PR:

  • Livelit invocation must be directly surrounded by a parenthesis

Future PRs:

  • User-defined livelits (pending modules)
  • Splices (pending splices in projectors)
  • Parameters (pending splices)
  • Pattern livelits
  • LivelitAp: Switch mode of Ap to LivelitAp when applied to a LivelitName
  1. Cannot define Livelits during runtime, Livelits don't have access to context -- this needs to be revealed to projectors
  2. Cannot implement splices, requires context, merge with Live Projectors ? @disconcision
  3. Livelit invocation must be directly surrounded by a parenthesis in order to be grouped in InfoExp; example: (^emotion(100)) -- this is a current limitation of projectors

@gcrois
Copy link
Contributor Author

gcrois commented Apr 11, 2025

https://github.com/hazelgrove/hazel/tree/livelit-lift-syntax

I attempted to replace my model replacement function with the existing lift-syntax, and ran into some errors when replacing the model -- namely, a nebulous error called "Not_found"... I had these in earlier versions of my replace model function, eventually finding stability when I replaced the labels of the existing syntax without modifying the shape or ids of the syntax.

Example:
Livelit Branch vs. Livelit with lift_syntax
When the slider livelit is projected and interacted with, model changes as expected in the livelit branch, but a fatal error occurs with lift_syntax when unprojected and selected.

Screenshot 2025-04-11 at 4 43 10 PM

@disconcision Any ideas here?

@gcrois
Copy link
Contributor Author

gcrois commented Apr 15, 2025

We now do a full replacement of the syntax (including the livelit name). What cause the previous crash in livelit-lift-syntax is still unknown, but is resolved for now. Thanks @disconcision!

@gcrois
Copy link
Contributor Author

gcrois commented Apr 24, 2025

Create Self.re common error type for bad livelit model, needs exp_t

For built-in livelits, we need a function to determine if an exp is a value, lives in Statics (static value checker)

@gcrois
Copy link
Contributor Author

gcrois commented Apr 24, 2025

@cyrus- Made the changes we talked about earlier today, and a couple more for stability + error reporting

@cyrus- cyrus- merged commit 5345223 into dev May 8, 2025
4 checks passed
@cyrus- cyrus- deleted the livelit branch May 8, 2025 20:20
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.

4 participants