Giter Site home page Giter Site logo

golua's Introduction

WARNING! Please expect breaking changes and unstable APIs. Most of them are currently at an early, experimental stage.

Contributing

This project welcomes contributions and suggestions. Most contributions require you to agree to a Contributor License Agreement (CLA) declaring that you have the right to, and actually do, grant us the rights to use your contribution. For details, visit https://cla.microsoft.com.

When you submit a pull request, a CLA-bot will automatically determine whether you need to provide a CLA and decorate the PR appropriately (e.g., label, comment). Simply follow the instructions provided by the bot. You will only need to do this once across all repos using our CLA.

This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact [email protected] with any additional questions or comments.

golua's People

Contributors

adamreese avatar covrom avatar fibonacci1729 avatar microsoftopensource avatar msftgits avatar quasilyte avatar vdice avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

golua's Issues

This api is too difficult to use. This is Golang not c!

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"))

Lots of avoidable imported package name shadowing

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.

Why is it so slow?

github.com/Azure/golua/lua 137s
github.com/yuin/gopher-lua 48s
lua53 6s

CLA notice in README is dishonest or misleading

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 :/

int/uint overflows when compiling for 32-bit targets

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.

Is it dead?

The last commit is nearly two month ago. Is the project dead?

Suspicious commented-out code

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
}

What are the goals of this project?

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.

error in Frame.extend

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)...,
	)
}

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.