 |
AutoHotkey Community Let's help each other out
|
| View previous topic :: View next topic |
| Author |
Message |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Fri Feb 08, 2008 10:13 am Post subject: Other languages like AutoHotkey or AutoIT |
|
|
Hi,
are there any other languages which are system independent and similar to AHK? I mean the fact, that the scripts are compiled in memory before executing, so that they are very fast.
If I'm right, scripting languages like PHP or Ruby or normal interpreters which are slower than AHK. _________________ Tekl |
|
| Back to top |
|
 |
majkinetor
Joined: 24 May 2006 Posts: 3622 Location: Belgrade
|
Posted: Fri Feb 08, 2008 1:04 pm Post subject: |
|
|
You can't really compare them that way.
AHK is automatition language, and there was already question about that class on the forum. Some of the alternatives are PP, Ranorex, WinRunner, Phantom, AutoIt, WinBatch....
If you are talking about exe compilation, AHK is faster as script.
If you are talking about semicompilation, there are number of languagages with that approach, most notably Perl.
Since you touched Ruby, there are some projects going on to convert Ruby to C
I don't beleive you can find faster scripting lang then AHK. This is probably because AHK all mentioned languages are 100xpowerful then AHK and much more flexibile (automatition langs are designed for special purpose, so this is OK). There were already talks around about AHK having its own language can be seen as wrong concept. Instead, it could made its functionality as DLL and let the people use its functionality from any language, for instance Lua (only 100 kb, very powerful and fast). This is how Ranorex is for instance done - that is library for Pithon, C, C++, C#, and Java and you can create interface for any language. In pro (commercial) version you have even concepts like HotKeys ala AHK way. _________________
 |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Fri Feb 08, 2008 2:17 pm Post subject: |
|
|
Hi,
thanks for your detailed answer.
I'm not looking for an automation language like AutoHotkey.
I'm looking for a fast language for scripts like parsing text files and not automating other applications. I can do most of my tasks with AHK and I can do it very fast most times, but it only works on Windows.
I'm looking for a fast language which is also available on Mac OS X or Linux, so I don't have to learn one language for every system.
It should be possible to create simple GUIs and it should also be possible to easily share scripts. So the scripting environment must be simple to install. In AutoHotkey I like that I don't have to install it and that it's very small. Java for example is a very big package and has to be installed.
I thought about Python with its just-in-time-compiler Psyco, but it makes things more complicated. As my main Unix platform is OS X I also thought about ObjC, but I hate compiling and AppleScript is slow and has a bad syntax.
My main tasks are reading files, parsing them and writing to a file. _________________ Tekl |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 384 Location: Berlin
|
Posted: Fri Feb 08, 2008 11:13 pm Post subject: |
|
|
Just tipps, have not tested them ...
BASIC Interpreter
| http://www.thefreecountry.com/compilers/basic.shtml wrote: | ScriptBasic BASIC Interpreter
This free BASIC interpreter works under Linux and Win32. It is distributed with its C source code under the GNU GPL and is extensible using dynamic load libraries (or shared libraries for Linux). It actually creates an intermediate pseudo code, which is then interpreted. The interpreter is designed to be thread-safe, and can be embedded into other programs or systems (like a web server). It has a CGI module, which allows it to be used for CGI programs, as well as modules for accessing databases. |
ScriptBASIC Home
C Interpreter
| http://www.thefreecountry.com/compilers/cpp.shtml wrote: | CINT C and C++ Interpreter
This is a C/C++ interpreter that comes with source code. It can be compiled and used on a large variety of Unices, including HP-UX, Solaris, SunOS, AIX, Alpha/OSF, FreeBSD and Linux, as well as Windows NT. You can even issue system calls from the interpreter (such as Posix calls on Unix or Windows API calls from Windows). It accepts most of K&R and ANSI C and is close to the standard C++ (at the time of this writing). As with all interpreters, it may be useful in debugging programs or learning the language. |
CINT Home
CINT Windows binary download |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Sat Feb 09, 2008 4:14 am Post subject: |
|
|
Thanks for the suggestions.
ScriptBasic does not have Regular Expressions, so it's useless for me.
I don't think I want to learn C as I think scripts get very complicated or large. I want one command to read files, on command for replacing strings etc. _________________ Tekl |
|
| Back to top |
|
 |
