Re: [go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Mike Schinkel
Hi Kurtis,

> Is the code after the "end" label ever going to be more complicated than a 
> simple "return err"? If not then I don't see the point of the goto statements.

Yes, very often. 

I could show examples but don't want to trigger bike shedding.

If you want to see some I'll be happy to send off-list. 

> Also, since you named the return value you can simply do "return" rather than 
> "return err" (personally I'm not a fan of bare returns that implicitly return 
> the named return parameters).

I started using this pattern to avoid multiple return statements which can be 
problematic when you want the debugger to stop before a function returns. If 
you miss breakpointing a return you can waste time chasing your tail.

Most recommend against naked returns so I prefer one set of return values 
instead of many repeating ones.

I have also found other beneficial reasons to use the pattern than just the 
debugging concern, which I can discuss off-list if you like.

> That function can be ten lines (25%) shorter

Length is one useful metric, but there are other metrics I consider too.

> I would argue would be clearer since the reader doesn't have to look at what 
> follows the "end" label.


The pattern has an `end:` label always at or near the only return in the func, 
and (almost) never any other labels so a reader need not look for it 
after recognizing the pattern.
 

-Mike



> On Aug 26, 2023, at 10:51 PM, Kurtis Rader  wrote:
> 
> On Sat, Aug 26, 2023 at 6:02 PM Mike Schinkel  > wrote:
> OTOH, in my quest to provide the simplest example I could, I provided an 
> example that does not expose the use-case I was interested in exploring, 
> unfortunately.
> 
> Let me instead present some real code from my current project, specifically 
> the variable declarations on the lines 35-36 of the `Process()` method of 
> `*FileProcessor` where the variables declared at the top are not referenced 
> after the label:
> 
> https://github.com/newclarity/wpfr/blob/88d1289a90646f59ec4233eed0e421f1eae36332/pkg/wpfr.go#L34-L75
>  
> 
> 
> Is the code after the "end" label ever going to be more complicated than a 
> simple "return err"? If not then I don't see the point of the goto 
> statements. Also, since you named the return value you can simply do "return" 
> rather than "return err" (personally I'm not a fan of bare returns that 
> implicitly return the named return parameters). That function can be ten 
> lines (25%) shorter and I would argue would be clearer since the reader 
> doesn't have to look at what follows the "end" label.
> 
> -- 
> Kurtis Rader
> Caretaker of the exceptional canines Junior and Hank

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3495CCD1-6509-4027-9F2B-082B205E1568%40newclarity.net.


Re: [go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Kurtis Rader
On Sat, Aug 26, 2023 at 6:02 PM Mike Schinkel  wrote:

> OTOH, in my quest to provide the simplest example I could, I provided an
> example that does not expose the use-case I was interested in exploring,
> unfortunately.
>
> Let me instead present some real code from my current project,
> specifically the variable declarations on the lines 35-36 of the
> `Process()` method of `*FileProcessor` where the variables declared at the
> top are not referenced after the label:
>
>
> https://github.com/newclarity/wpfr/blob/88d1289a90646f59ec4233eed0e421f1eae36332/pkg/wpfr.go#L34-L75
>
>
Is the code after the "end" label ever going to be more complicated than a
simple "return err"? If not then I don't see the point of the goto
statements. Also, since you named the return value you can simply do
"return" rather than "return err" (personally I'm not a fan of bare returns
that implicitly return the named return parameters). That function can be
ten lines (25%) shorter and I would argue would be clearer since the reader
doesn't have to look at what follows the "end" label.

-- 
Kurtis Rader
Caretaker of the exceptional canines Junior and Hank

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD-%3D-nWm917Mujx6spwPwOPwy-Su8AvCr2bATB-2t8Wcsg%40mail.gmail.com.


Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Robert Solomon
Showing the call stack is a core function of the Delve debugger for Go.  
See github.com/go-delve/delve/cmd/dlv.  Install w/
  go install github.com/go-delve/delve/cmd/dlv@latest

Once learning how to use delve, then any IDE/editor will work.  I believe 
that both VSCode and Goland use delve's code for their debugging 
capabilities


On Saturday, August 26, 2023 at 6:09:44 PM UTC-4 Robert Engels wrote:

> Sorry that was snotty. Bring back the punch cards to really prove who’s a 
> great developer!
>
> On Aug 26, 2023, at 4:29 PM, Robert Engels  wrote:
>
> 
>
> Or you click on the top stack line in an IDE and then arose down. 
>
> It’s like some people want to go back to horse and buggy “because it was 
> better for the environment”. Balancing competing priorities is a great 
> skill to have. 
>
> On Aug 26, 2023, at 3:51 PM, Justin Israel  wrote:
>
> 
>
>
> On Sun, Aug 27, 2023 at 12:47 AM Mike Schinkel  
> wrote:
>
>> If I understand what you are asking then JetBrains GoLand does. 
>>
>> I do not know if there is a way to use the keyboard, but it does provides 
>> links you can click when it displays the call stack on panic.
>>
>
> If your keymap configuration derives from one of the system configs 
> (Windows, Macos, ...) then "Next Frame" and "Previous Frame" have default 
> mapped hotkeys. So you can do the same workflow Jason mentioned, starting a 
> debugger execution, which panics, and then navigating the stack all via 
> keyboard (if that really is your thing).
>  
>
>>
>> -Mike
>>
>> On Saturday, August 26, 2023 at 8:33:08 AM UTC-4 Jason E. Aten wrote:
>>
>>> Is there any IDE that allows you to jump through a stack trace like 
>>> emacs does?
>>>
>>> e.g. If I have a panic on a run, with two keystrokes I can jump to the 
>>> origin
>>> of the panic, and then their caller, and then the parent caller, and 
>>> then up to
>>> the grandparent on the call stack... instantly. I've never found this 
>>> essential
>>> functionality elsewhere, but maybe I'm just not familiar... A friend of 
>>> mine tried
>>> to add it to Visual Studio and gave up... it was just too hard for VS. 
>>> But maybe JetBrains has it??
>>>
>>> I'd love to try an IDE other than emacs, but this is a fundament thing, 
>>> that I cannot give up.
>>>
>>> On Friday, August 25, 2023 at 6:21:35 PM UTC+1 Mike Schinkel wrote:
>>>
 Yes, as Luke Crook mentioned I think those requirements are more ALM 
 functionality than IDE functionality.  

 Generally, ALM addresses concerns broader than individual concerns 
 whereas IDEs are more focused on individual productivity.

 Just my opinion, but I would expect you'd be better off finding an ALM 
 solution and then an IDE that integrates with that ALM, or vice versa, 
 i.e. 
 find an IDE that integrates with an ALM and then use that ALM.

 #fwiw

 -Mike
 On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote:

> Hi All !
>
> Considering that IBM's punch cards were bearing at least twice, I 
> would vote for them. :-)
>
> Of cource I do agree with them who wrote that to feel comfortable 
> "under fingers" is great !
>
> So, the tasks to code - they are different. 
> Sometimes it is possible to keep all the details regards to the task 
> in a head or several.
> Sometimes it is nesessary to write say a hard copy of them(details) on 
> a paper with a different size.
>
> But in case the task from the area of the "poorly formalized". You 
> spend paper quickly. :-)
>
> The Luke Crook points to:
> https://en.wikipedia.org/wiki/Application_lifecycle_management
>
> I will simplify the task somewhat and take from ALM for example even 
> less than SDLC, namely:
> requirements, design, implementation, testing, deployment.
>
> 1. Requirements must be described somewhere.
> 2. Design artifacts should reflect requirements.
> 3. Design decisions refer to objects and messages that
> implemented in the form of classes and operations.
> 4. Each operation must pass at least one test.
> All tests must be passed successfully.
> 5. The application is assembled and installed there and 
> the tests are successfully passed again.
>
> Question: is there any IDE or plugin which one support that kind of 
> dependencies in a graphical mode ?
>
> Thank you.
>
> вторник, 22 августа 2023 г. в 18:22:52 UTC+3, Mike Schinkel: 
>
>> On Saturday, August 19, 2023 at 5:27:34 AM UTC-4 alex-coder wrote:
>>
>> What I'm looking for is the ability to manage dependencies not only 
>> in code,
>> but entirely in a project from requirements to deployment.
>>
>>
>> I assume you mean a lot more than just Go package dependencies, as 
>> `go mod` handles those nicely.
>>
>> Can you elaborate on the specific dependencies you are trying to 
>> manage?  In 

