AutoHotkey Homepage AutoHotkey Community
Let's help each other out
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Integrating Lua into AutoHotkey
Goto page Previous  1, 2, 3, 4  Next
 
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List
View previous topic :: View next topic  
Author Message
Tuncay



Joined: 07 Nov 2006
Posts: 383
Location: Berlin

PostPosted: Sat Jun 07, 2008 11:48 am    Post subject: Reply with quote

The two different operators := and = should be definetely merged, because it confuses beginners so much, I thinked in the past. But If I think further, then I came to the result, that the simple assignment methode with = can be really helpful.

Construct like:
Code:
words = "%w1%" is not "%w2%", but "%w3%" is.

looks very natural.

Construncts with quoting in example looks ugly and unreadable and is hard to write in some situations:
Code:
words := """" . w1 . """ is not """ . w2 . """, but """ . w3 . """ is".
Back to top
View user's profile Send private message Send e-mail
Guest






PostPosted: Sat Jun 07, 2008 1:38 pm    Post subject: Reply with quote

Tuncay wrote:
Construncts with quoting in example looks ugly and unreadable...

...I agree that "doubling up the quotes" as a means to "escape" them is unintuitive & unreadable...I would prefer...

Code:
;single-quotes, for when you need doubles inside...
words='"'+w1+'" is not "'+w2+'", but "'+w3+'" is.'

;double-quotes, but escape the other doubles: this way...
words="`""+w1+"`" is not `""+w2+"`", but `""+w3+"`" is."

;double-quotes, but escape the other doubles: or this way...
words="\""+w1+"\" is not \""+w2+"\", but \""+w3+"\" is."

;parse % or $ vars in double quotes, but not in single quotes...(vars replaced)...
words="`"%w1%`" is not `"%w2%`", but `"%w3%`" is."

