Re: [go-nuts] where in gc compiler does converting from syntax.TypeDecl to reflect.Type happen?

2018-01-29 Thread 'Axel Wagner' via golang-nuts
I can give you a little bit of a start: I looked at the runtime recently, and its representation is here . It doesn't tell you how the creation/translation happens, but it tells you how the

[go-nuts] where in gc compiler does converting from syntax.TypeDecl to reflect.Type happen?

2018-01-29 Thread Jason E. Aten
I wrote some code to convert (go/types) types.Type to reflect.Type, but I kept thinking, "this has to be done somewhere already in the runtime or compiler libraries...", doesn't it? [ I know gc doesn't use go/types, but assume I'm asking about the equivalent (say

Re: [go-nuts] [ANN] A gradient boosting regressor package

2018-01-29 Thread Sina Siadat
Hi Matt, Thank you for the code review! ​ ​ > gradboostreg/tree, stat, sample have no tests. Yes, thanks for reminder, I should write tests for them!​ ​ ​ > These sub-packages may be better in package gradboostreg since they seem straightforward and contained to this library. Keeping those

[go-nuts] Upcoming Go protobuf release

2018-01-29 Thread lee
Very nice! Do the speed improvements also benefit Proto2? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more

Re: [go-nuts] Re: why defer function with parentheses

2018-01-29 Thread Michael Jones
great! On Mon, Jan 29, 2018 at 9:28 PM, Flying wrote: > thanks > > yes, i think i have understood. as you said, fn is a value not a function > call, the thing that we defer a function call means it will be called > later. if we defer a fn not a fn(), the compile doesn't

Re: [go-nuts] Re: why defer function with parentheses

2018-01-29 Thread Flying
thanks yes, i think i have understood. as you said, fn is a value not a function call, the thing that we defer a function call means it will be called later. if we defer a fn not a fn(), the compile doesn't know you want to call a function later On Monday, January 29, 2018 at 12:29:56 AM

[go-nuts] Re: get_tls macro and friends

2018-01-29 Thread Damian Gryski
Other examples I found in the runtime seem to refer to "go_tls.h". My guess is the /doc/asm page is out of date. Damian On Wednesday, January 24, 2018 at 7:26:18 PM UTC-8, Caleb Spare wrote: > > Quick question about the Go assembler. > > I'm trying to use the get_tls and related macros

Re: [go-nuts] [ANN] A gradient boosting regressor package

2018-01-29 Thread matthewjuran
Hi Sina, here’s a general code review. gradboostreg/tree, stat, sample have no tests. These sub-packages may be better in package gradboostreg since they seem straightforward and contained to this library. Keeping those things in sub-packages doesn’t seem to add much value over just having

[go-nuts] Upcoming Go protobuf release

2018-01-29 Thread 'Joe Tsai' via golang-nuts
(If you don't use Go protocol buffers, you can stop reading) Hello gophers, This is an announcement that we will be merging the dev branch of github.com/golang/protobuf into master on April 30th (approximately 3 months from now). This merge will

Re: [go-nuts] [ANN] A gradient boosting regressor package

2018-01-29 Thread Sina Siadat
Hi Sebastien, ​Thanks for your comment and question :) > I have one "drive-by-comment" and a question: > you could have perhaps used gonum for the stats stuff :) ​Actually, I did start with gonum :)) but I thought it was a large dependency and I only needed a few funcs from it, so I decided to

[go-nuts] Re: Is it possible to determine total number of bytes read/written for an HTTP request? (including headers)

2018-01-29 Thread aroman
Thanks! I'm not willing close the connection on every request -- that's too painful. I don't need an _exact_ count, but I want to be confident that my counts are really close. Serializing the headers and adding the size of the body is the closest that I've come up with to do accurate

Re: [go-nuts] [ANN] A gradient boosting regressor package

2018-01-29 Thread Sebastien Binet
hi Sina, On Mon, Jan 29, 2018 at 10:25 PM, Sina Siadat wrote: > Hi all! > > I just wrote a simple gradient regressor in Go. Gradient boosting is a > statistical learning method. Given a number of samples it returns a > function that fits the those data and can be used to

Re: [go-nuts] Go present installation

2018-01-29 Thread Bob Hancock
That is it. Thank you for the rapid reply. On Mon, Jan 29, 2018 at 4:00 PM Ian Lance Taylor wrote: > On Mon, Jan 29, 2018 at 12:49 PM, wilson wrote: > > > > On a Mac with go version 1.9.3 with a GOPATH=$HOME/go with the subdirs > src, > > pkg, and

Re: [go-nuts] Go present installation

2018-01-29 Thread Ian Lance Taylor
On Mon, Jan 29, 2018 at 12:49 PM, wilson wrote: > > On a Mac with go version 1.9.3 with a GOPATH=$HOME/go with the subdirs src, > pkg, and bin, I ran: > > go get golang.org/x/tools/present > > The source was downloaded and present.a was downloaded into >

