[go-nuts] Re: Performance: Restrictions on arguments in registers in SSA implementation

2025-01-09 Thread Andrey Bokhanko
structures ABI allows to pass via registers on the target platform) rather than plain 4*Widthptr as the limitation in "CanSSA". This should solve Arseny's case. Yours, Andrey среда, 25 декабря 2024 г. в 16:38:53 UTC+3, Arseny Samoylov: > Hello, thank you for your response. &g

Re: [go-nuts] Is it possible to compile a Go program without jump tables ?

2024-12-03 Thread Andrey Bokhanko
("Five") case 10: fmt.Println("Ten") default: fmt.Println("Other") } } Karolina, in this specific test case the whole switch got optimized out, as it's clear it always computes to 10, so only one case remains. Andrey -- You receive

Re: [go-nuts] Generics in gollvm

2022-12-13 Thread Andrey Bokhanko
e at least some understanding of generics in gollvm plans, to adjust our own plans accordingly.) Yours, Andrey === Advanced Software Technology Lab Huawei воскресенье, 11 декабря 2022 г. в 23:39:51 UTC+3, Ian Lance Taylor: > On Sun, Dec 11, 2022, 7:11 AM Alex Markin wrote: > >> Hello.

Re: [go-nuts] Go http/2 implementation is x5 less per performant than http/1.1

2021-11-10 Thread Andrey T.
4 is a viable fix > (and should of been supported originally). > > On Nov 10, 2021, at 12:59 PM, Andrey T. wrote: > > Fellas, > I would say the 5x throughput difference is a serious problem.Would you be > kind and open an issue on github about it? > Also, the PR that you

Re: [go-nuts] Go http/2 implementation is x5 less per performant than http/1.1

2021-11-10 Thread Andrey T.
. Thanks! Andrey On Tuesday, November 9, 2021 at 4:50:34 PM UTC-7 ren...@ix.netcom.com wrote: > Well, I figured out a way to do it simply. The CL is here > https://go-review.googlesource.com/c/net/+/362834 > > The frame size will be used for all connections using that transport,

Re: [go-nuts] Idea extending xerror.As

2021-09-20 Thread Andrey T.
... or, to put a crazy idea out there, we need to ask for extension of switch statement to support (v, err) tuples for a case argument... On Sunday, September 19, 2021 at 3:43:36 PM UTC-6 david@gmail.com wrote: > On Sun, Sep 19, 2021 at 5:19 PM roger peppe wrote: > >> In some ways, the exis

[go-nuts] Re: go 1.17.1 in docker (m1) Segmentation Fault

2021-09-16 Thread Andrey T.
Hi Remi, You might want to open a bug on https://github.com/golang/go/issues/new and try to check if 1.17 (not 1.17.1) has the same problem - that will reduce the scope of thing to verify for dev team Andrey On Wednesday, September 15, 2021 at 1:05:52 PM UTC-6 remi.p...@gmail.com wrote

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

2020-09-21 Thread andrey mirtchovski
> Is this simply a recommendation or should the docs be updated to clarify what > this means? perhaps the latter, although that question only seems to come up once every two or so years. here's a good link: https://groups.google.com/d/msg/golang-nuts/XqW1qcuZgKg/Ui3nQkeLV80J the entire discussi

[go-nuts] Re: [ANN] CGo-free sqlite database/sql driver 1.4.0 for linux/amd64 released

