I guess I wasn't clear. I can't change the fact that PassThrough must execute before anything else in the hotkey. This is a consequence of the fact that the keyboard hook must return to the OS as fast as possible. It's a limitation imposed by the nature of PassThrough (what it does at the system level).
The only thing I can control is how this fact gets communicated to the user.
There are three channels through which I can communicate this fact: documentation, language syntax, and error messages.
You learned about the fact from an error message.
What I was discussing was how I chose to communicate the fact, not the fact itself, which is a given.
C++ programs and AutoIt programs are different sorts of things. They work in completely different ways. C++ programs are very, very, very much faster.I discovered that performing a DLL call took a LOT longer than it did in C++. Most users would never even notice since the difference was only a few milliseconds.
C++ programs are compiled and linked. Compiled means native code, code that executes immediately inside the CPU. Linked means the different pieces of code exist in the same process and can call each other through CALL instructions executed by the CPU.
AutoIt programs are nothing like that. They are interpreted programs. They aren't native code. They don't consist of instructions that execute in the CPU. They don't have a process. The process belongs to the AutoIt interpreter. These facts alone (apart from DLLs) make execution many times slower.
With C++, the DLL gets loaded into the process's address space once, and from that time onward, your code can call the DLL as if the DLL was an integral part of the code (which it is after it's loaded).
That doesn't happen with an AutoIt program because your program isn't the same kind of code as a DLL. They can't be linked directly. What happens is that the AutoIt interpreter (not your program) asks the operating system to load the DLL into AutoIt's address space. Then AutoIt calls your requested function in the DLL through a bunch of intermediary code which is much, much, much slower than the equivalent operation in C++.
That's not the reason. Both languages are written in C++. (In other words, C++ compilers are written in C++. They have to be written in something.)But basically it took like 2 hours to execute this algorithm in AutoIt but only like 10 minutes in C++. I can only assume the reason is because AutoIt is a language coded from C++.
Designing a language and implementing its interpreter (or compiler) is one of the most interesting, educational things a programmer can do.I'm a user of languages, not a writer of them. So some of my opinions here could be wrong. I only speak from my own experiences. I would have to do a lot of research to even know where to begin writing a language.
It's also a lot of fun to create your own language and use it.
Writing a language is harder than most things that self-taught programmers do for fun, but it's not *that* hard. It's within reach of many programmers. If it seems interesting to you, i urge you to give it a try.
Connect With Us