[go-nuts] Go present installation

2018-01-29 Thread wilson
On a Mac with go version 1.9.3 with a GOPATH=$HOME/go with the subdirs src, pkg, and bin, I ran: go get golang.org/x/tools/present The source was downloaded and present.a was downloaded into $GOPATH/pkg/darwin_amd64/golang.org/x/tools. But, no executable in $GOPATH/bin. There is no change

[go-nuts] Re: Async process state snapshotting in Golang

2018-01-29 Thread jul . semaan
My main goal is to avoid complex granular locking inside the data structure since writes are very common in the map (whether its adding items or modifying the actual item). My idea was to implement MarshalJSON for my map and then while creating the JSON I'd be holding locks at the appropriate

Re: [go-nuts] Why []Interface{} indexing failing at if statement

2018-01-29 Thread Trig
Actually, Jan's way is probably the best... as if you wrongfully type convert the wrong type, it'll panic (you'll need to know for sure that arr in this instance will always be a boolean). With Jan's way, you're just making a comparison of value... which will work regardless of the type. On

Re: [go-nuts] Why []Interface{} indexing failing at if statement

2018-01-29 Thread Trig
This... or just specify the type after 'arr' such as: if arr.(bool) { fmt.Println("This is a boolean value") } On Monday, January 29, 2018 at 5:41:17 AM UTC-6, Jan Mercl wrote: > > On Mon, Jan 29, 2018 at 12:36 PM pradam > wrote: > > > //here its throwing error

[go-nuts] Re: Table Driven Test (TDT) and log only failed test case

2018-01-29 Thread Jérôme LAFORGE
Is it worth opening an issue? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] gijit, a go interpreter/repl based on a just-in-time trace compiler

2018-01-29 Thread Jason E. Aten
Gijit, my go interpreter/interactive REPL, is approaching usability. Major limitations: It is currently missing pointers and interfaces, channels and go-routines. These should be added shortly. While it is still work in progress, I invite early adopters to try it out. Please star it, try it,

[go-nuts] Re: [ANN] Bob, a framework to create a distributed AI that can learn to understand your voice, speak back, interact with your mouse and keyboard, and anything else you want

2018-01-29 Thread matthewjuran
Hi Quentin, here’s a code review. Since type ability is not exported, why not embed sync.Mutex? What does o stand for? I’d say that comments like “// newAbility creates a new ability” are unnecessary. The identifiers are documentation. There are many unnecessary comments. For read-only

[go-nuts] Re: Async process state snapshotting in Golang

2018-01-29 Thread matthewjuran
Can you describe your performance needs in more detail? I missed the need for the struct values in the copy (obviously needed to encode to JSON). Going back to locks for a moment, my thought now is that a sync.RWMutex on this map would have an RLock taken by every struct read/write and then

[go-nuts] Re: Async process state snapshotting in Golang

2018-01-29 Thread jul . semaan
Hi, Thanks for all the input. Unfortunately, as Tamás and Jake pointed out, I can't simply grab a copy of the map that has the same pointers since I'll need to be locking the structure everytime I'm copying it. So that means Matt's idea wouldn't really work for my use-case I was really hoping

Re: [go-nuts] Why []Interface{} indexing failing at if statement

2018-01-29 Thread Jan Mercl
On Mon, Jan 29, 2018 at 12:36 PM pradam wrote: > //here its throwing error like: non-boolean condition in if statement The compiler is right. 'arr' is not a boolean expresion, its type is 'interface{}'. Try: https://play.golang.org/p/zwNV9RD2oCs. -- -j -- You

[go-nuts] Why []Interface{} indexing failing at if statement

2018-01-29 Thread pradam
package main import ( "fmt" "reflect" ) func main() { array := []interface{}{true,1,"dodda"} arr:=array[0] fmt.Println(arr, reflect.TypeOf(arr)) // prints *true bool* if arr{ fmt.Println("This is a boolean value") //here its throwing error like: *non-boolean condition in if statement* } }

[go-nuts] Re: [ANN] Go Jupyter kernel and an interactive REPL

2018-01-29 Thread Max
Hello yunabe, congratulations for your impressive work! The Go REPL looks really complete and user-friendly :) I am the author of https://github.com/cosmos72/gomacro;>gomacro - the interpreter used by gophernotes, and I am very interested in understanding how lgo REPL is implemented: I had a

[go-nuts] [ANN] Bob, a framework to create a distributed AI that can learn to understand your voice, speak back, interact with your mouse and keyboard, and anything else you want

2018-01-29 Thread Asticode
Heys guys, I'm happy to announce Bob, a framework to create a distributed AI that can learn to understand your voice, speak back, interact with your mouse and keyboard, and anything else you want: https://github.com/asticode/go-astibob. Let me know what you think. Cheers -- You received