2020-08-27 Thread Andrey T.
Jan, This is fantastic news! Congratulation on hitting such a milestone! (patiently waiting for the windows and macos) Andrey On Wednesday, August 26, 2020 at 3:52:13 PM UTC-6, Jan Mercl wrote: > > From the change log (https://godoc.org/modernc.org/sqlite#hdr-Changelog) > > 2020-

[go-nuts] Re: [Generics] Simplified syntax to sidestep the bracket arguments

2020-07-21 Thread Andrey T.
@, $ or # or could be an interesting approach, be that spiritually following ' (apostrophe) in Lisp, or * (star) as a pointer to a type T to be read $T as "meta-T" Thanks, Andrey On Tuesday, July 21, 2020 at 10:51:21 AM UTC-6, Kh Af wrote: > > Forgive me for making a n

Re: [go-nuts] [generics] cannot use generic type list.Element(type TElem) without instantiation

2020-07-01 Thread Andrey T.
Ian, continuation question -- does `type intElement list.Element(int)` introduce a new type just like `type myInt int` does? If so, in a previous example, these 2 maps are not of the same type, am I right? Thank you very much, Andrey On Wednesday, July 1, 2020 at 10:50:07 AM UTC-6, Ian

Re: [go-nuts] [generics] Syntax feedback

2020-06-28 Thread Andrey T.
Tyler, May I humbly suggest https://groups.google.com/d/msg/golang-nuts/W3fSnH0w1G0/JbMkJrKICAAJ for an additional item for your list? Thank you very much, Andrey On Saturday, June 27, 2020 at 11:46:23 AM UTC-6, Tyler Compton wrote: > > Hi Rob, > > This topic has been discussed m

[go-nuts] Re: [generics] Use decorators ($, or @, or #) to specify that the type is a generic type.

2020-06-24 Thread Andrey T.
> > On Thursday, 25 June 2020 06:17:24 UTC+2, Andrey T. wrote: > > >> 3. Ability to use decorated interface name as spec for type constrains >> >>func (type T Comparable) Max(a... T) (result T) {...} >> >>might become >> >>

Re: [go-nuts] Is there +v Stringer interface?

2020-06-24 Thread andrey mirtchovski
>> fmt.Formatter is woefully under documented. > > My reference is pkg/errros - > https://github.com/pkg/errors/blob/master/errors.go#L127 we have wasted tens of man-hours hunting for a bug that didn't manifest in logs due to that custom formatter. %#v basically went directly to stringer without

[go-nuts] [generics] Use decorators ($, or @, or #) to specify that the type is a generic type.

2020-06-24 Thread Andrey T.
arable) {...} 4. It does not prevent usage of type keyword if wanted/needed. Thanks, Andrey PS. it is a distill of my previous post https://groups.google.com/forum/#!topic/golang-nuts/Rp3yUUy2nS8, which asked a different question about "How often do we have to specify type during i

[go-nuts] [generics] What are the cases when type spec is absolutely needed during invocation?

2020-06-22 Thread Andrey Tcherepanov
bother? How often it cannot be deduced at the invocation site what types this was called with? And even if the do, can these places be casted just like a normal cast to some type? So it becomes result, err := Some(int('A'), string(make([]byte,0))) when needed. Thanks, Andrey

[go-nuts] Re: [generics] Why is constraint optional?

2020-06-17 Thread Andrey Tcherepanov
Wouldn't it be nice to have just func Foo(type T1, type T2 Bar) (type as keyword splitting it into 2 type declarations) On Wednesday, June 17, 2020 at 5:50:47 AM UTC-6, Brian Candler wrote: > > Consider a generic where you want T1 unconstrained but T2 constrained. If > you write > > func Foo(

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

2020-06-14 Thread andrey mirtchovski
Hi, I have a non-profit I'd like to support. Who do I ask to put a banner on golang.org for me? (reductio ad absurdum) On Sun, Jun 14, 2020 at 4:08 PM Robert Engels wrote: > > Equating not supporting this and supporting marginalized groups is not > correct. You can support marginalized groups

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread andrey mirtchovski
> Cool, makes sense. Assuming NewTicker does return monotonic time. > > I wonder if there is a way to verify. just fmt.Println the value you receive on the ticker chan, you'll see the monotonic component tacked on in the end: $ cat t.go package main import ( "fmt" "time" ) func main() {

Re: [go-nuts] Regarding time.NewTicker() and monotonic time

2020-06-10 Thread andrey mirtchovski
> Does anyone know if the time data that NewTicker returns (i.e. via it's > channel, etc...) includes monotonic time? it's right at the top: https://golang.org/pkg/time/ On Wed, Jun 10, 2020 at 4:48 PM Curtis Paul wrote: > > It sounds like NewTicker will dynamically adjust to keep tick time "ac

[go-nuts] Re: Is there a library for validating gmail's Variants

2020-05-01 Thread Andrey Tcherepanov
I don't think it is a good idea to even try to figure it out. There are domains that using GSuite, or redirect to gmail as their mail service. They will use the same rules, but different host name. On Thursday, April 30, 2020 at 11:05:43 AM UTC-6, Walter Peng wrote: > > Hello community, > > We

Re: [go-nuts] Re: net.ParseIP unable to parse some types of ipv6 addresses

2020-05-01 Thread andrey mirtchovski
thanks. that ought to do it. On Fri, May 1, 2020 at 11:16 AM Brian Candler wrote: > > parseIP returns a net.IP which is just a slice of bytes without the zone. > > However, type net.IPAddr includes the zone. Looks like net.ResolveIPAddr > will do the job: > > https://play.golang.org/p/7p1XXIrVG

[go-nuts] net.ParseIP unable to parse some types of ipv6 addresses

2020-05-01 Thread andrey mirtchovski
IPv6 addresses including a zone identifier [rfc4007] are not parsed correctly by net.ParseIP. is there any point in creating an issue or is this intentional and we're supposed to strip the zone identifier? https://play.golang.org/p/kQKyYYnZydX -- You received this message because you are subscri

Re: [go-nuts] how to design log package to avoid allocations

2020-03-09 Thread andrey mirtchovski
to avoid allocations you have to hint at the type of what you're going to print. for example see/use zerolog: https://github.com/rs/zerolog On Mon, Mar 9, 2020 at 10:36 AM 'Axel Wagner' via golang-nuts wrote: > > IMO, there really isn't a super good answer. The simple answer is: You need > to de

Re: [go-nuts] Fuchsia Programming Language Policy

2020-02-25 Thread andrey mirtchovski
my take: - c++ programmers are going to c++ program. film at 11 (rob pike had a talk about that) - dart has UI - rust is fashionable, but scary (if you've done rust you'll know why) yes, go was touted as a systems programming language, but it meant "distributed systems". had that been made clear f

Re: [go-nuts] Bound checks elimination hint.

2020-02-21 Thread andrey mirtchovski
got it down to two: https://play.golang.org/p/jmTqhLGaLY_T On Fri, Feb 21, 2020 at 11:24 AM Bruno Albuquerque wrote: > > This is interesting. If I simplify the loop to something like this: > > nrgbaData := make([]byte, len(rgbData)+(len(rgbData)/3)) > > _ = nrgbaData[len(rgbData)] > >

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

2020-02-18 Thread andrey mirtchovski
?w=1 is an option. On Tue, Feb 18, 2020 at 7:16 PM Wojciech S. Czarnecki wrote: > > Dnia 2020-02-18, o godz. 10:16:57 > Manlio Perillo napisał(a): > > > Here is an example of a diff with a lot of noise, where the actual change > > is very hard to see: > > https://gist.github.com/perillo/c5b3bdff

Re: [go-nuts] Virus detection issues on Windows/386 binaries built with -ldflags -s -w

2020-02-11 Thread andrey mirtchovski
sorry, wanted to add: submit your file to VT and see if it triggers a detection there (like in my link it is most likely that only the MS engine will detect it). then you have a case to argue. On Tue, Feb 11, 2020 at 9:29 PM andrey mirtchovski wrote: > > you can find similar detecti

Re: [go-nuts] Virus detection issues on Windows/386 binaries built with -ldflags -s -w

2020-02-11 Thread andrey mirtchovski
you can find similar detections on virustotal. unfortunately it looks like a false positive: https://www.virustotal.com/gui/file/93eb448cedd4b4355065a4f9193d8548b02bc56ed5ba9e774095f9ab3da46227/detection there are members of this community working for microsoft, perhaps they'll have an avenue tha

Re: [go-nuts] Help with Oauth2 "grant_type=client_credentials"

2020-02-11 Thread andrey mirtchovski
i would strongly advise against implementing advice received online for something as important as auth. my suggestion is to work with curl from the command line (examples are given on the webpage you linked) until you have the process working. implementing that afterwards using http.Client will be

[go-nuts] Re: Go 1.14 Release Candidate 1 is released

2020-02-05 Thread Andrey Tcherepanov
Sorry to mention, but for me https://tip.golang.org/doc/go1.14 returns "template: main:846: unexpected EOF" Not sure if this is because it is work in progress, or too many people trying to hit this site after announcement. Andrey On Wednesday, February 5, 2020 at 12:43:47 PM UTC

Re: [go-nuts] difference response from play.golang (bit operations)

2020-01-03 Thread andrey mirtchovski
sorry, i meant to put this in too; https://play.golang.org/p/vn5iMAWbDiv On Fri, Jan 3, 2020 at 11:27 AM andrey mirtchovski wrote: > > https://play.golang.org/p/cpKEQZJKDsh > > On Fri, Jan 3, 2020 at 11:24 AM X-Thief wrote: > > > > thx but have you tried it? i

Re: [go-nuts] difference response from play.golang (bit operations)

2020-01-03 Thread andrey mirtchovski
https://play.golang.org/p/cpKEQZJKDsh On Fri, Jan 3, 2020 at 11:24 AM X-Thief wrote: > > thx but have you tried it? it just gives positive on playground. > > пятница, 3 января 2020 г., 22:05:48 UTC+4 пользователь Ian Lance Taylor > написал: >> >> On Fri, Jan 3, 2020 at 9:50 AM X-Thief wrote: >>

Re: [go-nuts] Reordering error output in flags package so Usage is printed before the error?

2019-12-08 Thread andrey mirtchovski
You'll need to create a FlagSet instead and pass ContinueOnError as the error handling. If .Parse() returns an error call .PrintDefaults(), then print the error. On Sun, Dec 8, 2019 at 4:00 AM Thomas Nyberg wrote: > > Hello, > > Given the following file `flag_example.go`: > > package main > > imp

Re: [go-nuts] Re: Where is the middle of Brazil?

2019-12-07 Thread andrey mirtchovski
this is quickly becoming off-topic. however, from https://en.wikipedia.org/wiki/Geographical_centre: "As noted in a USGS document "There is no generally accepted definition of geographic center, and no completely satisfactory method for determining it."[1] In general, there is room for debate aro

Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread andrey mirtchovski
once for callbacks in a library in 2013 and forgot about it :) it just works. On Thu, Dec 5, 2019 at 9:52 PM Dan Kortschak wrote: > > Thanks. Can you explain the reason for this so it sticks in my head? > > On Thu, 2019-12-05 at 21:03 -0700, andrey mirtchovski wrote: > > you jus

Re: [go-nuts] cgo wrapper function not working in buildmode=c-shared with exported function

2019-12-05 Thread andrey mirtchovski
you just need to split it in two files. the cfuncs go into another (sorry for lack of playground link): $ go build cgo.go cfunc.go $ ./cgo Hello from stdio $ cat cgo.go package main /* #include extern void myprint(char *s); */ import "C" import "unsafe" //export Example func Example() { cs :=

Re: [go-nuts] Where is the middle of Brazil?

2019-11-30 Thread andrey mirtchovski
i think JuciÊ wants us to crack the md5. i'm fresh off a CTF competition so i don't have any more resources to throw at warming the universe and increasing entropy, unfortunately... On Sat, Nov 30, 2019 at 6:43 PM Michael Jones wrote: > > > My answer is this place. > 14°35'03.5"S 53°03'51.3"W > -

Re: [go-nuts] Re: Slices, backing array, goroutines, perhaps Considerations for Go2

2019-10-27 Thread andrey mirtchovski
>> I think it only catches concurrent access to the same address, so not sure >> if it catches everything. > > > If two things aren't writing concurrently to the same address, what's the > problem? I took that to mean 'things may be updating concurrently at different addresses inside an array ba

Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Andrey Tcherepanov
x27;t fine any problem either. > My playground: https://play.golang.org/p/LLmQqxLKfME > > On Wednesday, 9 October 2019 07:29:29 UTC+2, Jakob Borg wrote: >> >> On 8 Oct 2019, at 19:27, Andrey Tcherepanov >> wrote: >> >> >> In this case it loses subsecond

Re: [go-nuts] json time format discrepancy

2019-10-09 Thread Andrey Tcherepanov
Thanks Jakob. I am shamefully have to concur that I indeed messed up. Now I need to find where did I do it though :) Still curious - how RFC3339 works with parsing nanoseconds past decimal point? Andrey On Tuesday, October 8, 2019 at 11:29:29 PM UTC-6, Jakob Borg wrote: > > On 8 Oct 20

[go-nuts] json time format discrepancy

2019-10-08 Thread Andrey Tcherepanov
re in play there? Thank you in advance! Andrey -- 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. To view this discus

Re: [go-nuts] Where are the GO compiler sources?

2019-09-16 Thread andrey mirtchovski
'x' is for experimental. things that have a chance to get into the standard library but are not finished yet. the major differentiator is that they're not bound by the Go 1 guarantee that nothing changes (i.e., they can change). you should be able to find the compiler in https://golang.org/src/cmd

Re: [go-nuts] Re: If v2.x.y+incompatible exists, then getting the modules based v3 version will always fail?

2019-09-13 Thread andrey mirtchovski
are you following the steps outlined below? https://github.com/golang/go/wiki/Modules#releasing-modules-v2-or-higher in particular, for a v2 (or v3) it states that the go.mod file must be updated: > Update the go.mod file to include a /v3 at the end of the module path in the > module directive

Re: [go-nuts] select on slice of channels

2019-09-13 Thread Andrey Tcherepanov
Thanks Ian, it is nice to know that there is at least "an escape hatch" through reflect package if needed. Is there an upper bound for how many items could be in that slice (select statement)? Andrey On Friday, September 13, 2019 at 12:02:18 AM UTC-6, Ian Lance Taylor wrote: >

[go-nuts] select on slice of channels

2019-09-12 Thread Andrey Tcherepanov
Folks, well, subj - why can't I "just" do a select on a slice of channels? Yes, I can run a bunch goroutines with of reads on an each channel, funnel it all into 1 notification channel, pick up on the other side... boring stuff, really... But why not "just" func main() { cc := make(

Re: [go-nuts] playground - time.Sleep causes deadlock

2019-08-31 Thread andrey mirtchovski
see the "faking time" section here: https://blog.golang.org/playground not sure if anything has changed since that article On Sat, Aug 31, 2019 at 4:22 PM robert engels wrote: > Yes, the code runs fine locally. Reviewing the playground docs, it sees > that at one point time.Sleep() was a no-op

Re: [go-nuts] pushing too far reflect usage ? another attempts to pipline based processing

2019-08-04 Thread Andrey Tcherepanov
It is actually not that bad. Quite a lot of C# (especially LINQ) code is written that way On Sunday, August 4, 2019 at 5:56:20 PM UTC+3, Robert Engels wrote: > > Would honestly want to maintain somebody else’s code that was written in > this style? I wouldn’t. > > On Aug 4, 2019, at 9:13 AM,

Re: [go-nuts] Re: How to mock functions in Go ?

2019-08-03 Thread Andrey Tcherepanov
what if you need only a subpart of the package to be mocked ? On Thursday, August 1, 2019 at 5:29:30 PM UTC+3, Robert Engels wrote: > > That brings up an interesting idea. A ‘package replace’ during compile. So > you request that the os package is replaced by osmock etc. > > This would allow eas

Re: [go-nuts] PCRE to RE2

2019-07-24 Thread andrey mirtchovski
I'm sorry to say that this list isn't RE2-specific (although one of the main Go contributors wrote RE2). you will probably get very good suggestions on how to convert that to Go's regex, which are RE2-like and I hope you find your answer. A good additional step to do for this particular list is to

[go-nuts] Re: Can't install tools

2019-07-24 Thread Andrey Tcherepanov
This is a weirdest way to post a TEXTUAL error to a text-based web group. In black. Depending on when did you try to do it, you might've hit the time that github.com was having issues. Or your corp network has a firewall. Maybe try to reach that ip:port with browser, curl or wget, see what is

[go-nuts] Re: Goroutines & ENV

2019-07-24 Thread Andrey Tcherepanov
Yes On Wednesday, July 24, 2019 at 1:56:46 PM UTC-6, B Carr wrote: > > Basic question: Do goroutines all share the same ENV? > > -- 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, se

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Andrey Tcherepanov
ompiler invokes this code on defer it if knows that there is only one reference to the remaining part, and that part is "small" A. On Friday, July 19, 2019 at 6:43:41 PM UTC-6, Ian Lance Taylor wrote: > > On Fri, Jul 19, 2019 at 5:17 PM Andrey Tcherepanov > > wrote: > >

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Andrey Tcherepanov
I understand that it is very easy on application level... if programmer even thought about it. But my assumption is that compiler has some sort of liveness analysis, and it could be utilized here just to help with disposal of a bitten part. Andrey On Friday, July 19, 2019 at 2:48:57 PM UTC-6

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Andrey Tcherepanov
My suggestion was not to make "the kitchen" work harder by marking parts of the hamburger to be good for the consumption, no. My suggestion was to recycle bitten hamburger out and put just the bitten piece aside in a doggy bag, sorry. A. On Friday, July 19, 2019 at 1:08:51 PM UTC-6, Michael Jo

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

2019-07-18 Thread andrey mirtchovski
s taken, but all I found is some very > general stuff. At least it very suspicious. I don't believe that Google can't > fund such a non-profit initiative without affecting true artists. > > And apparently, very unlikely, that you paid a cent to any independent artist > ove

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-18 Thread Andrey Tcherepanov
required on a side. Again, thank you very much for the answer. Andrey On Thursday, July 18, 2019 at 10:57:26 AM UTC-6, Ian Lance Taylor wrote: > > On Thu, Jul 18, 2019 at 8:35 AM Andrey Tcherepanov > > wrote: > > > > > Basically, it's hard to be sure that there

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

2019-07-18 Thread andrey mirtchovski
> Funny thing that today Google has announced "official" store for Go-related > merch, which in it's essence is a try to take away even an even tiny business > opportunities for artists who were creating some goods and had a very very > little outcome on this. Now they will have ZERO. really? t

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-18 Thread Andrey Tcherepanov
a smaller array, how does the GC knows that there are no more slices pointing to a part of an old allocation? Andrey On Thursday, July 18, 2019 at 9:16:27 AM UTC-6, Ian Lance Taylor wrote: > > On Thu, Jul 18, 2019 at 7:24 AM robfig > > wrote: > > > > I was cu

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

2019-07-15 Thread andrey mirtchovski
> Google invested in a tool for themselves, which helped a lot in getting some > zillions of bucks as return. Corps open smth to communities not because they > a "good", but because at some point they smart enough to make others work for > free. I see a "Go Haters Handbook" in the works. I only

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

2019-07-15 Thread Andrey Tcherepanov
y 14, 2019 at 12:53:52 AM UTC-6, rog wrote: > > On Fri, 12 Jul 2019, 07:22 Sam Whited, > > wrote: > >> >> >> On July 12, 2019 4:35:54 AM UTC, Andrey Tcherepanov < >> xnow4f...@sneakemail.com > wrote: >> >What these guys are proposing in that paper

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

2019-07-11 Thread Andrey Tcherepanov
Thanks Sam, I haven't seen your proposal before, but it looks interesting - you seem to have put quite a thought into it already. Funny how these seems to be far-sided things - error handling, generics, sum types - are coming all related to each other at the end of the day... Andre

[go-nuts] Re: On the topic of try() and errors

2019-07-11 Thread Andrey Tcherepanov
h associated with "try-catch", and for having function syntax to really hide the "return from inside".) Andrey On Tuesday, July 9, 2019 at 5:46:03 PM UTC-6, Michael Jones wrote: > > In the hope of elevating the discussion of late, I've made a little speech > a

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

