Quote Originally Posted by Freddie View Post
Thanks. I appreciate that. It's not the worst program I ever wrote, but it's much less good than its replacement will be if I ever finish it.
You're welcome! Even if your program is not perfect, and what program is? It's still a great program and I'm very sure you had a lot of sleepless nights working on it.


Quote Originally Posted by Freddie View Post
Let me give you an example of the bad decisions I made when I designed HotkeyNet's language. The worst one was not having any end-of-block markers. It makes the language terribly confusing. The language *does* have blocks, and they *do* nest, but since there are no end-markers, the language imposes the block structure according to precedence rules which are described under "Blocks and nesting" in the instruction section of the website. I thought this would be simpler than requiring the user to mark blocks, but in fact it makes things harder because the user has to understand the precedence rules.

I did this as an experiment because I had never seen a language with this kind of design, and I was curious to see how it would work. Well, it works very badly! Now I know why nobody designs languages this way!
Yes, I discovered this limitation when I tried to nest <If> blocks. <DoHotkey> allows a workaround, but there is definitely room for improvement in this area.


Quote Originally Posted by Freddie View Post
What does PassThrough really do? It tells the keyboard hook not to swallow the trigger event. Therefore it's a directive to the keyboard hook.

Every other keyword you write in a defintion (including If) gets executed by the interpreter after the hook finishes. PassThrough is a different kind of keyword. It's the only directive in the entire script language that gets executed by the hook.

The hook finishes before the interpreter begins. Therefore, PassThrough must execute before everything else you write in a hotkey definition.

I added a syntax rule -- which is enforced by the parser -- that requires PassThrough, if it's used at all, to be the first statement in a definition.
Which explains the error. The <PassThrough> was inside of an <If> block and was also not the first statement in the definition.

Quote Originally Posted by Freddie View Post
I thought this was a clever solution to the problem because everybody assumes scripts execute from top to bottom, and the parser would automatically force them to realize that PassThrough executes first. They wouldn't have to read this in the documentation. The parser would force them to do it correctly by means of an error message.

But as you can see from your own experience, this didn't work. You thought you encountered some sort of problem. Perhaps it would have been better if I had made a completely different syntax for PassThrough.
Yeah, there's probably room for improvement there. I can think of some situations where it would cause some problems. Like if someone only wanted to use <PassThrough> if certain conditions existed. Which would mean the PassThrough would have to be placed inside of an <If> block. Unless <DoHotkey> would allow a workaround for this as well. I haven't faced this particular situation yet so I haven't had to try it.

But still, every language has it's limitations. Some people will never hit the limitations of some languages. It depends on how advanced they are and what they are trying to accomplish.

For example, I found a limitation of AutoIt a few years back. 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. But when you have an algorithm that calls a DLL 10 million times those few milliseconds multiply the overall time it takes to execute by a lot. If the DLL call in C++ only took .1 ms and in AutoIt the call took 10 ms, that means it took 100 times longer to execute!!!

I don't know the exact time differences, that's just an example. 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++. So doing the call in C++ is a straightforward call, but in AutoIt it performs other actions behind the scenes which add to the time since it executes more lines of code.

So the language needs to fit the situation. I loved AutoIt. I found it very fun to use. But It couldn't be used for everything.

HotkeyNet is the same thing. It works great with basic scripts and in some advanced situations. But it has it's limitations. Your new language will be much better I am sure. But even that language will have it's limitations. Whether or not people actually hit those limitations remains to be seen. But I would say that some probably will.


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.