The link shows a blank page for me (Firefox, Arch Linux). I can read the article on the home page (https://nalaginrut.com).
It is interesting that you chose to implement Lua 5.2. Why choose 5.2 over 5.3 (the most recent version) or 5.1 (probably still the most used)?
As a Lua developer I really don't like what you did with ISSUE-1. In particular there could be some code that calls `foo()` explicitly on another object: `a.b.c.foo(d)`. This is perfectly well defined in Lua and can be used in some libraries that implement object models. It will not behave as expected with your design.
I am pretty happy to see articles mentioning both Lua and Scheme though. Both communities shared a developer room at FOSDEM last year, and hopefully we will this year too. [1]
For the version issue, I have to say when I started to research Lua, there's only 5.2 BNF I can find on the internet. So I decided to try it from 5.2. Of course, I'm willing to catch up with the newer version.
For ISSUE-1. Yes, I know it may break the compatibility of some existing code.
The problem is why people reference a variable named 'self' but not expect it to be the current table? People may named a var as 'self' to hold other value. I think that is the problem. 'self' is actually a reserved word in Lua, but Lua permit it to be used for other value. I don't think it's good. For example, some Scheme implementations allow users redefine primitives, you may redefine '+' with '-'. It's interesting, but it's bad when you want to build serious program.
Another point is mentioned in the article that people could easier find the error when they encountered an exception related to 'self'.
Anyway, my point is that a good Lua programmer should avoid to use a.b.c.foo() if one wants to get the current table, no matter how the function is defined (colon or point). But people always do wrong thing (include me), so why not provide a mechanism to let them avoid this problem? Fixed ISSUE-1 could let people get rid of this problem, even you make the mistake to use point reference on 'self', you can get correct value if you defined the function with colon.
I'm very sorry, the problem is raised by folks comments, it's all my bad, I should build a better blog.
Now I closed the comments, if you have any comments please leave it here.
[+] [-] catwell|9 years ago|reply
It is interesting that you chose to implement Lua 5.2. Why choose 5.2 over 5.3 (the most recent version) or 5.1 (probably still the most used)?
As a Lua developer I really don't like what you did with ISSUE-1. In particular there could be some code that calls `foo()` explicitly on another object: `a.b.c.foo(d)`. This is perfectly well defined in Lua and can be used in some libraries that implement object models. It will not behave as expected with your design.
I am pretty happy to see articles mentioning both Lua and Scheme though. Both communities shared a developer room at FOSDEM last year, and hopefully we will this year too. [1]
[1] https://archive.fosdem.org/2016/schedule/room/k3201/
[+] [-] nalaginrut|9 years ago|reply
For ISSUE-1. Yes, I know it may break the compatibility of some existing code. The problem is why people reference a variable named 'self' but not expect it to be the current table? People may named a var as 'self' to hold other value. I think that is the problem. 'self' is actually a reserved word in Lua, but Lua permit it to be used for other value. I don't think it's good. For example, some Scheme implementations allow users redefine primitives, you may redefine '+' with '-'. It's interesting, but it's bad when you want to build serious program. Another point is mentioned in the article that people could easier find the error when they encountered an exception related to 'self'.
Anyway, my point is that a good Lua programmer should avoid to use a.b.c.foo() if one wants to get the current table, no matter how the function is defined (colon or point). But people always do wrong thing (include me), so why not provide a mechanism to let them avoid this problem? Fixed ISSUE-1 could let people get rid of this problem, even you make the mistake to use point reference on 'self', you can get correct value if you defined the function with colon.
[+] [-] nalaginrut|9 years ago|reply