[go-nuts] All Forms of Wishful Generics

2018-02-15 Thread dc0d
All forms of generics that I would love to have in Go: -- You received this message because you are subscribed to the Google Groups "golang-nuts"

[go-nuts] Re: Possible to stream database/sql rows to text/template?

2018-02-15 Thread Tamás Gulácsi
net/http implements "Chunked" encoding automatically, so just leave Content-Length out, and it will "Just Work". -- 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

[go-nuts] Re: Go on MIPS32

2018-02-15 Thread Juliusz Chroboczek
> cgo is not go. The speed of system calls is similar though -- 110 microseconds for a UDP send/receive pair over loopback. As compared to a single core of a 2.4GHz laptop, the MIPS nodes are: - 10 to 20 times slower on integer code; - 30 times slower on small UDP packets over loopback;

[go-nuts] Re: Tweaking sync.Pool for mostly-empty pools

2018-02-15 Thread Kevin Malachowski
If there is likely nothing in the Pool, then maybe it's better to not use one at all. Can you compare the internal workload with an implementation where all callers just call the `New` function directly? What's the purpose of using a pooled memory if there's often nothing in the pool? On

[go-nuts] Re: Possible to stream database/sql rows to text/template?

2018-02-15 Thread Matt R.
Ah! Should have thought of that. After implementing it, however, I realized that it's not very conducive to HTTP requests, in which the Content-Size header is expected to be sent, and thus, how can I know the content size of a response until I've rendered the whole thing? Thanks anyways! --

Re: [go-nuts] gccgo produces much slower code than gc

2018-02-15 Thread Ian Lance Taylor
On Thu, Feb 15, 2018 at 11:31 AM, Tamir Duberstein wrote: > What does all do? Anyway, the results are better, but still not "good": Using "all" applies the options to all packages, not just the one being built. Thanks for the benchmarks, it's something to look at. Ian >>

Re: [go-nuts] Come Contribute to an Open Source Web-Hosting Control Software written in Golang!

2018-02-15 Thread Ali Nabavi
Seems amazing! Thank you!  -Ali On Thu, Feb 15, 2018, 4:11 PM George Shaw wrote: > I've been developing a piece of software for the last couple of months > used for web-hosting control that has a server/client/public structure like > other known web-hosting control

[go-nuts] Come Contribute to an Open Source Web-Hosting Control Software written in Golang!

2018-02-15 Thread George Shaw
I've been developing a piece of software for the last couple of months used for web-hosting control that has a server/client/public structure like other known web-hosting control platforms. I think that it is finally at a stage where other people can start contributing and using it as well. I

[go-nuts] Experience report with nil interface{}

