Jump to content

Sky Slate Blueberry Blackcurrant Watermelon Strawberry Orange Banana Apple Emerald Chocolate
Photo

Source-to-source compiler, AutoHotkey to C++


  • Please log in to reply
13 replies to this topic
SOTE
  • Members
  • 53 posts
  • Last active: Jul 06 2015 12:35 PM
  • Joined: 04 Jun 2015

In learning and reading the forum, it appears there are people with an interest to sell AutoHotkey commercially or protect their source code.  It seems that in theory, it would be possible to make a source-to-source compiler for AutoHotkey scripts.  For those not familiar with the term, a kind of translator between different programming languages.  Clearly there is a direct 1 to 1 link between commands of the languages, as AutoHotkey is created from C++.  Instead of binding the script with the AutoHotkey executable, the source-to-source compiler would spit out equivalent C++ source code (or best guess), and then the user would use a C++ compiler to make the executable.  The user wouldn't have to get so deep into C++, unless they wanted, except for compiling or making some corrections.

 

In this way, users can have the best of both worlds and tremendous added flexibility.  Being able to stay fast, light, and simple with AutoHotkey scripting, or they can go as deep as they want into programming (definitely not for everyone).  Instead of one or the other, they have both, and can easily switch between them.



gregster
  • Members
  • 283 posts
  • Last active: Nov 09 2015 03:08 AM
  • Joined: 19 Mar 2009

AHK is open source... what stops you?



SOTE
  • Members
  • 53 posts
  • Last active: Jul 06 2015 12:35 PM
  • Joined: 04 Jun 2015

It's a suggestion, so don't take offense.  I'm just beginning with AHK, so don't have that level of skill yet.  I would think more advanced AHK coders or programmers might consider it.  And at some point I may though.  Such a conversion tool could be quite useful.  As I read up on old posts at this website, it seemed like a solution for what some wanted to do commercially or businesswise.



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

Clearly there is a direct 1 to 1 link between commands of the languages, as AutoHotkey is created from C++.

 

Far from it.  The commands are implemented in C++; they are not part of the C++ language.

 

Instead of binding the script with the AutoHotkey executable, (...)

 

The executable contains not only the script interpreter, but also the library of commands and all the rest of the program's functionality, including the namesake hotkeys.  The license under which the program and all of its components are available (the GNU GPL) would not permit the use of the program's code in a closed-source compiled program.

 

The basis of the argument (which may or may not be valid) that compiled scripts need not comply with the GPL is that the script and interpreter/library are really separate things, packaged together for convenience.  The harder you make it to separate the two, the less likely it is that you're actually complying with the GPL.

 

Changing the license is not a feasible option, as it would require permission from all of the contributors since the beginning of the project (or, I guess, replacing a significant portion of code).

 

...  it appears there are people with an interest to sell AutoHotkey commercially or protect their source code.

 

I'm not going to stop others from hiding their code or trying to charge for their scripts, but I'm certainly not going to invest my time just to help them do it.



SOTE
  • Members
  • 53 posts
  • Last active: Jul 06 2015 12:35 PM
  • Joined: 04 Jun 2015

I highly respect your opinions and contributions.  Most definitely would like you working on version 2 of AutoHotkey.  What I was saying was more along the lines of a source-to-source translator.  Not necessarily that the output is compiled, but just that the source code is in a different computer language. Like a person would translate English into German.  My thought is that each AutoHotkey command has a C++ implementation.  Thus the source code script itself could be translated into equivalent C++ code, then compiled.  There is precedence for this in other computer languages.

 

The GPL question is a difficult one, but people do have the right to copyright their own source code.  So if they take that code and translate it into another language, I would think that's their individual right to do so.  I would think it's only a problem if you take somebody else's source code that has copyright to it.

 

Anyway, just a suggestion.  And I'm enjoying learning AutoHotkey.



Lexikos
  • Administrators
  • 9844 posts
  • AutoHotkey Foundation
  • Last active:
  • Joined: 17 Oct 2006

