-
Notifications
You must be signed in to change notification settings - Fork 1
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
enhance minifier #3
base: main
Are you sure you want to change the base?
Conversation
I got kinda "mentally-blocked" at this point, so I'll write pseudo-code, then translate to Go. I think doing that might help me solve the algorithm faster |
I realized it's helpful
IDK why it was that way before
(for later use)
Thank you (everyone reading this) for your patience. I'm sorry for "abandoning" this project. Since I had to reinstall my OS, I didn't find time to install the Golang toolchain. I'll be back in ~2 months, if everything goes fine IRL (please read my profile for context) |
No problem!
|
- minor edits to comments - write some pseudo-code to remember how to implement mem-simulator algorithm
Now that bfgo has support for loading "memory-dumps", some of the minifier's assumptions would be broken (such as zero-loop). I propose we add optimization levels (like a compiler). Here's a draft: I want to branch that into its own PR, as this PR is already blocking on multiple features |
As I mentioned in the updates at #5, I added If we add bf.style inside bfgo, I will use memory-dumping internally without exposing the feature to the user so that the minifier is not affected. The |
oh ok. But still, I believe it'll be useful to have (at least) 2 minification levels ( Loading/dumping mem can be useful for users who want to debug their code, although REPL seems to be enough for simple cases, and there's websites that provide full-blown debuggers (even stepping!), so I agree with not implementing mem |
Memory-dumping is removed at |
I got a new optimization idea! I named it "infinite-loop tail-elimination" (I added it to the task-list): It consists of recognizing "obvious" ♾️-loops of the form If the This allows the minifier to do transformations like these I'm aware |
Since the PR has been delayed for a long time, I'll defer ZBL and ILTE to a follow-up PR. I'll implement the mem-sim as it's high-priority |
Closes #2
+
/-
x 256 removal" (wrap-around normalizer), "mutual-cancel", and "+
/-
129+ swapper".
or,
or]
+++[-]
->[-]
(doesn't apply to,,,[-]
)[...]
->[.]
(deferred, and doesn't apply to[,,,]
)