Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

As everyone says AHK is phenomenal but the scripting language is pretty warty. I wonder if they considered using Lua or something instead of improving their custom language?


I think the language is more of a feature than a detriment: much like Excel, it’s able to get non-programmers to do programming without realizing it. Both tools have a low barrier to entry and a relatively gradual learning curve.

All you have to do set up an AHK script is open up notepad, type a hotkey symbol, then some basic commands like “Click <X>, <Y>” or “Send <keystrokes>”, save the file, and double click to run. Doesn’t get much simpler. Loops and routines can be learned over time as needed, and aren’t necessary to meet most people’s use cases.


I think this has more to do with scripting nature of the language than its syntax itself - at least I always found the best/easiest environments to use in practice to be the ones that:

1) executed in a clear, top-down fashion, allowing to write code top-level, without wrapping it in functions and calling from an explicit entry point like main();

2) interfaced directly with the useful APIs, vs. having to manage libraries and namespaces;

3) interpreted directly from the source file, as opposed to having first run a compiler or other explicit, artifact-producing step;

Basically, languages that would let me just write minimum amount of code to solve, through trial and error and experimentation, my simple problems.

I believe this is where some Lisp language would shine, if not for the fact that you have to press SHIFT to enter parentheses... I suspect this is a large reason people ended up preferring scripting languages with punctuation that can mostly be entered without modifier keys.


I suspect it's similar to why we don't use Lua, Python, or whatever language is considered easy and quick to learn and write as a shell language. There are specialized cases where it's much, much faster to write commands in a custom language (even if it has to be a "proper" (e.g., Turing complete) language and not just some tags like markdown). From my limited use of AHKv1 a decade ago, I would suspect that AHK is such a case. You can get a long way with operator overloading, but having seen students who had decent C++ knowledge use CPLEX, I'm not sure it makes things any less confusing.


I agree AHK is warty... but Lua?


What’s the benefit of trading one awful language for another? Why bother?




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: