Is there a Minify/Uglify equivalent for ahk?

Get help with using AutoHotkey and its commands and hotkeys
brutus_skywalker
Posts: 175
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Is there a Minify/Uglify equivalent for ahk?

23 Apr 2018, 03:20

I'm playing around with java script, and i simply love minifying code,it of course serves a practical purpose,i.e speed- in js, but i was wondering out of simple curiosity if one exists for ahk, FYI i scoured the forums before asking, plenty of obfuscation methods, but none regarding minifying, the one i found with that particular term only removes white spaces.
Outsourcing Clicks & Presses Since 2004.
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Is there a Minify/Uglify equivalent for ahk?

23 Apr 2018, 15:17

writing a minifier that goes beyond the basic strip down the whitespace is a massive undertaking for something that would essentially be useless to 99.99999999999% of the userbase

i doubt youre gonna see this come to fruition
brutus_skywalker
Posts: 175
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Is there a Minify/Uglify equivalent for ahk?

24 Apr 2018, 01:47

swagfag wrote:writing a minifier that goes beyond the basic strip down the whitespace is a massive undertaking for something that would essentially be useless to 99.99999999999% of the userbase

i doubt youre gonna see this come to fruition
Yeah probly, but there's plenty of code in these forums written as a matter of curiosity, usefulness aside, so I'm hopping someone had my curiosity b4 me. Else I might have to whip one up my self just for the hell of it...

IMO, its not really a massive undertaking, it's just removing white spaces & comments and renaming every function/call, label, variable to fewer strings and programmatically refactoring if-else statements using ternary operators and possibly concactinating successive expressions for simultaneous processing(I.e ',' prefix to successive expressions). And given all that minifiying does logically result in increased performance, so it might even have practical use.
Outsourcing Clicks & Presses Since 2004.
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Is there a Minify/Uglify equivalent for ahk?

24 Apr 2018, 02:57

brutus_skywalker wrote:removing white spaces & comments and renaming every function/call, label, variable to fewer strings and programmatically refactoring if-else statements using ternary operators and possibly concactinating successive expressions for simultaneous processing(I.e ',' prefix to successive expressions)
sounds like the description of a massive undertaking to me

also, how does minifying improve performance
brutus_skywalker
Posts: 175
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Is there a Minify/Uglify equivalent for ahk?

24 Apr 2018, 03:16

In my experience, use of ternaries(implicitly faster) and having successive expressions processed 'simultaneously',as in

Code: Select all

X := 4
, y := 5.888
, z := Round(y)
Is faster than

Code: Select all

X := 4
y := 5.888
z := Round(y)
,it's a matter of making such alterations part of minifiying a script,as expressed in my prior post.
Outsourcing Clicks & Presses Since 2004.
swagfag
Posts: 1238
Joined: 11 Jan 2017, 17:59

Re: Is there a Minify/Uglify equivalent for ahk?

24 Apr 2018, 05:47

what? cmon now, youre pulling my leg
brutus_skywalker
Posts: 175
Joined: 24 Dec 2016, 13:16
Location: Antarctica

Re: Is there a Minify/Uglify equivalent for ahk?

24 Apr 2018, 22:27

swagfag wrote:what? cmon now, youre pulling my leg

I used skan's speed test function here https://autohotkey.com/board/topic/9186 ... code-runs/ , try it your self, it wasn't conjuncture or opinion on my part,just what I observed.

If I was wrong, I would gladly like to know how, I really would.
Outsourcing Clicks & Presses Since 2004.
Helgef
Posts: 3195
Joined: 17 Jul 2016, 01:02
Contact:

Re: Is there a Minify/Uglify equivalent for ahk?

25 Apr 2018, 06:25

youre pulling my leg
expressions wrote:Performance: [v1.0.48+]: The comma operator is usually faster than writing separate expressions, especially when assigning one variable to another (e.g. x:=y, a:=b). Performance continues to improve as more and more expressions are combined into a single expression; for example, it may be 35% faster to combine five or ten simple expressions into a single expression.
Cheers :wave:

Return to “Ask For Help”

Who is online

Users browsing this forum: No registered users and 202 guests