Re: [go-nuts] Re: Generics, please go away!

2020-12-26 Thread Henrik Johansson
it should be. This was one of the main drivers in > creating Go in the first place (as I understand it). > > Trying to make all programming languages identical means that all but one > of them is redundant. > > On Fri, Dec 25, 2020, 11:49 AM Henrik Johansson > wrote: > >> Ok m

Re: [go-nuts] Re: Generics, please go away!

2020-12-25 Thread Henrik Johansson
Ok maybe this thread has gone on too long. Both Java and C++ has benefited greatly from generics and most of their respective communities wouldn't want them gone. I am pretty sure that's what will happen with Go as well. Can we leave it now before we go from "corruption" to whatever hyperbole is

Re: [go-nuts] Re: [generics] Print[T Stringer](s []T) vs Print(s []Stringer)

2020-12-23 Thread Henrik Johansson
Why will interfaces be more idiomatic once generics lands? It remains to be seen I guess but I could very well see the other way become the idiom. On Wed, 23 Dec 2020, 21:20 wilk, wrote: > On 23-12-2020, Ian Lance Taylor wrote: > > On Wed, Dec 23, 2020 at 9:54 AM wilk wrote: > >> > >>

Re: [go-nuts] mytex.RWLock recursive read lock

2020-09-23 Thread Henrik Johansson
;> The rest is just additional explanation. This sentence alone is already >> sufficient to define the behavior. >> >> On Mon, Sep 21, 2020 at 2:14 PM Axel Wagner >> wrote: >> >>> On Mon, Sep 21, 2020 at 2:06 PM Henrik Johansson >>> wrote: >

Re: [go-nuts] mytex.RWLock recursive read lock

2020-09-21 Thread Henrik Johansson
improperly, that possibility doesn't seem worthwhile to advertise > further. > > So even if the docs are ambiguous, that hardly seems a problem. > > On Mon, Sep 21, 2020 at 12:58 PM Axel Wagner < > axel.wagner...@googlemail.com> wrote: > >> It only says that

Re: [go-nuts] mytex.RWLock recursive read lock

2020-09-21 Thread Henrik Johansson
g and another goroutine might >>> call Lock […] >> >> >> So if you know that no other goroutine might call Lock concurrently, then >> yes, you can call RLock twice. I can't really imagine a setting where you'd >> need an RWMutex and have that assurance and need

[go-nuts] mytex.RWLock recursive read lock

2020-09-21 Thread Henrik Johansson
https://golang.org/pkg/sync/#RWMutex Holds that this prohibits recursive read locks but why would it? I understand that deadlocks can happen in case write locks are held in between the read locks but why can't a goroutine issue several RLock calls? It does actually work in the playground.

Re: [go-nuts] JMX Call with non-HTTP

2020-09-14 Thread Henrik Johansson
rch for Java RMI-IIOP. > > On Sep 14, 2020, at 2:04 PM, Robert Engels wrote: > >  > You need a bridge. RMI requires Java. if you use a subset you can use > Corba/IIOP clients. > > On Sep 14, 2020, at 11:11 AM, Henrik Johansson > wrote: > >  > Newrelic has some

Re: [go-nuts] JMX Call with non-HTTP

2020-09-14 Thread Henrik Johansson
Newrelic has some tools for this but I think they require agents installed in the Java side. I think you are better off going for the Jolokia solution but perhaps there is something you can use from Newrelic. On Mon, 14 Sep 2020, 17:52 Venkata Madhusudhan Rao V, wrote: > Hi All, > I have a

Re: [go-nuts] Generics and parentheses

2020-07-16 Thread Henrik Johansson
This is good. I have been reaching for a consistency check and this just may be it. On Thu, Jul 16, 2020 at 12:04 AM 'Dan Kortschak' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Wed, 2020-07-15 at 14:36 -0700, Randall O'Reilly wrote: > > And the use of [ ] in map is more

Re: [go-nuts] Re: Build management mechanism for go lang

2020-05-27 Thread Henrik Johansson
I usually use make for that in combination with Goreleaser https://github.com/goreleaser/goreleaser/ . On Wed, May 27, 2020 at 7:18 AM Chashika Weerathunga < chashikajw...@gmail.com> wrote: > go mod, go build fine. Also I want to pack(zip) a executable and other few > directories into a folder.

Re: [go-nuts] Why golang allocated memory space increases?

2020-03-26 Thread Henrik Johansson
Isn't this because of the GC tracking these and treating then as effectively weak references to borrow a Java term? If they are not pointers they are not tracked by the GC and I guess they could all be removed at every scan? Just guessing though, I haven't in any way checked it. On Thu, Mar 26,

