Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

Discuss other programming languages besides AutoHotkey
User avatar
nnnik
Posts: 4276
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 05:50

You made the statement that AHK is fast enough for everything - but deliver no proof.
I have delivered a context where AHK wouldn't be fast enough.
You claim it's fast enough but have no actual proof.
The games you keep comparing the current problem to don't require a fraction of the resources.
Until you deliver the finished game with the genetic algorythm that can hold let's say 500 players at once I will ignore your comments as incoherent rambling.
Have a nice day :)
Recommends AHK Studio
User avatar
nnnik
Posts: 4276
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 05:55

Also btw since I used no optimization techniques in my Java code - stuff like MCode or creating your own Dlls or using external dlls aside from the WinAPI is forbidden.
Recommends AHK Studio
User
Posts: 407
Joined: 26 Jun 2017, 08:12

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 09:01

Oh my God, this is really silly, watching 2 people with good programming knowledge trying to prove that AHK, an interpreted language, a language that requires its interpreter all the time during script execution, to not be a slow language!

If you don't want to search google, well, I will not be the one to do that for you! (Though I know that you already did it, and that you already found out that, yes, Autohotkey = a very slow language!)

As far as I know, most languages, if not all, are interpreted language, because somehow their scripts need to be interpreted by an interpreter!

The main difference is that, for interpreted languages like Ahk or AutoIt, the interpreter is required all the time during script execution, which instantly makes the language a slow language!

For compiled languages like C\C++\C#, Java, Python, etc the interpreter is needed only once, before script execution, after that, the interpreter is not required during script execution, which instantly makes the language a fast language!

Tired of this, I already have the answers I wanted from this thread! Somebody please lock this thread! Thanks!



[Obs]: Most of the times, heavy Data-Processing\String-Manipulation tasks may be more demanding than Games!
User avatar
jeeswg
Posts: 6829
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 10:34

- @User: There is no technical term 'slow language'. I've told you that I've always managed to make my personal AutoHotkey scripts 'fast enough', and that I would welcome examples of scripts that couldn't be made 'fast enough' (as an AHK/C++/data storage challenge).
- FYI RegEx can be used in some situations to bypass Loop. Just one of many tricks.
nnnik wrote:I already gave an example which neither of you gave a reply to.
Any Application that I use should be fast. When I have to wait for any application I'm always on the verge of uninstalling it.
AHK is slow - anything else you say is false information and a lie.
The techniques you mentioned are essentially avoiding coding in AHK while seemingly coding in AHK.
You 2 are really starting to twist the truth here - it might become a problem so I will discuss this matter with the other staff.
- @nnnik:
- With games the issue is lag (performance) rather than duration. So your point was basically offtopic. Surely you'd know that performance issues are a sideways point cf. overall duration. So, do you have any examples re. overall duration?
- What do you mean by 'slow'? You're making the same mistake as User. Do you just want an argument that goes round in circles? (You say you don't use slow applications, and that AHK is slow, but you use AHK, which sounds like a contradiction.)
- I mentioned 2 techniques. I counted using machine code as within AHK. I counted calling external C++ exes as outside of AHK.
- While it's theoretically possible that you misunderstood me, nevertheless you have lied. Should I discuss it with the staff?

- As ever any criticisms you have made of me are either invalid or based on a misunderstanding. As ever you have maximised the discourtesy of your comments. Do try to redeem yourself this year, because I am inclined to be less forgiving than last year.
- Do try to behave as an administrator should and do consider matching the friendly ethos of the AutoHotkey Community. Let this be a teachable moment. As ever I don't bear any ill will against you and hope to work cooperatively with you in future.
- You're probably the only user on the forum that would make such a negative post over nothing for no reason. :facepalm:
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User avatar
nnnik
Posts: 4276
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 11:26

We have been talking about performance the entire time.
Recommends AHK Studio
User avatar
jeeswg
Posts: 6829
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 11:49

