Re: [go-nuts] Dynamically loading custom passes with gollvm?

2022-04-09 Thread Ian Lance Taylor
On Sat, Apr 9, 2022 at 8:28 PM Balamurugan Marimuthu wrote: > > I see I can invoke the following and see the steps 'go build' is doing. > > % go build -work -x mypackage.go 1> transcript.txt 2>&1 > > I struggle to understand how can I load my custom pass created as a shared > library? > > I was l

Re: [go-nuts] Generic arguments in recursive functions

2022-04-09 Thread Ian Lance Taylor
On Sat, Apr 9, 2022 at 8:28 PM Aidan Hahn wrote: > > I am playing with the generics that were added in go 1.18 and noticed an odd > discrepancy that I have not been able to find an authoritative answer to. > Consider the following data type, as well as the function defined for it: > > type Node[

[go-nuts] Statically Typed Context

2022-04-09 Thread 'Adam Berkan' via golang-nuts
Khan Academy Engineering Blog Post: https://blog.khanacademy.org/statically-typed-context-in-go/ Khan Academy has been porting our backend from Python to Go. One thing we hoped to get from it was fewer uses of implicit global resources and request data. We looked at explicitly passing everyt

[go-nuts] Detecting external dependencies in non-Go files

2022-04-09 Thread 'Rodrigo Queiro' via golang-nuts
Hi all, The go-licenses tool helps automate the license review process by analyzing the licenses of a Go package's dependencies. It uses x/tools/go/packages to visit the dependencies and maps these to l

Re: [go-nuts] Missing /usr/lib/go/pkg/include/ for native binaries

2022-04-09 Thread Zach Hoffman
Looks like golang-1.18-go owns /usr/lib/go-1.18/pkg/include <<'SH_COMMANDS' docker run --rm -i debian:bookworm sh apt update && apt -y install apt-file && apt-file update && apt-file search /usr/lib/go-1.18/pkg/include SH_COMMANDS On Saturday, April 9, 2022 at 1:33:04 AM UTC-6 Brian Candler wrote:

[go-nuts] Dynamically loading custom passes with gollvm?

2022-04-09 Thread Balamurugan Marimuthu
Hi there, I see I can invoke the following and see the steps 'go build' is doing. % go build -work -x mypackage.go 1> transcript.txt 2>&1 I struggle to understand how can I load my custom pass created as a shared library? I was looking for something like this which is done with Clang: clang -X

[go-nuts] Generic arguments in recursive functions

2022-04-09 Thread Aidan Hahn
Hello Go users! I am playing with the generics that were added in go 1.18 and noticed an odd discrepancy that I have not been able to find an authoritative answer to. Consider the following data type, as well as the function defined for it: type Node[T any] struct { Inner T Next *Node

[go-nuts] Packages for Accessing .a Archives?

2022-04-09 Thread jlfo...@berkeley.edu
Other than what's in the Go distribution, I haven't been able to find any packages for accessing .a archives. Is there anything else out there? Google wasn't helpful. Cordially, Jon Forrest -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

[go-nuts] Re: go/wasm how to test browser APIs

2022-04-09 Thread Corin Lawson
I suppose you need to load and run the tests in browser... this might help: https://github.com/agnivade/wasmbrowsertest On Friday, 8 April 2022 at 9:31:59 pm UTC+10 mi...@ubo.ro wrote: > I'm trying to unitest a browser wasm/js application but it seems that the > browser objects are missing. I a

Re: [go-nuts] Structured configuration in Go

2022-04-09 Thread Andrew Pillar
> Out of interest, have you come across CUE? > I have heard of it, but not explored it in depth. At a glance it seems too heavyweight for what I wanted. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rec

Re: [go-nuts] Structured configuration in Go

2022-04-09 Thread Paul Jolly
Out of interest, have you come across CUE? https://cuelang.org/ On Sat, 9 Apr 2022, 15:31 Andrew Pillar, wrote: > An article I wrote about a new configuration library I developed in Go > for working with structured configuration. > > Article: > > https://andrewpillar.com/programming/2022/04/09/

Re: [go-nuts] Game Of Life in Go : Any comments welcome (I'm not sure I have implemented it correctly)

2022-04-09 Thread Serge Hulne
Cool. Thanks. Please, let me know if my implementation is correct, if you have time and if your'e interested. :-) On Saturday, 9 April 2022 at 17:52:22 UTC+2 Jan Mercl wrote: > One more variant at > https://www.reddit.com/r/golang/comments/14s59i/conways_game_of_life_by_jan_mercl/ > > ;-) >

Re: [go-nuts] Game Of Life in Go : Any comments welcome (I'm not sure I have implemented it correctly)

2022-04-09 Thread Jan Mercl
One more variant at https://www.reddit.com/r/golang/comments/14s59i/conways_game_of_life_by_jan_mercl/ ;-) On Sat, Apr 9, 2022, 17:39 Serge Hulne wrote: > I have just published on Github one possible implementation of Conway's > Game of Life in Go: > > https://github.com/serge-hulne/Game-of-life

[go-nuts] Game Of Life in Go : Any comments welcome (I'm not sure I have implemented it correctly)

2022-04-09 Thread Serge Hulne
I have just published on Github one possible implementation of Conway's Game of Life in Go: https://github.com/serge-hulne/Game-of-life-go/ It seems to work, however it might be buggy. Feel free to file a bug report under "Issues", if you find an error in the impementation. -- You received

Re: [go-nuts] float exactness

2022-04-09 Thread 'Jack Li' via golang-nuts
Thanks Robert, It is great! a, _ := decimal.NewFromString("0.1") b, _ := decimal.NewFromString("0.2") c := a.Add(b) fmt.Println("decimal:", c) a = decimal.NewFromFloat(0.1) b = decimal.NewFromFloat(0.2) c = a.Add(b) fmt.Println("

Re: [go-nuts] float exactness

2022-04-09 Thread Brian Hatfield
Here's a more general explanation of why floating point operations didn't do what you expected: https://floating-point-gui.de/basic/ On Sat, Apr 9, 2022 at 9:56 AM 'Jack Li' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Hi group, > > 1. > Is there a package can do exact float operation

[go-nuts] Structured configuration in Go

2022-04-09 Thread Andrew Pillar
An article I wrote about a new configuration library I developed in Go for working with structured configuration. Article: https://andrewpillar.com/programming/2022/04/09/structured-configuration-in-go/ Repo: https://github.com/andrewpillar/config -- You received this message because you are sub

Re: [go-nuts] float exactness

2022-04-09 Thread Robert Engels
There are several. See github.com/robaho/fixed As to why, read up on numerical analysis. It’s an interesting topic. > On Apr 9, 2022, at 8:56 AM, 'Jack Li' via golang-nuts > wrote: > >  > Hi group, > > 1. > Is there a package can do exact float operations, like Decimal in Python? For >

[go-nuts] float exactness

2022-04-09 Thread 'Jack Li' via golang-nuts
Hi group, 1.  Is there a package can do exact float operations, like Decimal in Python? For example: x := 0.1; y := 0.2; z := x + y; z will be exact 0.3 2. Why literal operation is exact, variable is not? fmt.Println(0.1 + 0.2) // 0.3 exactly fmt.Println(x + y) // 0.30004

Re:[go-nuts] Re: MaxDiskSize MaxLogCount for glog?

2022-04-09 Thread 'Jack Li' via golang-nuts
Is it still maintained? The last commit is Aug 20, 2021 which is more than half year ago. The last commit of glog in C++ is just 5 days ago. -- Original -- From: "peterGo"https://github.com/golang/glog#glog   "The code in this repo is for export only and i

Re: [go-nuts] Missing /usr/lib/go/pkg/include/ for native binaries

2022-04-09 Thread Brian Candler
Are you sure Debian didn't split it into multiple packages, like a separate "golang-src" package perhaps? On Friday, 8 April 2022 at 13:49:28 UTC+1 sunto...@gmail.com wrote: > On Fri, Apr 8, 2022 at 2:00 AM Jack Li wrote: > > > > Yes, I download the latest go 1.18 installer for macOS from > go