Murga-Projects Forums

Full Version: How to advertise?
You're currently viewing a stripped down version of our content. View the full version with proper formatting.

mikshaw Wrote:
Have you tried putting the functions above the rest of the commands? Lua (or at least murgaLua) seems to run line-by-line, meaning that if it tries to run receive before the receive function is defined, it will fail.


I put the receive function first and got "attempt to call method 'timeout' (a nil value)"

Ahhh.
It looks like timeout is not available in socket.http (or at least not in murgaLua).
There is, however, a socket.http.TIMEOUT constant. It seems that it is stuck at 60?

asafp Wrote:
I put the receive function first and got "attempt to call method 'timeout' (a nil value)"


The luasocket docs will tell you that the "timeout()" method was changed to "settimeout()" a while ago ...

Update 1 :

I re-arranged your code and it looks fine, but when I run it I get a "attempt to yield across metamethod/C-call boundary" ... Aha, I have figured that one out now too, the check-links luasocket example fails in the same way.

Update 2 :

Ummm ...
I think the LuaSocket API and LUA have changed enough for this to NOT work.

However, I have a safe way of making LuaSocket work as it should - Expect a reworked example and updated executables in the coming days.

Update 3 :

New binaries are NOT required, and there is a problem with the LuaSocket example, but I think I got asafp's example running WITH co-routines and the CURRENT murgaLua binaries ... More testing and I'll post it tonight.

Cheers
JohnM

Hi,

Just updated forum to accept lua scripts (!)

Anyway, here you have working socket co-routines for the existing murgaLua binaries (it'll even work on 0.5.5 I think).

The secret was to read the Lua and LuaSocket documentation, as both have changed somewhat since the example you where using was written.

Cheers
JohnM
This is a somewhat self-serving reply, but read my post on the Lua Workshop (or better yet take a look at http://lua.org/wshop08.html).  I'd be quite interested in having someone give a talk on MurgaLua or a project they were building with MurgaLua.

I've been looking for a long time for something that would let me easily do portable Lua gui programs.  I've looked at IUP and canvas, the lua-cairo bindings, wxLua, etc. and none of them have really fit the bill.  I haven't had a chance yet to do much with MurgaLua (or I'd do a talk...), but from what I've seen, it looks to be exactly what I've been wanting.

Matt
MurgaLua is without a doubt the easiest way to create a cross-platform graphical user interface. The Lua language is small fast and simple, and FLTK is one of the lightest widget sets available.

I'll be the first to say that I'm not a programmer, but I found it very easy (after a brief period of scratching my head) to pick up Lua, and FLTK, while sometimes a little odd or even buggy, provides all of the most commonly used widgets in an equally simple package. I will never reach the day when I'm not grateful to John Murga for creating this tool.
I almost talked myself into going to Washington.
Maybe next year with version 1.0 and a better sense of things.

Hopefully someone is in the DC area in July to say murgaLua into the right ears.

iGame3D Wrote:
I almost talked myself into going to Washington.
Maybe next year with version 1.0 and a better sense of things.



Oh, c'mon!  You know what will happen:  you'll get to V1 and say "V2 will be so much nicer, I'll wait..." and then when V2 rolls around you'll say, "but if I wait until V3 then I'll be able to show such and such..."  And it will _NEVER_ happen! Smile

Plus, it will be a great opportunity to recruit new participants, bounce ideas off of other Lua folk, etc., etc.

So why not just give in and come this year!

Matt

John, thanks for a working coroutine example. Now I just have to figure out how to put it to practical use. It's nice to have an active user community for an open source project.

The more I get into lua/murgalua, the more I like it.

Just a few rambling thoughts from a greenhorn:

Somewhere I read that lua was sort of a modern version of awk and that struck me as being right on the money. I've got a lot of awk scripts laying around (I'm sure many other people do also) and thought it would be nice if all those scripts could be murgalua scripts and started thinking about writing a murgalua script that would convert the awk scripts to murgalua.

Then, I started thinking about some things that would be nice to have. The first thing would be a split function that works like what is available in awk/python/perl. Now, I know it's not too difficult to code such a thing with existing string and loop functions, but think it could be justified to make it a standard part of murgalua.

1) It wouldn't add much to the size of murgalua.
2) Split is a very common function and certainly has a place in a highly table oriented language like lua. It's a logical compliment to table.concat.
3) It would be "advertising" for those currently coding in awk/pthon/perl and other languages that already have a split function. It would also attract those who aren't really programmers but occasionally write scripts.

I don't have a lot of gripes about lua, but one is ~= for not equal. I'm not a big fan of that. It causes me a great deal of consternation when other languages I use on a regular basis use != and <> for not equal. I know it sounds trivial, but little things like that can stop somebody from learning a new language. Could murgalua accept any of the three variations?

Again, just a few ramblings from the new guy.

mmburke Wrote:
Oh, c'mon! You know what will happen: you'll get to V1 and say "V2 will be so much nicer, I'll wait..." and then when V2 rolls around you'll say, "but if I wait until V3 then I'll be able to show such and such..." And it will _NEVER_ happen! Smile

It is funny, I actually lived in Arlington, VA for a while ... So it would have been easy for me to attend at the time - Now that I live in Switzerland its maybe not so easy.

As it is murgaLua is at version 0.6.0 ... So we haven't even reached V1.

mmburke Wrote:
Plus, it will be a great opportunity to recruit new participants, bounce ideas off of other Lua folk, etc., etc.

It would be ...

But there are so many things I want to fix before I get to that point :-)

mmburke Wrote:
So why not just give in and come this year!

I have seriously penciled it in for next year ...

Cheers
JohnM

Pages: 1 2 3
Reference URL's