Re: [go-nuts] Go without garbage collector

2020-02-12 Thread Henrik Johansson
ears, is that GCs are slowly > eating more and more of the cake. As they improve, it definitely converges > toward more viability, not less. There will always be programs for which > they fare badly. But as they are detected, so are GCs improved. > > On Wed, Feb 12, 2020 at 4:11 PM

Re: [go-nuts] Go without garbage collector

2020-02-12 Thread Henrik Johansson
he GC tuning is not designed for latency with > max pauses of 500ms. > > Re-run the tests on Shenandoah or Zing and see how they compare. > > -Original Message- > From: Henrik Johansson > Sent: Feb 12, 2020 9:10 AM > To: Kevin Chadwick > Cc: golang-nuts > Su

Re: [go-nuts] Go without garbage collector

2020-02-12 Thread Henrik Johansson
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 not to be true in the wild although I am sure theoretical cases can be

Re: [go-nuts] Go without garbage collector

2020-02-12 Thread Henrik Johansson
Sure, writing these system in a non-GC language is harder but that's not really what is talked about here right? There is a reason why databases are not really successful in Java for example. Caching software are predominantly in C/C++. Beating highly tuned C/C++ is not something that a GC can do

Re: [go-nuts] [ANN] GoLand 2020.1 EAP starts with Go Modules improvements and Go 1.14 support

2020-02-07 Thread Henrik Johansson
Outstanding IDE! I was always impressed with JetBrains stuff but Goland really rocks! On Fri, Feb 7, 2020 at 10:20 AM Florin Pățan wrote: > Hi Gophers, > > I'd like to announce the start of the 2020.1 Early Access Program of > GoLand IDE, the JetBrains dedicated IDE for Go development. > A few

Re: [go-nuts] Re: Contracts Draft: why are method pointers allowed

2019-07-30 Thread Henrik Johansson
Why make any distinction between pointers and non pointers? Isn't the (usual) point to allow the caller to decide upon instantiation? We define a contract in terms of an unknown set of types and then let whoever uses it fullfil the contract however they want? On Tue, Jul 30, 2019, 21:57 wrote:

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-20 Thread Henrik Johansson
Reports of violations are not violations. I assume the standard coc procedure kicks in to determine if violations occurred or not. On Sat, Jul 20, 2019, 10:24 Jan Mercl <0xj...@gmail.com> wrote: > On Fri, Jul 19, 2019 at 10:39 PM Cassandra Salisbury > wrote: > > > > I encourage everyone to take

Re: [go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-09 Thread Henrik Johansson
Not sure if anyone has already mentioned the possibility that "try" could actually improve error handling by simply removing much of the tediousness. Both reading and writing all the error checks becomes a nail in my eyes even if realize that it is very important. What if "try" could take some of

Re: [go-nuts] Re: The "leave "if err != nil" alone?" anti-proposal

2019-07-01 Thread Henrik Johansson
ve these conversations in the first place? Why have any community > involvement at all? I am pretty sure this is not the position of the "Go > team". > > -Original Message- > From: Henrik Johansson > Sent: Jul 1, 2019 12:14 PM > To: robert engels > Cc: D

Re: [go-nuts] Re: The "leave "if err != nil" alone?" anti-proposal

2019-07-01 Thread Henrik Johansson
This is funny since you are perfectly describing the Go core team... ;) I really can't get my head around it that this topic generates so much vitriol (maybe harsh). Generics I kinda get but this is just incredible. Don't like try? Don't use it. On Mon, Jul 1, 2019, 18:42 Robert Engels wrote:

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-01 Thread Henrik Johansson
If it is as bad as "every sane Go shop" comes to this conclusion then I am sure "try" will not be added... On Mon, Jul 1, 2019 at 12:57 PM Wojciech S. Czarnecki wrote: > On Mon, 1 Jul 2019 12:33:16 +0200 > Henrik Johansson wrote: > > > That is one bi

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-07-01 Thread Henrik Johansson
uite a few situations and simplify, not in a >> drastic way, but subtle and valuable one. >> >> My 2c. >> >> Le samedi 29 juin 2019 21:31:19 UTC+2, Henrik Johansson a écrit : >> >>> I for one like the try proposal. It removes much of my gripes wi

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-06-29 Thread Henrik Johansson
I for one like the try proposal. It removes much of my gripes with the verbosity of error handling. I think that it will become more readable than explicit error handling quite fast. Note that it is still explicit, if you don't use the try notation the error can be handled as it is now or ignored