2019-07-11 Thread Andrey Tcherepanov
Thank you very much for pointing to that paper! Somehow I think it will be referenced in the future with a prefix "seminal" :) What these guys are proposing in that paper would be closer to (Go-style) func f() (v value | e error) { ... } (where "|" could be read as "or" or "union") with that in

Re: [go-nuts] Passing Struct from Go to C

2019-07-10 Thread andrey mirtchovski
ry clients, in which case you'll need to construct a more elaborate struct that implements locking and (at least what I do) a map between callback names and interface{} pointing to the callbacks sent by the library clients. On Wed, Jul 10, 2019 at 8:14 AM Nitish Saboo wrote: > > Hi Andre

Re: [go-nuts] Passing Struct from Go to C

2019-07-10 Thread andrey mirtchovski
what i do is have a similar struct in Go, and the original C one. here 'callbacks' is the go one, and "type Engine C.struct_cl_engine" is the opaque C one: https://github.com/mirtchovski/clamav/blob/master/callback.go#L63 On Wed, Jul 10, 2019 at 5:25 AM Nitish Saboo wrote:

Re: [go-nuts] Passing Struct from Go to C

2019-07-10 Thread andrey mirtchovski
i don't think you can use a go function directly in the callback. you need a correctly-typed C helper to do it. at least that used to be the case. see examples: https://github.com/mirtchovski/clamav/blob/master/cfuncs.go https://github.com/mirtchovski/clamav/blob/master/callback.go -- You receiv

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

