Re: [go-nuts] Re: Go - language of the future!

2017-03-19 Thread Konstantin Khomoutov
On Sat, 18 Mar 2017 05:31:20 -0700 (PDT) mhhc...@gmail.com wrote: [...] > For those which are language designers, comparing the language to > such things > like haskell is made in an attempt to make the best language design > (small ego trip here ?), > not the most practical, effective IRL languag

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread a . petrovsky
воскресенье, 19 марта 2017 г., 21:15:25 UTC+3 пользователь Konstantin Shaposhnikov написал: > > >> As you can see, your hypothesis is not true, more then 99 percent of >> requests is really fast and occur less the 1 millisecond! And I try to find >> our what happens in this 1 percent! >> >>

[go-nuts] Only build go binary from source

2017-03-19 Thread gruszczy
Hi gophers, I am tinkering with some runtime code and I would like to build only the go binary to the test it on a small program I wrote. I don't see any script in the source that would allow that, all of these also try to compile the standard library. I would like to avoid that, because it's e

[go-nuts] How to accept any function with one return value as a parameter

2017-03-19 Thread aktungmak
Hi, I am trying to write a function that initializes a generic collection. For adding new items to the collection, the user specifies a constructor which takes one argument and returns a pointer to the struct that will be inserted in the collection, and also sets fields to initial values. For

Re: [go-nuts] Re: Different latency inside and outside

2017-03-19 Thread a . petrovsky
воскресенье, 19 марта 2017 г., 20:46:16 UTC+3 пользователь Jesper Louis Andersen написал: > > On Sun, Mar 19, 2017 at 4:58 PM Alexander Petrovsky > wrote: > >> >> > * The 99th percentile ignores the 40 slowest queries. What does the 99.9, >>> 9.99, ... and max percentiles look like? >>> >> >

[go-nuts] Re: Guetzli perceptual JPEG encoder for Go

2017-03-19 Thread chaishushan
good idea. it is a big work. i sugget use cgo as the start point: use Go implement some pure c function, then export as the c function. for example: //export ButteraugliScoreForQuality func ButteraugliScoreForQuality(quality C.double) C.double { // go code } 在 2017年3月18日星期六 UTC+8下午4:32:47,