- Is that just semantic game playing again? I was referring specifically to the live performance quality of a game/video/audio. (If a data task 'performs' faster, it finishes earlier, but that's obvious.)
- User mentioned data processing and string manipulation, which are generally one-off input / output (with an end time), versus say games which are continual input / output (lag issues, live performance issues, which could potentially go on forever).
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
User
Posts: 407
Joined: 26 Jun 2017, 08:12

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 13:14

jeeswg wrote:
25 Jan 2019, 11:49
Just a simple example, make "Is()" function faster! (Without resorting to C\C++, Machine Codes, etc, etc)

"==" takes only 31 milliseconds to compare 2 strings of ~= 20 megabytes each!

"Is()" function takes 14000 milliseconds! (Too slow)

99_ SubStr() - can handle 20100100 (Recommended).png
99_ SubStr() - can handle 20100100 (Recommended).png (5.76 KiB) Viewed 2237 times

SubStr() - can handle 20100100 (Recommended)

Code: Select all

#NoEnv
SetBatchLines -1
ListLines Off

gui, add, text, w200 h100, please wait
gui, show

loop, 20100100
x .= "a"

y := x

x .= "a"
y .= "b"

Start := A_TickCount

if (x = y)
{
gui, hide
msgbox, % "yes (" A_TickCount - Start " milliseconds)"  
}
else
{
gui, hide
msgbox, % "no (" A_TickCount - Start " milliseconds)"  
}

gui, show

msgbox, % Is(x, "=", y)


guiclose:	;_______________
exitapp


Is(String_1, Operator, String_2)	;___________________
{

Start := A_TickCount

	loop
	{
	Char_1 := SubStr(String_1, a_index, 1)
	Char_2 := SubStr(String_2, a_index, 1)

		if (Char_1 == Char_2)
		{
			if (Char_1 == "" and Char_2 == "")
			{
			gui, hide

			return, "yes (" A_TickCount - Start " milliseconds)"
			}
		}
		else
		{
		gui, hide

		return, ""
		. "no (" A_TickCount - Start " milliseconds)"       "`r`n"
		. "`r`n"
		. "Difference found at string position " a_index    "`r`n"
		. "`r`n"
		. "(" Char_1 ") != (" Char_2 ")"
		}


	}

}

StrSplit() - can't handle 20100100

Code: Select all

#NoEnv
SetBatchLines -1
ListLines Off

#MaxMem 1000

gui, add, text, w200 h100, please wait
gui, show

loop, 10100100		;StrSplit() can't handle 20100100 
x .= "a"

y := x

x .= "a"
y .= "b"

Start := A_TickCount

if (x = y)
{
gui, hide
msgbox, % "yes (" A_TickCount - Start " milliseconds)"  
}
else
{
gui, hide
msgbox, % "no (" A_TickCount - Start " milliseconds)"  
}

gui, show

msgbox, % Is(x, "=", y)


guiclose:	;_______________
exitapp


Is(String_1, Operator, String_2)	;___________________
{

Start := A_TickCount

String_1 := StrSplit(String_1)
String_2 := StrSplit(String_2)

	loop
	{

		if (String_1[a_index] == String_2[a_index])
		{
			if (String_1[a_index] == "" and String_2[a_index] == "")
			{
			gui, hide

			return, "yes (" A_TickCount - Start " milliseconds)"
			}
		}
		else
		{
		gui, hide

		return, ""
		. "no (" A_TickCount - Start " milliseconds)"       "`r`n"
		. "`r`n"
		. "Difference found at string position " a_index    "`r`n"
		. "`r`n"
		. "(" String_1[a_index] ") != (" String_2[a_index] ")"
		}


	}

}
SOTE
Posts: 789
Joined: 15 Jun 2015, 06:21

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 13:29

jeeswg wrote:
25 Jan 2019, 11:49
- Is that just semantic game playing again? I was referring specifically to the live performance quality of a game/video/audio. (If a data task 'performs' faster, it finishes earlier, but that's obvious.)
- User mentioned data processing and string manipulation, which are generally one-off input / output (with an end time), versus say games which are continual input / output (lag issues, live performance issues, which could potentially go on forever).
And jeeswg, you are being so kind. I was expecting nnnik to teach us, by showing us comparative lines of code between languages, but then he was talking about us programming a game for "500 players at once". This then gets into Client-Server architecture, networking, thread pooling, additional libraries, and all kinds of other points of failure that go beyond just which programming language that a person is using. And we are supposed to take his unfinished Java code, and use that as the reference point to rewrite the entire game for him.

User, thanks for the example. Though you are putting a condition on possible solutions, that was never our argument. The counter-argument was that you could use machine code, if performing a task in AutoHotkey was too slow. And that if you had to learn another language, this would be no harder than learning to implement machine code in Autohotkey. We didn't say AutoHotkey was perfect, just that it was "fast enough" for most purposes. People should be free to use whatever programming language they feel good about. Nothing wrong with using AutoHotkey, and some other language to accomplish whatever goals.

Anyway, I think this is a no win debate. Let's call a truce. We just all have to agree, to disagree on this one.
User avatar
nnnik
Posts: 4276
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 13:46

@SOTE you didn't click on any on the links I sent or?

@jeeswg I'll take that as a yes.
If we are talking about performance it's the things it achieves divided by the time it takes right?
Recommends AHK Studio
User
Posts: 407
Joined: 26 Jun 2017, 08:12

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 13:53

SOTE wrote:
25 Jan 2019, 13:29
Though you are putting a condition on possible solutions, that was never our argument. The counter-argument was that you could use machine code, if performing a task in AutoHotkey was too slow. And that if you had to learn another language, this would be no harder than learning to implement machine code in Autohotkey.
You must be kidding! You and jeewsag are being stubborn on this matter!
1_ whistling.gif
1_ whistling.gif (1.19 KiB) Viewed 2210 times

AHK can't even fast handle the simple function I posted above, what else do you want to prove you 2 that, yes, AHK is a very slow language!

AHK = slow language

AHK + C\C++ machine code = may be a faster language (in which is absurd! I better learn C#, Java or whatever instead AHK + C\C++ machine code)

AHk is suitable for some Windows OS and Games automation!

AHK should not be used for data-processing\string-manipulation, unless you want to stress out yourself with C\C++ machine codes!
Helgef
Posts: 4002
Joined: 17 Jul 2016, 01:02
Contact:

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 14:23

Hello :wave:. This thread got me thinking of a new puzzle.

Cheers.
swagfag
Posts: 2998
Joined: 11 Jan 2017, 17:59

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 14:36

here is ur faster way:

Code: Select all

#NoEnv
SetBatchLines -1
ListLines Off


DllCall("LoadLibrary", "Str", "msvcrt.dll", "Ptr")

gui, add, text, w200 h100, please wait
gui, show



VarSetCapacity(temp_a, (temp_chars := 100000) * 2)
Loop % temp_chars
	temp_a .= "a"

global NUM_CHARS := 2000 * 1000000 ; in millions
VarSetCapacity(x, NUM_CHARS * 2 + 2)
loop % NUM_CHARS / temp_chars
x .= temp_a

VarSetCapacity(y, NUM_CHARS * 2 + 2)
y := x

x .= "a"
y .= "a"
; y .= "b"
++NUM_CHARS

Start := A_TickCount

if (x = y)
{
gui, hide
msgbox, % "yes (" A_TickCount - Start " milliseconds)"  
}
else
{
gui, hide
msgbox, % "no (" A_TickCount - Start " milliseconds)"  
}

gui, show

msgbox, % Is(x, "=", y)

guiclose:	;_______________
exitapp



Is(ByRef String_1, Operator, ByRef String_2)	;___________________
{

	Start := A_TickCount

	if DllCall("msvcrt.dll\memcmp", "Ptr", &String_1, "Ptr", &String_2, "Int", NUM_CHARS * (A_IsUnicode ? 2 : 1), "Int")
	{
	gui, hide
	return "no (" A_TickCount - Start " milliseconds)"  
	}
	else
	{
	gui, hide
	return "yes (" A_TickCount - Start " milliseconds)"  
	}
}
SOTE
Posts: 789
Joined: 15 Jun 2015, 06:21

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 16:38

swagfag wrote:
25 Jan 2019, 14:36
here is ur faster way:

Code: Select all

#NoEnv
SetBatchLines -1
ListLines Off


DllCall("LoadLibrary", "Str", "msvcrt.dll", "Ptr")

gui, add, text, w200 h100, please wait
gui, show



VarSetCapacity(temp_a, (temp_chars := 100000) * 2)
Loop % temp_chars
	temp_a .= "a"

global NUM_CHARS := 2000 * 1000000 ; in millions
VarSetCapacity(x, NUM_CHARS * 2 + 2)
loop % NUM_CHARS / temp_chars
x .= temp_a

VarSetCapacity(y, NUM_CHARS * 2 + 2)
y := x

x .= "a"
y .= "a"
; y .= "b"
++NUM_CHARS

Start := A_TickCount

if (x = y)
{
gui, hide
msgbox, % "yes (" A_TickCount - Start " milliseconds)"  
}
else
{
gui, hide
msgbox, % "no (" A_TickCount - Start " milliseconds)"  
}

gui, show

msgbox, % Is(x, "=", y)

guiclose:	;_______________
exitapp



Is(ByRef String_1, Operator, ByRef String_2)	;___________________
{

	Start := A_TickCount

	if DllCall("msvcrt.dll\memcmp", "Ptr", &String_1, "Ptr", &String_2, "Int", NUM_CHARS * (A_IsUnicode ? 2 : 1), "Int")
	{
	gui, hide
	return "no (" A_TickCount - Start " milliseconds)"  
	}
	else
	{
	gui, hide
	return "yes (" A_TickCount - Start " milliseconds)"  
	}
}
Wow, that didn't take long to come up with a possible solution, after code was actually posted.
User avatar
jeeswg
Posts: 6829
Joined: 19 Dec 2016, 01:58
Location: UK

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 19:46

- @nnnik: Words can have multiple meanings. For example, if someone wants to turn an ordinary discussion into a childish argument, 'pretending that A means B' is a rhetorical device that one could use.
- If we take the word 'performance' as an example. My dictionary states 'a task or operation seen in terms of how successfully it is performed', i.e. quality (low CPU, low energy consumption, few errors, no lag), not necessarily speed.

- @User: I think that you enjoy arguing somewhat, and you've taken some brave positions sometimes (e.g. your 'O' object and 'dynamic' coding). Fortunately for you, you argue in a stubborn but reasonably friendly way, so I remain inclined to participate.
- As ever, slow and fast are relative terms, so your sentence is more emotional than it is meaningful. Repeating it hasn't made it in any way a strong argument.

- These functions are useful for comparing data, though are subtly different:
msvcrt\memcmp returns: 0 if same, positive if data 1 is greater, negative if data 2 is greater
ntdll\RtlCompareMemory returns: 0 or positive (number of bytes that match)
- You could use RtlCompareMemory to the find the first byte that differs, and then memcmp to find the larger byte of the two.
- memcpy is another useful function.
- Loop and SubStr were always going to be slow.

- I wouldn't use StrSplit on a string that was too large. Instead I might use repeated InStr/RegExMatch, and store the results in an array or comma-separated list.
homepage | tutorials | wish list | fun threads | donate
WARNING: copy your posts/messages before hitting Submit as you may lose them due to CAPTCHA
SOTE
Posts: 789
Joined: 15 Jun 2015, 06:21

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 22:22

jeeswg wrote:
25 Jan 2019, 19:46
- As ever, slow and fast are relative terms, so your sentence is more emotional than it is meaningful. Repeating it hasn't made it in any way a strong argument.
Truth! If somebody says, "It's slow." Then the obvious response is, "Slow for what?" It's going to be relative to what you are doing or need. If a person is so consumed by just an unreasonable need for speed, then arguably they should go program in the Assembly language. Yeah, your programs might be smaller and faster, but you are likely to take longer to make them or get frustrated making bigger programs. Like most things, there is a trade off, of positives and negatives. The major reason for AutoHotkey in the first place was easy of use, to be easier to understand, and convenience.
- These functions are useful for comparing data, though are subtly different:
msvcrt\memcmp returns: 0 if same, positive if data 1 is greater, negative if data 2 is greater
ntdll\RtlCompareMemory returns: 0 or positive (number of bytes that match)
- You could use RtlCompareMemory to the find the first byte that differs, and then memcmp to find the larger byte of the two.
- memcpy is another useful function.
- Loop and SubStr were always going to be slow.
- I wouldn't use StrSplit on a string that was too large. Instead I might use repeated InStr/RegExMatch, and store the results in an array or comma-separated list.
These important points should not be lost in this "need for speed" mania. There can be multiple ways of doing something or speeding things up. But one person doesn't see it, while another person does. Maybe the answer is to use a certain DLL. Maybe mix program languages in your AutoHotkey script or add some machine code. Maybe the answer is to code your program a different way. Maybe the person needs to study more about algorithms or become a better programmer. Etc...

There has been many times where I couldn't do something one day, then the next day figured out how to do it or figured out some other way it could be done. Sometimes I couldn't figure it out, so asked some others for help. And with more eyes on the problem, someone came up with an answer I just couldn't see before. Such things can require us not to get so emotional or frustrated that we throw a tantrum against the program, but try to be more open-minded about how to solve it. I know it's hard, and we all can be stubborn or get frustrated, but it's good to at least try to open our minds to other possiblites.
User
Posts: 407
Joined: 26 Jun 2017, 08:12

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 22:36

swagfag wrote:
25 Jan 2019, 14:36
Oh My God, what a shitty code!

First of all, your code returns only "out of memory" blah blah blah!

Secondly, the point of "Is()" function is to show where (string position) the 2 strings don't match each other!

I dismiss your shitty code 100%! Image
swagfag
Posts: 2998
Joined: 11 Jan 2017, 17:59

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 23:40

if u get out of memory u can:

1. buy more ram
2. generate a smaller string

i trust ull figure out how to do 2.

as for the code being shit. well yeah, i agree, it absolutely is. after all, was ur code to begin with. i tried making it better, but im no magician sadly. u can only polish a turd so much

re ur second point: does = tell u where the difference is? no? so why tf then are u benching it against the implementation of a shitty algorithm that does??
Last edited by swagfag on 25 Jan 2019, 23:46, edited 1 time in total.
User
Posts: 407
Joined: 26 Jun 2017, 08:12

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

25 Jan 2019, 23:43

swagfag wrote:
25 Jan 2019, 23:40
Hehe, swagfag's and its shitty codes! Image
swagfag
Posts: 2998
Joined: 11 Jan 2017, 17:59

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

26 Jan 2019, 02:20

hey, at least ur becoming cognizant of the fact
thats progress, my friend!
User avatar
nnnik
Posts: 4276
Joined: 30 Sep 2013, 01:01
Location: Germany

Re: Is there any non-100%-interpreted scripting language alternative to AutoHotKey?

26 Jan 2019, 03:12

This topic is not doing well I locked it.
Recommends AHK Studio

Return to “Other Programming Languages”

Who is online

Users browsing this forum: No registered users and 3 guests