[go-nuts] Position(s) available at FireEye

2018-11-14 Thread David Riley
Hi all, I work at FireEye on the tooling end of things, and my team needs more decent senior backend devs. Our current project is a large-ish system in Go; we're looking for experienced systems programmers, but deep proficiency in Go isn't strictly required (Go is easy enough to pick up,

Re: [go-nuts] What does "nil implay?

2019-01-20 Thread David Riley
On Jan 20, 2019, at 18:00, 伊藤和也 wrote: > > I know "nil" is zero values for slices, maps, interfaces, etc but I don't > know what "nil" implays. Does nil implay the absence of value or a variable > has't been initialized yet or something else? Basically yes, all of the above. This pattern

Re: [go-nuts] What is nil pointer dereference?

2019-01-20 Thread David Riley
On Jan 20, 2019, at 16:36, Burak Serdar wrote: > >> On Sun, Jan 20, 2019 at 2:32 PM 伊藤和也 wrote: >> >> type a interface{ >> m() >> } >> >> type abc int >> func (abc) m() {} >> >> func main() { >> var v a >> v.m() >^^ > > v is nil. It is declared but never assigned a value. You

Re: [go-nuts] Re: pass interface

2018-12-10 Thread David Riley
Ah! No, that is not possible, because interfaces (and other types) are not first-class objects in Go like they are in some other languages (such as Python). You can work around it, to some extent, by passing a zero-valued instance of such an interface (e.g. PrintInterface(A{})) and using some

Re: [go-nuts] Versioning golang.org/x/foo packages

2018-12-14 Thread David Riley
Oh man, I searched in vain for any kind of discussion exactly like that issue. Your Google-fu is clearly superior to mine. Thanks! :-) > On Dec 14, 2018, at 10:08 AM, Paul Jolly wrote: > > Just to briefly note the discussion in > https://github.com/golang/go/issues/27858 (and other issues

[go-nuts] Versioning golang.org/x/foo packages

2018-12-14 Thread David Riley
Hi all, We're building with go 1.10.x and dep for a project at work, and having been bitten twice in the space of a week with unversioned upstream executables fetched via "go get" causing strife with versioned vendor code fetched by "dep", we've been working on making our build environment

Re: [go-nuts] go in cloud server

2019-04-03 Thread David Riley
On Apr 3, 2019, at 11:34 AM, Shyaka Rene wrote: > > > Hello. > I'm new to go, i'm looking for a programming language to replace java. I have > simple questions > • is it a good idea to deploy go in cloud server if go is compiled to > machine binaries, what can happen if the cloud

Re: [go-nuts] Build problems with modules in Docker

2019-04-03 Thread David Riley
A few things. Responses inline. > On Apr 3, 2019, at 7:05 AM, Marcus Franke wrote: > > Hello, > > I have a small project here at work, that does not compile using modules > inside the golang docker image. > > The software resides inside a rather monorepo like repository inside the >

Re: [go-nuts] Is Go a single pass compiler?

2019-02-28 Thread David Riley
Was this book written in the '70s or '80s? Single-pass compilation is great in some ways (memory and time efficient), not in others (usability). C is (sort of) single-pass (if you don't count the preprocessor, optimization passes, etc), which is why you need function prototypes. Assemblers

[go-nuts] Module replacement forks and Artifactory

2019-03-11 Thread David Riley
Hi all, We're running into a bit of an interesting problem with modules. A month or two ago, we finally converted our project over to using modules, partly because it was The Right Thing To Do and partly because Artifactory supports module repositories (but not dep). The process hasn't

Re: [go-nuts] [CoC] screenshot images. Lazines or incompetence?

2019-03-12 Thread David Riley
On Mar 12, 2019, at 7:44 AM, Wojciech S. Czarnecki wrote: > > On Mon, 11 Mar 2019 23:13:00 -0700 (PDT) > Lucio wrote: > >> It's clearly become a lot easier > > An that is the crux of the problem. > > It is so easy that it easily turns off the brain and suppress > the last faint of thought

Re: [go-nuts] Re: using docker for compiling

2019-02-07 Thread David Riley
Yes, but we have somewhat different objectives than you might. We use the Docker golang (alpine) image to build our images, and it works wonderfully (and really makes it a lot easier to cope with differences in Jenkins build nodes). However, our apps generally eventually run on Kubernetes,

Re: [go-nuts] ctrl-c and Golang

2019-02-16 Thread David Riley
I suspect it's because your reference to the time_array is actually copying it into your closure that's running as the goroutine instead of making a reference to it. You might do better to pass that array as a parameter to the goroutine instead of trying to absorb it as context. I should note

Re: [go-nuts] floating point question

2019-04-15 Thread David Riley
On Apr 15, 2019, at 12:47 PM, Miki Tebeka wrote: > > On Monday, April 15, 2019 at 2:12:18 PM UTC+3, Jan Mercl wrote: > > 1.1*1.1 and 1.21 are untyped constants and have much higher precision at > which they are not equal. > Does that mean that the Go compiler is using floats with more

Re: [go-nuts] floating point question

2019-04-16 Thread David Riley
On Apr 16, 2019, at 2:29 AM, Miki Tebeka wrote: >> >> On Monday, April 15, 2019 at 7:59:28 PM UTC+3, David Riley wrote: >> On Apr 15, 2019, at 12:47 PM, Miki Tebeka wrote: >> > >> > On Monday, April 15, 2019 at 2:12:18 PM UTC+3, Jan Mercl wrote: >

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-05-31 Thread David Riley
Because Min and Max are very good and simple indicators of whether the mechanism is generic enough to handle a fairly common idiom: small functions for similarly behaved items, say comparable items, which are annoying and repetitive to write for every data type which might support the operation

Re: [go-nuts] Go 2 generics counterproposal: giving up restricting types

2019-05-30 Thread David Riley
On May 30, 2019, at 2:25 PM, Ian Lance Taylor wrote: > > One of my guidelines for an acceptable generics proposal is that > people can write Min and Max. Your proposal admits that it doesn't > permit that. I think that is a problem. I'm fine with the general > idea of "do 80% of the job" but

Re: [go-nuts] How to constant ?!

2019-05-28 Thread David Riley
On May 28, 2019, at 8:12 AM, Ashutosh Baghel wrote: > > Hello folks, > > I want to declare a few variables constant. But I guess there is nothing as > "Constant" type in GoLang. How do I achieve this in GoLang? https://tour.golang.org/basics/15 -- You received this message because you are

Re: [go-nuts] Re: Marshaling to JSON and dynamically choosing fields

2019-06-02 Thread David Riley
There are other JSON packages (jsoniter, gojay come to mind) which may do more of what you want. The standard library's JSON package is fine for simple things, but because it relies on struct tagging, it's not terribly well suited for situations where you want to separate the serialized

Re: [go-nuts] Re: Project Layout Question

2019-06-11 Thread David Riley
On Jun 11, 2019, at 13:38, Ronny Bangsund wrote: > > > >> On Tuesday, June 11, 2019 at 2:47:44 PM UTC+2, Boris Mühmer wrote: >> Is the project layout total rubbish? > > I'm not sure - all I know is that it's different from how I prefer it, and > "pkg" is the one thing I frequently see people

Re: [go-nuts] Re: the Dominance of English in Programming Languages

2019-05-18 Thread David Riley
On May 18, 2019, at 05:59, ma...@madra.net wrote: > >> On Saturday, 18 May 2019 00:44:33 UTC+1, Rob 'Commander' Pike wrote: >> jail is a clear improvement over the ludicrous gaol... > > I hadn't actually realised that GAOL vs JAIL was a British vs. US English > distinction. I thought 'Gaol' was

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-05-12 Thread David Riley
On May 12, 2019, at 06:55, Jesper Louis Andersen wrote: > > I don't think there are developers who find it unreadable once they know the > logic of that operator. However, if you don't know the rules, then it looks > like black magic. > > In large software developments, consistency beats

Re: [go-nuts] Running tests in read-only containers

2019-04-27 Thread David Riley
> On Apr 27, 2019, at 1:11 AM, Constantin Konstantinidis > wrote: > > Your description seems to relate to this issue > https://github.com/golang/go/issues/30667. It does indeed! It would be great if there were also a way to prevent it from trying to modify the cache, or at least to be less

Re: [go-nuts] cracking the go language aplication

2019-04-26 Thread David Riley
On Apr 26, 2019, at 07:12, smn shilla wrote: > > Hi > any luck please Your request (“how to crack the Go application.exe”) is vague, and it is not immediately clear that you’re asking for help that people here might be comfortable giving. If you’re interested in reverse engineering Go

Re: [go-nuts] Go+ replacement

2019-04-23 Thread David Riley
On Apr 21, 2019, at 9:02 PM, icod.d...@gmail.com wrote: > > I don't know about you but for me, even if there wasn't so much going on, > Google+ and the Go+ community was a source of info. > > Reddit is reddit, this whatever it is, is what it is, mewe can't replace > G+. > Facebook just

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread David Riley
On Apr 24, 2019, at 8:04 AM, Mark Volkmann wrote: > > >> On Apr 24, 2019, at 6:22 AM, Robert Engels wrote: >> >> Though to the ops point, not sure why Go doesn’t have the ternary operator - >> which is pretty ubiquitous. > > The idea of adding the ternary operator to Go has been debated

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread David Riley
On Apr 24, 2019, at 12:34 PM, Marcus Low wrote: > > On Wednesday, April 24, 2019 at 10:08:53 PM UTC+8, Mark Volkmann wrote: >> Are there really developers that find this unreadable? >> >> color := temperature > 80 ? “red” : “green” >> >> I know what you are going to say. People will nest

Re: [go-nuts] Go+ replacement

2019-04-23 Thread David Riley
> On Apr 23, 2019, at 12:52 PM, Darko Luketic wrote: > > But Twitter is a loose group of individuals, or does it have group > functionality now? Everything is done via #channels last time I checked. > I honestly very rarely use it, too small sized posts, it's very chaotic and > stuff you've

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-24 Thread David Riley
On Apr 24, 2019, at 5:25 PM, andrey mirtchovski wrote: > >> I may easily misremember, but that doesn't match my recollection. I >> don't remember what position Rob and Robert took, but as I recall Ken >> was generally opposed to the ternary operator. He had been in part >> responsible for

[go-nuts] Running tests in read-only containers

2019-04-26 Thread David Riley
Hi all, We have an unusual issue owing somewhat to Jenkins' rather odd (but understandable) method of running things in containers. Jenkins, when it runs things in Docker containers through its pipeline plugin, volume-mounts the workspace directory at the same location as it is in the host

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-26 Thread David Riley
On Apr 26, 2019, at 2:12 AM, Mike Schinkel wrote: > > Given that, I am curious what your thoughts would be if this were possible in > Go instead? > >color := if temperature > 80 then “red” else “green” > > And especially if this formatting were valid: > >color := if temperature >

Re: [go-nuts] Need help to learn go lang

2019-07-21 Thread David Riley
This may be a controversial opinion on this list (maybe it's not, I don't know), but I've never thought Go is a particularly good first language. It's an *excellent* language, but I've always said the same thing about it as I did about C/C++ and Java: there's just a touch too much arcana for

Re: [go-nuts] Re: arm64 builder on raspberry pi 3B/3B+

2020-02-13 Thread David Riley
As does Armbian (armbian.com). I dare say they're my favorite ARM distribution for getting stuff up and running on generic ARM boards; their default SD card installs mostly Just Do The Right Thing (including automatically expanding the filesystem on first boot to fit), and the hardware support

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread David Riley
On Mar 2, 2020, at 1:54 PM, Warren Stephens wrote: > > I have never experienced that writing tests at the beginning saves time. I > find it is always faster to not write them in the beginning. Functionality > typically changes 3 or 4 times before it "settles down" enough that writing >

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread David Riley
On Mar 5, 2020, at 9:26 AM, Warren Stephens wrote: > > And I am saying Functions PLUS Structure. > > > > Functions remain. Visible structure is added. Right, and you can do your testing at the boundaries of those functions, because the structure is nothing but a shell (in most Step Lambda

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-05 Thread David Riley
On Mar 5, 2020, at 5:17 PM, Warren Stephens wrote: > > So I should invent a fractal programming language -- where every function > must be defined within another function -- have people write tests for that! I think we call that "LISP". - Dave -- You received this message because you are

Re: [go-nuts] [Proposal] Change how gofmt formats struct fields

2020-02-03 Thread David Riley
On Feb 1, 2020, at 9:00 AM, Manlio Perillo wrote: > > On Saturday, February 1, 2020 at 12:45:23 AM UTC+1, David Riley wrote: >> Please don't do this. Or make it an opt-in. This is not a good change to >> force on users by default. >> > > You are right, thank

Re: [go-nuts] [Proposal] Change how gofmt formats struct fields

2020-01-31 Thread David Riley
On Jan 30, 2020, at 8:46 AM, Manlio Perillo wrote: > > Yes. > > In fact I wrote that alignment should be done by the editor, not gofmt. In this scenario, the editor needs to understand Go formatting and apply special formatting to tabs within struct fields? I strongly discourage this. It

Re: [go-nuts] Re: [Proposal] Change how gofmt formats struct fields

2020-02-18 Thread David Riley
On Feb 18, 2020, at 9:15 PM, Wojciech S. Czarnecki wrote: > > [1] use marker relative to the opening brace hinting at the desired comment > position, ie. compute type-start position relative to the opening brace then > comment-start position relative to the marker from the comment of the brace >

Re: [go-nuts] Re: [Proposal] Change how gofmt formats struct fields

2020-02-20 Thread David Riley
On Feb 20, 2020, at 8:35 AM, Manlio Perillo wrote: > > This is not a matter of style. It is a matter of having clean diffs in > commits. It is both. You may prioritize clean diffs, and I understand your reasons for that. Many other people prioritize readability over clean diffs. Neither

Re: [go-nuts] Why Discord is switching from Go to Rust

2020-02-09 Thread David Riley
On Feb 7, 2020, at 7:24 AM, Everton Marques wrote: > > I think Go is way better than Rust, but it is amusing to see why people pick > one over another. I think they have very different use cases. Rust is fundamentally a functional language, which suits it quite well for things functional

Re: [go-nuts] Go without garbage collector

2020-02-13 Thread David Riley
On Feb 13, 2020, at 1:45 PM, Robert Engels wrote: > > Swift uses GC - it uses a reference counting GC which has been proven to be > inferior compared to tracing collectors - especially in concurrent > environments. Not to mention cycles. Worth noting, too, that Swift does this largely because

Re: [go-nuts] Go without garbage collector

2020-02-12 Thread David Riley
> On Feb 12, 2020, at 10:10 AM, Henrik Johansson wrote: > > Well, Cassandra has a rewrite in C++ ScyllaDB hat performs many times better > so that particular example isn't really helping the GC case. > > I don't mind the GC myself but I hear the "GC is actually faster" often and > it seems

Re: [go-nuts] Re: Go mindshare is low & ~flat, per Google Trends

2020-01-16 Thread David Riley
I'll be interested to see how this trend goes when they FINALLY pull the plug on Python 2.7 and everyone who's been kicking the can down the road for the better part of a decade finally has to figure out which third-party libraries are breaking. Python is better for some things, Go better for

Re: [go-nuts] Go security bugs database

2020-01-20 Thread David Riley
I strongly agree this would be beneficial. I’ve discussed this exact concept with my employer before, because it’s an area we have scanners for with older languages, but not Go. I do believe Snyk offers a commercial version of this service, but a public, official, well-vetted repository that

Re: [go-nuts] Re: A question !

2020-01-07 Thread David Riley
On Jan 7, 2020, at 04:44, Motaz Hejaze wrote: > >  > Thank you all guys for your help.. > > May i ask what is the best deployment for more performance ?? I’m not quite sure what you mean. Do you mean what environment results in the highest-performing Go programs? I’d imagine the s390x

Re: [go-nuts] Re: go run requires internet connection?

2020-04-09 Thread David Riley
I feel like it's 10.15 where Apple really started doubling down on their "notarization" service? I haven't updated anything to it because it breaks (by design) a number of things I regularly use, so it would be hard to say, but that has to be frustrating for developers who can't be constantly

Re: [go-nuts] Go course

2020-03-25 Thread David Riley
If you are already a programmer in another language, the Tour of Go (tour.golang.org) is absolutely the best. If you are not already a programmer in another language, I personally don't recommend Go as a first language; it's an excellent language, but I feel that people will do better with it

Re: [go-nuts] Go course

2020-03-26 Thread David Riley
And since I'm a fan of lifelong learning, I have to admit to not having known that println() was a builtin until this post. Thanks! That does un-complicate it somewhat. > On Mar 26, 2020, at 10:34 AM, Sebastien Binet wrote: > > On Thu, Mar 26, 2020 at 3:29 PM David Ril

Re: [go-nuts] Go course

2020-03-25 Thread David Riley
s.google.com/d/topic/golang-nuts/FIRSDBehb3g/discussion > > Dan > >> On Wed, 2020-03-25 at 13:34 -0400, David Riley wrote: >> If you are already a programmer in another language, the Tour of Go >> (tour.golang.org) is absolutely the best. >> >> If you are n

Re: [go-nuts] Re: Using modules with private repos

2020-04-01 Thread David Riley
This is actually a fairly neat solution! I might look at using that from here on out. How well does it work if something else (also with access to your private repository) tries to include your module? - Dave > On Apr 1, 2020, at 11:47 AM, Dave Mazzoni wrote: > > With all the examples out

Re: [go-nuts] Go course

2020-03-26 Thread David Riley
gt; I never really understood the rationale for the feature. > > The Go 1 compatibility promise is also helpful. This means that course > materials or online code examples written > 8 years ago will still work today. The python community broke most existing > code whe

Re: [go-nuts] High Performance REST API Framework.

2020-05-09 Thread David Riley
I like Echo (echo.labstack.com) a lot. Nice and modular, more capable than Gin with about the same performance, and I think it meets all of your criteria (except having never used Spring Boot before, I don't know how it compares). - Dave > On May 9, 2020, at 12:39 AM, Sai Matam wrote: > >

Re: [go-nuts] SIGILL running 1.14 on macOS

2020-03-17 Thread David Riley
On Feb 26, 2020, at 2:00 PM, James Pettyjohn wrote: > > A little further digging shows that VZEROUPPER is part of the AVX instruction > set, not supported on any Apple computers prior to 2011 from what I can tell. > > Given the rc1 code worked fine, that could be an alternative for Darwin

Re: [go-nuts] gccgo problem compiling go from source

2020-10-20 Thread David Riley
On Oct 20, 2020, at 2:38 AM, fge...@gmail.com wrote: > > After looking at the list of supported platforms on build.golang.org > and looking at the golang-nuts and golang-dev mailing list archives, I > can't see the ppc e500 as a supported hardware platform for the go > compiler (available on

Re: [go-nuts] [ generics] Moving forward with the generics design draft

2020-08-21 Thread David Riley
On Aug 21, 2020, at 00:56, Ian Lance Taylor wrote: > > No, the intent is that you would switch on the type parameter itself, > not a value. > > func g[T C](v T) T { > switch T { >// the rest is the same > } > } > > Thanks for asking. Oh, this clarifies my remaining murkiness about the

Re: [go-nuts] [ generics] Moving forward with the generics design draft

2020-08-20 Thread David Riley
On Aug 20, 2020, at 20:27, Ian Lance Taylor wrote: > > 1. > > We’re going to settle on square brackets for the generics syntax. > We’re going to drop the “type” keyword before type parameters, as > using square brackets is sufficient to distinguish the type parameter > list from the ordinary

Re: [go-nuts] Golang slow performance inside for loop MySQL Queries

2020-10-21 Thread David Riley
On Oct 21, 2020, at 6:41 AM, Bill wrote: > > Hello, > I created the sql to fetch all info in one call instead of multiple calls per > each row. > > One thing I noticed about golang is that when I ping my Remote DB from > localhost (running in vscode) I get ping -> 1.573826274s. So I think

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread David Riley
On Jul 15, 2020, at 2:48 PM, Ian Lance Taylor wrote: > > More seriously, though, let's look closely at Robert's example: > > a, b = w < x, y > (z) TBH, I think a big argument in favor of square brackets over angle brackets is that they ascend above the center line in most typefaces, which

Re: [go-nuts] Port to powerpc 440fpu

2020-08-10 Thread David Riley
On Aug 10, 2020, at 4:59 AM, Hugo Cornelis wrote: > > > Hi, > > Bottom line: Docker works reliably on powerpc 440fpu 32 bit using gccgo as > the compiler. We will likely soon start working on powerpc e6500 in 32bit > mode. > > After a fix in the structures used by the epoll system calls,

Re: [go-nuts] First git commit for Go was in 1972? 勞

2020-08-05 Thread David Riley
> On Aug 5, 2020, at 5:16 AM, Amarjeet Anand > wrote: > > How come the first git commit for Go was in 1972? > > Anybody want to share the story behind the first 4 commits of Go project by > Brian Kernighan? > > >

Re: [go-nuts] Generics and parentheses

2020-07-14 Thread David Riley
On Jul 14, 2020, at 5:54 PM, 'Robert Griesemer' via golang-nuts wrote: > > But if we are comfortable with the extra type keyword, the ambiguity > disappears: > > type A[type N] E > > (When we originally dismissed square brackets, the type keyword was not yet > on the table.) > >

Re: [go-nuts] Generics and parentheses

2020-07-15 Thread David Riley
On Jul 15, 2020, at 4:47 AM, Nick Craig-Wood wrote: > > In my mind the use of [ ] clashes horribly with the array declaration > syntax. When I see [int] in particular my brain says, ah array declaration of > size int, what, no wait... On the other hand, this is already how maps are declared

Re: [go-nuts] Re: Generics and parentheses

2020-07-15 Thread David Riley
On Jul 15, 2020, at 12:13 AM, Ian Lance Taylor wrote: > > The disadvantage of guillemets is that they are hard to type on many > keyboards. So to me either square brackets or angle brackets would be > better than guillemets. Not to mention that, while Go *is* officially in UTF-8, the chance of

Re: [go-nuts] building go 1.14.4 on CentOS 7 multiple test failures

2020-07-10 Thread David Riley
On Jul 10, 2020, at 3:02 PM, Alastair Neil wrote: > > > It's an old but not an especially slow machine: dual 8 core E5-2670 Xeon > with 64 GB Ram. > I wil try > GO_TEST_TIMEOUT_SCALE=4 I've successfully built on an older and slower (pre-Nehalem) 8-core Xeon with a similar RAM load just

Re: [go-nuts] Golang telnet package

2020-07-12 Thread David Riley
On Jul 12, 2020, at 10:17 AM, Harris Newman wrote: > > I'm writing a telnet server and have found several packages which provide > telnet functionality, but can't find any telnet support in the standard > library or other packages in the golang.org site. > > Is there a golang supported

Re: [go-nuts] [generics] replace ()/(type ) with :[]

2020-06-18 Thread David Riley
On Jun 18, 2020, at 12:30 PM, 'Thomas Bushnell, BSG' via golang-nuts wrote: > > On Thu, Jun 18, 2020 at 9:46 AM Kiswono Prayogo wrote: > Personally () parentheses seems like to be harder to read, too similar with > function calls. > > This is exactly why I like it. These are parameters, and

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread David Riley
On Jun 25, 2020, at 8:49 PM, chandrak13...@gmail.com wrote: > > Essentially based on the existing capacity, the assignment of one slice > effects other slices. These are stemming from the underlying pointer > arithmetic and seems inconsistent. Looks like programmer needs to know the > history

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread David Riley
> On Jun 26, 2020, at 2:52 PM, Tyler Compton wrote: > > On Fri, Jun 26, 2020 at 10:52 AM David Riley wrote: >> Also, to this specific point: this exact approach, as with much of Go, >> embodies the Bell Labs approach to design (for better or for worse, and with >&g

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread David Riley
On Jun 26, 2020, at 2:59 PM, Ian Lance Taylor wrote: > > I honestly don't think that append is an example of worse-is-better. > I think it's an example of preferring to pass and return values rather > than pointers. The language could easily have made append take a > pointer to a slice as its

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread David Riley
On Jun 26, 2020, at 1:41 PM, Robert Engels wrote: > > My opinion is that if RTFM is required more than once for a core concept > there may be a design problem. It clearly bites a lot of people. Slices are a > higher level struct, as the underlying array is the same as Java, but Java > doesn’t

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread David Riley
On Jun 26, 2020, at 1:41 PM, Robert Engels wrote: > > I don’t think “how it works” is the confusion, more of “how to use it > properly” > > My opinion is that if RTFM is required more than once for a core concept > there may be a design problem. It clearly bites a lot of people. Slices are a

Re: [go-nuts] Re: Speed up png.Decode

2020-06-27 Thread David Riley
On Jun 27, 2020, at 8:30 AM, Robert Engels wrote: > > Just because the bulk of the time is in the decode doesn’t mean the decode is > inefficient or can be improved upon. It might be the most expensive stage in > the process regardless of the implementation. This is I think the most

Re: [go-nuts] Re: political fundraising on golang.org!

2020-06-16 Thread David Riley
On Tuesday, June 16, 2020 at 11:52:10 AM UTC-4, K Richard Pixley wrote: > > There is agreement on the code of conduct. There is not agreement on the > banner. IMO, the banner is out of line with the goals of this group and > with the code of conduct. It's inappropriate. It needs to be

Re: [go-nuts] [generics] Closure?

2020-06-18 Thread David Riley
I think this probably gets a little closer to what you were going for, but there's a puzzling error that leads me to think the parser doesn't quite understand the instantiation in the return type: https://go2goplay.golang.org/p/gcD609dr21E type Foo(type T) struct {} type

Re: [go-nuts] Awkwardness around built in containers and user containers

2020-06-17 Thread David Riley
On Jun 17, 2020, at 8:45 PM, Ian Lance Taylor wrote: > > On Wed, Jun 17, 2020 at 9:35 AM wrote: >> >> How do I write a function that can take any container? Either a built in >> container or a user defined structure? Java is awkward when deciding to >> accept arrays or the List type — is go

Re: [go-nuts] Generics: More on parens

2020-06-18 Thread David Riley
On Jun 18, 2020, at 6:19 PM, Jon Conradt wrote: > > Ian, I like the direction being taken on Generics, and I am thankful the Go > Team did not rush into an implementation. > > I'm not a huge fan of another set of ()'s and I agree with not wanting the > overhead of overloading <>. That got me

Re: [go-nuts] Slices and inconsistency

2020-06-26 Thread David Riley
> On Jun 26, 2020, at 9:28 AM, Robert Engels wrote: > >> On Jun 26, 2020, at 8:23 AM, David Riley wrote: >> >> You are correct, the programmer needs to read the manual. Slices are >> "windows" into their underlying array, therefore assigning data into

Re: [go-nuts] It is said that future Macs will use ARM, is golang ready for this move ?

2020-06-10 Thread David Riley
On Jun 10, 2020, at 5:50 AM, Jesper Louis Andersen wrote: > > 2. Dynamic binary translation from machine-code to machine-code has been used > in the past for these architectural changes. While this carries a penalty, it > also provides a short-term solution. The added efficiency of recompiles

Re: [go-nuts] It is said that future Macs will use ARM, is golang ready for this move ?

2020-06-10 Thread David Riley
On Jun 10, 2020, at 3:23 PM, David Riley wrote: > > Also worth noting that IBM i (f/k/a System i and AS/400) traditionally stores > its executables as an IR form to be compiled to native code (currently PPC) > on execution, though my recollection is that this is a one-

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread David Riley
On Jul 15, 2020, at 4:59 PM, Ian Lance Taylor wrote: > > On Wed, Jul 15, 2020 at 5:44 AM Jan Mercl <0xj...@gmail.com> wrote: >> >> My 2c - Alternative type parameters syntax (ab)using @$: >> https://docs.google.com/document/d/1AoU23DcNxYX2vYT20V2K16Jzl7SP9taRRhIT8l_pZss/edit?usp=sharing > >

Re: [go-nuts] Generics and parentheses

2020-07-22 Thread David Riley
On Jul 22, 2020, at 8:02 PM, Russ Cox wrote: > > So it sounds like everyone is in favor of the entire generics proposal and > all the semantics, and all we have left to hammer out is the bracket > characters? Do I have that right? We haven't covered what the bike shed roof is going to be made

Re: [go-nuts] Generic symbol metaproposal

2020-07-24 Thread David Riley
On Jul 24, 2020, at 5:50 PM, Ian Lance Taylor wrote: > > On Fri, Jul 24, 2020 at 2:22 PM wrote: > > > > On 7/23/20, Michael Jones wrote: > > ... > > > Another delight is the uppercase signal for external. > > > > > > Maybe the “how to signal it” aspect of type instantiation could look to > > >

Re: [go-nuts] Generics - please provide real life problems

2020-12-24 Thread David Riley
Indeed. I'm working on a boolean logic package that has a number of different bitfield oriented backends, all of which will have a lot of very needlessly repetitive code without generics. If generics weren't coming "soon" I'd consider writing a generator to build it, but generics are the much

Re: [go-nuts] Golang slow performance inside for loop MySQL Queries

2020-10-21 Thread David Riley
On Oct 20, 2020, at 1:18 PM, Marcin Romaszewicz wrote: > > Go's database layer is generally pretty quick, I use it a lot, but your code > immediately sets off my DB alarms, because you are doing queries within the > body of another query loop, which means you're opening up lots of >

Re: [go-nuts] Generics - please provide real life problems

2020-12-30 Thread David Riley
This topic has shown little other than that a few people here are unwilling to consider points of view other than their own and declare that very real problems are not real. You should listen to people who have been doing this much longer than you have before discarding all their points as

Re: [go-nuts] Generics - please provide real life problems

2021-01-01 Thread David Riley
On Dec 31, 2020, at 11:54 AM, 'Axel Wagner' via golang-nuts wrote: > > On Thu, Dec 31, 2020 at 5:46 PM robert engels wrote: > I’ll state for the record again, I was originally very dismayed that Go did > not offer generics - after developing with it for a while that is far less of > an issue

Re: [go-nuts] Advice, please

2021-01-14 Thread David Riley
On Jan 13, 2021, at 7:21 PM, Peter Wilson wrote: > So, after a long ramble, given that I am happy to waste CPU time in busy > waits (rather than have the overhead of scheduling blocked goroutines), what > is the recommendation for the signalling mechanism when all is done in go and >

Re: [go-nuts] Advice, please

2021-01-17 Thread David Riley
This particular problem is akin to the way GPUs work; in GPU computing, you generally marshal all your inputs into one buffer and have the outputs from a single kernel written to an output buffer (obviously there can be more on either side). The execution overhead of a single invocation is

Re: [go-nuts] Go Create

2021-02-03 Thread David Riley
On Jan 12, 2021, at 5:40 AM, Kevin Chadwick wrote: > > On 1/12/21 9:43 AM, Axel Wagner wrote: >> git init >> go mod init >> >> I guess you *could* safe the `git init` part, but is that really worth the >> added >> complexity? > > > I usually init git from within vscode afterwards. I wonder

Re: [go-nuts] Golang language specification Document: Composite Literals example is not understandable

2021-06-22 Thread David Riley
On Jun 22, 2021, at 12:42, Axel Wagner wrote: > >  > Oh and also: > >> Likewise, I think this only works for array literals; I don’t think (though >> again have not tried it) that you can declare slice literals with only >> selected members initialized. > > Works fine too:

Re: [go-nuts] Golang language specification Document: Composite Literals example is not understandable

2021-06-22 Thread David Riley
On Jun 22, 2021, at 11:39, Vaibhav Maurya wrote: > > Hi, > > Please help me to understand the following syntax mentioned in the Golang > language specification document. > > https://golang.org/ref/spec#Composite_literals > > following is the search string for CTRL + F > // vowels[ch] is

Re: [go-nuts] Go: pointer bit stealing technique

2021-05-06 Thread David Riley
On May 6, 2021, at 7:16 AM, Vitaly Isaev wrote: > > There is no similar type in C/C++/Go stdlib, but at least in C++ it's > possible to model it using bit stealing approach (see C++ example). On x86_64 > arch only 48 bits of 64 bits are actually used, so one can store arbitrary > data in the

Re: [go-nuts] Go and GPUs

2021-06-25 Thread David Riley
On Jun 25, 2021, at 1:32 PM, Robert Engels wrote: > > Why not develop a Go <> CUDA binding using CGo? This (ditto for OpenCL, Vulkan, etc) is more likely the path you'll have to go down. Generally all of these interfaces rely on pretty massive libraries from NVIDIA, AMD, Intel, etc. which

Re: [go-nuts] Go and GPUs

2021-06-25 Thread David Riley
On Jun 25, 2021, at 10:23 PM, Robert Engels wrote: > > There is also a LOT of support for Java and CUDA/OpenCL. You can essentially > reimplement them Java portion in Go. There are multiple open source projects > in this area. > > Might be a lot easier than starting from scratch. Yes, CGo

Re: [go-nuts] Makefiles for Go Programs

2021-08-23 Thread David Riley
On Aug 22, 2021, at 23:11, jlfo...@berkeley.edu wrote: > >  > I've noticed that few, if any, Go programs use Makefiles. Is that because the > overhead of using make is greater than the overhead of just always compiling > and linking everything? > One piece of evidence for this is that the Go

Re: [go-nuts] Re: Makefiles for Go Programs

2021-08-23 Thread David Riley
On Aug 23, 2021, at 12:48, Roland Müller wrote: > > What are the alternatives to Makefile that are used by Go developers? Please > comment :-) Well, there’s mage, which aims to more or less replace the functionality of Make for Go. I’m not really sold on *needing* a replacement for Make, and

Re: [go-nuts] Why isn't go more popular?

2021-08-06 Thread David Riley
On Aug 5, 2021, at 10:27 PM, Ian Lance Taylor wrote: > > On Thu, Aug 5, 2021 at 7:20 PM Santi Ferra > wrote: >> >> When you see the ranking of the most liked programming languages, go is near >> c++, a really "hated app". But since is efficient and produces really clean >> code, why no wants

Re: [go-nuts] Draining http response bodies

2021-10-08 Thread David Riley
On Oct 7, 2021, at 3:36 AM, Amnon wrote: > > Is it necessary for a http client to fully read the http response body? > > Opinion on the Go forums seems divided > https://forum.golangbridge.org/t/do-i-need-to-read-the-body-before-close-it/5594 > > But a simple benchmark