Re: [go-nuts] How go-mysql-driver get data? "get all data at a time" or "only get a batch when we call rows.Next"?

2019-06-26 Thread Henrik Johansson
I am pretty sure it's the latter case with lazy loading when needed during the Next() call. On Wed, Jun 26, 2019 at 2:59 PM 杜沁园 wrote: > When we operate with mysql with Go, as follow: > > > rows, err := db.Query() > > for rows.Next() { > . > } > > > When the driver get data? > > Get

Re: [go-nuts] Re: is there a goroutine scope global veriable ?

2019-06-20 Thread Henrik Johansson
On a practical note I think thread local storage is more or less discouraged in for example Java as well because it makes all the new shine "reactive" tools break since they make no guarantees as to which thread you are running on. That may or may not be relevant to your case but to say that it's

Re: [go-nuts] [Job] remote Go developer at Mattel (fulltime, US-only)

2019-06-19 Thread Henrik Johansson
Wow! I live outside the US but this really makes me want to work for Mattel. Sounds like a great place to work. On Tue, Jun 18, 2019, 22:07 Nate Finch wrote: > Want to work with me at Mattel on a Go platform? > > Mattel’s Connected Products Platform team is *the model* of where Mattel > is

Re: [go-nuts] How can I compile my project only relay on my vendor folder with go modules?

2019-06-11 Thread Henrik Johansson
I think "go mod vendor" does the trick as stated in "go mod help vendor". On Tue, Jun 11, 2019 at 11:12 AM 唐彦昭 wrote: > I need put my project on the server to compile.But my server can't connect > to internet. > So I need to put all my relay in my vendor folder in my develop > environment. >

Re: [go-nuts] New development tool: missing watch mode for "go"

2018-10-23 Thread Henrik Johansson
I have always used https://github.com/cespare/reflex what is the main benefit vs this and the other quite numerous options? tis 23 okt. 2018 kl 11:28 skrev Nelo Mitranim : > Good day gophers! > > I want to highlight a certain Go development tool. My golleagues (sic) and > I have found it quite

Re: [go-nuts] Sharing data via Mutex vs. Channel

2018-10-23 Thread Henrik Johansson
Mutexes aren't expensive when compared to channels. They are usually harder to get right and that's why there is the old Go mantra: "Don't communicate by sharing memory; instead, share memory by communicating." I would say you should use what fits the use case but prefer channels if possible.

Re: [go-nuts] Huge map[string]*Object and GC where *Object is from sync.Pool

2018-09-28 Thread Henrik Johansson
ence to anything, it is just an > integer. > > On Sep 28, 2018, at 8:00 AM, Henrik Johansson > wrote: > > That's clever but irrelevant for this discussion. > > fre 28 sep. 2018 kl 14:57 skrev Jan Mercl <0xj...@gmail.com>: > >> On Fri, Sep 28, 2018 at 2:53 PM Henr

Re: [go-nuts] Huge map[string]*Object and GC where *Object is from sync.Pool

2018-09-28 Thread Henrik Johansson
That's clever but irrelevant for this discussion. fre 28 sep. 2018 kl 14:57 skrev Jan Mercl <0xj...@gmail.com>: > On Fri, Sep 28, 2018 at 2:53 PM Henrik Johansson > wrote: > > > The data pointed to by the uintptrs ... > > Uintptrs are integers. They do not poi

Re: [go-nuts] Huge map[string]*Object and GC where *Object is from sync.Pool

2018-09-28 Thread Henrik Johansson
How is storing unintptrs in a map different from say java.util.WeakHashMap? The data pointed to by the uintptrs can at any given time have been reclaimed by the GC much the same as weak references in Java. I am not saying you are using it the same way as one would normally use weak references in

Re: [go-nuts] Huge map[string]*Object and GC where *Object is from sync.Pool

2018-09-28 Thread Henrik Johansson
This sounds much like the trickery people have used both successfully but also disastrously using weak references in Java. Is that where you got the idea from? fre 28 sep. 2018 kl 08:36 skrev Keith Randall : > On Thu, Sep 27, 2018 at 11:26 PM Peter Mogensen wrote: > >> >> >> On 09/28/2018

Re: [go-nuts] Re: Perf : Multithreaded goroutines files I/O

