Re: [go-nuts] gollvm build failed

2022-02-25 Thread T Odin
Hi Than, I see there is malloc.h present in that path. But, cmake throws one more error even before the mmap issue: *-- Performing Test SPLIT_STACK_FUNCTIONAL* *-- Performing Test SPLIT_STACK_FUNCTIONAL - Failed* *-- trying -fcf-protection=none workaround* *-- Performing Test SPLIT_STACK_WORKAROU

[go-nuts] Improving on unit test styles

2022-02-25 Thread 'Markus Zimmermann' via golang-nuts
Hi Gophers! We were unhappy with the common unit test styles and we think we found a style that has clear advantages. An in-depth comparison can be found here https://symflower.com/en/company/blog/2022/better-table-driven-testing. We also added support for maintaining such tests in our VS Code

Re: [go-nuts] Aligning loops in Go assembly

2022-02-25 Thread Ian Lance Taylor
On Fri, Feb 25, 2022 at 1:25 AM Wojciech Muła wrote: > > Thanks! Didn't know that the assembler is able to do this. TBH, for me, it's > not desired behaviour when an assembler program does something extra to a > low-level code. I have already observed that Go asm strips a series of NOPs, > whic

Re: [go-nuts] Is there a way to specify or use the tmp directory used in testing?

2022-02-25 Thread Leam Hall
My apologies for taking so long to respond; a new job and cold weather have taken up most of my time. I have two versions of the application; one CLI and one web. The programs create characters for games and fiction, and use data text files relative to the binary ( /data/* ) to get names. The

Re: [go-nuts] Aligning loops in Go assembly

2022-02-25 Thread 'Keith Randall' via golang-nuts
I don't think PCALIGN is supported for x86. The assembler can parse the instruction, but the x86 assembler backend can't generate machine code for it. Wouldn't be hard to add, I think. There's already disabled experimental code in there for aligning loops. On Friday, February 25, 2022 at 1:25:3

[go-nuts] Re: Environment setup for developing golang/go

2022-02-25 Thread Francesco Mari
Thanks for sharing this! Picking up on that configuration, I found this piece of documentation about gopls [1]. I followed these steps: - Check out github.com/golang/go to /Users/frm/src/go. - Build the language distribution as described here [2]. - Create a new VSCode workspace at /User

[go-nuts] Re: are Go generics more like C++ or more like Java?

2022-02-25 Thread Markus Heukelom
Correction: - it must be possible to express that T is comparable (so that you can use map[K]V, were K must be comparable) - it must be possible restrict T to a concrete list of types (f.e. min(a, b T) T must be possible to write) On Friday, February 25, 2022 at 11:13:01 AM UTC+1 Markus Heukelo

[go-nuts] Re: are Go generics more like C++ or more like Java?

2022-02-25 Thread Markus Heukelom
I think the consensus in the Go community is to refrain from comparing Go language features with other programming languages. Rationale ~: - it is highly contentious - it is very difficult to answer, it's like asking "is purple more blue or more red" - no matter the answer, it will not help you

Re: [go-nuts] Aligning loops in Go assembly

2022-02-25 Thread Wojciech Muła
Thanks! Didn't know that the assembler is able to do this. TBH, for me, it's not desired behaviour when an assembler program does something extra to a low-level code. I have already observed that Go asm strips a series of NOPs, which is highly unexpected. A directive for alignment is way cleare

Re: [go-nuts] Aligning loops in Go assembly

2022-02-25 Thread Brian Candler
Oops, I see it's disabled; but the knob is there if you want to experiment. On Friday, 25 February 2022 at 08:35:10 UTC Brian Candler wrote: > It seems to me that there is automatic alignment for loops: > > https://github.com/golang/go/blob/go1.17.7/src/cmd/internal/obj/x86/asm6.go#L51-L67 > > >

Re: [go-nuts] Aligning loops in Go assembly

2022-02-25 Thread Brian Candler
It seems to me that there is automatic alignment for loops: https://github.com/golang/go/blob/go1.17.7/src/cmd/internal/obj/x86/asm6.go#L51-L67 On Friday, 25 February 2022 at 06:42:23 UTC Wojciech Muła wrote: > The directive is not documented on https://pkg.go.dev/cmd/internal/obj/x86. > `grep