Re: [go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Mike Schinkel
Hi Ian,

Thank you for the explanation. That makes perfect sense.

OTOH, in my quest to provide the simplest example I could, I provided an 
example that does not expose the use-case I was interested in exploring, 
unfortunately.

Let me instead present some real code from my current project, specifically the 
variable declarations on the lines 35-36 of the `Process()` method of 
`*FileProcessor` where the variables declared at the top are not referenced 
after the label:

https://github.com/newclarity/wpfr/blob/88d1289a90646f59ec4233eed0e421f1eae36332/pkg/wpfr.go#L34-L75

However, your links to https://go.dev/issue/27165 and 
https://go.dev/issue/26058  seems to be addressing 
exactly the concern, so I will follow up with use-cases on those tickets after 
spending enough time with them to determine which one addresses my use-cases 
better.

Again, thank you.

-Mike

> On Aug 26, 2023, at 7:00 PM, Ian Lance Taylor  wrote:
> 
> On Sat, Aug 26, 2023 at 2:11 PM Mike Schinkel  wrote:
>> 
>> Question about disallowing `goto ` jumping over a variable 
>> declaration?
>> 
>> 
>> And please, before bikeshedding opinions about the use of `goto` pro or con 
>> — note that the Go standard library uses `goto` in some places — this 
>> question is purely for me to gain better understanding the choices made with 
>> the Go compiler.
>> 
>> 
>> Question. Was it:
>> 
>> 
>> 1. Somehow logically required by the compiler, and if so can you elaborate 
>> why?
>> 
>> 2. A design decision made, and if so what what the rationale for the design 
>> decision?
>> 
>> 3. A limitation place on GoLang for some other reason, and if so, what and 
>> why?
>> 
>> 
>> I have prepared an example showing use of `goto` that compiles and one that 
>> does not at this playground URL:
>> 
>> 
>> https://goplay.tools/snippet/tSAbWhmiCZK
>> 
>> 
>> Hoping to hear from someone who actually knows why the decision was made as 
>> opposed to someone who might just be guessing at the reason.
> 
> Consider a function like
> 
> func F() {
>goto lab
>x := 1
> lab:
>fmt.Println(x)
> }
> 
> This function is forbidden today.  If it were permitted, what should it print?
> 
> If the answer to that question seems obvious, what about a case like
> 
> func F() {
>goto lab
>x := func() int {
>fmt.Println("setting x")
>return 1
>}()
> lab:
>fmt.Println(x)
> }
> 
> Should that print "setting x"?
> 
> Rather than attempt to answer these kinds of questions, Go simply
> forbids cases like this.
> 
> Note that Go is not the only language with this restriction.  This
> similar C++ function is invalid, because the goto crosses the
> initialization of the variable.
> 
> int f() {
>goto lab;
>int x = 1;
> lab:
>std::cout << x;
>return 0;
> }
> 
> If you are interested in this topic you may be interested in
> https://go.dev/issue/27165 and https://go.dev/issue/26058.
> 
> Ian

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/B066901D-A60A-4F08-A1BF-D2C307910548%40newclarity.net.


Re: [go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Ian Lance Taylor
On Sat, Aug 26, 2023 at 2:11 PM Mike Schinkel  wrote:
>
> Question about disallowing `goto ` jumping over a variable declaration?
>
>
> And please, before bikeshedding opinions about the use of `goto` pro or con — 
> note that the Go standard library uses `goto` in some places — this question 
> is purely for me to gain better understanding the choices made with the Go 
> compiler.
>
>
> Question. Was it:
>
>
> 1. Somehow logically required by the compiler, and if so can you elaborate 
> why?
>
> 2. A design decision made, and if so what what the rationale for the design 
> decision?
>
> 3. A limitation place on GoLang for some other reason, and if so, what and 
> why?
>
>
> I have prepared an example showing use of `goto` that compiles and one that 
> does not at this playground URL:
>
>
> https://goplay.tools/snippet/tSAbWhmiCZK
>
>
> Hoping to hear from someone who actually knows why the decision was made as 
> opposed to someone who might just be guessing at the reason.

Consider a function like

func F() {
goto lab
x := 1
lab:
fmt.Println(x)
}

This function is forbidden today.  If it were permitted, what should it print?

If the answer to that question seems obvious, what about a case like

func F() {
goto lab
x := func() int {
fmt.Println("setting x")
return 1
}()
lab:
fmt.Println(x)
}

Should that print "setting x"?

Rather than attempt to answer these kinds of questions, Go simply
forbids cases like this.

Note that Go is not the only language with this restriction.  This
similar C++ function is invalid, because the goto crosses the
initialization of the variable.

int f() {
goto lab;
int x = 1;
 lab:
std::cout << x;
return 0;
}

If you are interested in this topic you may be interested in
https://go.dev/issue/27165 and https://go.dev/issue/26058.

Ian

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAOyqgcVuD0-3r37FfFHdBgoTFX7-1QVUY54MYgG0XKjvQVeKnQ%40mail.gmail.com.


Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Robert Engels
Sorry that was snotty. Bring back the punch cards to really prove who’s a great 
developer!

> On Aug 26, 2023, at 4:29 PM, Robert Engels  wrote:
> 
> 
> Or you click on the top stack line in an IDE and then arose down. 
> 
> It’s like some people want to go back to horse and buggy “because it was 
> better for the environment”. Balancing competing priorities is a great skill 
> to have. 
> 
>>> On Aug 26, 2023, at 3:51 PM, Justin Israel  wrote:
>>> 
>> 
>> 
>> 
>>> On Sun, Aug 27, 2023 at 12:47 AM Mike Schinkel  
>>> wrote:
>>> If I understand what you are asking then JetBrains GoLand does. 
>>> 
>>> I do not know if there is a way to use the keyboard, but it does provides 
>>> links you can click when it displays the call stack on panic.
>> 
>> If your keymap configuration derives from one of the system configs 
>> (Windows, Macos, ...) then "Next Frame" and "Previous Frame" have default 
>> mapped hotkeys. So you can do the same workflow Jason mentioned, starting a 
>> debugger execution, which panics, and then navigating the stack all via 
>> keyboard (if that really is your thing).
>>  
>>> 
>>> -Mike
>>> 
 On Saturday, August 26, 2023 at 8:33:08 AM UTC-4 Jason E. Aten wrote:
 Is there any IDE that allows you to jump through a stack trace like emacs 
 does?
 
 e.g. If I have a panic on a run, with two keystrokes I can jump to the 
 origin
 of the panic, and then their caller, and then the parent caller, and then 
 up to
 the grandparent on the call stack... instantly. I've never found this 
 essential
 functionality elsewhere, but maybe I'm just not familiar... A friend of 
 mine tried
 to add it to Visual Studio and gave up... it was just too hard for VS. But 
 maybe JetBrains has it??
 
 I'd love to try an IDE other than emacs, but this is a fundament thing, 
 that I cannot give up.
 
> On Friday, August 25, 2023 at 6:21:35 PM UTC+1 Mike Schinkel wrote:
> Yes, as Luke Crook mentioned I think those requirements are more ALM 
> functionality than IDE functionality.  
> 
> Generally, ALM addresses concerns broader than individual concerns 
> whereas IDEs are more focused on individual productivity.
> 
> Just my opinion, but I would expect you'd be better off finding an ALM 
> solution and then an IDE that integrates with that ALM, or vice versa, 
> i.e. find an IDE that integrates with an ALM and then use that ALM.
> 
> #fwiw
> 
> -Mike
>> On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote:
>> Hi All !
>> 
>> Considering that IBM's punch cards were bearing at least twice, I would 
>> vote for them. :-)
>> 
>> Of cource I do agree with them who wrote that to feel comfortable "under 
>> fingers" is great !
>> 
>> So, the tasks to code - they are different. 
>> Sometimes it is possible to keep all the details regards to the task in 
>> a head or several.
>> Sometimes it is nesessary to write say a hard copy of them(details) on a 
>> paper with a different size.
>> 
>> But in case the task from the area of the "poorly formalized". You spend 
>> paper quickly. :-)
>> 
>> The Luke Crook points to:
>> https://en.wikipedia.org/wiki/Application_lifecycle_management
>> 
>> I will simplify the task somewhat and take from ALM for example even 
>> less than SDLC, namely:
>> requirements, design, implementation, testing, deployment.
>> 
>> 1. Requirements must be described somewhere.
>> 2. Design artifacts should reflect requirements.
>> 3. Design decisions refer to objects and messages that
>> implemented in the form of classes and operations.
>> 4. Each operation must pass at least one test.
>> All tests must be passed successfully.
>> 5. The application is assembled and installed there and 
>> the tests are successfully passed again.
>> 
>> Question: is there any IDE or plugin which one support that kind of 
>> dependencies in a graphical mode ?
>> 
>> Thank you.
>> 
>> вторник, 22 августа 2023 г. в 18:22:52 UTC+3, Mike Schinkel: 
>>> On Saturday, August 19, 2023 at 5:27:34 AM UTC-4 alex-coder wrote:
>>> What I'm looking for is the ability to manage dependencies not only in 
>>> code,
>>> but entirely in a project from requirements to deployment.
>>> 
>>> I assume you mean a lot more than just Go package dependencies, as `go 
>>> mod` handles those nicely.
>>> 
>>> Can you elaborate on the specific dependencies you are trying to 
>>> manage?  In specific, vs generalities.
>>> 
>>> -Mike  
>>> 
>>> -- 
>>> You received this message because you are subscribed to a topic in the 
>>> Google Groups "golang-nuts" group.
>>> To unsubscribe from this topic, visit 
>>> https://groups.google.com/d/topic/golang-nuts/4yVXlyZZatM/unsubscribe.
>>> To unsubscribe from 

Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Robert Engels
Or you click on the top stack line in an IDE and then arose down. 