2018-02-15 Thread Tarmigan
We recently had a crash in our code because of an interface != nil issue (covered in FAQ as https://golang.org/doc/faq#nil_error). The thing that made it more subtle than the typical error interface case is that the assignment from a function returning a concrete type was made to an interface

Re: [go-nuts] gccgo produces much slower code than gc

2018-02-15 Thread Tamir Duberstein
What does all do? Anyway, the results are better, but still not "good": nameold time/opnew time/opdelta > ValueSetBytes-16 38.5ns ± 0% 105.8ns ± 4% +174.81% (p=0.008 n=5+5) > ValueSetFloat-16 27.5ns ± 1%73.2ns ± 1% +166.38% (p=0.008 n=5+5) >

Re: [go-nuts] gccgo produces much slower code than gc

2018-02-15 Thread Ian Lance Taylor
On Thu, Feb 15, 2018 at 10:59 AM, Ian Lance Taylor wrote: > On Thu, Feb 15, 2018 at 6:42 AM, Tamir Duberstein wrote: >> Built at this revision: >> https://github.com/gcc-mirror/gcc/commit/a82f431e184a9ac922ad43df73cdcc702ab0f279 > > Thanks. What do you see

Re: [go-nuts] gccgo produces much slower code than gc

2018-02-15 Thread Ian Lance Taylor
On Thu, Feb 15, 2018 at 6:42 AM, Tamir Duberstein wrote: > Built at this revision: > https://github.com/gcc-mirror/gcc/commit/a82f431e184a9ac922ad43df73cdcc702ab0f279 Thanks. What do you see from go test -gccgoflags="-g -O2" ? Ian > On Wed, Feb 14, 2018 at 7:44 PM, Ian

Re: [go-nuts] Go on MIPS32

2018-02-15 Thread andrey mirtchovski
just bump the clock rate to 3ghz and you'll reduce the cgo call cost to reasonable values :D On Thu, Feb 15, 2018 at 11:29 AM, Dave Cheney wrote: > cgo is not go. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To

Re: [go-nuts] Resources to learn Go as a first programming language?

2018-02-15 Thread Jon Calhoun
You can also check out Caleb Doxseys free ebook - https://www.golang-book.com/books/intro -- 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

[go-nuts] Go on MIPS32

2018-02-15 Thread Dave Cheney
cgo is not go. -- 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

Re: [go-nuts] Syntax problem, please help me

2018-02-15 Thread junije wen
Thanks for your fast response very much! It really helps. 在 2018年2月15日星期四 UTC-6上午10:01:09,Burak Serdar写道: > > On Thu, Feb 15, 2018 at 8:41 AM, junije wen > wrote: > > I'm reading the source code of Iris and trying to reimplement it. > > There is a line I can't understand.

Re: [go-nuts] Re: ported cgo project to windows, how to vary the #cgo LDFLAGS used per OS?

2018-02-15 Thread Jason E. Aten
Thanks guys! #cgo LDFLAGS: -lm > #cgo (linux OR darwin) LDFLAGS: -ldl > Lest anyone be led astray, my example above fails to add the -ldl flag on linux, the ( OR ) expression isn't the actual syntax, its just explanation in the docs. But putting them on their own lines does work: #cgo LDFLAGS:

Re: [go-nuts] memory leak, heap size doesn't match process res size

2018-02-15 Thread Ian Lance Taylor
On Thu, Feb 15, 2018 at 7:21 AM, Kane Kim wrote: > > I was surprised to see that overhead is so significant, is there any way to > peek into that and see what is taking up space in race detector? I've tried > --inuse_objects in a heap dump, but didn't see anything

Re: [go-nuts] Syntax problem, please help me

2018-02-15 Thread Burak Serdar
On Thu, Feb 15, 2018 at 8:41 AM, junije wen wrote: > I'm reading the source code of Iris and trying to reimplement it. > There is a line I can't understand. > > if p, is := e.Engine.(EngineRawExecutor); is { >return p.ExecuteRaw(src, wr, binding) > } > > The define of

[go-nuts] Syntax problem, please help me

2018-02-15 Thread junije wen
I'm reading the source code of Iris and trying to reimplement it. There is a line I can't understand. if p, is := e.Engine.(EngineRawExecutor); is { return p.ExecuteRaw(src, wr, binding) } The define of EngineRawExecutor is EngineRawExecutor interface { // ExecuteRaw is super-simple

Re: [go-nuts] memory leak, heap size doesn't match process res size

2018-02-15 Thread Kane Kim
I think I've got a clue. I've discovered that the process under question was built with -race flag. Apparently race detector structures (tsan) are not visible to runtime and are not reported. On Thursday, February 15, 2018 at 2:14:55 AM UTC-8, Peter Waller wrote: > > On 14 February 2018 at

Re: [go-nuts] gccgo produces much slower code than gc

2018-02-15 Thread Tamir Duberstein
Built at this revision: https://github.com/gcc-mirror/gcc/commit/a82f431e184a9ac922ad43df73cdcc702ab0f279 On Wed, Feb 14, 2018 at 7:44 PM, Ian Lance Taylor wrote: > On Wed, Feb 14, 2018 at 12:00 PM, Tamir Duberstein > wrote: > > Running the benchmarks in

[go-nuts] Re: ported cgo project to windows, how to vary the #cgo LDFLAGS used per OS?

2018-02-15 Thread Jason E. Aten
Ahah! Figured it out. Thanks to reading the fine manual at https://golang.org/cmd/cgo/. This syntax works: #cgo LDFLAGS: -lm #cgo (linux OR darwin) LDFLAGS: -ldl > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] ported cgo project to windows, how to vary the #cgo LDFLAGS used per OS?

2018-02-15 Thread Sebastien Binet
Jason, You can use the same build tag mechanism than for regular Go files: // #cgo amd64 386 CFLAGS: -DX86=1 See: https://golang.org/pkg/cmd/cgo/ Hth, -s sent from my droid On Feb 15, 2018 2:12 PM, "Jason E. Aten" wrote: > I ported my CGO-using project to windows, and

Re: [go-nuts] ported cgo project to windows, how to vary the #cgo LDFLAGS used per OS?

2018-02-15 Thread andrey mirtchovski
#cgo darwin LDFLAGS:-framework Security -framework Foundation -framework SystemConfiguration #cgo linux LDFLAGS:-L${SRCDIR}/../../lib -lxml2 etc. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving

[go-nuts] ported cgo project to windows, how to vary the #cgo LDFLAGS used per OS?

2018-02-15 Thread Jason E. Aten
I ported my CGO-using project to windows, and found that the -ldl flag that is needed on darwin and linux (for dynamic code loading) cannot also be used on windows. Its presence causes my project build to fail. In order to change the LDFLAG list, I tried putting an #ifdef __APPLE__ or #ifdef

[go-nuts] Go on MIPS32

2018-02-15 Thread Juliusz Chroboczek
BenchmarkGoCall 29.00 ns/op BenchmarkCgoCall 100 2302 ns/op 2 microseconds to call into C. Ouch. (That's on a 680MHz 24Kc core with 32kB data cache. I'm not complaining, merely noticing.) -- You received this message because you are

Re: [go-nuts] memory leak, heap size doesn't match process res size

2018-02-15 Thread Peter Waller
On 14 February 2018 at 16:15, Kane Kim wrote: > If we don't use CGO all memory should be reported somewhere? > Well, assuming no part of your software calls mmap, or there isn't something else funny going on. Can you capture when this large region is mapped with strace?

Re: [go-nuts] can someone create an example for me of a webpage that can run a bash command ?

2018-02-15 Thread Sebastien Binet
hi Dave, On Thu, Feb 15, 2018 at 3:56 AM, David Brendlinger < davidbrendling...@gmail.com> wrote: > can someone create an example for me of a webpage that can run a bash > command ? > > I would like a index.html that has a button on it. you hit the button and > it would do a ls /tmp >>