Skip to content
This repository has been archived by the owner on Aug 10, 2020. It is now read-only.

draft about new lazy encoding #211

Open
wants to merge 3 commits into
base: source
Choose a base branch
from
Open

draft about new lazy encoding #211

wants to merge 3 commits into from

Conversation

bobzhang
Copy link
Member

No description provided.

@bobzhang bobzhang changed the title post about lazy encoding draft about new lazy encoding May 13, 2020
Copy link

@BlueHotDog BlueHotDog left a comment

Choose a reason for hiding this comment

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

awesome. but what is lazy and why will anyone use it would be a nice addition.

website/blog/2020-05-13-lazy-encoding.md Show resolved Hide resolved
website/blog/2020-05-13-lazy-encoding.md Outdated Show resolved Hide resolved
website/blog/2020-05-13-lazy-encoding.md Outdated Show resolved Hide resolved
website/blog/2020-05-13-lazy-encoding.md Outdated Show resolved Hide resolved
@TheSpyder
Copy link

TheSpyder commented May 13, 2020

This is cool! Also I learned something, I didn’t know pattern match was an alternative to calling Lazy.force 🤔

@anmonteiro
Copy link
Contributor

anmonteiro commented May 13, 2020

@bobzhang This is a good improvement, nicely done!

I have a question that may be better converted to an issue in the BuckleScript repo. Would you consider changing the representation of lazy values to say something like "unrealized" or "pending" instead of "todo". I'm betting folks will be confused if they see "todo" in their output (either code or console).

My reasoning for the above is that "todo" generally represents things that need to be addressed in code, and it may make sense to generate another keyword.

@TheSpyder
Copy link

TheSpyder commented May 14, 2020

@anmonteiro the problem with a longer string is it'll be repeated for every lazy value, which might bloat the app size depending on how much it's used

maybe true/false would be better? 🤔

@bobzhang
Copy link
Member Author

bobzhang commented May 14, 2020

@anmonteiro @TheSpyder good idea, I am going to rename it to {RE_LAZY_DONE : true|false}

rescript-lang/rescript-compiler#4384

@TheSpyder
Copy link

TheSpyder commented May 14, 2020

@bobzhang cool, maybe later there can be a "minify" compiler mode that shrinks the key string to a single character 😂 something I'd like for some of my records-as-objects too 😂

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants