AutoHotkey Community

It is currently May 26th, 2012, 5:55 pm

All times are UTC [ DST ]




Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next
Author Message
PostPosted: February 8th, 2008, 10:13 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2008, 1:04 pm 
Offline

Joined: May 24th, 2006, 2:49 pm
Posts: 4511
Location: Belgrade
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.

_________________
Image


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2008, 2:17 pm 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 8th, 2008, 11:13 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
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.

:arrow: 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.

:arrow: CINT Home
:arrow: CINT Windows binary download


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2008, 4:14 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2008, 9:56 pm 
Offline

Joined: November 7th, 2006, 9:47 pm
Posts: 1934
Location: Germany
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

:arrow: 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??


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 9th, 2008, 10:11 pm 
Just mentioning it because it hasn't been yet, but what about Perl?

Offers native RegEx support and GUIs could possibly created with GTK+?
http://gtk2-perl.sourceforge.net/
http://gtk2-perl.sourceforge.net/doc/gtk2-perl-tut/
______________________
Cheers AGU


Report this post
Top
  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2008, 12:37 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
@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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 10th, 2008, 11:25 am 
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 ... r.C3.BCcke
http://www.troubleshooters.com/codecorn ... erlreg.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


Report this post
Top
  
Reply with quote  
 Post subject: Try TCL
PostPosted: February 10th, 2008, 5:04 pm 
Offline

Joined: April 29th, 2007, 12:20 pm
Posts: 15
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2008, 3:28 am 
Offline

Joined: September 24th, 2004, 3:00 pm
Posts: 814
Location: Germany
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


Report this post
Top
 Profile  
Reply with quote  
 Post subject:
PostPosted: February 11th, 2008, 10:15 am 
Offline
User avatar

Joined: August 11th, 2004, 1:47 am
Posts: 5347
Location: UK
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
   }
}

_________________
GitHubScriptsIronAHK Contact by email not private message.


Report this post
Top
 Profile  
Reply with quote  
 Post subject: guicontrol
PostPosted: May 1st, 2009, 2:55 am 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
If you just get rid of guicontrol, and display the whole thing at once at the end, you will get a 10x speed boost...


Report this post
Top
 Profile  
Reply with quote  
 Post subject: Re: guicontrol
PostPosted: May 1st, 2009, 5:55 am 
Offline

Joined: April 18th, 2008, 7:57 am
Posts: 1390
Location: The Interwebs
tinku99 wrote:
If you just get rid of guicontrol, and display the whole thing at once at the end, you will get a 10x speed boost...


Necropost much? :roll:


Report this post
Top
 Profile  
Reply with quote  
 Post subject: necroposting
PostPosted: May 1st, 2009, 6:15 am 
Offline

Joined: August 3rd, 2007, 8:01 am
Posts: 555
Location: Houston, TX
What do you call someone, who reponds to a necropost?

By the way, I am glad phpbb doesn't prevent necroposting.
Its one thing I dislike about slashdot.


Report this post
Top
 Profile  
Reply with quote  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 16 posts ]  Go to page 1, 2  Next

All times are UTC [ DST ]


Who is online

Users browsing this forum: Apollo and 12 guests


You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Powered by phpBB® Forum Software © phpBB Group