2018-09-17 Thread Henrik Johansson
Perhaps you can try https://github.com/avikivity/diskplorer to estimate how many readers you should optimally create. mån 17 sep. 2018 kl 11:33 skrev Thomas S : > Is my time display method wrong ? > > t := time.Now() > // Process > fmt.Println(time.Since(t)) > > > > Le dimanche 16 septembre 2018

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Henrik Johansson
taskset works for sure and I managed to crash a program with ulimit. I thought these stuff was what the container runtimes used under the hood. Am I missing something? ons 12 sep. 2018 kl 16:14 skrev Ian Lance Taylor : > On Wed, Sep 12, 2018 at 7:07 AM, robert engels > wrote: > > With the Azul

Re: [go-nuts] Go memory usage inside containers

2018-09-12 Thread Henrik Johansson
Afaik it works fine for Go programs as long as these limits translates to things like taskset etc. ons 12 sep. 2018 kl 08:48 skrev Leigh McCulloch : > Hi, > > Does anyone here know how Go interacts with memory limits inside > containers? (e.g. Kubernetes, Docker) > > Does the Go runtime have

[go-nuts] [ANN] go-set type-safe sets for Go

2018-08-06 Thread henrik
Go-set is a type-safe, zero-allocation set implementation for Go. https://github.com/scylladb/go-set At Scylla we are long time users of https://github.com/fatih/set and after it’s discontinuation we wanted to still use it. We therefore created an enhanced clone with a typesafe API and high

