Timeline for Program for compacting other given code
Current License: CC BY-SA 3.0
14 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Apr 3, 2015 at 15:08 | vote | accept | Peter | ||
Mar 29, 2015 at 1:27 | history | tweeted | twitter.com/#!/StackCodeReview/status/581990960642580481 | ||
Mar 28, 2015 at 13:15 | answer | added | Veedrac | timeline score: 2 | |
Mar 27, 2015 at 0:15 | comment | added | Gareth Rees |
minipy can't be sure that b.rowColumnLayout is idempotent — it could be a property that has a side effect, or which returns a different result each time it is called.
|
|
Mar 27, 2015 at 0:10 | comment | added | Peter |
Thanks, that looks a bit above my level but I kinda half understand what you're doing haha. Also noticed something you may have overlooked. There's a lot of repeated functions in the output such as with b.rowColumnLayout(... that could be all assigned to one variable
|
|
Mar 27, 2015 at 0:02 | comment | added | Gareth Rees |
Names are found by walking over the abstract syntax tree in the FindNames class. The mapping from original names to minified names is constructed in rename_ast .
|
|
Mar 26, 2015 at 23:56 | comment | added | Peter |
Ah nice, didn't realise you made it, and it was just a mistake on my part. I'd passed rename slightly wrong in minify :) The reduce part is really cool though, if you don't mind me asking, how do you detect what is a variable, and which letters are already taken?
|
|
Mar 26, 2015 at 23:37 | comment | added | Gareth Rees |
What was your test case? Trying pastebin.com/VaWTSZH3, I find that minipy shrinks it from 170k to 108k, and with --rename down to 83k. (Also, minipy always removes comments.) I'd be grateful if you could open an issue with all the relevant details (Python version, operating system etc.) so I can figure out what went wrong.
|
|
Mar 26, 2015 at 23:03 | comment | added | Peter | For the record, I just tried it out. Without renaming variables it was a tiny bit longer (since I removed the comments and that doesn't), however when I tried to let it rename variables, it shot up to 650k characters from the original 170k :p | |
Mar 26, 2015 at 22:49 | history | edited | Jamal | CC BY-SA 3.0 |
deleted 54 characters in body; edited title
|
Mar 26, 2015 at 22:37 | history | edited | 200_success |
edited tags
|
|
Mar 26, 2015 at 22:36 | comment | added | Peter | Ah nice, I guessed there might have been something out there but I never managed to find anything | |
Mar 26, 2015 at 22:32 | comment | added | Gareth Rees | See github.com/gareth-rees/minipy | |
Mar 26, 2015 at 22:27 | history | asked | Peter | CC BY-SA 3.0 |