Tuncay
Joined: 07 Nov 2006 Posts: 384 Location: Berlin
|
Posted: Sat Feb 09, 2008 9:56 pm Post subject: |
|
|
Another suggestion:
BASIC Interpreter Environment
| http://www.jmksf.de/rb5/index.php?lang=1 wrote: | | RapidBATCH is a powerful scripting language and development platform for professional automation-tools and common Windows-applications. The brand-new version 5.1 of RapidBATCH opens new dimensions and possibilities, tuning RapidBATCH up to a real software solution system for different problems and purposes. |
| http://www.jmksf.de/rb5/index.php?pageID=1132918959&lang=1 wrote: | * A complete, easy learnable, clearly arranged and powerful Windows® programming language for the development of professional batch-tools and common applications
* At least 90 easy learnable programming instructions and build-in functions for fast application development
* Very flexible syntax and usage
* More than 30 build-in functions for system-specific operations
* 10 build-in dialog windows to program simple user interaction possibilities very quickly
* Possibility to create completely individual user-interfaces and dialog windows with about 15 different dialog controls, like e.g. buttons, text-fields, listboxes and many more.
* More than 50 pre-declared variables to individualize your RapidBATCH applications and to access many Windows-functionalities
* RapidBATCH script-interpreter for a fast, direct script-execution
* Includes the sourcecode-editor RapidBATCH Builder for comfortable script editing with direct debugging
* Integrated script-debugger to quickly search logical bugs within your scripts (Professional Edition only)
* Fast script-compiler to compile RapidBATCH script-files into stand-alone running .EXE program-files, running on all Windows-systems without a RapidBATCH-interpreter (Professional Edition only)
* Includes numerous example-programs
* Some parts of the RapidBATCH software package had been written in RapidBATCH itself!
* Visual Dialog Designer for a quick and easy creation of dialog- and application-windows in a WYSIWYG (What You See Is What You Get) environment (Professional Edition only)
* Detailed programming manual with huge language reference guide
* Completely english software-package and manual
* Runable on Windows 95/NT/98/ME/2000/XP and 2003 Server, designed for Windows XP |
RapidBATCH Home
But I dont think, that it would fit your wishes.
Why are you searching for an alternative? What about AutoIt? Are you not happy with AutoHotkey? What do you miss in Ahk?? |
|
| Back to top |
|
 |
AGU Guest
|
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Sun Feb 10, 2008 12:37 am Post subject: |
|
|
@Tunacy: RapidBatch is Windows only. Windows only AHK fits my need.
@AGU:Do you know about Perls performance? Is it comparable with AHK? GKT+ seems to be an Addition to Perls, so If I give someone other my script he should know how to install GTK+, right? _________________ Tekl |
|
| Back to top |
|
 |
AGU Guest
|
Posted: Sun Feb 10, 2008 11:25 am Post subject: |
|
|
| Quote: | | Do you know about Perls performance? | Sorry. I don't know Perls performance. I just came across Perl through c't.
It was about generating Websites with Perl and Template Toolkit. (23/07 S.186)
Maybe these guys can say something about Perls performance. Maybe even in comparison with AHK.
As they're making a lot of text replacement and knowing that Perls RegEx support is deeply integrated, Perl being crossplatform compatible , I thought this is what you're looking for.
RegEx in Perl:
http://de.wikipedia.org/wiki/Perl#Regul.C3.A4re_Ausdr.C3.BCcke
http://www.troubleshooters.com/codecorn/littperl/perlreg.htm
I don't know very much about cross compatible GUIs, but thought GTK+ might be a good solution, as it can be used under Windows, Linux and MacOS.
| Quote: | | GKT+ seems to be an Addition to Perls, so If I give someone other my script he should know how to install GTK+, right? | Yes I think so.
Because of Inkscape and GIMP a lot of Windows user might have it installed already. Linux Gnome users have it installed to.
_____________
Cheers AGU |
|
| Back to top |
|
 |
jar
Joined: 29 Apr 2007 Posts: 11
|
Posted: Sun Feb 10, 2008 5:04 pm Post subject: Try TCL |
|
|
| Tekl wrote: |
...
I'm looking for a fast language for scripts like parsing text files and not automating other applications. I can do most of my tasks with AHK and I can do it very fast most times, but it only works on Windows.
I'm looking for a fast language which is also available on Mac OS X or Linux, so I don't have to learn one language for every system.
It should be possible to create simple GUIs and it should also be possible to easily share scripts. So the scripting environment must be simple to install. In AutoHotkey I like that I don't have to install it and that it's very small. Java for example is a very big package and has to be installed.
My main tasks are reading files, parsing them and writing to a file. |
Try tcl at www.tcl.tk.
Greetings,
Jar |
|
| Back to top |
|
 |