Re: [go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-15 Thread Henrik Johansson
y like to build everything through single command and move > projects between machines without pain > 4. I want distribute my projects without big notes how to build them and > how to tune environment > > > On Tuesday, May 15, 2018 at 9:31:08 AM UTC+3, Henrik Johansson wrote: > >

Re: [go-nuts] golang maven plug-in 2.2.0 has been published in maven central

2018-05-15 Thread Henrik Johansson
How in the name of anything does using Maven make life easier? Hyperbole aside I am curious. How does it help? tis 15 maj 2018 kl 07:55 skrev Igor Maznitsa : > as usual - to make life easier > > > On Tuesday, May 15, 2018 at 8:36:40 AM UTC+3, kortschak wrote: >> >> Why! >> >>

Re: [go-nuts] gocql date field conversion issue

2018-04-11 Thread Henrik Johansson
There is a PR for `date` marshalling https://github.com/gocql/gocql/pull/878 that is merged March last year. If you have gocql older than that I suggest trying to update but I am not sure if it helps. Timestamp/time.Time has always worked very well for me though so if you can switch that could be

Re: [go-nuts] [ANN] Elastic APM Go Agent

2018-03-20 Thread Henrik Johansson
Out of curiosity is it Open Tracing compatible? On Wed, Mar 21, 2018, 02:55 Andrew Wilkins wrote: > Hi folks, > > Elastic APM [0] is an open source APM solution being developed by Elastic. > The Elastic APM server [1] is written in Go. We've recently started working > on a

Re: [go-nuts] Re: Would this race condition be considered a bug?

2018-03-18 Thread Henrik Johansson
That post is fantastic and horrible at the same time. It is mandatory read for anyone endeavoring into concurrent programming however. On Sun, Mar 18, 2018, 09:42 David Anderson wrote: > There's a difference though. The program that uses sync/atomic will behave >

Re: [go-nuts] Is channel push atomic?

2018-03-08 Thread Henrik Johansson
What do you mean atomic? The individual operations create happens before edges afaik and since your channel is local there is nothing to worry about. If you publish that channel then no I would say someone else can puh or pull in between the two operations. fre 9 mars 2018 kl 07:47 skrev Andrey

Re: [go-nuts] Alibaba Cloud hash released official Go SDK v1.0.0

2018-03-02 Thread Henrik Johansson
I am sure it's really cool but the docs are in chinese I assume. Most other projects speared by non native English speakers still write in English. Is a translation available? On Fri, Mar 2, 2018, 14:44 wrote: > https://github.com/aliyun/alibaba-cloud-sdk-go > > Any

Re: [go-nuts] Go += Package Versioning

2018-02-23 Thread Henrik Johansson
A sidenote is that there seems to always be issues with using kubernetes client. Is it structured very un Go-ish? Very nice writeup! NB: I was also hit by the casing issue with the same viper dependency. fre 23 feb. 2018 kl 08:28 skrev David Anderson : > I should add: even

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Henrik Johansson
Why would that be a mistake? Working with tags and branches is what the VCS is for. Extracting a given version and using that per the convention that the import ends with the major version sounds very reasonable. On Wed, Feb 21, 2018, 22:51 Zellyn wrote: > On Wednesday,

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Henrik Johansson
That's not necessarily true. The tool can understand from the tag and assert or even rewrite the imports to make the compiler happy. On Wed, Feb 21, 2018, 21:51 Sam Whited <s...@samwhited.com> wrote: > On Wed, Feb 21, 2018, at 14:46, Henrik Johansson wrote: > > But wait. Wasn't

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Henrik Johansson
But wait. Wasn't there a mention of archive downloads instead of relying on the different VCS's? In the GitHub case I guess it amount to downloading releases (or any commit I guess) as a zip or tarball. On Wed, Feb 21, 2018, 20:54 Sam Whited wrote: > On Wed, Feb 21, 2018,

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Henrik Johansson
Actually it seems viper imports it with lower case. I don't remember if import paths are to be considered different if they only differ in case. ons 21 feb. 2018 kl 09:04 skrev Henrik Johansson <dahankz...@gmail.com>: > I am currently running `vgo build` on a decent sized project

Re: [go-nuts] Go += Package Versioning

2018-02-21 Thread Henrik Johansson
I am currently running `vgo build` on a decent sized project that has a few dependencies. It bailed on import case it seems: import "github.com/spf13/jwalterweatherman": module path of repo is github.com/spf13/jWalterWeatherman, not github.com/spf13/jwalterweatherman (wrong case) This is a

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Well, first I'll have a look at it's magic  On Mon, Feb 19, 2018, 22:06 Rob Pike <r...@golang.org> wrote: > You could say > > export GOCACHE=off > > in your bashrc to disable the cache permanently. > > -rob > > > On Tue, Feb 20, 2018 at 8:00 AM, Henrik Joha

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Ok, good to know. Thanks! On Mon, Feb 19, 2018, 21:49 Ian Lance Taylor <i...@golang.org> wrote: > On Mon, Feb 19, 2018 at 12:40 PM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > Yes I understand. I was just wondering if the GOCACHE flag is permanent > or &

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Yes I understand. I was just wondering if the GOCACHE flag is permanent or as a temp safety in case someone encounters a bug in the caching. On Mon, Feb 19, 2018, 21:35 Ian Lance Taylor <i...@golang.org> wrote: > On Mon, Feb 19, 2018 at 12:08 PM, Henrik Johansson <dahankz...@gmail.

Re: [go-nuts] Re: Go 1.10 is released

2018-02-19 Thread Henrik Johansson
Ah, that's not what I meant but GOCACHE var itself and if it will be permanent as a way to disable the cache. On Mon, Feb 19, 2018, 21:00 Ian Lance Taylor <i...@golang.org> wrote: > On Sun, Feb 18, 2018 at 11:00 PM, Henrik Johansson <dahankz...@gmail.com> > wrote: >

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Henrik Johansson
I disagree that generics would decrease readability at the call site. Perhaps within the library where it is used but maybe not even there. The only complexity is within the compiler and other internals. This is not irrelevant by far but the carte blanche "generics is bad" is most often hyperbole.

Re: [go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Henrik Johansson
..@golang.org>: > On Sun, Feb 18, 2018 at 11:22 AM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > The GOCACHE variable. What is it's effect when building Go itself? > > It doesn't disable test caching when using the resulting go tools right? > > Right. > &

Re: [go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Henrik Johansson
The GOCACHE variable. What is it's effect when building Go itself? It doesn't disable test caching when using the resulting go tools right? sön 18 feb. 2018 kl 19:55 skrev Lucio : > > > On Sunday, 18 February 2018 04:20:39 UTC+2, Dmitriy Cherchenko wrote: >> >> I like how

Re: [go-nuts] Extensive Go resources for CS101

2018-02-03 Thread Henrik Johansson
This is good news in so many ways! Finally a useable language in university courses! Sure everyone could use a good lisp now and then but for most engineering getting to useable stuff fast is very important. And there is a lot of stuff there! Thank you! lör 3 feb. 2018 kl 11:18 skrev Stefan

Re: [go-nuts] Rate controlling the Go http server

2018-02-02 Thread Henrik Johansson
Happy to help! The limit can be anything from the link above or something more advanced that Jesper suggested. The skeleton could be as outlined above however. On Fri, Feb 2, 2018, 15:40 mrx <patrik@gmail.com> wrote: > On Fri, Feb 2, 2018 at 1:28 PM, Henrik Johansson <dahankz.

Re: [go-nuts] Rate controlling the Go http server

2018-02-02 Thread Henrik Johansson
You can either use one of the existing other routers that have meddleware support or you could wrap your handlers in another handler much like this: handle("/foo",wrapHandler(rateLimiter, realHandler)) func wrapHandler(limit *ARateLimiter, handler func(http.ResponseWriter, *http.Request))

Re: [go-nuts] Rate controlling the Go http server

2018-02-02 Thread Henrik Johansson
I guess a middleware wrapping any of the available rate limiters https://godoc.org/?q=rate+limit should do the trick? fre 2 feb. 2018 kl 11:30 skrev Patrik Iselind : > Hi, > > If i define a webserver as such (taken from the docs) > > http.Handle("/foo", fooHandler) > >

Re: [go-nuts] Re: Upcoming Go protobuf release

2018-01-31 Thread Henrik Johansson
Surely these issues already exist in gogo-protobuf? How are they handled there? On Thu, Feb 1, 2018, 08:28 'Jisi Liu' via golang-nuts < golang-nuts@googlegroups.com> wrote: > This is not Java specific. I just used Java as an example. For most > protobuf implementations, there is a contract

Re: [go-nuts] Re: How golang garbage collector works

2018-01-11 Thread Henrik Johansson
I think this one by Rick Hudson is very good as well. https://www.infoq.com/presentations/go-gc-performance tors 11 jan. 2018 kl 18:38 skrev : > Hi! > > Currently go uses concurrent mark'n'sweep. Best talk about gc in go and > theory: >

Re: [go-nuts] The o.done access on the once.Do function

2017-12-29 Thread Henrik Johansson
Surely single goroutine scenarios are trivial? Anything else would be a compiler bug. In multiple goroutine scenarios a lock must be held or some of the atomic functions are needed. Any other use that "works" are by accident say on x86 or some other stricter arch. I am no expert in this but surely

Re: [go-nuts] The o.done access on the once.Do function

2017-12-29 Thread Henrik Johansson
Isn't the lock operation an memory acquire operation that means that the next load of the done field needs to be loaded from memory? Perhaps it is not stated in the memory model exactly but this seems safe. On Fri, Dec 29, 2017, 08:11 Dave Cheney wrote: > > > On 29 Dec 2017,

Re: [go-nuts] Re: [urgent] need aguments to justify use of Go for a scientific application

2017-12-06 Thread Henrik Johansson
I have a vague memory of +Rob Pike tweeting something about astronomy or perhaps an observatory a few months ago. Perhaps there was no programming involved but if so I imagine Go is safe bet. But building pipelines using something like Pachyderm would allow for a very polyglot

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-05 Thread Henrik Johansson
No problems! If I can get a beta running I'll revisit this thread. Cheers, On Tue, Dec 5, 2017, 19:41 Rick Hudson <r...@golang.org> wrote: > Henrik, > Thanks for the kind offer but there isn't much the runtime team can do > with the logs since 1.9 isn't likely to be changed du

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-05 Thread Henrik Johansson
in seeing what > these pauses look like in the beta. If you have the time could you send > them to us after the beta comes out. > > > On Tue, Dec 5, 2017 at 9:06 AM, Henrik Johansson <dahankz...@gmail.com> > wrote: > >> Ok so it's not bad, thats good! >> &g

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-05 Thread Henrik Johansson
s 10x or 100x larger. This will reduce GC frequency by 10x or > 100x and if your tail latency is a GC problem the 99%tile latency numbers > will become 99.9%tile or 99.99%tile numbers. > > On Tuesday, December 5, 2017 at 2:39:53 AM UTC-5, Henrik Johansson wrote: > >> I am watching with c

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-04 Thread Henrik Johansson
MB goal, 8 P 28 + 64 ms SW (if I understand this correctly) to collect what 6-7 MB? tis 5 dec. 2017 kl 08:25 skrev Dave Cheney <d...@cheney.net>: > Oh yeah, I forgot someone added that a while back. That should work. > > On Tue, Dec 5, 2017 at 6:23 PM, Henrik Johansson <

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-04 Thread Henrik Johansson
2017 kl 08:10 skrev Dave Cheney <d...@cheney.net>: > Probably not for your scenario, gcviz assumes it can run your program > as a child. > > On Tue, Dec 5, 2017 at 6:07 PM, Henrik Johansson <dahankz...@gmail.com> > wrote: > > I found https://github.com/davecheney/gcv

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-04 Thread Henrik Johansson
I found https://github.com/davecheney/gcvis from +Dave Cheney <d...@cheney.net> is it a good choice for inspecting the gc logs? tis 5 dec. 2017 kl 07:57 skrev Henrik Johansson <dahankz...@gmail.com>: > I have just added the gc tracing and it looks like this more or less all > t

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-04 Thread Henrik Johansson
pection. I will download the logs later today and try to generate realistic load. What is the overhead of running like this, aside from the obvious extra logging? Are there any automatic tools to analyze these logs? lör 2 dec. 2017 kl 22:36 skrev Henrik Johansson <dahankz...@gmail.com>: > I

Re: [go-nuts] Re: GC SW times on Heroku (Beta metrics)

2017-12-02 Thread Henrik Johansson
trace=1 will give you a sense of the GC's view of the application. > > In any case these kinds of numbers, running on a real systems, and > duplicatable on tip are worth filing an issue. > > On Saturday, December 2, 2017 at 3:02:30 AM UTC-5, Henrik Johansson wrote: >> >> Hi

Re: [go-nuts] aws lambda native support for go in a few weeks

2017-12-02 Thread Henrik Johansson
Now we have to rewrite all our apps to use Lambda :D Joking aside, it is cool and good news! lör 2 dec. 2017 kl 00:38 skrev JM : > just announced this week at re:invent. also cloud 9 the new dev ide also > supports go. > > In case anyone cares ^^^ > > -- > You received

[go-nuts] GC SW times on Heroku (Beta metrics)

2017-12-02 Thread Henrik Johansson
Hi, I am befuddled by GC SW times on several seconds (seen 20s once) in the metrics page for our app. There are several things that are strange but perhaps I am misreading it. The same metrics page reports Max Total 35 MB out of which 1 MB s swap the rest RSS. The response times on the service is

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-28 Thread Henrik Johansson
Huh... I could have sworn that I tried it. Thx! On Tue, Nov 28, 2017, 5:59 PM roger peppe <rogpe...@gmail.com> wrote: > On 28 November 2017 at 16:30, Henrik Johansson <dahankz...@gmail.com> > wrote: > > Ok, thanks for the clarification. > > > >

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-28 Thread Henrik Johansson
alue methods are > implemented by pointer > values too), then your method couldn't change the original value, so > the JSON unmarshaler > just saw the zero value unchanged. > > On 28 November 2017 at 16:10, Henrik Johansson <dahankz...@gmail.com> > wrote: > > Th

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-28 Thread Henrik Johansson
strings as the key. A bit less typed but not unmanageable. Thanks for clarifying everyone! On Tue, Nov 28, 2017, 3:34 PM Marvin Renich <m...@renich.org> wrote: > * Henrik Johansson <dahankz...@gmail.com> [171128 07:43]: > > But wouldn't unmarshal just overwrite in case

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-28 Thread Henrik Johansson
> > This works OK: https://play.golang.org/p/KJk4iR3D3D > > On 27 November 2017 at 10:53, Henrik Johansson <dahankz...@gmail.com> > wrote: > > It seems that time.Time as keys exhibit the same issue: > > https://play.golang.org/p/-_H3ZD6YLG > > > > Is this rea

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-27 Thread Henrik Johansson
It seems that time.Time as keys exhibit the same issue: https://play.golang.org/p/-_H3ZD6YLG Is this really intended or a bug? mån 27 nov. 2017 kl 11:25 skrev Henrik Johansson <dahankz...@gmail.com>: > There is a discussion here > https://groups.google.com/forum/#!searchin/golang-de

Re: [go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-27 Thread Henrik Johansson
<proglot...@gmail.com>: > Think UnmarshalText needs to have a pointer receiver or you'll only be > modifying a copy of the struct > > On 27 November 2017 at 23:13, Henrik Johansson <dahankz...@gmail.com> > wrote: > >> Hi, >> >> https://play.golang.org/p/

[go-nuts] Problems with JSON Marshal/UnmarshalText aand maps

2017-11-27 Thread Henrik Johansson
ult" key with 3 underscores. Anyone knows what I missed? Thx, Henrik -- 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...@goog

Re: [go-nuts] Re: Would someone care to compare Firefox Quantum Rust concurrency features to Go....

2017-11-25 Thread Henrik Johansson
Ifaik rusts safety is compiler magic. Nothing special runtime you just can't share stuff in dangerous ways. Syntax is horrible compared to Go but who knows sometimes it can maybe be worth it. On Sat, 25 Nov 2017, 05:10 , wrote: > > > On Thursday, November 23, 2017 at

Re: [go-nuts] Re: concurrency programing about go

2017-11-06 Thread Henrik Johansson
: > Always call Add() before spawning the corresponding goroutine(s). And > always call Add() in the same goroutine that also calls Wait(). This way > you have no race condition between Add(), Done(), and Wait(). > > > On Saturday, November 4, 2017 at 10:46:21 AM UTC+1, H

Re: [go-nuts] Re: concurrency programing about go

2017-11-04 Thread Henrik Johansson
I find continuously adding and calling done on a waitgroup a bit odd. The waiting goroutine can continue as soon as the count is zero so there is a race between adds and dones. On Sat, 4 Nov 2017, 10:01 , <2891132l...@gmail.com> wrote: > Thank you very much.Sorry I still have some

Re: [go-nuts] Handling dynamic and unknown number of wait groups?

2017-11-02 Thread Henrik Johansson
And technically they are not tracking goroutines but done things. Each goroutine could each finish 10 things. On Thu, 2 Nov 2017, 17:01 Andy Balholm, wrote: > You can add goroutines to a WaitGroup as you create them. There is nothing > that keeps you from calling Add more

Re: [go-nuts] mutual exclusion algorithm of Dijkstra - strange behaviour

2017-10-30 Thread Henrik Johansson
I think it's the non-preemptive scheduler that hits you. Afaik it is a known behavior that I am not sure how to fix. I did not at all look at the solution itself. mån 30 okt. 2017 kl 18:29 skrev : > Dear Go-community, > > I noticed a very strange effect by translating the

Re: [go-nuts] Re: slice of pointer of struct vs slice of struct

2017-10-22 Thread Henrik Johansson
No, you are right but then I have made an explicit decision that state is important and mutable so hopefully I would take that into consideration when exposing the data. lör 21 okt. 2017 kl 13:00 skrev Juliusz Chroboczek : > > I have started to use non pointer slices much more as

Re: [go-nuts] Re: slice of pointer of struct vs slice of struct

2017-10-20 Thread Henrik Johansson
https://play.golang.org/p/xILWETuAii I have started to use non pointer slices much more as of late. Every time I bother measuring it is always faster and it is better for the GC (usually, caveats apply). It also, perhaps naively, feels safer... :) fre 20 okt. 2017 kl 13:41 skrev Juliusz

Re: [go-nuts] Rewriting a realtime game server from Node.js to Golang

2017-10-01 Thread Henrik Johansson
No not at all. If you can write a game engine in any language you should be fine just try to avoid too big design decisions too early so that once you get a better grasp of Go you can more easily refactor. mån 2 okt. 2017 kl 06:13 skrev Aaron : > Hi I am in a process of

Re: [go-nuts] Re: Proposal: Just Use GitHub

2017-09-24 Thread Henrik Johansson
I am sorry but this type of straw man is not what Nate and others are arguing for. Never has anyone suggested we sacrifice quality for quantity but rather that more better than less to turn the old adage around. If code review can be done efficiently enough and by enough people then more

Re: [go-nuts] Magefiles - a makefile replacement using go

2017-09-23 Thread Henrik Johansson
I just have a case where I was wondering if a Makefile could be the answer. Ill try mage instead and see what it can do! lör 23 sep. 2017 kl 07:11 skrev snmed : > Hi Nate > > Awesome, i never liked make files and fortunately i could use npm scripts > to build front and

Re: [go-nuts] Do you check in vendor packages?

2017-09-15 Thread Henrik Johansson
I always check in. It is super nice to not have to download separately and have one transitive dep destroy everything when you need it the least. On Fri, 15 Sep 2017, 02:37 Kevin Malachowski wrote: > I generally vote for checking in, or at least ensuring that /something/

Re: [go-nuts] Re: Do you guys use ORMs when working with SQL?

2017-09-10 Thread Henrik Johansson
The switching of databases can happen but I have always solved it at a higher "service" level. What ORM's help you with is quickly getting started and it can in some cases help you with type safety. In the (not so) long run only the second matter and personally I wish there was something like

Re: [go-nuts] Re: Choosing a framework

2017-09-10 Thread Henrik Johansson
Maybe it is better nowadays but at least last time I tried a bigger framework the first thing that happened was I had to either change logger or wrestle with how the framework did it's logging. I would from experience in both Go and other languages (mostly Java, Spring is not your friend) very

Re: [go-nuts] error handling needs syntactical sugar

2017-09-05 Thread Henrik Johansson
I think Rob is really on to something here and I have seen it evolve in my own programming. I tend to make simple things "flatter" and model things around cores that don't error out and just at the boundaries evaluate and possibly produce an error. Is that "monadic"? Anyway it gets easier if you

Re: [go-nuts] sync.Map for caching

2017-09-01 Thread Henrik Johansson
If you absolutely must make sure you ever create 2 instances of any value in the map then I guess you have to lock. Otherwise you can maybe use map.LoadOrStore? fre 1 sep. 2017 kl 00:18 skrev bep : > sync.Map in Go 1.9 is a little low on examples/doc in the wild,

  1   2   >