azure / golua Goto Github PK
View Code? Open in Web Editor NEWA Lua 5.3 engine implemented in Go
License: MIT License
A Lua 5.3 engine implemented in Go
License: MIT License
The last commit is nearly two month ago. Is the project dead?
The vm
receiver and argument name for v53
type is unfortunate as it's used in pair with vm
package. When you have vm
variable in scope, one can't access vm
package.
It could be OK to rename vm
to v
, for example.
Simple example of shadowing is:
func (vm *v53) trace(instr vm.Instr) {
if vm.thread().global.config.debug {
fmt.Printf("vm @ ip=%02d fp=%02d: %v\n",
vm.thread().frame().pc,
vm.thread().frame().depth,
instr,
)
}
}
Method gets vm
receiver and refers to vm
package in it's arguments list.
If function body will ever need something from that package, it would be an unpleasant experience to have.
In the CLA it says:
conveys certain license rights to Microsoft Corporation
(and has a whole copyright grant paragraph)
But the README only says:
declaring that you have the right to, and actually do, grant us the rights to use your contribution
This is completely misleading, and in my opinion dishonest. A submission of code under MIT or GPL license without a CLA would grant you the rights to use the contribution. The CLA grants essentially all rights for Microsoft to do whatever they want.
Anytime you have a CLA you can guarantee the project has their own interests first. Let's just hope those interests are benevolent :/
This is do nothing, check it please and improve:
func (fr *Frame) extend(grow int) {
fr.locals = append(
fr.locals[:len(fr.locals)],
make([]Value, 0, grow)...,
)
}
github.com/Azure/golua/lua 137s
github.com/yuin/gopher-lua 48s
lua53 6s
While doing an audit, I've found pieces of code like:
func (p *state) packFloat(o option, v interface{}) error {
fmt.Println("pack: float")
// return p.pack(o, v)
return nil
}
func (p *state) packString(o option, v interface{}) error {
fmt.Println("pack: string")
// return p.pack(o, v)
return nil
}
It looks like commented-out code should be uncommented while fmt.Println
statement is to be removed.
Since I'm not familiar with the project or what the packer
is, opening an issue instead of sending you a PR.
Another suspicious place:
func (p *state) packInt(o option, v interface{}) error {
// fmt.Printf("packInt (%t) => %T\n", o.typ == optUint, v)
if v, ok := v.(Packer); ok {
return v.Pack(p)
}
// return p.pack(o, v)
return nil
}
We needs lua5.3, But this api is too difficult to use. This is Golang not c!
state.NewTableSize(0, len(osFuncs))
state.SetFuncs(osFuncs, 0)
This is what we want :)
gopher-lua
// register functions to the table
mod := L.SetFuncs(L.NewTable(), exports)
// register other stuff
L.SetField(mod, "name", lua.LString("value"))
Given that there are already a number of existing lua VMs in Go, how does this one from Microsoft plan to differentiate itself (aside from the fact that it's lua 5.3).
The rationale for a new project should be in the README.
I want to start contribution in this project. Is there any doc or something which can help understand project ?
Sometimes luac
isn't 5.3.
Line 305 in cd7e06d
Compiling the master
branch (at 5105380) for the armeabi-v7a target, the compiler bails out at the following problems:
# github.com/Azure/golua/pkg/packer
github.com/Azure/golua/pkg/packer/scan.go:222:52: constant 1844674407370955161 overflows uint
# github.com/Azure/golua/std/math
github.com/Azure/golua/std/math/math.go:61:12: constant 9223372036854775807 overflows int
github.com/Azure/golua/std/math/math.go:65:12: constant -9223372036854775808 overflows int
Looks like it might be helpful to add a 32-bit target (x86 or ARM) to your test plan.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.