;parse % or $ vars in double quotes, but not in single quotes...(vars NOT replaced, use option 1, concatenation not in-string %'s)...
words='"%w1%" is not "%w2%", but "%w3%" is."'

...granted some or most of those are equally unreadable, but really quoting vars inside a string like that is really just problematic anyway...I don't normally include double quotes in my resulting vars/msgbox's/error messages...I guess continuation sections are the most elegant for this...

Code:
;continuation section...
words=
(LTrim
   "%w1%" is not "%w2%", but "%w3%" is.
)

...no escaping...I use single-line (technically 4-line) continuation sections anytime I don't wanna spend time escaping chars...which is never, I never escape more than 3 chars in a string without re-doing it to a continuation section...for completeness, if you wanted the % (percents) in the resulting string & not to be resolved as vars...

Code:
;continuation section...literal %'s...
words=
(LTrim %
   "%w1%" is not "%w2%", but "%w3%" is.
)
Back to top
tank



Joined: 21 Dec 2007
Posts: 1033

PostPosted: Sat Jun 07, 2008 4:05 pm    Post subject: Reply with quote

majkinetor wrote:
Quote:
What's so insane about the current methods? They are very simple...

They are unintuitive, error prone and generaly very limited in expressivness. You also don't have some basic programming mechanisms.

It didn't matter much when AHK was generaly used for 10 - 50 line scripts. Today AHK is used more broadly so now it does matter.

Also, Lua is separately developed wich means that functionality could change on its own, and language on its own by the team of dedicated ppl.

About "simple" part, to me, Lua is easier to learn and understand.

AMEN Smile
simply couldnt be more well put
I have in my job several people with some limited programming skill and ahk is just wringing there necks. Twisted Evil But all agree its usefulness so they plug thru the unintuitive problematic code structure any how
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sat Jun 07, 2008 5:56 pm    Post subject: Reply with quote

Tuncay wrote:
The two different operators := and = should be definetely merged, because it confuses beginners so much, I thinked in the past. But If I think further, then I came to the result, that the simple assignment methode with = can be really helpful.

Construct like:
Code:
words = "%w1%" is not "%w2%", but "%w3%" is.

looks very natural.

Construncts with quoting in example looks ugly and unreadable and is hard to write in some situations:
Code:
words := """" . w1 . """ is not """ . w2 . """, but """ . w3 . """ is".
I think you may be missing the point with the quoted % variable usage. Mixing the 2 methods has advantages when writing dynamic code. The advantage comes when referencing another variable instead of referencing the contents of the variable.

Code:
a = hello ; yawn...
a := "hello"  ; yawn...

blah = a
%blah% = hello ; boring example but adds more functionality since it uses the variable that has the same name as the value of blah instead.

a := %blah% . " world" ; another boring example but also additional functionality


Other methods could be used to achieve the same results but the existing methods are soooo simple...
Back to top
View user's profile Send private message Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Sat Jun 07, 2008 6:10 pm    Post subject: Reply with quote

majkinetor wrote:
Also, Lua is separately developed wich means that functionality could change on its own, and language on its own by the team of dedicated ppl.

About "simple" part, to me, Lua is easier to learn and understand.
Out of curiosity, have you asked the lua team if they would like to add AutoHotkey functionality to lua? I'm assuming that much of AutoHotkey's functionality is currently missing in lua or I'd think that you would just use lua instead. I'm not sure I understand why you'd suggest that AutoHotkey should implement lua's syntax instead of adding additional functionality to lua if you prefer lua's syntax/functionality in general...
Back to top
View user's profile Send private message Visit poster's website
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Sun Jun 08, 2008 11:07 am    Post subject: Reply with quote

corrupt wrote:
Out of curiosity, have you asked the lua team if they would like to add AutoHotkey functionality to lua?

Perhaps at this point, you would like to inform yourself a bit more about Lua.
_________________
Back to top
View user's profile Send private message MSN Messenger
Zippo()
Guest





PostPosted: Sun Jun 08, 2008 12:07 pm    Post subject: Reply with quote

majkinetor wrote:
Perhaps at this point, you would like to inform yourself a bit more about Lua.


If you really want Lua integrated, start a new branch or something with AHK.

Don't try to force that language on those of us who don't want it.
Back to top
n-l-i-d
Guest





PostPosted: Sun Jun 08, 2008 12:24 pm    Post subject: Reply with quote

Or even better: create an AutoHotkey.dll, than you can use any other language you like.
Back to top
majkinetor



Joined: 24 May 2006
Posts: 3652
Location: Belgrade

PostPosted: Sun Jun 08, 2008 3:09 pm    Post subject: Reply with quote

Zippo() wrote:
If you really want Lua integrated, start a new branch or something with AHK.
Don't try to force that language on those of us who don't want it.

I didn't create this thread, I am just rationaly thinking about this topic, thats all, far away from forcing it. I don't want anything, nor I am going to do anything about it ATM. I am just saying its a good idea knowing both Lua and AHK.

Second, there are bunch of ppl here and there were bunch of ppl before having poistive opinion about that, and I actually heard about Lua on this very place. Contrary to corrupt who doesn't know anything about it and still feels free to comment, I actually did my homework and even more. That was the point of my comment to him. If he knew anything about Lua, he wouldnt ask me, nor comment things like he did, even trying to be funny.

In advance, If you don't have anything constructvely too add to the topic instead whining, please ignore what I say.

At the end, you don't have to have IQ 200 to deduce that Lua will never see this place, its just theoretical discussion.
_________________
Back to top
View user's profile Send private message MSN Messenger
tank



Joined: 21 Dec 2007
Posts: 1033

PostPosted: Sun Jun 08, 2008 6:07 pm    Post subject: Reply with quote

im going to go out on a limb here and im probably wrong but i like to open my big fat mouth a bit
Those who are finding themselves so defensive on this subject even if they know other languages never got very comfortable with them
they probnably started with ahk and went into other things. this isnt bad or good just different
facts are these Most modern languages seem to conform with a certain indentifyable strictness to the lang in question
the fact that ahk is so .....well lets face it loose and varied in use and syntax is found to be a bit annoying by those with strong back grounds in programming even if they are nothing but serious hobbiests.

among other things the fact that an "if statment" can be written so many different ways or a variable set or parsed in so many different ways does create a certain level of chaos

This is by no means a reflection of the shear usefulness of ahk. it in fact is a serious peice of work and has uses that other development environments fail in. and yet it doesnt replace them its more like the perfect swiss knife and roll of duct tape for the bunch of us wannabe programming mcgyvers. Very Happy
"i know i had a ball point pen around here some where."

the real genious comes in the form of allowing users to use methods from other programs or environments thru the call of a dll.


If i understand the person who started this thread and maj correctly is that all any one is saying is it would theoretiucally be nice to incorperate a little stricter language structure so some can feel a bit more comfortable using some of the more advanced features. I get the impression that those such as corrupt or zippo() think ahk is under attack or some way of life needs to be defended

Lua is in fact a language with a good structure and open source it is in fact a good fit to satisfy the concerns raised but in the very wize words

majkinetor wrote:
At the end, you don't have to have IQ 200 to deduce that Lua will never see this place, its just theoretical discussion.

_________________
Read this
Com
Automate IE7 with Tabs


Last edited by tank on Mon Jun 09, 2008 4:26 am; edited 1 time in total
Back to top
View user's profile Send private message
Zippo()
Guest





PostPosted: Sun Jun 08, 2008 11:57 pm    Post subject: Reply with quote

@majkinetor: Every time AHK syntax gets questioned you start squawking about Lua. And no, you aren't saying "its a good idea knowing both Lua and AHK". You are saying that you think AHK's syntax is weak and you like to see it replaced by Lua (read a page back or so...).

Your idea of "a bunch of people" and mine are very different. By my count, around 10 or so people here consistently harp about Lua. Considering the size of the AHK user base, that's not "a bunch of people".

Lastly, you are low on the food chain of people that should be making guesses at my IQ or deciding if what I add is "constructive".

@tank: The loose and syntax of AHK is one of the things that make it really great. If you can't remember the difference between If a = far and if a = %far% in ten minutes or so, I think you have more problems than worrying if AHK should look more like newer, greatest languages evar. Most people that want this kind of change are limited in what languages they would feel comfortable working in, and get defensive when someone likes having a loose language that doesn't force them to obey strict rules at every turn when they just want to get something done quickly. That's the beauty of AHK.

I just don't want to see AHK get ruined by making changes that really aren't needed. AHK does exactly what it was intenteded to do, and it does it nicely.
Back to top
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Mon Jun 09, 2008 12:34 am    Post subject: Reply with quote

majkinetor wrote:
Second, there are bunch of ppl here and there were bunch of ppl before having poistive opinion about that, and I actually heard about Lua on this very place. Contrary to corrupt who doesn't know anything about it and still feels free to comment, I actually did my homework and even more. That was the point of my comment to him. If he knew anything about Lua, he wouldnt ask me, nor comment things like he did, even trying to be funny.
I haven't claimed to know anything about lua and am not too interested in investigating further at this time (I don't have anything against it - just not interested at the moment). I have visited the site, read through a few bits and pieces of the manual, downloaded .exe and .dll versions, ran a few demo scripts (that came with the source code), etc... Honestly, based on what I've seen so far, I don't really understand why you'd want to replace AutoHotkey's syntax with lua's but I don't feel that I know enough about lua to see the benefit(s). I was hoping that you would try and go into more detail to help clarify the benefit(s) that might help to justify trashing the existing syntax and replacing it with lua's. ...or is it more of a personal preference for the style of the language thing?
Back to top
View user's profile Send private message Visit poster's website
corrupt