It’s like some people want to go back to horse and buggy “because it was better 
for the environment”. Balancing competing priorities is a great skill to have. 

> On Aug 26, 2023, at 3:51 PM, Justin Israel  wrote:
> 
> 
> 
> 
>> On Sun, Aug 27, 2023 at 12:47 AM Mike Schinkel  
>> wrote:
>> If I understand what you are asking then JetBrains GoLand does. 
>> 
>> I do not know if there is a way to use the keyboard, but it does provides 
>> links you can click when it displays the call stack on panic.
> 
> If your keymap configuration derives from one of the system configs (Windows, 
> Macos, ...) then "Next Frame" and "Previous Frame" have default mapped 
> hotkeys. So you can do the same workflow Jason mentioned, starting a debugger 
> execution, which panics, and then navigating the stack all via keyboard (if 
> that really is your thing).
>  
>> 
>> -Mike
>> 
>>> On Saturday, August 26, 2023 at 8:33:08 AM UTC-4 Jason E. Aten wrote:
>>> Is there any IDE that allows you to jump through a stack trace like emacs 
>>> does?
>>> 
>>> e.g. If I have a panic on a run, with two keystrokes I can jump to the 
>>> origin
>>> of the panic, and then their caller, and then the parent caller, and then 
>>> up to
>>> the grandparent on the call stack... instantly. I've never found this 
>>> essential
>>> functionality elsewhere, but maybe I'm just not familiar... A friend of 
>>> mine tried
>>> to add it to Visual Studio and gave up... it was just too hard for VS. But 
>>> maybe JetBrains has it??
>>> 
>>> I'd love to try an IDE other than emacs, but this is a fundament thing, 
>>> that I cannot give up.
>>> 
 On Friday, August 25, 2023 at 6:21:35 PM UTC+1 Mike Schinkel wrote:
 Yes, as Luke Crook mentioned I think those requirements are more ALM 
 functionality than IDE functionality.  
 
 Generally, ALM addresses concerns broader than individual concerns whereas 
 IDEs are more focused on individual productivity.
 
 Just my opinion, but I would expect you'd be better off finding an ALM 
 solution and then an IDE that integrates with that ALM, or vice versa, 
 i.e. find an IDE that integrates with an ALM and then use that ALM.
 
 #fwiw
 
 -Mike
> On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote:
> Hi All !
> 
> Considering that IBM's punch cards were bearing at least twice, I would 
> vote for them. :-)
> 
> Of cource I do agree with them who wrote that to feel comfortable "under 
> fingers" is great !
> 
> So, the tasks to code - they are different. 
> Sometimes it is possible to keep all the details regards to the task in a 
> head or several.
> Sometimes it is nesessary to write say a hard copy of them(details) on a 
> paper with a different size.
> 
> But in case the task from the area of the "poorly formalized". You spend 
> paper quickly. :-)
> 
> The Luke Crook points to:
> https://en.wikipedia.org/wiki/Application_lifecycle_management
> 
> I will simplify the task somewhat and take from ALM for example even less 
> than SDLC, namely:
> requirements, design, implementation, testing, deployment.
> 
> 1. Requirements must be described somewhere.
> 2. Design artifacts should reflect requirements.
> 3. Design decisions refer to objects and messages that
> implemented in the form of classes and operations.
> 4. Each operation must pass at least one test.
> All tests must be passed successfully.
> 5. The application is assembled and installed there and 
> the tests are successfully passed again.
> 
> Question: is there any IDE or plugin which one support that kind of 
> dependencies in a graphical mode ?
> 
> Thank you.
> 
> вторник, 22 августа 2023 г. в 18:22:52 UTC+3, Mike Schinkel: 
>> On Saturday, August 19, 2023 at 5:27:34 AM UTC-4 alex-coder wrote:
>> What I'm looking for is the ability to manage dependencies not only in 
>> code,
>> but entirely in a project from requirements to deployment.
>> 
>> I assume you mean a lot more than just Go package dependencies, as `go 
>> mod` handles those nicely.
>> 
>> Can you elaborate on the specific dependencies you are trying to manage? 
>>  In specific, vs generalities.
>> 
>> -Mike  
>> 
>> -- 
>> You received this message because you are subscribed to a topic in the 
>> Google Groups "golang-nuts" group.
>> To unsubscribe from this topic, visit 
>> https://groups.google.com/d/topic/golang-nuts/4yVXlyZZatM/unsubscribe.
>> To unsubscribe from this group and all its topics, send an email to 
>> golang-nuts+unsubscr...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/c8b2e710-240b-4f4a-ae80-3142578673d3n%40googlegroups.com.
> 
> -- 
> You received this 

