Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread Wojciech S. Czarnecki
On Wed, 24 Oct 2018 10:59:12 -0500 robert engels wrote: > If you head back to the genesis time of Java, Can you get all this Java babble out of the **GO** focused list, please! In less PC times it was called by its true name: **trolling**. https://en.wikipedia.org/wiki/Internet_troll "... to

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread alan . fox6
Well, FWIW, I'm not a fan of sigils either though, in this particular case, it did seem to me to be a convenient way of solving a thorny problem given that* ! *wouldn't be needed much anyway. So what would you suggest then? I think Ian's suggestion would work but, as a general approach, seems

[go-nuts] Partial Slice Swapping

2018-10-27 Thread Sayan Shankhari
Hello Masters, This is from a beginner in go. Please read the code for Swapping a 64 element array using two 32 element arrays. I have used two ways (OPTIONs), one is working, the other is not. Please tell me where I am wrong and what is the real concept in this language. Thank You. -- You

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread roger peppe
I'm not keen on this idea (including Ian's idea too). It makes parsing context-sensitive because the set of syntactic tokens varies would depend on the names declared in the package. That is, you can't parse a file in isolation because without reading all the files in a package, you don't know

Re: [go-nuts] Partial Slice Swapping

2018-10-27 Thread Sebastien Binet
Subslicing a slice is just creating another view to the same backing memory. It's a zero-copy operation. hth, -s sent from my droid On Sat, Oct 27, 2018, 15:31 Sayan Shankhari wrote: > Hello Masters, > This is from a beginner in go. Please read the code for Swapping a 64 > element array using

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Gerald Henriksen
On Sat, 27 Oct 2018 07:02:46 -0700 (PDT), you wrote: >I wish go2 team would focus on cross-platform GUI rather than nobody-needed >generics after all. There is nothing you can do atm, write your own library >I guess... An acceptable cross-platform GUI is a major undertaking to create an even

Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread Burak Serdar
On Sat, Oct 27, 2018 at 2:53 AM Wojciech S. Czarnecki wrote: > > On Wed, 24 Oct 2018 10:59:12 -0500 > robert engels wrote: > > > If you head back to the genesis time of Java, > > Can you get all this Java babble out of the **GO** focused list, please! > > In less PC times it was called by its

[go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Space A.
I wish go2 team would focus on cross-platform GUI rather than nobody-needed generics after all. There is nothing you can do atm, write your own library I guess... пятница, 26 октября 2018 г., 19:48:37 UTC+3 пользователь Andrew Williams написал: > > I'd be very interested to see if it would be

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread Gerald Henriksen
On Fri, 26 Oct 2018 22:31:46 -0500, you wrote: >First, there is simply no debate, Java += Android, and you have the most >successful language/platform ever. NO debate. Which explains why, as soon as Google gave them the choice, developers began the stampede away from Java to Kotlin. Java may

Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread Robert Engels
I don’t really understand your vitriol. I have not bashed Go in any way shape or form. I am not the only Go person that thinks generics are a bad idea. The original designers of Go thought it was a bad idea, and that’s why it wasn’t included. Calling someone a troll for expressing an opinion

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread alan . fox6
So you're basically saying that an identifier should either be reserved or not and that there should be no *contextual* keywords at all, not even *contract*. Well, it's a clear and simple stance to take but it inevitably means that adding any new keyword will not be backwards compatible and

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread roger peppe
On Sat, 27 Oct 2018, 5:46 pm So you're basically saying that an identifier should either be reserved or > not and that there should be no *contextual* keywords at all, not even > *contract*. > Yes, I agree with this. FWIW the generics draft proposal has at least one suggestion for avoiding

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread alanfo
Well, for me at least, that would mean that *contract* would be a contextual keyword :) However I agree that given *contract* could only appear as the first word of a top level declaration it would be far easier for the tokenizer to deal with than if *check *and *handle *were also contextual

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread alanfo
As a general principle, Ian, that makes sense to me and perhaps it's something we could all unite on. The remaining problem is how to distinguish between the two cases - new keywords used as such or as ordinary identifiers. Your suggestion is to leave it to the compiler to figure that out from

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Scott Cotton
On Saturday, 27 October 2018 23:31:11 UTC+2, Ian Lance Taylor wrote: > > On Sat, Oct 27, 2018 at 7:02 AM, Space A. > wrote: > > > > I wish go2 team would focus on cross-platform GUI rather than > nobody-needed > > generics after all. There is nothing you can do atm, write your own >

Re: [go-nuts] Re: Regarding contracts

2018-10-27 Thread hay
Hi Marko, That is good and interesting project. Although I still like to see proper support for code contracts in Go. But it might work for something I'm looking for here: https://groups.google.com/forum/#!topic/golang-nuts/w1-JQMaH7c4 Thanks and regards, On Sunday, October 28, 2018 at