Joined: 29 Dec 2004
Posts: 2436

PostPosted: Mon Jun 09, 2008 1:18 am    Post subject: Reply with quote

tank wrote:
im going to go out on a limb here and im probably wrong but i like to open my big fat mouth a bit
Laughing Don't we all... Smile

tank wrote:
Those who are finding themselves so defensive on this subject even if they know other languages never got very comfortable with them
they probnably started with ahk and went into other things. this isnt bad or good just different
facts are these Most modern languages seem to conform with a certain indentifyable strictness to the lang in question
the fact that ahk is so .....well lets face it loose and varied in use and syntax is found to be a bit annoying by those with strong back grounds in programming even if they are nothing but serious hobbiests.
I think you may have the wrong impression. I'm not really trying to be defensive (although I can see how it looks that way) but I think that replacing the existing syntax with one from another language is a bit too extreme considering the size of the existing user base that seems to really like to existing syntax.

I can't speak for others but I have a programming background and didn't start with AutoHotkey. I don't personally find "loose and varied" to be annoying. Quite the opposite actually, since it allows additional flexibility. There are a few things I'd love to see added to the existing syntax/functionality (dot notation, arrays, etc...) but I personally find most of the existing syntax to be relatively easy and find that it allows scripts to be written quickly in most cases.