2019-07-05 Thread andrey mirtchovski
me > reasons I dislike exceptions. It's just really hard to reason about such > jumps in logic especially in massively concurrent programs that go allows us > to write. > > > > On Friday, July 5, 2019 at 10:30:43 PM UTC, andrey mirtchovski wrote: >> >> > So

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

2019-07-05 Thread andrey mirtchovski
> So I was quiet on the topic then - I am not now. i guess you missed the point where I advocated for a new survey, well advertised, where all the people who are fervent Go programmers but somehow neglected to fill out the Go surveys for three years running can cast their voice. "does go error han

Re: [go-nuts] OOM occurring with a small heap

2019-07-02 Thread andrey mirtchovski
t; github.com/aws/aws-sdk-go/aws/request.(*Request).Sign >> 0 0% 80.00% 1024.23kB 13.34% >> github.com/aws/aws-sdk-go/aws/signer/v4.(*signingCtx).build >> 0 0% 80.00% 1024.23kB 13.34% >> github.com/aws/aws-sdk-go/aws/signer/v4.SignSDKRequest >&g

Re: [go-nuts] OOM occurring with a small heap

2019-07-02 Thread andrey mirtchovski
What I have found useful in the past is pprof's ability to diff profiles. That means that if you capture heap profiles at regular intervals you can see a much smaller subset of changes and compare allocation patterns. On Tue, Jul 2, 2019, 10:53 AM 'Yunchi Luo' via golang-nuts < golang-nuts@googleg