The GPL question is a difficult one, but people do have the right to copyright their own source code.

 

It's not about how they distribute their (translated and/or compiled) code, but about the parts of AutoHotkey itself which are included in the final executable. The GPL is designed to prevent the use of GPL-licensed code in compiled applications (aka "derived works") except where a compatible open-source license is used for the whole application.  If the translator just did a 1:1 translation of syntax and did not include the implementation of AutoHotkey's commands or hotkeys, the result would not be subject to the GPL, but it would also be incomplete and therefore quite useless.



col_mik
  • Members
  • 171 posts
  • Last active: Aug 29 2015 03:29 PM
  • Joined: 28 Jun 2015

If people want to sell their programs, another way, of course, would be for them to learn C++, write and compile their code and sell it.

Enough people have learned C++ to prove that it's do-able.  Not really my place to say, but if that's what they want from their programming skills, are they not in the wrong place here?

 

Prof. Feynman once said "Science is like sex - it may have a practical application, but that's not why we do it!".   I always thought of AutoHotkey in much the same way.



SOTE
  • Members
  • 53 posts
  • Last active: Jul 06 2015 12:35 PM
  • Joined: 04 Jun 2015

If people want to sell their programs, another way, of course, would be for them to learn C++, write and compile their code and sell it.

Enough people have learned C++ to prove that it's do-able.  Not really my place to say, but if that's what they want from their programming skills, are they not in the wrong place here?

 

Prof. Feynman once said "Science is like sex - it may have a practical application, but that's not why we do it!".   I always thought of AutoHotkey in much the same way.

 

The problem of course is that C++ is not as convenient or as easy to use as AutoHotkey.  I would think that many AHK coders would only need C++ in a specific instance, not in general.  So a source-to-source translator would be for a particular program.  If it existed, the person would still need to know some C++ to compile or make minor corrections.  But it would make the entire process, for say a particular program, much faster.



nnnik
  • Members
  • 1625 posts
  • Last active: Apr 11 2017 02:13 PM
  • Joined: 28 Jul 2012

I'm kinda working on something like this. But the theories behind that one are quite complicated and I doubt that I will ever finish.


Visit the new forum ahkscript.org.

http://ahkscript.org


SOTE
  • Members
  • 53 posts
  • Last active: Jul 06 2015 12:35 PM
  • Joined: 04 Jun 2015

I'm kinda working on something like this. But the theories behind that one are quite complicated and I doubt that I will ever finish.

 

Maybe make it a public project.  Various people could contribute by "translating" an AutoHotkey command to it's C++ equivalent.  Even something on the basic level of AutoHotkey syntax to C or C++ syntax could be useful and worthwhile for learning.



nnnik
  • Members
  • 1625 posts
  • Last active: Apr 11 2017 02:13 PM
  • Joined: 28 Jul 2012

It does not work that way


Visit the new forum ahkscript.org.

http://ahkscript.org


joedf
  • Administrators
  • 986 posts
  • AutoHotkey Foundation
  • Last active: Jul 18 2017 06:01 PM
  • Joined: 20 May 2012
lol.
Why ahkscript.org? - autohotkey.com is outdated

SnowFlake_FlowSnake
  • Members
  • 845 posts
  • Last active: Jan 24 2016 05:24 PM
  • Joined: 08 Oct 2012

Really?

 I doubt that I will ever finish

  • Download link of my scripts on Autohotkey.com 2/10/2015 [DOWNLAND]
  • Contact Info:  https://github.com/floowsnaake //  FloowSnaake(A)gmail.com
  • IF you need Help send me a PM,Email or Post on Github

  • Quote by tank  Posted 29 September 2015 - 06:14 PM

  • "Eventually i will find a way to convert the DB back to PHPBB3. but i dont have the bandwidth right now. No one that has tried has had success. It is the Only way i can keep this open is if i could successfully convert it."

SOTE
  • Members
  • 53 posts
  • Last active: Jul 06 2015 12:35 PM
  • Joined: 04 Jun 2015

It does not work that way


Could you elaborate more then on what your concept or approach is?