This is a little toy I recently wrote in my spare time at work that converts coffeescript (a javascript dialect, very similar to ruby) to ahk.
For me, this solution solves a lot of problems. Not only did it allow me to implement features with a more familiar syntax, but it also implemented some capabilities that v1 did not have, such as anonymous functions, template strings, function nesting, etc.
The following is the address of the project, which may not be very stable since it is a new project written on the fly.
https://github.com/phonowell/coffee-ahk
This is an example of what was actually written with the project, a game script for Genshin Impact.
https://github.com/phonowell/genshin-impact-script
Another ahk solution, coffeescript to ahk
Forum rules
Discuss Autohotkey related topics here. Not a place to share code.
Discuss Autohotkey related topics here. Not a place to share code.
Re: Another ahk solution, coffeescript to ahk
This is an html for quick preview, drag and drop it into your browser and start playing immediately.
However, due to browser security policy restrictions, features like `include` and `import/export` are not available.
However, due to browser security policy restrictions, features like `include` and `import/export` are not available.
- Attachments
-
- coffee-AHK preview 0.0.31.zip
- (647.44 KiB) Downloaded 143 times
Last edited by Mimiko on 23 Feb 2021, 01:27, edited 1 time in total.
Re: Another ahk solution, coffeescript to ahk
Yes, very interesting and thank you Mimiko for showing this. Also, reversing this transpiler and going from AHK to Coffeescript, appears quite intriguing as well.
Re: Another ahk solution, coffeescript to ahk
https://github.com/phonowell/coffee-ahk/blob/master/doc.md
Simply write an instruction document.
I've been using this tool for practical development myself, and feel pretty good abt it.
Simply write an instruction document.
I've been using this tool for practical development myself, and feel pretty good abt it.
Re: Another ahk solution, coffeescript to ahk
So I came back with a little something new, a webapp based on Neutron.ahk
Since coffee-ahk is able to use javascript syntax to work with ahk, this project can be done all in javascript
Also, it would be nice if there was a webview2 library for 1.x
Since coffee-ahk is able to use javascript syntax to work with ahk, this project can be done all in javascript
Also, it would be nice if there was a webview2 library for 1.x
- Attachments
-
- Clock.zip
- (516.19 KiB) Downloaded 89 times
Re: Another ahk solution, coffeescript to ahk
so you can use CS to write AHK using libraries in CS that look like native JS but are actually AHK under the hood, and it all compiles with Ahk2Exe. And using Neutron you can mix your fake CS that compiles to AHK with *real* CS that compiles to JS and thus make it all single-language, if I've understood this correctly. This is all super fascinating. I've seen you even did Lodash and JQuery for AHK here: https://github.com/phonowell/shell/. Are the language and the libraries all full compatible with JS? In other words, can you execute Coffee-AHK in both your browser as JS and using your compiler as AHK?
CS and AHK are probably my favorite languages. I built CoffeeSense and AHK_X11 so I love to see both languages getting married :)
CS and AHK are probably my favorite languages. I built CoffeeSense and AHK_X11 so I love to see both languages getting married :)
Re: Another ahk solution, coffeescript to ahk
Methods injected into the js environment from ahk can be called in the browser via js with little perception of use. However, using js methods in ahk is much more difficult, as there are too many built-in functions missing.phil294 wrote: ↑08 Sep 2022, 04:50so you can use CS to write AHK using libraries in CS that look like native JS but are actually AHK under the hood, and it all compiles with Ahk2Exe. And using Neutron you can mix your fake CS that compiles to AHK with *real* CS that compiles to JS and thus make it all single-language, if I've understood this correctly. This is all super fascinating. I've seen you even did Lodash and JQuery for AHK here: https://github.com/phonowell/shell/. Are the language and the libraries all full compatible with JS? In other words, can you execute Coffee-AHK in both your browser as JS and using your compiler as AHK?
CS and AHK are probably my favorite languages. I built CoffeeSense and AHK_X11 so I love to see both languages getting married
Coffee-AHK can compile a copy of the code into both ahk and js, and both are basically the same at the syntax level, the only difference is the environment they run in.
So I can use CoffeeSense (yes, your awesome project) to compile the cs code into js first, use that js to call typescript for checking, and eventually provide static type support for ahk.
I've recently been writing d.ts for my past project to provide type support, and this feels very ...... modern. As of now, I've found no less than ten typo errors :p
Return to “General Discussion”
Who is online
Users browsing this forum: No registered users and 29 guests