Re: [go-nuts] YAEHI (Yet another error-handling idea)

2019-07-02 Thread Andrey Tcherepanov
?.passed() } func usage3() interface{} { return getMood()?.avoided() } func usage4() (interface{}, error) { mood := getMood()?? /// will short-circuit if getMood() returns an error return mood?.passed() // guard for mood == nil; but will return no error in that case either since it wi

Re: [go-nuts] YAEHI (Yet another error-handling idea)

2019-07-01 Thread Andrey Tcherepanov
I wanted to >> speak up and say how your human-language phrasing matches your idea of >> computer-language phrasing. That seems a powerful kind of naturalness to >> take advantage of in this issue and future ones. >> >> On Sat, Jun 29, 2019 at 2:56 PM Andrey Tcher

Re: [go-nuts] YAEHI (Yet another error-handling idea)

2019-06-30 Thread Andrey Tcherepanov
I find sometimes it is easier to express ideas in code than a just plain old English... *sigh* Andrey On Saturday, June 29, 2019 at 5:05:44 PM UTC-6, Michael Jones wrote: > > My personal thought, though it may seem strange, is that the best argument > for it lies in the single word se

[go-nuts] Re: YAEHI (Yet another error-handling idea)

2019-06-30 Thread Andrey Tcherepanov
" construct. A. On Sunday, June 30, 2019 at 3:12:18 AM UTC-6, mh cbon wrote: > > f := file.Open() ? error { > //f is nill > return erors.Wrap("nop",err) > } > defer f.Close() > > On Saturday, June 29, 2019 at 11:56:09 PM UTC+2, Andrey Tcherepanov wrote: >>

Re: [go-nuts] Counter-counter-counter proposals

2019-06-30 Thread andrey mirtchovski
"Users don't care about what the designer does. They care about what they do. If every time you drove a car, you had to learn the meaning of 100 knobs, the whole system wouldn't work. Simplicity comes from tuning down the tasks required to drive the car into a certain set of understood paradigms an

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

2019-06-29 Thread andrey mirtchovski
> I will let Andrey speak for himself. Since this is turning into a bit of fisticuffs I will quote my private message to you for clarity, here it is: --8<- Your point is a good one. I agree with your stance. > Which is why nothing should be done, because every proposal is

[go-nuts] YAEHI (Yet another error-handling idea)

2019-06-29 Thread Andrey Tcherepanov
Hello mighty fighters of errors! Here comes my half-thought idea of another way to express error handling: *Add a postfix '?' that checks value for **emptiness (nil, 0, "") **AND an error for nil. * (Denis have shred it to pieces already in https://github.com/golang/go/issues/32852. Thank you

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

2019-06-29 Thread andrey mirtchovski
> go back to what is proven to work - Java and C++ are the dominant languages > in use today, adding their exception based error handling to Go is ‘the way > to Go” :) the battle you're fighting has already been lost. if you want java you know where to find it :) -- You received this message b

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

2019-06-29 Thread andrey mirtchovski
> This issue seems to have resonated with a lot of people, which may be an > important data point when considering the try proposal Where were all those people when the Go Surveys were being taken the last few years? Overwhelmingly, the people have voted error handling as a major issue. The voter

Re: [go-nuts] Pointer Method Receiver

2019-06-16 Thread andrey mirtchovski
Hi Ali, I understand your desire to provide useful information about Go in blog posts. This is commendable. However let's try to keep this list for technical issues and keep empty posts containing just a link to a minimum. More signal, less noise. Is there a particular issue you'd like to raise? I

Re: [go-nuts] https://godoc.org/github.com/couchbase/moss

2019-06-12 Thread andrey mirtchovski
collection is not an exported type: https://github.com/couchbase/moss/blob/master/collection.go#L24 the ?m=all parameter should enable you to see those, but it's not working for me on your link. perhaps because "collection" and "Collection" are not considered by godoc to be two different things? y

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

2019-06-11 Thread andrey mirtchovski
"go mod vendor" will populate the vendor directory in your project, then "go build -mod=vendor" will only use that directory to build. On Tue, Jun 11, 2019 at 3: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 m

Re: [go-nuts] Re: A good indicator of code quality

2019-06-06 Thread andrey mirtchovski
"does it look like the go standard library?" that style is desirable, yet inimitable -- 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] math.Atan implementation