[go-nuts] Re: Static assert at compile time

2018-10-27 Thread T L
If the strings values are constants, you can use this trick to assert they are not blank at compile time. https://go101.org/article/tips.html#assert-at-compile-time For example, for a constant string with name *Version*, you can assure it is not blank by using var _ = map[bool]int{false: 0,

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread Ian Lance Taylor
On Sat, Oct 27, 2018 at 4:52 PM, alanfo wrote: > > As it's a package (rather than a file) level aspect, I propose adding an > optional tag to the package clause. > > If there were no tag, then the compiler would only recognize version 1 > keywords and newer ones would be treated as ordinary

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Lucio
On Sunday, 28 October 2018 01:58:56 UTC+2, Scott Cotton wrote: > > > [ ... ] > Then a cross platform App would just implement for each platform. That > would be more work for app writers but provide more support for optimal > UIs, but then you'd know that on this platform, these accounts are

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread robert engels
I think arguing that marketing was the cause of the proliferation is not accurate. Marketing helps push technology, see big mega company, but in the embedded space since the consumer does not “know what’s in there” it matters far less. Java proliferated substantially on technical merits.

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread Burak Serdar
On Sat, Oct 27, 2018 at 5:53 PM alanfo wrote: > > As a general principle, Ian, that makes sense to me and perhaps it's > something we could all unite on. > > The remaining problem is how to distinguish between the two cases - new > keywords used as such or as ordinary identifiers. > > Your

[go-nuts] Static assert at compile time

2018-10-27 Thread hay
Hi, I've a project and it needs static asserts at compile time to check if string values are not left empty by the programmer. Is this possible in golang? Thanks in advance -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread robert engels
This is the cross I was referring to https://github.com/fyne-io/fyne > On Oct 27, 2018, at 4:30 PM, Ian Lance Taylor wrote: > > On Sat, Oct 27, 2018 at 7:02 AM, Space A. wrote: >> >> I wish go2 team would focus on cross-platform GUI rather than

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread robert engels
I don’t think it is possible in any language - I think it is a very of the halting problem https://en.wikipedia.org/wiki/Halting_problem unless you are referring to checking a constant ? > On Oct 27, 2018, at 5:07 PM, hay wrote: > > Hi, > >

[go-nuts] Re: Regarding contracts

2018-10-27 Thread hay
Hello, Code contracts are needed for safety critical applications but they would help other applications too. I hope code contracts support comes to golang. Also static compile time asserts and conditional checking. By code contracts I mean support for pre-conditions, post-conditions, and

Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread robert engels
Here is the research paper on the use of Java generics (without comment on Java’s “broken” generics being a contributing factor): https://www.researchgate.net/publication/236644412_Adoption_and_Use_of_Java_Generics (it is free to access) I provide it because it is important to understand

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread Ian Denhardt
It's a little unclear to me what exactly you're trying to check; giving an example might make it easier to advise. But in any case, Go doesn't have anything quite like static_assert in C/C++. Depending on what you're trying to do, you could put a call to panic in an init() function, which would