[go-nuts] Reason for "goto jumps over declaration" being disallowed

2023-08-26 Thread Mike Schinkel
Hi All,

Question about disallowing `goto ` jumping over a variable declaration?

And please, before bikeshedding opinions about the use of `goto` pro or con — 
note that the Go standard library uses `goto` in some places — this question is 
purely for me to gain better understanding the choices made with the Go 
compiler.

Question. Was it:

1. Somehow logically required by the compiler, and if so can you elaborate why?

2. A design decision made, and if so what what the rationale for the design 
decision?

3. A limitation place on GoLang for some other reason, and if so, what and why?

I have prepared an example showing use of `goto` that compiles and one that 
does not at this playground URL: 

https://goplay.tools/snippet/tSAbWhmiCZK

Hoping to hear from someone who actually knows why the decision was made as 
opposed to someone who might just be guessing at the reason.

Thank you in advance.

-Mike

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/B6B94DDC-323C-4C4C-9292-903421EC7103%40newclarity.net.


Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Justin Israel
On Sun, Aug 27, 2023 at 12:47 AM Mike Schinkel 
wrote:

> If I understand what you are asking then JetBrains GoLand does.
>
> I do not know if there is a way to use the keyboard, but it does provides
> links you can click when it displays the call stack on panic.
>

If your keymap configuration derives from one of the system configs
(Windows, Macos, ...) then "Next Frame" and "Previous Frame" have default
mapped hotkeys. So you can do the same workflow Jason mentioned, starting a
debugger execution, which panics, and then navigating the stack all via
keyboard (if that really is your thing).


>
> -Mike
>
> On Saturday, August 26, 2023 at 8:33:08 AM UTC-4 Jason E. Aten wrote:
>
>> Is there any IDE that allows you to jump through a stack trace like emacs
>> does?
>>
>> e.g. If I have a panic on a run, with two keystrokes I can jump to the
>> origin
>> of the panic, and then their caller, and then the parent caller, and then
>> up to
>> the grandparent on the call stack... instantly. I've never found this
>> essential
>> functionality elsewhere, but maybe I'm just not familiar... A friend of
>> mine tried
>> to add it to Visual Studio and gave up... it was just too hard for VS.
>> But maybe JetBrains has it??
>>
>> I'd love to try an IDE other than emacs, but this is a fundament thing,
>> that I cannot give up.
>>
>> On Friday, August 25, 2023 at 6:21:35 PM UTC+1 Mike Schinkel wrote:
>>
>>> Yes, as Luke Crook mentioned I think those requirements are more ALM
>>> functionality than IDE functionality.
>>>
>>> Generally, ALM addresses concerns broader than individual concerns
>>> whereas IDEs are more focused on individual productivity.
>>>
>>> Just my opinion, but I would expect you'd be better off finding an ALM
>>> solution and then an IDE that integrates with that ALM, or vice versa, i.e.
>>> find an IDE that integrates with an ALM and then use that ALM.
>>>
>>> #fwiw
>>>
>>> -Mike
>>> On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote:
>>>
 Hi All !

 Considering that IBM's punch cards were bearing at least twice, I would
 vote for them. :-)

 Of cource I do agree with them who wrote that to feel comfortable
 "under fingers" is great !

 So, the tasks to code - they are different.
 Sometimes it is possible to keep all the details regards to the task in
 a head or several.
 Sometimes it is nesessary to write say a hard copy of them(details) on
 a paper with a different size.

 But in case the task from the area of the "poorly formalized". You
 spend paper quickly. :-)

 The Luke Crook points to:
 https://en.wikipedia.org/wiki/Application_lifecycle_management

 I will simplify the task somewhat and take from ALM for example even
 less than SDLC, namely:
 requirements, design, implementation, testing, deployment.

 1. Requirements must be described somewhere.
 2. Design artifacts should reflect requirements.
 3. Design decisions refer to objects and messages that
 implemented in the form of classes and operations.
 4. Each operation must pass at least one test.
 All tests must be passed successfully.
 5. The application is assembled and installed there and
 the tests are successfully passed again.

 Question: is there any IDE or plugin which one support that kind of
 dependencies in a graphical mode ?

 Thank you.

 вторник, 22 августа 2023 г. в 18:22:52 UTC+3, Mike Schinkel:

> On Saturday, August 19, 2023 at 5:27:34 AM UTC-4 alex-coder wrote:
>
> What I'm looking for is the ability to manage dependencies not only in
> code,
> but entirely in a project from requirements to deployment.
>
>
> I assume you mean a lot more than just Go package dependencies, as `go
> mod` handles those nicely.
>
> Can you elaborate on the specific dependencies you are trying to
> manage?  In specific, vs generalities.
>
> -Mike
>
 --
> You received this message because you are subscribed to a topic in the
> Google Groups "golang-nuts" group.
> To unsubscribe from this topic, visit
> https://groups.google.com/d/topic/golang-nuts/4yVXlyZZatM/unsubscribe.
> To unsubscribe from this group and all its topics, send an email to
> golang-nuts+unsubscr...@googlegroups.com.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/c8b2e710-240b-4f4a-ae80-3142578673d3n%40googlegroups.com
> 
> .
>

-- 
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 discussion on the web visit 

Re: [go-nuts] does gonum insist on row-major?

2023-08-26 Thread 'Dan Kortschak' via golang-nuts
On Sat, 2023-08-26 at 07:28 -0700, Brian Candler wrote:
> Could you explain the comment "all of Go is cm"?
> https://go.dev/play/p/tDJiSTqsiSC
> 

Sorry, that was a typo, should read "all of Go is rm" (what is there is
inconsistent with everything else I wrote).

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/69b7647f39877c994878c657eb45e7960b48d99f.camel%40kortschak.io.


Re: [go-nuts] Re: wtf

2023-08-26 Thread Aln Kapa
I understand, thanks.

On Sat, Aug 26, 2023, 18:47 Brian Candler  wrote:

> In both cases, the argument inside parenthesis is evaluated at the time
> "defer" is executed - as indeed is the value of "p".
>
> In the first case, you wrote "defer p.close(err)".  Since err is nil at
> this point, at the end of the function body, p.close(nil) is called.
>
> In the second case, you wrote "defer p.close(pt)" where pt is a pointer to
> some variable. Therefore, at the end of the function body, p.close(pt) is
> called, with the value of the pointer at that time.
>
> Since in the second case you have a valid pointer to some data, then you
> can modify that data through the pointer. Note that if the pointer pt had
> changed, it would still be referring to the original value of pt, since
> that was captured at the time "defer" was called.
>
> Maybe this clarifies?
> https://go.dev/play/p/T2OXfmh-slj
>
> On Saturday, 26 August 2023 at 16:37:43 UTC+1 Aln Kapa wrote:
>
>> Well here is the code that works as I need, what is wrong with the
>> previous one ?
>> https://go.dev/play/p/ZW-GmEP5uqu
>>
>> package main
>>
>> import (
>>
>> "fmt"
>> )
>>
>> type process struct {
>> }
>>
>> func (p *process) close(err any) {
>> v, _ := err.(*int)
>> if *v == 1 {
>>
>> fmt.Println("error")
>> } else {
>> fmt.Println("no error")
>> }
>> }
>> func Handle(b bool) {
>> p := process{}
>> var i = 2
>> var pt any = 
>> defer func() {
>> p.close(pt)
>> }()
>> if b {
>> i = 1
>>
>> }
>> }
>>
>> func HandleWTF(b bool) {
>> p := process{}
>> var i = 2
>> var pt any = 
>> defer p.close(pt)
>> if b {
>> i = 1
>>
>> }
>> }
>>
>> func main() {
>> Handle(true)// error
>> Handle(false)   // no error
>> HandleWTF(true) // error
>> }
>>
>>
>> On Sat, Aug 26, 2023 at 6:10 PM Brian Candler  wrote:
>>
>>> Any arguments to defer functions are evaluated at the time that the
>>> defer is executed.  In HandleWTF, defer p.close(err) is called immediately
>>> after err is declared with value nil, so nil is what is used.
>>>
>>> From the specification :
>>>
>>> "Each time a "defer" statement executes, the function value and
>>> parameters to the call are evaluated as usual
>>>  and saved anew but the actual function
>>> is not invoked."
>>>
>>> On Saturday, 26 August 2023 at 15:58:06 UTC+1 Aln Kapa wrote:
>>>
 Hi All !
 Need some help, what am I doing wrong?

 https://go.dev/play/p/bBlA-i1CxNO

 // You can edit this code!
 // Click here and start typing.
 package main

 import (
 "errors"
 "fmt"
 )

 type process struct {
 }

 func (p *process) close(err error) {
 if err != nil {
 fmt.Println("error")
 } else {
 fmt.Println("no error")
 }
 }
 func Handle(b bool) {
 p := process{}
 var err error
 defer func() {
 p.close(err)
 }()
 if b {
 err = errors.New("err")
 }
 }

 func HandleWTF(b bool) {
 p := process{}
 var err error
 defer p.close(err)
 if b {
 err = errors.New("err")
 }
 }

 func main() {
 Handle(true)// error
 Handle(false)   // no error
 HandleWTF(true) // no error ?
 }

>>> --
>>> 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...@googlegroups.com.
>>> To view this discussion on the web visit
>>> https://groups.google.com/d/msgid/golang-nuts/25846715-b3bf-4d1d-81b4-4a2799e69d27n%40googlegroups.com
>>> 
>>> .
>>>
>> --
> 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 discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/75285ba7-f9aa-4d43-b136-9c3d676c9891n%40googlegroups.com
> 
> .
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAJqqVEVpyxRjBTmg%3DrAs3y9GZf7AJUniB08jxe4rh3VbYkjWOA%40mail.gmail.com.


Re: [go-nuts] Re: wtf

2023-08-26 Thread Brian Candler
In both cases, the argument inside parenthesis is evaluated at the time 
"defer" is executed - as indeed is the value of "p".

In the first case, you wrote "defer p.close(err)".  Since err is nil at 
this point, at the end of the function body, p.close(nil) is called.

In the second case, you wrote "defer p.close(pt)" where pt is a pointer to 
some variable. Therefore, at the end of the function body, p.close(pt) is 
called, with the value of the pointer at that time.

Since in the second case you have a valid pointer to some data, then you 
can modify that data through the pointer. Note that if the pointer pt had 
changed, it would still be referring to the original value of pt, since 
that was captured at the time "defer" was called.

Maybe this clarifies?
https://go.dev/play/p/T2OXfmh-slj

On Saturday, 26 August 2023 at 16:37:43 UTC+1 Aln Kapa wrote:

> Well here is the code that works as I need, what is wrong with the 
> previous one ?
> https://go.dev/play/p/ZW-GmEP5uqu
>
> package main
>
> import (
>
> "fmt"
> )
>
> type process struct {
> }
>
> func (p *process) close(err any) {
> v, _ := err.(*int)
> if *v == 1 {
>
> fmt.Println("error")
> } else {
> fmt.Println("no error")
> }
> }
> func Handle(b bool) {
> p := process{}
> var i = 2
> var pt any = 
> defer func() {
> p.close(pt)
> }()
> if b {
> i = 1
>
> }
> }
>
> func HandleWTF(b bool) {
> p := process{}
> var i = 2
> var pt any = 
> defer p.close(pt)
> if b {
> i = 1
>
> }
> }
>
> func main() {
> Handle(true)// error
> Handle(false)   // no error
> HandleWTF(true) // error
> }
>
>
> On Sat, Aug 26, 2023 at 6:10 PM Brian Candler  wrote:
>
>> Any arguments to defer functions are evaluated at the time that the defer 
>> is executed.  In HandleWTF, defer p.close(err) is called immediately after 
>> err is declared with value nil, so nil is what is used.
>>
>> From the specification :
>>
>> "Each time a "defer" statement executes, the function value and 
>> parameters to the call are evaluated as usual 
>>  and saved anew but the actual function 
>> is not invoked."
>>
>> On Saturday, 26 August 2023 at 15:58:06 UTC+1 Aln Kapa wrote:
>>
>>> Hi All ! 
>>> Need some help, what am I doing wrong?
>>>
>>> https://go.dev/play/p/bBlA-i1CxNO
>>>
>>> // You can edit this code!
>>> // Click here and start typing.
>>> package main
>>>
>>> import (
>>> "errors"
>>> "fmt"
>>> )
>>>
>>> type process struct {
>>> }
>>>
>>> func (p *process) close(err error) {
>>> if err != nil {
>>> fmt.Println("error")
>>> } else {
>>> fmt.Println("no error")
>>> }
>>> }
>>> func Handle(b bool) {
>>> p := process{}
>>> var err error
>>> defer func() {
>>> p.close(err)
>>> }()
>>> if b {
>>> err = errors.New("err")
>>> }
>>> }
>>>
>>> func HandleWTF(b bool) {
>>> p := process{}
>>> var err error
>>> defer p.close(err)
>>> if b {
>>> err = errors.New("err")
>>> }
>>> }
>>>
>>> func main() {
>>> Handle(true)// error
>>> Handle(false)   // no error
>>> HandleWTF(true) // no error ?
>>> }
>>>
>> -- 
>> 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...@googlegroups.com.
>> To view this discussion on the web visit 
>> https://groups.google.com/d/msgid/golang-nuts/25846715-b3bf-4d1d-81b4-4a2799e69d27n%40googlegroups.com
>>  
>> 
>> .
>>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/75285ba7-f9aa-4d43-b136-9c3d676c9891n%40googlegroups.com.