Tekl
Joined: 24 Sep 2004 Posts: 813 Location: Germany
|
Posted: Mon Feb 11, 2008 3:28 am Post subject: |
|
|
Thanks, Tcl seems to be very interesting. As I looked for performance information I found this page: http://www.timestretch.com/FractalBenchmark.html
I translated their mandelbrot test code to AutoHotkey to see its performance. I was very astonished about the results. AutoHotkey is 11.45 times slower than Python. Maybe AHK has weakness in math operations as I haven't realized yet that AHK is slow on my regular scripts.
| Code: | ; For details look at http://www.timestretch.com/FractalBenchmark.html
#Singleinstance force
#NoEnv
SetBatchLines, -1
SetWinDelay, -1
SetControlDelay, -1
Gui, Font,s4, Courier New
Gui, Add, Text, vText w250 h500, Please wait ...
Gui, Font, s9
Gui, Add, Text, vResult w250 y+5, Please wait ...
Gui, Show, w250 h530
mandelbrot_run()
mandelbrot(x, y)
{
cr := y - 0.5
ci := x
zi := 0.0
zr := 0.0
BAILOUT := 16
MAX_ITERATIONS := 1000
Loop
{
temp := zr * zi
zr2 := zr * zr
zi2 := zi * zi
zr := zr2 - zi2 + cr
zi := temp + temp + ci
if (zi2 + zr2 > BAILOUT) {
return A_Index
}
if (A_Index > MAX_ITERATIONS) {
return 0
}
}
}
mandelbrot_run()
{
output := ""
date := A_TickCount
y := -39
Loop
{
wholeoutput := wholeoutput output "`n"
output := ""
GuiControl,,Text,%wholeoutput%
x := -39
Loop
{
if (mandelbrot(x/40.0, y/40.0) = 0) {
output .= "*"
}
else
{
output .= " "
}
x++
If x = 39
break
}
y++
If y = 39
break
}
date2 := A_TickCount
wholeoutput := wholeoutput output
GuiControl,,Result, % "Autohotkey Elapsed " ((date2-date) / 1000)
GuiControl,,Text,%wholeoutput%
return false
}
|
_________________ Tekl |
|
| Back to top |
|
 |
Titan
Joined: 11 Aug 2004 Posts: 5041 Location: imaginationland
|
Posted: Mon Feb 11, 2008 10:15 am Post subject: |
|
|
While AutoHotkey's biggest weakness is expressions they still can be extremely fast. You miss many key optimization techniques so it comes as no surprise that your test yields poor results. The documentation discusses many of these methods - such as combining expressions and when to use which concatenation method, et al. I'm sure that with those in mind the test will be a lot more favourable.
| Code: | #NoEnv
#NoTrayIcon
#SingleInstance ignore
SetBatchLines, -1
Process, Priority, , R
t := f := t0 := t1 := 0x00000000
DllCall("QueryPerformanceCounter", "Int64P", t0)
l =
y = -39
Loop, 78
{
y++
l = %l%`n
Loop, 78
l .= mandelbrot((A_Index - 40) / 40.0, y / 40.0) ? " " : "*"
}
l = %l%`n
DllCall("QueryPerformanceCounter", "Int64P", t1)
DllCall("QueryPerformanceFrequency", "Int64P", f)
t := (t1 - t0) / f
MsgBox, AutoHotkey elapsed %t% seconds`n`n%l%
mandelbrot(x, y) {
cr := y - 0.5, ci := x, zi := zr := 0.0
Loop {
temp := zr * zi, zr2 := zr * zr, zi2 := zi * z1
, zr := zr2 - zi2 + cr, zi := temp + temp + ci
If (zi2 + zr2 > 16) ; BAILOUT
Return, A_Index
If (A_Index > 1000) ; MAX_ITERATIONS
Return, 0
}
} |
_________________
RegExReplace("irc.freenode.net/ahk", "^(?=(.(?=[\0-r\[]*((?<=\.).))))(?:[c-\x73]{2,8}(\S))+((2)|\b[^\2-]){2}\D++$", "$u3$1$3$4$2") |
|
| Back to top |
|
 |
|
|
You can post new topics in this forum You can reply to topics in this forum
|
Powered by phpBB © 2001, 2005 phpBB Group
|