2019-05-30 Thread andrey mirtchovski
Atan is implemented in assembly. for amd64 it's just a call to atan (lowercase a): https://golang.org/src/math/atan_amd64.s for 386 it is not: https://golang.org/src/math/atan_386.s On Thu, May 30, 2019 at 9:15 AM rhiro wrote: > > I'd like to see the implementation for math.Atan, but I see that

Re: [go-nuts] Re: Interesting public commentary on Go...

2019-05-24 Thread andrey mirtchovski
On Fri, May 24, 2019 at 12:49 AM Rob Pike wrote: > > If that's true - and it might well not be - it's a surprise to me. When > launching the language we explicitly made sure NOT to trademark it. > Go appears to be trademarked, as well as the new design of the Go logo. Golang doesn't seem to be.

Re: [go-nuts] go runtime in DLL not getting intialized(?) on some windows hosts

2019-05-13 Thread andrey mirtchovski
file an issue, please, if you have not done so already. i'd like to follow it. On Mon, May 13, 2019 at 8:01 PM Jason E. Aten wrote: > > Indeed, confirming data: I can re-create the crashing circumstances > immediately by renaming C:\Go to C:\Go1.12.5. > > On Tuesday, May 14, 2019 at 3:53:10 AM U

Re: [go-nuts] What happens to global vars when main() ends ?