Re: [go-nuts] Re: wtf

2023-08-26 Thread Aln Kapa
Well here is the code that works as I need, what is wrong with the previous
one ?
https://go.dev/play/p/ZW-GmEP5uqu

package main

import (
"fmt"
)

type process struct {
}

func (p *process) close(err any) {
v, _ := err.(*int)
if *v == 1 {
fmt.Println("error")
} else {
fmt.Println("no error")
}
}
func Handle(b bool) {
p := process{}
var i = 2
var pt any = 
defer func() {
p.close(pt)
}()
if b {
i = 1
}
}

func HandleWTF(b bool) {
p := process{}
var i = 2
var pt any = 
defer p.close(pt)
if b {
i = 1
}
}

func main() {
Handle(true)// error
Handle(false)   // no error
HandleWTF(true) // error
}


On Sat, Aug 26, 2023 at 6:10 PM Brian Candler  wrote:

> Any arguments to defer functions are evaluated at the time that the defer
> is executed.  In HandleWTF, defer p.close(err) is called immediately after
> err is declared with value nil, so nil is what is used.
>
> From the specification :
>
> "Each time a "defer" statement executes, the function value and
> parameters to the call are evaluated as usual
>  and saved anew but the actual function is
> not invoked."
>
> On Saturday, 26 August 2023 at 15:58:06 UTC+1 Aln Kapa wrote:
>
>> Hi All !
>> Need some help, what am I doing wrong?
>>
>> https://go.dev/play/p/bBlA-i1CxNO
>>
>> // You can edit this code!
>> // Click here and start typing.
>> package main
>>
>> import (
>> "errors"
>> "fmt"
>> )
>>
>> type process struct {
>> }
>>
>> func (p *process) close(err error) {
>> if err != nil {
>> fmt.Println("error")
>> } else {
>> fmt.Println("no error")
>> }
>> }
>> func Handle(b bool) {
>> p := process{}
>> var err error
>> defer func() {
>> p.close(err)
>> }()
>> if b {
>> err = errors.New("err")
>> }
>> }
>>
>> func HandleWTF(b bool) {
>> p := process{}
>> var err error
>> defer p.close(err)
>> if b {
>> err = errors.New("err")
>> }
>> }
>>
>> func main() {
>> Handle(true)// error
>> Handle(false)   // no error
>> HandleWTF(true) // no error ?
>> }
>>
> --
> 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 discussion on the web visit
> https://groups.google.com/d/msgid/golang-nuts/25846715-b3bf-4d1d-81b4-4a2799e69d27n%40googlegroups.com
> 
> .
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAJqqVEUE4M0Hn%3DeRi2HPePCETXwRMxqxMifpquhOp18cifgXJQ%40mail.gmail.com.


[go-nuts] Re: wtf

2023-08-26 Thread Brian Candler
Any arguments to defer functions are evaluated at the time that the defer 
is executed.  In HandleWTF, defer p.close(err) is called immediately after 
err is declared with value nil, so nil is what is used.

>From the specification :

"Each time a "defer" statement executes, the function value and parameters 
to the call are evaluated as usual  and 
saved anew but the actual function is not invoked."

On Saturday, 26 August 2023 at 15:58:06 UTC+1 Aln Kapa wrote:

> Hi All ! 
> Need some help, what am I doing wrong?
>
> https://go.dev/play/p/bBlA-i1CxNO
>
> // You can edit this code!
> // Click here and start typing.
> package main
>
> import (
> "errors"
> "fmt"
> )
>
> type process struct {
> }
>
> func (p *process) close(err error) {
> if err != nil {
> fmt.Println("error")
> } else {
> fmt.Println("no error")
> }
> }
> func Handle(b bool) {
> p := process{}
> var err error
> defer func() {
> p.close(err)
> }()
> if b {
> err = errors.New("err")
> }
> }
>
> func HandleWTF(b bool) {
> p := process{}
> var err error
> defer p.close(err)
> if b {
> err = errors.New("err")
> }
> }
>
> func main() {
> Handle(true)// error
> Handle(false)   // no error
> HandleWTF(true) // no error ?
> }
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/25846715-b3bf-4d1d-81b4-4a2799e69d27n%40googlegroups.com.


[go-nuts] wtf

2023-08-26 Thread Aln Kapa
Hi All ! 
Need some help, what am I doing wrong?

https://go.dev/play/p/bBlA-i1CxNO

// You can edit this code!
// Click here and start typing.
package main

import (
"errors"
"fmt"
)

type process struct {
}

func (p *process) close(err error) {
if err != nil {
fmt.Println("error")
} else {
fmt.Println("no error")
}
}
func Handle(b bool) {
p := process{}
var err error
defer func() {
p.close(err)
}()
if b {
err = errors.New("err")
}
}

func HandleWTF(b bool) {
p := process{}
var err error
defer p.close(err)
if b {
err = errors.New("err")
}
}

func main() {
Handle(true)// error
Handle(false)   // no error
HandleWTF(true) // no error ?
}

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/380f3947-dcb8-4996-9031-60b555090204n%40googlegroups.com.


Re: [go-nuts] does gonum insist on row-major?

2023-08-26 Thread Brian Candler
Could you explain the comment "all of Go is cm"?
https://go.dev/play/p/tDJiSTqsiSC

On Saturday, 26 August 2023 at 14:02:34 UTC+1 Dan Kortschak wrote:

> On Sat, 2023-08-26 at 13:45 +0100, Jason E. Aten wrote:
> > ah... there is documentation, it is just buried...
> > 
> > https://pkg.go.dev/gonum.org/v1/gonum/mat#section-readme
> > 
> > "All matrices are stored in row-major format and users should
> > consider this when expressing matrix arithmetic to ensure optimal
> > performance."
> > 
> > Seems odd not to allow both; since this is usually very important for
> > perf.
>
> The original Cgo code did allow both. The maintenance burden or
> providing both for the Go implementation would have been far too
> onerous, so the column-major implementation option was remove from the
> Cgo wrapper for parity.
>
> I don't think the docs are buried; that is the first place people will
> look in general.
>
> FWIW The choice between rm and cm is difficult; all of Go is cm. All of
> Fortran is cm (also any GPU code). We've had this discussion internally
> and probably if we did it again, we might have chosen cm, but then we'd
> get people complaining that they can't represent matrices in source
> easily.
>
> Dan
>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/5782b6e8-7e1c-4a7e-8982-6f39b217b866n%40googlegroups.com.


Re: [go-nuts] does gonum insist on row-major?

2023-08-26 Thread 'Dan Kortschak' via golang-nuts
On Sat, 2023-08-26 at 13:45 +0100, Jason E. Aten wrote:
> ah... there is documentation, it is just buried...
> 
> https://pkg.go.dev/gonum.org/v1/gonum/mat#section-readme
> 
> "All matrices are stored in row-major format and users should
> consider this when expressing matrix arithmetic to ensure optimal
> performance."
> 
> Seems odd not to allow both; since this is usually very important for
> perf.

