Squirrel 2.2发布了

快一个星期前的事了,不过我之前都没留意到。

[url=http://squirrel-lang.org/forums/thread/2382.aspx]squirrel 2.2 is out[/url]
[quote="fagiano"]***version 2.2 stable***

-added _newslot metamethod in classes

-added enums added constants

-added sq_pushconsttable, sq_setconsttable

-added default param

-added octal literals(thx Dinosaur)

-fixed debug hook, 'calls' and 'returns' are properly notified in the same number.

-fixed a coroutine bug[/quote]

[url=http://sourceforge.net/project/showfiles.php?group_id=85893]SourceForge上的下载点[/url]

不过,==,他们在论坛讨论里有提到svn trunk,但我没找到地址。记下这个问题。

------------------------------------------------------------------

话说Squirrel 3.x的设计讨论里,有一点是关于“是否自动将自由变量绑定到内部嵌套作用域”的问题。
在Squirrel 2.1.2的参考手册里,第20页有这么一段:
[quote][b]Free variables[/b]
Free variables are variables referenced by a function that are not visible in the function scope. In the following example the function foo() declares x, y and testy as free variables.
[code]local x=10,y=20
testy <- “I’m testy”

function foo(a,b):(x,y,testy)
{
::print(testy);
return a+b+x+y;
}[/code]
The value of a free variable is frozen and bound to the function when the function is created; the value is passed to the function as implicit parameter every time is called.[/quote]
不知道为什么,我会对这种没有遵循lexical scoping的做法有兴趣。或许是因为至少它提供了一种获取free variable的[b]值[/b]的手段,而不像TJS2那样想用free variable都用不了。而这种做法实现起来又比完全遵守lexical scoping来得方便…… =_=||

...这个时候也会想起Python的self。呵呵,Guido看来是没打算把self从方法声明中去掉呢。

------------------------------------------------------------------

也有看到尝试制作Squirrel到.NET的绑定的,[url=http://squirrel-lang.org/forums/thread/1324.aspx]这里[/url]。只是直觉,不过我觉得CLI的优点就是"common object",类似Lua/Squirrel的栈的解决方案用在CLI上到底有没有它原本在C/C++意义呢?

挖掘老帖,发现Alberto以前在[url=http://www.gamedev.net/community/forums/topic.asp?topic_id=345249]这里[/url]说过:
[quote]Squirrel RC is very fast because of the register based architecture(the majority of interepreted languges are stack-machines) and a conservative way to cleanup function's stacks. It also has a backup garbage collector(mosly for debug pouposes) and recently I've added weak references so you can create cycles without locking your mem.[/quote]
咦?他是说register-based [b]virtual machine[/b]会比stack-based virtual machine快?如果是实际硬件的话那肯定是register-based的快,但如果都是软件实现的VM,两者差不了多少才对。
这恐怕还是得看中间代码到具体执行这中间的过程是如何实现的吧。没人说stack-based instruction set就一定要真的建些个stack出来才能执行……stack-based的主要好处应该是较小的字节码吧(相对register-based来说,等于有隐含参数,因而节省了一些数据)
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值