2019-05-03 Thread andrey mirtchovski
when you terminate a process the virtual memory associated with that process ceases to exist. any real memory associated with that process is not addressable anymore. if another process allocates a page that maps to a page previously held by the first process will get a zeroed-out page. you should

Re: [go-nuts] What happens to global vars when main() ends ?

2019-05-03 Thread andrey mirtchovski
https://www.ardanlabs.com/blog/2018/12/garbage-collection-in-go-part1-semantics.html -- 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...@googl

Re: [go-nuts] Re: If Go is using libc instead of syscalls on macOS now, why is it not shown via otool -L?

2019-05-03 Thread andrey mirtchovski
macOS doesn't support static linking user binaries. in fact I do see libSystem linked for each go binary on my Mojave system, including the simplest non-outputting hello world: $ cat > t.go package main; func main(){} $ go build t.go && otool -L t t: /usr/lib/libSystem.B.dylib (compatibility versi

Re: [go-nuts] Re: Need help to launch hello.go

2019-04-30 Thread andrey mirtchovski
\windows_amd64\unicode\utf16.a > packagefile unicode=C:\Go\pkg\windows_amd64\unicode.a > packagefile internal/race=C:\Go\pkg\windows_amd64\internal\race.a > packagefile > internal/syscall/windows/sysdll=C:\Go\pkg\windows_amd64\internal\syscall\windows\sysdll.a > packagefile > int