The original Cgo code did allow both. The maintenance burden or
providing both for the Go implementation would have been far too
onerous, so the column-major implementation option was remove from the
Cgo wrapper for parity.

I don't think the docs are buried; that is the first place people will
look in general.

FWIW The choice between rm and cm is difficult; all of Go is cm. All of
Fortran is cm (also any GPU code). We've had this discussion internally
and probably if we did it again, we might have chosen cm, but then we'd
get people complaining that they can't represent matrices in source
easily.

Dan

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/db555a3daa5d92c268e6c9bcb9d9e043ba371935.camel%40kortschak.io.


[go-nuts] Re: does gonum insist on row-major?

2023-08-26 Thread Jan
Not exactly what you asked, but something that you may consider: GoMLX 
. It's an accelerated ML and Math library 
that uses XLA  --> it just-in-time compiles 
a computation graph to CPU/GPU (and hopefully soon TPU). It powers 
Jax/Tensorflow and is really fast (after the first execution).

Now, while pretty rich set of functionality, it's not a super-set of Gonum 
(it has some stuff not available in Gonum also). If anything is missing, 
but is supported by XLA , 
I would be happy to add. Plus it's well documented (see tutorial 
). 
Storage is row-major for 2d-tensors by default -- but internally it may 
reshuffle storage depending on optimization.

ps.: It's a biased suggestion (plus a bit of advertisement) because I 
created the project.

On Saturday, August 26, 2023 at 2:14:22 PM UTC+2 Jason E. Aten wrote:

> I do alot of stats/numerical stuff but I haven't tried gonum until now.
>
> Yesterday I went to port a bunch of C code that uses BLAS/LAPACK
> into Go, and thought I'd try it (Gonum) out.  Now the logic is the original
> code is very hairy, and does delicate operations like a bunch
> of QR decompositions... in short, I don't want to mess with the
> algorithm at all, I just want to port it to Go. The C original code runs 
> fine against
> OpenBLAS. Of course, being numeric code, it all assumes column-major
> Fortran style matrices.
>
> But when I tried to run the same logic on Gonum, I was hitting issues
> left and right. At first I thought they were bugs in Gonum. But then
> I realized, by default Gonum is assuming that your matrices will
> be row-major (C-style).
>
> There's almost zero documentation for gonum of these kinds of
>  assumptions and even less about how to use
> Gonum Like how do you switch between the Go and C BLAS implementation?
> Not documented; that I can find. You would think this would be front and 
> center. Ugh.
>
> Anyway: somebody here probably knows-- does Gonum also support column-major
> matrices?  In the Go BLAS, or in a cgo binding to OpenBLAS?
>
> With Bewildered Thanks.
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/3b21ad7c-6bf2-4806-8d16-e5967a7bbe0fn%40googlegroups.com.


Re: [go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Jan Mercl
On Sat, Aug 26, 2023 at 2:33 PM Jason E. Aten  wrote:
>
> Is there any IDE that allows you to jump through a stack trace like emacs 
> does?

I think many code editors can do that, for example vim:
https://vim.fandom.com/wiki/Open_file_under_cursor

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAA40n-VY54WdM2bC8ev-SWdXSpAJPpXyadea81xsmUJEuqcvxQ%40mail.gmail.com.


[go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Mike Schinkel
If I understand what you are asking then JetBrains GoLand does. 

I do not know if there is a way to use the keyboard, but it does provides 
links you can click when it displays the call stack on panic.

-Mike

On Saturday, August 26, 2023 at 8:33:08 AM UTC-4 Jason E. Aten wrote:

> Is there any IDE that allows you to jump through a stack trace like emacs 
> does?
>
> e.g. If I have a panic on a run, with two keystrokes I can jump to the 
> origin
> of the panic, and then their caller, and then the parent caller, and then 
> up to
> the grandparent on the call stack... instantly. I've never found this 
> essential
> functionality elsewhere, but maybe I'm just not familiar... A friend of 
> mine tried
> to add it to Visual Studio and gave up... it was just too hard for VS. But 
> maybe JetBrains has it??
>
> I'd love to try an IDE other than emacs, but this is a fundament thing, 
> that I cannot give up.
>
> On Friday, August 25, 2023 at 6:21:35 PM UTC+1 Mike Schinkel wrote:
>
>> Yes, as Luke Crook mentioned I think those requirements are more ALM 
>> functionality than IDE functionality.  
>>
>> Generally, ALM addresses concerns broader than individual concerns 
>> whereas IDEs are more focused on individual productivity.
>>
>> Just my opinion, but I would expect you'd be better off finding an ALM 
>> solution and then an IDE that integrates with that ALM, or vice versa, i.e. 
>> find an IDE that integrates with an ALM and then use that ALM.
>>
>> #fwiw
>>
>> -Mike
>> On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote:
>>
>>> Hi All !
>>>
>>> Considering that IBM's punch cards were bearing at least twice, I would 
>>> vote for them. :-)
>>>
>>> Of cource I do agree with them who wrote that to feel comfortable "under 
>>> fingers" is great !
>>>
>>> So, the tasks to code - they are different. 
>>> Sometimes it is possible to keep all the details regards to the task in 
>>> a head or several.
>>> Sometimes it is nesessary to write say a hard copy of them(details) on a 
>>> paper with a different size.
>>>
>>> But in case the task from the area of the "poorly formalized". You spend 
>>> paper quickly. :-)
>>>
>>> The Luke Crook points to:
>>> https://en.wikipedia.org/wiki/Application_lifecycle_management
>>>
>>> I will simplify the task somewhat and take from ALM for example even 
>>> less than SDLC, namely:
>>> requirements, design, implementation, testing, deployment.
>>>
>>> 1. Requirements must be described somewhere.
>>> 2. Design artifacts should reflect requirements.
>>> 3. Design decisions refer to objects and messages that
>>> implemented in the form of classes and operations.
>>> 4. Each operation must pass at least one test.
>>> All tests must be passed successfully.
>>> 5. The application is assembled and installed there and 
>>> the tests are successfully passed again.
>>>
>>> Question: is there any IDE or plugin which one support that kind of 
>>> dependencies in a graphical mode ?
>>>
>>> Thank you.
>>>
>>> вторник, 22 августа 2023 г. в 18:22:52 UTC+3, Mike Schinkel: 
>>>
 On Saturday, August 19, 2023 at 5:27:34 AM UTC-4 alex-coder wrote:

 What I'm looking for is the ability to manage dependencies not only in 
 code,
 but entirely in a project from requirements to deployment.


 I assume you mean a lot more than just Go package dependencies, as `go 
 mod` handles those nicely.

 Can you elaborate on the specific dependencies you are trying to 
 manage?  In specific, vs generalities.

 -Mike  

>>>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/c8b2e710-240b-4f4a-ae80-3142578673d3n%40googlegroups.com.


Re: [go-nuts] does gonum insist on row-major?

2023-08-26 Thread Jason E. Aten
ah... there is documentation, it is just buried...

https://pkg.go.dev/gonum.org/v1/gonum/mat#section-readme

"All matrices are stored in row-major format and users should consider this
when expressing matrix arithmetic to ensure optimal performance."

Seems odd not to allow both; since this is usually very important for perf.

On Sat, Aug 26, 2023 at 1:14 PM Jason E. Aten  wrote:

> I do alot of stats/numerical stuff but I haven't tried gonum until now.
>
> Yesterday I went to port a bunch of C code that uses BLAS/LAPACK
> into Go, and thought I'd try it (Gonum) out.  Now the logic is the original
> code is very hairy, and does delicate operations like a bunch
> of QR decompositions... in short, I don't want to mess with the
> algorithm at all, I just want to port it to Go. The C original code runs
> fine against
> OpenBLAS. Of course, being numeric code, it all assumes column-major
> Fortran style matrices.
>
> But when I tried to run the same logic on Gonum, I was hitting issues
> left and right. At first I thought they were bugs in Gonum. But then
> I realized, by default Gonum is assuming that your matrices will
> be row-major (C-style).
>
> There's almost zero documentation for gonum of these kinds of
>  assumptions and even less about how to use
> Gonum Like how do you switch between the Go and C BLAS implementation?
> Not documented; that I can find. You would think this would be front and
> center. Ugh.
>
> Anyway: somebody here probably knows-- does Gonum also support column-major
> matrices?  In the Go BLAS, or in a cgo binding to OpenBLAS?
>
> With Bewildered Thanks.
>
>
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/CAPNEFAaT9fwg9pOq2qaoagazH5h1kOYVw3dGs9UuSYYW_xAECQ%40mail.gmail.com.


[go-nuts] Re: Would it be possible to make this work in the future?

2023-08-26 Thread Jan
Notice that if you don't assign to `tok`, multiple alternatives in `case` 
works.

But the issue is that in Go there are no "duck typing" for data, only for 
methods (interfaces).  `xml.StartElement` and `xmlEndElement` not being the 
same type, the assignment ('tok.name.Local = "types"`) won't work.

Would converting to a method,  something like this 
, work for you  ? It could be changed by 
making the interface "Named" the type to match in the `switch` clause. 
There are many alternatives, the key point is when you are trying to share 
functionality (or data) across different types, it is usually done using 
common interfaces.


On Friday, August 25, 2023 at 4:44:02 PM UTC+2 محمد بومنذر wrote:

> Greetings everyone,
>
> I'm writing a parser based on Go's `encoding/xml`, I tried to use the 
> following pattern but it was deemed invalid:
>
> ```
> switch tok := p.tok.(type) {
> case xml.StartElement, xml.EndElement:
> tok.Name.Local == "types"
> }
>
>
> ```
> To me, it'd make sense if it was allowed since both types are structs and 
> both of them share the field `Name` with the subsequent field `Local`.
>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d2c96949-155a-43e5-9fc3-1a294f59e31cn%40googlegroups.com.


[go-nuts] Re: Best IDE for GO ?

2023-08-26 Thread Jason E. Aten
Is there any IDE that allows you to jump through a stack trace like emacs 
does?

e.g. If I have a panic on a run, with two keystrokes I can jump to the 
origin
of the panic, and then their caller, and then the parent caller, and then 
up to
the grandparent on the call stack... instantly. I've never found this 
essential
functionality elsewhere, but maybe I'm just not familiar... A friend of 
mine tried
to add it to Visual Studio and gave up... it was just too hard for VS. But 
maybe JetBrains has it??

I'd love to try an IDE other than emacs, but this is a fundament thing, 
that I cannot give up.

On Friday, August 25, 2023 at 6:21:35 PM UTC+1 Mike Schinkel wrote:

> Yes, as Luke Crook mentioned I think those requirements are more ALM 
> functionality than IDE functionality.  
>
> Generally, ALM addresses concerns broader than individual concerns whereas 
> IDEs are more focused on individual productivity.
>
> Just my opinion, but I would expect you'd be better off finding an ALM 
> solution and then an IDE that integrates with that ALM, or vice versa, i.e. 
> find an IDE that integrates with an ALM and then use that ALM.
>
> #fwiw
>
> -Mike
> On Wednesday, August 23, 2023 at 7:21:46 AM UTC-4 alex-coder wrote:
>
>> Hi All !
>>
>> Considering that IBM's punch cards were bearing at least twice, I would 
>> vote for them. :-)
>>
>> Of cource I do agree with them who wrote that to feel comfortable "under 
>> fingers" is great !
>>
>> So, the tasks to code - they are different. 
>> Sometimes it is possible to keep all the details regards to the task in a 
>> head or several.
>> Sometimes it is nesessary to write say a hard copy of them(details) on a 
>> paper with a different size.
>>
>> But in case the task from the area of the "poorly formalized". You spend 
>> paper quickly. :-)
>>
>> The Luke Crook points to:
>> https://en.wikipedia.org/wiki/Application_lifecycle_management
>>
>> I will simplify the task somewhat and take from ALM for example even less 
>> than SDLC, namely:
>> requirements, design, implementation, testing, deployment.
>>
>> 1. Requirements must be described somewhere.
>> 2. Design artifacts should reflect requirements.
>> 3. Design decisions refer to objects and messages that
>> implemented in the form of classes and operations.
>> 4. Each operation must pass at least one test.
>> All tests must be passed successfully.
>> 5. The application is assembled and installed there and 
>> the tests are successfully passed again.
>>
>> Question: is there any IDE or plugin which one support that kind of 
>> dependencies in a graphical mode ?
>>
>> Thank you.
>>
>> вторник, 22 августа 2023 г. в 18:22:52 UTC+3, Mike Schinkel: 
>>
>>> On Saturday, August 19, 2023 at 5:27:34 AM UTC-4 alex-coder wrote:
>>>
>>> What I'm looking for is the ability to manage dependencies not only in 
>>> code,
>>> but entirely in a project from requirements to deployment.
>>>
>>>
>>> I assume you mean a lot more than just Go package dependencies, as `go 
>>> mod` handles those nicely.
>>>
>>> Can you elaborate on the specific dependencies you are trying to 
>>> manage?  In specific, vs generalities.
>>>
>>> -Mike  
>>>
>>

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/ba7b55ac-826e-42c2-8695-376441e7915en%40googlegroups.com.


[go-nuts] does gonum insist on row-major?

2023-08-26 Thread Jason E. Aten
I do alot of stats/numerical stuff but I haven't tried gonum until now.

Yesterday I went to port a bunch of C code that uses BLAS/LAPACK
into Go, and thought I'd try it (Gonum) out.  Now the logic is the original
code is very hairy, and does delicate operations like a bunch
of QR decompositions... in short, I don't want to mess with the
algorithm at all, I just want to port it to Go. The C original code runs 
fine against
OpenBLAS. Of course, being numeric code, it all assumes column-major
Fortran style matrices.

But when I tried to run the same logic on Gonum, I was hitting issues
left and right. At first I thought they were bugs in Gonum. But then
I realized, by default Gonum is assuming that your matrices will
be row-major (C-style).

There's almost zero documentation for gonum of these kinds of
 assumptions and even less about how to use
Gonum Like how do you switch between the Go and C BLAS implementation?
Not documented; that I can find. You would think this would be front and 
center. Ugh.

Anyway: somebody here probably knows-- does Gonum also support column-major
matrices?  In the Go BLAS, or in a cgo binding to OpenBLAS?

With Bewildered Thanks.

-- 
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 discussion on the web visit 
https://groups.google.com/d/msgid/golang-nuts/d5586b79-0d3c-4a92-ba12-358a50a080ddn%40googlegroups.com.