Maybe lua's syntax is better though...? It would be interesting if those here that are familiar with lua would be willing to go into detail on how replacing AutoHotkey's syntax (and other aspects?) would be beneficial to a large percentage of AutoHotkey users. Perhaps a few significant side by side code comparisons?
Back to top
View user's profile Send private message Visit poster's website
tank



Joined: 21 Dec 2007
Posts: 1033

PostPosted: Mon Jun 09, 2008 4:25 am    Post subject: Reply with quote

corrupt wrote:
tank wrote:
im going to go out on a limb here and im probably wrong but i like to open my big fat mouth a bit
Laughing Don't we all... Smile

tank wrote:
Those who are finding themselves so defensive on this subject even if they know other languages never got very comfortable with them
they probnably started with ahk and went into other things. this isnt bad or good just different
facts are these Most modern languages seem to conform with a certain indentifyable strictness to the lang in question
the fact that ahk is so .....well lets face it loose and varied in use and syntax is found to be a bit annoying by those with strong back grounds in programming even if they are nothing but serious hobbiests.
I think you may have the wrong impression. I'm not really trying to be defensive (although I can see how it looks that way) but I think that replacing the existing syntax with one from another language is a bit too extreme considering the size of the existing user base that seems to really like to existing syntax.

I can't speak for others but I have a programming background and didn't start with AutoHotkey. I don't personally find "loose and varied" to be annoying. Quite the opposite actually, since it allows additional flexibility. There are a few things I'd love to see added to the existing syntax/functionality (dot notation, arrays, etc...) but I personally find most of the existing syntax to be relatively easy and find that it allows scripts to be written quickly in most cases.

Maybe lua's syntax is better though...? It would be interesting if those here that are familiar with lua would be willing to go into detail on how replacing AutoHotkey's syntax (and other aspects?) would be beneficial to a large percentage of AutoHotkey users. Perhaps a few significant side by side code comparisons?
all good im droppin it cause zippo is taking this way to hard and i think he is under the impression i just ran over his cat or something (where is my teriaki???? ) Twisted Evil
@ zippo
maj didnt make any guesses about any ones iq he made a flaverfull statement metaphoracally that no one could possibly take seriously as an insult
majkinetor wrote:
At the end, you don't have to have IQ 200 to deduce that Lua will never see this place, its just theoretical discussion.

seriously i think this conversation has gotten to serious
Peace all of ya Very Happy
_________________
Read this
Com
Automate IE7 with Tabs
Back to top
View user's profile Send private message
Zippo()
Guest





PostPosted: Mon Jun 09, 2008 7:11 am    Post subject: Reply with quote

I don't own a cat. I hate them. And personally I think it is insulting that you would suggest that I own one. You act like owning a cat has something to do with a persons IQ, that you group me with these people, and that you are somehow better than us because you eat them instead...

But you could try adding a little more seafood to your diet. I hear it is good at firming up the skin and keeping you looking young.
Back to top
Display posts from previous:   
Post new topic   Reply to topic    AutoHotkey Community Forum Index -> Wish List All times are GMT
Goto page Previous  1, 2, 3, 4  Next
Page 3 of 4

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum


Powered by phpBB © 2001, 2005 phpBB Group