Re: [go-nuts] Re: Need help to launch hello.go

2019-04-30 Thread andrey mirtchovski
> PS F:\GoWorckspace\src\hello> go build -work > WORK=E:\temp\go-build828919622 > open E:\temp\go-build828919622\b001\exe\a.out.exe: The system cannot find the > file specified. once you have done this you should be able to cd to E:\temp\go-build828919622 and look around to see if any files have

Re: [go-nuts] Re: Need help to launch hello.go

2019-04-30 Thread andrey mirtchovski
> PS F:\GoWorckspace\src\hello> go install > open E:\temp\go-build447177998\b001\exe\a.out.exe: The system cannot find the > file specified. is this a school or work computer? if yes then a group policy may have disabled the execution of exe files. supply the "-work" argument to go build. it will

Re: [go-nuts] Re: Need help to launch hello.go

2019-04-29 Thread andrey mirtchovski
try setting GOTMPDIR. not sure what this corresponds to on windows, but it will change where the go tool will create its temp files: $ go run -x t.go WORK=/var/folders/sp/06p28g2d0vs7gd2vhf26wl9mgn/T/go-build126372523 [...] $ GOTMPDIR=/tmp/go go run -x t.go WORK=/tmp/go/go-build661115935 [...]

Re: [go-nuts] strange bug

2019-04-28 Thread andrey mirtchovski
> But still, it would seem the range index should be unsigned - what would be > the purpose of it being signed? Similarly, the slice indexing should be > unsigned as well. Just thinking about it... not the first time this has come up. here are a couple of references: https://groups.google.com/d

Re: [go-nuts] strange bug

2019-04-28 Thread andrey mirtchovski
> So, the question is: why ‘i’ isn’t treated as unsigned, since it is a range > index - won't it always be positive? The author of the PR was most likely working on Go's tip (what will become 1.13), where the requirement that the right operator in a shift is an unsigned integer has been lifted.

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

2019-04-24 Thread andrey mirtchovski
Please do! We need to resolve this connundrum for the next 5 generations of computer programmers! On Wed, Apr 24, 2019 at 8:41 PM David Riley wrote: > > On Apr 24, 2019, at 5:25 PM, andrey mirtchovski wrote: > > > >> I may easily misremember, but that doesn't

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

2019-04-24 Thread andrey mirtchovski
> 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 adding it to C, and felt that it had been a mistake. > > Ian I am h

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

2019-04-24 Thread andrey mirtchovski
Here's the lore associated with the subject: Ken wanted ternary, Rob and Robert did not. They overruled Ken (remember, early on all three had to agree for a feature to go in). The end. The number of frivolous and egregious abuse of ternary that I've seen in _modern_ C code is too high.jpg -- You

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

2019-04-23 Thread andrey mirtchovski
> ? (test) { > //...do something > } > { > //..do something else > } I believe the Go team considered this very carefully early on the language's development and came to the decision to use "if test" for "? (test)" and "} else {" for "}{" (without the implied newline). They also threw in "} else i

  1   2   3   >