Re: [go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread Wojciech S. Czarnecki
> > On Sun, 19 Mar 2017, at 09:35 PM, Rob Pike wrote: > > everyone will see code indented as wide (or not) as they prefer. > Ian Davis wrote: > It seems to me that this explanation is at odds with the philosophy of > gofmt which is that there is a single way to lay out code. > The benefits of t

Re: [go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread Ian Davis
On Sun, 19 Mar 2017, at 09:35 PM, Rob Pike wrote: > How wide should the indentation be? 2 spaces? 4? 8? Something else? > > By making the indent be a tab, you get to decide the answer to that > question and everyone will see code indented as wide (or not) as > they prefer. > > In short, this

Re: [go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread 'Kevin Malachowski' via golang-nuts
I love that Go uses tabs because I use 3 spaces for my tabstop, and very few people share that preference. -- 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

Re: [go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread Tim K
gofmt documentation says: Gofmt formats Go programs. It uses tabs (*width = 8*) for indentation and > blanks for alignment. > https://golang.org/cmd/gofmt/ Just curious, any reason why it needs to specify the tab width = 8? Should that be removed if it's not relevant? Thanks! On Sunday, Mar

Re: [go-nuts] Expression evaluation with side effects

2017-03-19 Thread Steven Hartland
Think the following section should explain the strange behaviour you're seeing: https://golang.org/ref/spec#Order_of_evaluation On 19/03/2017 22:59, Jan Mercl wrote: While trying to resolve a failing (C) test case[0] I encountered a (Go) behavior I do not understand. This code[1] pack

[go-nuts] Expression evaluation with side effects

2017-03-19 Thread Jan Mercl
While trying to resolve a failing (C) test case[0] I encountered a (Go) behavior I do not understand. This code[1] package main import ( "fmt" ) var ( x = [1]int{2} x2 = [1]int{2} ) func foo() int {

Re: [go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread Carl
Exactly what I was looking for. Thank you! On Monday, March 20, 2017 at 10:36:06 AM UTC+13, Rob 'Commander' Pike wrote: > > How wide should the indentation be? 2 spaces? 4? 8? Something else? > > By making the indent be a tab, you get to decide the answer to that > question and everyone will see

Re: [go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread Rob Pike
How wide should the indentation be? 2 spaces? 4? 8? Something else? By making the indent be a tab, you get to decide the answer to that question and everyone will see code indented as wide (or not) as they prefer. In short, this is what the tab character is for. -rob On Sun, Mar 19, 2017 at 1:

[go-nuts] Why were tabs chosen for indentation?

2017-03-19 Thread Carl
Hi, This is a question to whoever decided that go will use tabs - team or person: Could you please explain your reasoning behind the decision? So far, all my googling has just turned up the what and not the why: States that tabs are to be used: cmd/gofmt: remove -tabs and -tabwidth flags

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Tamás Gulácsi
https://github.com/valyala/fasthttp/blob/master/README.md FAQ says "net/http handles more HTTP corner cases". For me, that means not following the specs. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Konstantin Shaposhnikov
> > > As you can see, your hypothesis is not true, more then 99 percent of > requests is really fast and occur less the 1 millisecond! And I try to find > our what happens in this 1 percent! > > I was probably not clear enough with my explanation. In 99% of cases net/http (or fasthttp) parsi

Re: [go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Jesper Louis Andersen
On Sun, Mar 19, 2017 at 4:58 PM Alexander Petrovsky wrote: * The 99th percentile ignores the 40 slowest queries. What does the 99.9, 9.99, ... and max percentiles look like? I'v have no answer to this question. And I don't know how it can help me? Usually, the maximum latency is a better in

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Alexander Petrovsky
As I know it's doesn't matter, before I've used net/http, and the situation doesn't change, except the count of allocations, they are reduced Could you point please where fasthttp doesn't follow the specs? воскресенье, 19 марта 2017 г., 20:00:25 UTC+3 пользователь Tamás Gulácsi написал: > > As

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Tamás Gulácsi
As fasthttp does not even follow the specs, you cannot assume that all requests are parsed the same, till you prove it. -- 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 ema

Re: [go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Alexander Petrovsky
Hello, Jesper! Nice to see not only in erlang community! воскресенье, 19 марта 2017 г., 18:09:17 UTC+3 пользователь Jesper Louis Andersen написал: > > My approach is usually this: > > When a problem like this occurs, I very quickly switch from random > guessing at what the problem can be into a

Re: [go-nuts] Re: atomic bugs

2017-03-19 Thread Michael Jones
In general is not not so much "will crash" but "will not run" On Sun, Mar 19, 2017 at 12:52 AM, T L wrote: > > > On Sunday, March 19, 2017 at 3:03:21 AM UTC+8, T L wrote: >> >> At the end of sync/atomic package docs, it says >> >> On x86-32, the 64-bit functions use instructions unavailable befo

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Alexander Petrovsky
Hello, Konstantin! воскресенье, 19 марта 2017 г., 14:19:36 UTC+3 пользователь Konstantin Shaposhnikov написал: > > Hi, > > External measurements probably show more acurate picture. > Of course! > > First of all internal latency numbers only include time spent doing actual > work but don't in

Re: [go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Jesper Louis Andersen
My approach is usually this: When a problem like this occurs, I very quickly switch from random guessing at what the problem can be into a mode where I try to verify the mental model I have of the system. Your mental model is likely wrong, and thus it is leading you astray in what the problem migh

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Alexander Petrovsky
Hello, Dave! воскресенье, 19 марта 2017 г., 3:28:13 UTC+3 пользователь David Collier-Brown написал: > > Are you seeing the average response time / latency of the cache from > outside? > I don't calculate average, I'm using percentiles! Looks like the "cache" don't affect at all, otherwise I'l

[go-nuts] Re: Different latency inside and outside

2017-03-19 Thread Konstantin Shaposhnikov
Hi, External measurements probably show more acurate picture. First of all internal latency numbers only include time spent doing actual work but don't include HTTP parsing (by net/http) and network overhead. Secondly latency measured internally always looks better because it doesn't include a

[go-nuts] Re: Aren't package declarations (and per file imports) redundant?

2017-03-19 Thread pierre . curto
Besides what has been said, another use for the package declaration is being able to declare "main" programs that are ignored at build time but used by go generate within the package. A good example of this is in the gob package: https://golang.org/src/encoding/gob/dec_helpers.go is generated by

[go-nuts] Re: atomic bugs

2017-03-19 Thread T L
On Sunday, March 19, 2017 at 3:03:21 AM UTC+8, T L wrote: > > At the end of sync/atomic package docs, it says > > On x86-32, the 64-bit functions use instructions unavailable before the > Pentium MMX. > > > On non-Linux ARM, the 64-bit functions use instructions unavailable before > the ARMv6k