[go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread hay
"To this day, you can take a “binary” written for Java 1.0 and it will run under the latest JRE. You can compile Java 1.0 source code with the latest compiler. This is an amazing accomplishment that can’t be understated." I've concern about this. This kind of guarantee might prevent needed

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread robert engels
As others pointed out, this was not true when ‘enums’ were added, but still the Java compiler has always supported compiling using old version constructs. In the case of enums it was binary compatible. I think Ian’s proposal on the comment build flag to specify the language version is a good

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread hay
Hi robert, I'm looking for something C/C++ like static assertion to check few things at compile time. Hi Ian, thanks for the reply. It is checking at init at the moment. It is basically string or/and version checks. I'll give simple example. In C++ it will be something like this. class Foo {

Re: [go-nuts] Static assert at compile time

2018-10-27 Thread David Collier-Brown
In the special case of versioning, think about implementing "updaters" or "downdaters" on receipt of a versioned object/struct, as in https://leaflessca.wordpress.com/2017/02/12/dll-hell-and-avoiding-an-np-complete-problem/ For other uses, if you describe them here, we might be able to make a

Re: [go-nuts] Re: Regarding contracts

2018-10-27 Thread Marko Ristin-Kaufmann
Hi Hay, There's already a tool for formal contracts in Go: https://github.com/Parquery/gocontracts Cheers Marko Le dim. 28 oct. 2018 à 00:19, hay a écrit : > Hello, > > Code contracts are needed for safety critical applications but they would > help other applications too. I hope code

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread Burak Serdar
On Sat, Oct 27, 2018 at 11:26 AM roger peppe wrote: > > > > On Sat, 27 Oct 2018, 5:46 pm > >> So you're basically saying that an identifier should either be reserved or >> not and that there should be no contextual keywords at all, not even >> contract. > > > Yes, I agree with this. FWIW the

Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread Wojciech S. Czarnecki
On Sat, 27 Oct 2018 08:49:52 -0600 Burak Serdar wrote: > Comparison to Java (or any other language) is not off-topic, > especially when generics are concerned. I don't agree with some of the > things discussed here, but they're still valid and relevant, in my > opinion. In my opinion there are

Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread Wojciech S. Czarnecki
On Sat, 27 Oct 2018 08:52:26 -0500 Robert Engels wrote: > I have not bashed Go in any way shape or form. I agree, you did not. Nor that I said you've been doing so. > Calling someone a troll for expressing an opinion different than yours is > pretty rude. I did not called you a troll. I

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread Ian Lance Taylor
On Sat, Oct 27, 2018 at 3:31 AM, wrote: > > Both the above are also 'take it or leave it' approaches. Either you can use > the new keywords as such or you can use them as ordinary identifiers - you > can't do both in the same package which my suggestion would allow. That is an interesting

Re: [go-nuts] go1.11.1.windows-386 affected by the wirus Win32/Xpaj-gen

2018-10-27 Thread Ian Lance Taylor
On Sat, Oct 27, 2018 at 1:52 PM, rak wrote: > > I have just downloaded the source go1.11.1.windows-386 from the > www.golang.org. When I tried to install it, my avast antywirus said me that > some of the files were infected by the wirus Win32/Xpaj-gen. I don't know If > it was a fake alarm or it

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Ian Lance Taylor
On Sat, Oct 27, 2018 at 7:02 AM, Space A. wrote: > > I wish go2 team would focus on cross-platform GUI rather than nobody-needed > generics after all. There is nothing you can do atm, write your own library > I guess... Realistically a good cross-platform GUI is far beyond the capabilities of

Re: [go-nuts] Draft error handling design - could 'check' and 'handle' be 'contextual' keywords?

2018-10-27 Thread alan . fox6
That's a sensible suggestion, Burak, but I wanted to restrict this thread to how we would deal with any new keywords rather than the merits of the draft error handling design itself. Of course, it may be that the potential answers to the first problem will influence the design that is

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Robert Engels
I’m away from computer right now but the latest one that was posted about here seems very well done and looks decent as well. Sent from my iPhone > On Oct 27, 2018, at 9:34 AM, Gerald Henriksen wrote: > >> On Sat, 27 Oct 2018 07:02:46 -0700 (PDT), you wrote: >> >> I wish go2 team would

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread Robert Engels
What exactly are you referring to? I wasn’t aware of Android no longer being Java. But also when I say java am referring to the JVM technology as well, so add in all of the JVM languages and it’s even more lopsided. Sent from my iPhone > On Oct 27, 2018, at 9:31 AM, Gerald Henriksen wrote: >

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread Pat Farrell
On Friday, October 26, 2018 at 11:32:10 PM UTC-4, Robert Engels wrote: > > First, there is simply no debate, Java += Android, and you have the most > successful language/platform ever. NO debate. > Er, I can argue that VisualBasic + Windows is the most successfull but I have no dog in that

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-27 Thread Robert Engels
I think you might be confusing my remarks with someone else. I am against generics in Go. Also, the Java + Android was in reference to installed applications. Since very few desktop applications are developed today, you typically need to look at back end. Java still dominates here. You could

Re: [go-nuts] Re: gomobile: what's the right way to make widgets?

2018-10-27 Thread Nathan Verrilli
Regarding cross-platform GUI: The below author has it precisely correct. As, after decades of effort, Qt 'mostly works' suggests strongly that those who care about their UI will end up implementing UI natively, and separating it from their code. Those who don't care will be happy to use

[go-nuts] go1.11.1.windows-386 affected by the wirus Win32/Xpaj-gen

2018-10-27 Thread rak
Hello All, I have just downloaded the source go1.11.1.windows-386 from the www.golang.org. When I tried to install it, my avast antywirus said me that some of the files were infected by the wirus Win32/Xpaj-gen. I don't know If it was a fake alarm or it is a real problem with binaries. --

Re: [go-nuts] Go 2 Proposal Comments

2018-10-27 Thread Ian Lance Taylor
On Sat, Oct 27, 2018 at 1:53 PM, Wojciech S. Czarnecki wrote: > On Sat, 27 Oct 2018 08:52:26 -0500 > Robert Engels wrote: > >> I have not bashed Go in any way shape or form. > I agree, you did not. Nor that I said you've been doing so. > >> Calling someone a troll for expressing an opinion