Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-27 Thread Kevin Chowski
Note that these samples are not semantically equivalent, so that may factor into the choice between the two for more complex examples. While using 'with', if the pipeline value comes out "empty" then the entire 'with' block is skipped. That may have implications in both the short and long term

[go-nuts] Looking for a way letting gopls ignore the _test.go files

2025-05-27 Thread Lin Lin
Hi, gophers When reading Go code, one always needs to find the references of a function or a constant. Those references in the _test.go can be very noisy. I'll be great if there is a way to let gopls ignore those files. I failed to find such a way or configuration in gopls. I've learned that gop

Re: [go-nuts] Spooky: http.Error(w, [text], [statusCode]) responds the code without the text

2025-05-27 Thread Zhaoxun Yan
Thank you very much, Alexander! I tried let text if (re.status) { text = await.re.text() console.log(text) } == and it works! On Mon, May 26, 2025 at 5:12 PM Alexander Ertli < ertli.alexan...@googlemail.com> wrote: > Hey! > > I saw your post and to me it looks lik

Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-26 Thread Paul Baker
> I'd consider both to be perfectly reasonable ways of going about > what you're doing. [...] And most of the time I would likely pick example 1 Thanks Nick. Example 1 is my preference as well - I'm a fan of the Zen of Python's "Explicit is better than implicit" and "Flat is better than nested".

Re: [go-nuts] eXtensible Markup for Go

2025-05-26 Thread Robert Engels
It’s already there. Read up on go templates. On May 26, 2025, at 4:42 PM, Hydroper wrote:I have been looking for whether Go could be used for creating user-facing apps. If so, it would be useful to support eXtensible markup directly nested in Go code, in the form of eXtensible Markup Language (XM

[go-nuts] eXtensible Markup for Go

2025-05-26 Thread Hydroper
I have been looking for whether Go could be used for creating user-facing apps. If so, it would be useful to support eXtensible markup directly nested in Go code, in the form of eXtensible Markup Language (XML), which translates to complex nodes that may be used for rendering GUI in reactive mo

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Robert Engels
Not my observation - it’s in the Go docs :)On May 26, 2025, at 2:51 PM, Jason E. Aten wrote:Interesting observation, thanks Robert!  I'll have to think about that more.Off the cuff, I don't think they mutually exclusive. Randomness might benefit liveness properties too/not just a safety ones.On M

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Jason E. Aten
Interesting observation, thanks Robert! I'll have to think about that more. Off the cuff, I don't think they mutually exclusive. Randomness might benefit liveness properties too/not just a safety ones. On Monday, May 26, 2025 at 12:58:17 PM UTC+1 Robert Engels wrote: I am pretty sure that isn

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Robert Engels
I am pretty sure that isn’t correct. You can still easily create deadlocks. The reason it is random is to avoid channel starvation. On May 26, 2025, at 2:09 AM, Jason E. Aten wrote:Since I've been researching reproducible simulation testing recently, andthinking about how to maximize determinism,

Re: [go-nuts] Prefer named variables or "with" in templates?

2025-05-26 Thread Nick White
Hi Paul, On Sun, May 25, 2025 at 03:08:12PM +1000, Paul Baker wrote: > Should I prefer one over the other? Which of these (if either) would > be considered idiomatic? > > 1. > {{- $resource := .Page.Resources.Get $path -}} > {{- $lines := split $resource.Content "\n" | after $skip_lines -}} > {{-

Re: [go-nuts] Spooky: http.Error(w, [text], [statusCode]) responds the code without the text

2025-05-26 Thread 'Alexander Ertli' via golang-nuts
Hey! I saw your post and to me it looks like the issue is in your JavaScript code. You're using response.statusText, which is *not* the response body. It's expected to see exactly what you're observing, because statusText just gives you the standard reason phrase for the status code (like "Forbidd

[go-nuts] Spooky: http.Error(w, [text], [statusCode]) responds the code without the text

2025-05-26 Thread Zhaoxun Yan
Hi All! I am stuck with this bizarre phenomenon that the http.Error function does not repond with the customizable text defined by the second argument. Suppose a simple ill http server with this function that responds an error as always: -- func (con *Net) ServeHTTP(w ht

Re: [go-nuts] Guaranteeing deterministic execution of Golang code

2025-05-26 Thread Jason E. Aten
Since I've been researching reproducible simulation testing recently, and thinking about how to maximize determinism, I was reading this two year old thread. I had a "lightbulb over the head" moment. I realized _why_ Go's select statement, from CSP, from Dijkstra's guarded commands, is specifie

[go-nuts] Prefer named variables or "with" in templates?

2025-05-25 Thread Paul Baker
I'm writing a simple Go template. Specifically, it's a Hugo shortcode that includes a page resource's content into a page, skipping a few lines. Both of these approaches work (but piping the output of `after` into `delimit` doesn't work, because `delimit` takes its arguments in the wrong order).

[go-nuts] dmap, deterministic map iterator order for DST

2025-05-24 Thread Jason E. Aten
I needed deterministic map iteration order for my deterministic simulation testing (using the new testing/synctest package -- experimental in go1.24, but proposal approved to move forward, yay!) so I wrote a "dmap" which provides repeatably ordered full range scan for keys that can be turned into

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread Jason E. Aten
It's a tour de force. You might especially enjoy the 18:00+ minute in discussion of the premature declarations about the death of Moore's law. He argues that if your design today makes the CPU wait on the network, then in two years you'll be waiting twice as long; this leads to a fascinating d

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread Robert Engels
One other point, my quick research shows the fastest processors can only process about 256 gb/sec with most around 100 gb/sec. I’m not saying that ultra fast networks don’t change the dynamics, but it’s been this way for a while. I plan on watching the video so maybe I am missing something and I’ll

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread Robert Engels
That last part is what is incorrect in my opinion. Even if the network bandwidth exceeds the memory bandwidth there is the IO overhead - which means that remote memory will be slower than local memory - as the remote memory still goes through the bus plus the overhead. On May 24, 2025, at 8:01 PM,

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread Jason E. Aten
He does claim that bandwidth for peer to peer, saying > 800 Gbps on a single link and https://www.tomshardware.com/news/800-gigabit-ethernet-gbe-spec-standard seems to confirm that, if I'm reading it right. You seem to be saying that memory is always the bottleneck. I don't think we disagree ther

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread robert engels
To elaborate, the entire way the “cloud” works - is by multiplexing jobs and their data across multiple machines - this is how Google BigQuery achieves sub-second responses searching terabytes of data. But this paradigm has been around for a long time - nothing new. Maybe I misread, but the gis

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread robert engels
I understand, but it makes no practical sense. The 800GB/sec is the throughput the fabric, not a peer to peer rate. So yes, the network can support multiple clients at a TOTAL rate greater than the speed of an individual machine - eventually the data goes through the memory bus of a machine. >

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread Jason E. Aten
In the video, https://www.infoq.com/presentations/redesign-oltp/ at 14:00 minutes in is what I was referring to. Greef shows a graph from Roland Dreier and cites his blog post, see Figure 1 of that blog. He points out the flip from 2020 to 2023. https://blog.enfabrica.net/the-next-step-in-high

Re: [go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread robert engels
That doesn’t make sense. Memory can’t be slower than disk - disk is either physical, or memory backed - which means its upper speed limit is the memory speed limit. If the presentation means to imply that ethernet is so fast - faster than memory busses themselves - that you could fan out to ach

[go-nuts] great talk on database/memory trends, DST, and the weaknesses of Raft

2025-05-24 Thread Jason E. Aten
This is an amazing talk from last year 2024 March 22 Qcon from the TigerBeetle CEO, Joran Greef. Zig has lessons for Go. "Redesigning OLTP for a New Order of Magnitude" https://www.infoq.com/presentations/redesign-oltp/ Early on the talks covers that latest trends in memory vs network vs disk, (h

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-24 Thread Kurtis Rader
The problem starts with these two lines: > var i = []i_t{{help}} > var t = []i_t{{fish}} You are initializing the structs with the values stored in `help` and `fish`, not references to those variables. Thus, when you change the value stored in the struct it has no effect on the variables from whi

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-24 Thread 'jlfo...@berkeley.edu' via golang-nuts
Bingo! This solves the problem. You win the prize! I hope this discussion helps other people facing similar problems. Jon -- 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

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-24 Thread Mikk Margus
Sorry, I seem to have copy-pasted your Go Playground link instead of mine, assuming "share" would place it in my clipboard automatically. https://go.dev/play/p/8XajdwXDdqW This is what I meant to share. It outputs the following: ``` before: help = falsestruct = [{%!t(*bool=0xc1006d)}]

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-24 Thread 'jlfo...@berkeley.edu' via golang-nuts
Thanks for your and Brian's replies. But, unless I'm missing something, neither solve the problem. I ran both of them in the Go Playground and they both produced the same incorrect result. The result I'm looking for would be: before: help = false struct = [{false}] after: help = true struct =

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-24 Thread Mikk Margus
As far as I can tell, they're asking for a way for `var help`/`var fish` etc. to get updated alongside the attribute `i_t.arg` in the update methods. This example accomplishes this. https://go.dev/play/p/7y5COCLU5EP Do note that it crashes and burns if the pointer is not of the expected type, a

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-24 Thread 'Brian Candler' via golang-nuts
Or you can use a setter method: https://go.dev/play/p/W9Cz2PO8NeK On Saturday, 24 May 2025 at 03:39:34 UTC+1 Def Ceb wrote: > You're creating new copies of the values and modifying the copies, rather > than storing a reference and then modifying the original data through it. > You'd use *string

Re: [go-nuts] Question About Interface Field in a Structure

2025-05-23 Thread Def Ceb
You're creating new copies of the values and modifying the copies, rather than storing a reference and then modifying the original data through it. You'd use *string and *bool there to have both change. This would be somewhat tedious and involve a good amount of type casting though, if you were to

[go-nuts] Question About Interface Field in a Structure

2025-05-23 Thread 'jlfo...@berkeley.edu' via golang-nuts
I'm trying to write a program (see below) that passes a slice of structs to a function. One of the struct fields is an interface{} that sometimes will hold a boolean value and other times will hold a string value. To do this, I put either a bool or a string variable in the field. What I want to

Re: [go-nuts] wanix = webassembly + unix -> plan9 in the browser

2025-05-23 Thread Jason E. Aten
Hi Boris, Well it is a browser, and plan9ish design, so "of course" the network is there, plus with namespaces...? would be my _guess_. It's still in preview release 0.3, and so I asked the author your question about using Go inside wanix on his/the wanix discord. It turns out he's on vacatio

Re: [go-nuts] wanix = webassembly + unix -> plan9 in the browser

2025-05-23 Thread Nagaev Boris
On Thu, May 22, 2025 at 11:48 PM Jason E. Aten wrote: > > Despite the hilarious name, this is the most awesome display > of developer virtuosity-- > > Wanix is a plan9-sh, fully local, web development environment. > It runs a plan9 like shell in the browser (using a > service worker) that can JIT

Re: [go-nuts] Execute so exported function in Go

2025-05-23 Thread 'Brian Candler' via golang-nuts
This might also be relevant: https://github.com/ebitengine/purego On Thursday, 15 May 2025 at 21:47:50 UTC+1 rudeus greyrat wrote: > Thanks Jason, I was looking for something like that indeed :) > > However meanwhile I found an amazing Go package that does what I want > https://github.com/rainyc

[go-nuts] wanix = webassembly + unix -> plan9 in the browser

2025-05-22 Thread Jason E. Aten
Despite the hilarious name, this is the most awesome display of developer virtuosity-- Wanix is a plan9-sh, fully local, web development environment. It runs a plan9 like shell in the browser (using a service worker) that can JIT your code to wasm or x86, using an embedded Go compiler that was co

Re: [go-nuts] minicrypt released

2025-05-22 Thread Stefan Claas
Thank you Robert! Regards Stefan On Wednesday, May 21, 2025 at 9:29:49 PM UTC+2 robert engels wrote: > Good luck! I wish you success. > > On May 21, 2025, at 9:16 AM, Stefan Claas wrote: > > Well, I am planning to do an audit, which has a hefty price tag and > looking for sponsors. For encrypt

[go-nuts] Re: Unexpected Dual Monitoring Behavior in GATUS-based Health Checker in STAGING env

2025-05-22 Thread 'Brian Candler' via golang-nuts
This sounds like a problem with the configuration of a very specific application ("Gatus"), rather than the Go programming language in general. You're more likely to get an answer to your question by going to a Gatus-related discussion group or issue tracker, where you can share the details of

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Natxo Asenjo
On Thu, May 22, 2025 at 10:46 AM Jan Mercl <0xj...@gmail.com> wrote: > On Thu, May 22, 2025 at 10:15 AM natxo@gmail.com > wrote: > > > fatal error: all goroutines are asleep - deadlock! > > Something like this? https://go.dev/play/p/4mWJOZd9hgz > This works beautiflly, thanks! So adding the

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread thatipelli santhosh
I think need to close errCh, resCh On Thu, May 22, 2025 at 1:44 PM natxo@gmail.com wrote: > hi, > > I do not seem to to get this one to not panic, and do not understand why > yet. > > This code gets the names of files using shell globbing , so go run > testchannels.go dir/* > > This gets th

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Natxo Asenjo
hi, I did not close the other channels, but adding this to the select code seems to fix it: for { select { case err := <-errCh: fmt.Println(err) case data := <-resCh: fmt.Println("from result c

Re: [go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread Jan Mercl
On Thu, May 22, 2025 at 10:15 AM natxo@gmail.com wrote: > fatal error: all goroutines are asleep - deadlock! Something like this? https://go.dev/play/p/4mWJOZd9hgz -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gr

[go-nuts] atal error: all goroutines are asleep - deadlock!

2025-05-22 Thread natxo....@gmail.com
hi, I do not seem to to get this one to not panic, and do not understand why yet. This code gets the names of files using shell globbing , so go run testchannels.go dir/* This gets the name and size info of all 1000 files in the dire, but panics at the end with a deadlock: fatal error: all

Re: [go-nuts] minicrypt released

2025-05-21 Thread robert engels
Good luck! I wish you success. > On May 21, 2025, at 9:16 AM, Stefan Claas wrote: > > Well, I am planning to do an audit, which has a hefty price tag and looking > for sponsors. For encryption it uses Ed25519 converted to Curve25519 and > XChaCha20. > > Regards > Stefan > > On Wednesday, May

[go-nuts] Unexpected Dual Monitoring Behavior in GATUS-based Health Checker in STAGING env

2025-05-21 Thread The Raptor
*Hi all,* I’ve extended our GATUS -based health check app to also monitor pipelines using cron schedules. Each endpoint is configured as either: - *Regular* → polled at fixed intervals (e.g., every 1 minute) - *Job-based* → triggered based

Re: [go-nuts] minicrypt released

2025-05-21 Thread Stefan Claas
Well, I am planning to do an audit, which has a hefty price tag and looking for sponsors. For encryption it uses Ed25519 converted to Curve25519 and XChaCha20. Regards Stefan On Wednesday, May 21, 2025 at 1:15:18 AM UTC+2 robert engels wrote: > The github readme has screen shots, but I agree w

Re: [go-nuts] minicrypt released

2025-05-20 Thread robert engels
The github readme has screen shots, but I agree with Roger that I don’t think that is sufficient. One thing, it appears it is not just a wrapper/GUI around GnuPG, and rather uses it’s own encryption scheme/format. If this is the case, the bar will be very high for adoption. It would need a secu

Re: [go-nuts] minicrypt released

2025-05-20 Thread Stefan Claas
Sorry about that, an old saying "a picture is worth thousands words" should pretty much explain how minicrypt is used. Feel free to try it out and you see the difference between, GnuPG, age and minicrypt. Regards Stefan On Monday, May 19, 2025 at 10:51:33 PM UTC+2 roger peppe wrote: > My initi

Re: [go-nuts] minicrypt released

2025-05-19 Thread roger peppe
My initial reaction is this: you assert that this is easy to use but don't say anything about how to use it or explain _why_ it's easy to use, or even exactly what it is (is it a command line program, a graphical app or what?). It might be worth addressing those issues if you want more feedback!

Re: [go-nuts] I saw the news today, oh boy

2025-05-18 Thread Nick White
Thanks for all your great work and patience in helping people in this community for all this time, Ian. The rest of us will have to step up to keep this place as active and useful as it is! -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To un

Re: [go-nuts] I saw the news today, oh boy

2025-05-17 Thread awaw...@gmail.com
Thank you so much Ian! Although, it's extremely sad to see you less on Go, al the best on your new plans! On Friday, May 16, 2025 at 6:55:53 AM UTC+8 Dimas Prawira wrote: > Warmest wishes, Ian, on your next adventure. > > Regards > > On Thu, May 15, 2025 at 12:21 AM robert engels > wrote: > >>

[go-nuts] GoTutor | Online Go Debugger & Visualizer

2025-05-17 Thread Ahmed Akef
I've been working on *Gotutor*, a *Go debugger and visualizer* Gotutor provides a visual representation of the execution flow, variable states, and goroutines, making it easier to understand concurrent code. I'd love for you to check it out and give me some feedback. What features would you f

Re: [go-nuts] I saw the news today, oh boy

2025-05-15 Thread Dimas Prawira
Warmest wishes, Ian, on your next adventure. Regards On Thu, May 15, 2025 at 12:21 AM robert engels wrote: > Well said Jason. Thanks for everything Ian. > > On May 14, 2025, at 11:30 AM, Jason E. Aten wrote: > > ...that Ian Lance Taylor is departing Google > and taking a break from Go. > > Ian

Re: [go-nuts] Execute so exported function in Go

2025-05-15 Thread rudeus greyrat
Thanks Jason, I was looking for something like that indeed :) However meanwhile I found an amazing Go package that does what I want https://github.com/rainycape/dl He does the same as you do with some assembly and automatic type conversion with reflect package to facilitate user experience :)

Re: [go-nuts] I saw the news today, oh boy

2025-05-15 Thread Ian Lance Taylor
On Wed, May 14, 2025 at 9:28 PM Tanawatra Chantaranit wrote: > > May I ask if there will be any further developments on Generics in gofrontend > going forward? I hope so. But no guarantees. But let me ask in turn: why do you care? What are you using gofrontend for? Ian -- You received this m

Re: [go-nuts] Re: url.ParseRequestURI validation of path

2025-05-15 Thread 'Alexander Ertli' via golang-nuts
Hi Diego, You're absolutely right to point out the flaw in my snippet, thanks for catching that. That said, my goal wasn't to provide a complete solution, but rather a minimal example to highlight the core issue. Judging from your ability to spot the edge case, I’m sure you’re more than capable of

Re: [go-nuts] Execute so exported function in Go

2025-05-15 Thread Jason E. Aten
wow. that .go got mangled by copy and paste. 2nd attempt: package main /* #cgo LDFLAGS: -ldl #include #include #include // Define the function type that matches our C function typedef int (*multiply_func)(int, int); // Helper function to load and call the multiply function int call_multiply(

Re: [go-nuts] Execute so exported function in Go

2025-05-15 Thread Jason E. Aten
Below is a working example in C. Once you have that going, then add the CGO layer on top to call from Go. Note I seem to recall you might have to mark your C function as //extern ...maybe, if in a separate C file and not inline in the .go file... read the CGO docs in full for details. $ cat libe

Re: [go-nuts] Re: url.ParseRequestURI validation of path

2025-05-15 Thread 'Diego Molina' via golang-nuts
Hi Alexander, thank you for your response. In your example, strings.Contains(strings.ToLower(original), "%2f") will give a false positive if we have passed a "/" in a query param since it would also be url-encoded, and this is valid and expected. You will come across this in your new API if you

Re: [go-nuts] Execute so exported function in Go

2025-05-15 Thread Bruno Albuquerque
You can not directly call a C function pointer from Go. You will need a CGO wrapper that calls it and them you call that wrapper from Go. -Bruno On Thu, May 15, 2025, 5:20 AM rudeus greyrat wrote: > Hello, > > Thanks for your answer. > > Three points to note: > >- I never asked how to crea

Re: [go-nuts] Execute so exported function in Go

2025-05-15 Thread rudeus greyrat
Hello, Thanks for your answer. Three points to note: - I never asked how to create an so, I already have a given so :/ - No need to provide the code because the issue is simple to describe: I have an address of a function in a Go variable, how to call it ? - AI is garbage (even thou

[go-nuts] Re: I saw the news today, oh boy

2025-05-15 Thread Peter Galbavy
All the best to Ian, thanks for the huge work on Go (hopefully it can continue) and also, for those of us of a certain age, for Taylor UUCP and more :) On Wednesday, 14 May 2025 at 17:30:43 UTC+1 Jason E. Aten wrote: > ...that Ian Lance Taylor is departing Google > and taking a break from Go. >

Re: [go-nuts] I saw the news today, oh boy

2025-05-14 Thread Tanawatra Chantaranit
May I ask if there will be any further developments on Generics in gofrontend going forward? On Thursday, 15 May 2025 at 06:05:36 UTC+7 rudeus greyrat wrote: > Ian was amongst the few guys that took time to answer some of my questions > in Golang nuts. Respect to sensei Ian :-) > > Le mercred

Re: [go-nuts] Execute so exported function in Go

2025-05-14 Thread Kurtis Rader
On Wed, May 14, 2025 at 4:17 PM rudeus greyrat wrote: > I am still a beginner in Linux internals so please bear with me. > > I have a ".so" that export "helloworld" function. > > I load the ".so" using CGO by: > >1. Creating a file descriptor >2. using ```write``` to write the so to it >

[go-nuts] Re: Passing parameters and result by registers in assembly ?

2025-05-14 Thread 'Keith Randall' via golang-nuts
What you are talking about is ABIInternal, which is currently supported only in the standard library (and compiler output). More details at https://go.googlesource.com/go/+/refs/heads/dev.regabi/src/cmd/compile/internal-abi.md We've been thinking about snapshotting ABIInternal as ABI1 at some po

[go-nuts] Execute so exported function in Go

2025-05-14 Thread rudeus greyrat
I am still a beginner in Linux internals so please bear with me. I have a ".so" that export "helloworld" function. I load the ".so" using CGO by: 1. Creating a file descriptor 2. using ```write``` to write the so to it 3. Get a handle using ```dlopen``` 4. Get the address of ```hello

Re: [go-nuts] I saw the news today, oh boy

2025-05-14 Thread rudeus greyrat
Ian was amongst the few guys that took time to answer some of my questions in Golang nuts. Respect to sensei Ian :-) Le mercredi 14 mai 2025 à 19:21:46 UTC+2, robert engels a écrit : > Well said Jason. Thanks for everything Ian. > > On May 14, 2025, at 11:30 AM, Jason E. Aten wrote: > > ...that

Re: [go-nuts] deterministic runtime with pseudo-random-number generator?

2025-05-14 Thread 'Axel Wagner' via golang-nuts
On Wed, 14 May 2025 at 23:25, 'Brian Candler' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Have you seen this? > https://groups.google.com/g/golang-nuts/c/QTML5XM9I-g > That thread was posted by OP, so yes, I assume they have seen it ;) > https://go.dev/blog/synctest > > I don't th

Re: [go-nuts] deterministic runtime with pseudo-random-number generator?

2025-05-14 Thread 'Brian Candler' via golang-nuts
Have you seen this? https://groups.google.com/g/golang-nuts/c/QTML5XM9I-g https://go.dev/blog/synctest I don't think it addresses random seeds, but it might help with deterministic, lock-step execution for tests. On Tuesday, 13 May 2025 at 20:54:37 UTC+1 Axel Wagner wrote: > It used to be possi

Re: [go-nuts] I saw the news today, oh boy

2025-05-14 Thread robert engels
Well said Jason. Thanks for everything Ian. > On May 14, 2025, at 11:30 AM, Jason E. Aten wrote: > > ...that Ian Lance Taylor is departing Google > and taking a break from Go. > > Ian has been an inspiration and a leader by example > of how to foster and create a vibrant technical > community.

[go-nuts] Re: I saw the news today, oh boy

2025-05-14 Thread scott beeker
Good luck Ian!🎉🤝 On Wednesday, May 14, 2025 at 9:30:43 AM UTC-7 Jason E. Aten wrote: > ...that Ian Lance Taylor is departing Google > and taking a break from Go. > > Ian has been an inspiration and a leader by example > of how to foster and create a vibrant technical > community. To me, and I sus

[go-nuts] I saw the news today, oh boy

2025-05-14 Thread Jason E. Aten
...that Ian Lance Taylor is departing Google and taking a break from Go. Ian has been an inspiration and a leader by example of how to foster and create a vibrant technical community. To me, and I suspect to many, he has been the face of Go for over a decade. He sets the highest bar for professio

[go-nuts] Passing parameters and result by registers in assembly ?

2025-05-14 Thread christoph...@gmail.com
I'm experimenting with assembly and apparently (based on objdump output), my assembly uses the abi0 which requires to pass parameters and results with the call stack. Looking at the runtime assembly, it seam possible to pass and receive arguments directly by registers. Is it possible to use th

[go-nuts] minicrypt released

2025-05-13 Thread Stefan Claas
Hi all, I just released minicrypt, a public key encryption program, which is aimed at elderly people or people with a disability and find the learning curve for GnuPG etc. too hard. I would appreciate if you take a look at minicrypt and leave a feedback. https://github.com/706f6c6c7578/min

Re: [go-nuts] deterministic runtime with pseudo-random-number generator?

2025-05-13 Thread 'Axel Wagner' via golang-nuts
It used to be possible to do this using NaCl. In fact, the playground used to be implemented using that and was fully deterministic. These days, the playground uses gVisor, AFAIK, and is no longer deterministic. I don't know how well the NaCl port is still maintained. Come to think of it, you might

Re: [go-nuts] deterministic runtime with pseudo-random-number generator?

2025-05-13 Thread Robert Engels
Pretty sure you cannot do this for two reasons: the runtime creates internal threads for IO and other purposes that you cannot control. Also the kernel IO / poll is non deterministic. You might have better luck with a custom tiny Go. On May 13, 2025, at 1:53 PM, Jason E. Aten wrote:I'd like to ru

[go-nuts] deterministic runtime with pseudo-random-number generator?

2025-05-13 Thread Jason E. Aten
I'd like to run variations of my Raft test code on a fully deterministic runtime (meaning only one thread, all randomness from a pseudo RNG controlled with a repeatable seed). I was looking at the standard (big) Go runtime, and I don't see where there are any options to control the random number

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-13 Thread 'Michael Knyszek' via golang-nuts
On Monday, May 12, 2025 at 3:58:54 PM UTC-4 Jason E. Aten wrote: possibly very relevant -- https://github.com/golang/go/issues/70683 On Monday, May 12, 2025 at 8:50:33 PM UTC+1 Jason E. Aten wrote: Interesting. Thanks, Robert, for the pointer to your tests in https://github.com/robaho/go-conc

[go-nuts] Re: golang.org/x/crypto/x509roots/fallback: high, unskippable, init cost

2025-05-12 Thread twp...@gmail.com
Gentle ping on this. If this is not wanted, then say. Otherwise, I will create an issue on https://github.com/golang/go to reach out to the relevant folk directly. Regards, Tom On Wednesday, April 23, 2025 at 1:11:22 AM UTC+2 twp...@gmail.com wrote: > tl;dr importing golang.org/x/crypto/x509ro

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Robert Engels
That’s interesting on the performance of sync.Map as the issues cited here are still open https://github.com/golang/go/issues/28938#issuecomment-441681208On May 12, 2025, at 12:48 PM, Jason E. Aten wrote:Robert's suggestion is obviously the most direct and correct route if you can change the IDL

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Jason E. Aten
Robert's suggestion is obviously the most direct and correct route if you can change the IDL of generated type. After all, code generation is there to simplify generating alot of code from a little definition. I was assuming that one of constraints was not being able to modify the struct receiv

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Robert Engels
Why not just modify the code generator to add a user data pointer to the structure?I can’t imagine something like that isn’t already there? Either the code generator should be easy to enhance or it should have a side car data field - anything else is hard to rationalize as even rudimentary design. 

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Alexander Shopov
Now that I think about it again - I guess your suggestion could work for my case with some caveats: 1. There can be contention on the map - but as you point out there is sync.Map as well 2. The state should be removed from the map but that can also be arranged by deferring a delete operation 3. If

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Jason E. Aten
Forgive me if this off base, as I'm still a little fuzzy on the exact constraints of you problem... but, as stated, if you want to associate additional optional behavior and state with any given response that is constrained to the generated, just use the responses's pointer (to its struct) (if lo

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Alexander Shopov
seems a very common assumption I would have guessed it is due to compatibility with C but https://pkg.go.dev/cmd/cgo#hdr-C_references_to_Go explicitly states: *Go struct types are not supported; use a C struct type. * So it may be completely at the decision of the implementer. The caveats in http

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-12 Thread Alexander Shopov
Hello all and thanx for the answers. Here I provide more information: @Robert Engels | Just have the parameters be interfaces and do reflection/type casting. I sadly cannot do this (at least right away). That is why I asked for help. I cannot guarantee the parameters are interfaces - they are what

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-11 Thread 'Axel Wagner' via golang-nuts
On Mon, 12 May 2025 at 07:05, Axel Wagner wrote: > A less evil, but still bad way, would be to store it in a global map: > https://go.dev/play/p/ZHBJVCduf25 (note: I'm not sure this use of weak > pointers is actually correct, I haven't used them yet). > Okay, I'm pretty sure it's not correct. It

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-11 Thread 'Axel Wagner' via golang-nuts
On Mon, 12 May 2025 at 00:25, Alexander Shopov wrote: > I cannot just make *EnrichedResponse* a struct embedding > *generated.Response *and add more state because then I cannot do the > conversion from normal response to enriched. > Why does this have to be a conversion? What's the downside of h

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-11 Thread Robert Engels
If you look at the example given the function accepts the base type and then tries to call the function needing the extended type - pretty sure you can’t do this with embedding as the type is erased when the outer function is called. You need an interface afaik. On May 11, 2025, at 8:43 PM, Jason E

Re: [go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-11 Thread Jason E. Aten
I think you have just misunderstood how to embed types in Go, because you say *> // Declare a new type that embeds the generated.Response> type EnrichedResponse generated.Response* and this is not type embedding, it is just a type definition, giving a new name and new type for the existing st

Re: [go-nuts] net/icmp: Echo.ID and Echo.Seq are defined as int, but Marshal converts them to uint16

2025-05-11 Thread Ian Lance Taylor
On Sun, May 11, 2025 at 8:59 AM Yuen Sun wrote: > > I believe changing the types of ID and Seq to uint16 would make the > implementation more consistent with the ICMP protocol specification. > Understanding the original design intent would also help the community better > align with Go's design

[go-nuts] Adding methods to non local types that use more state than available in the non local type

2025-05-11 Thread Alexander Shopov
Hi all, I need some guidance whether what I want to do is somehow possible in Go. I've already searched answers for two days. My problem boils down to how to sneak more in a type without changing the type. Lets say I have to implement the following method: *func (s *server) Get(ctx context.

Re: [go-nuts] Trying to port Go to HPE NonStop x86 - Need some guidance

2025-05-11 Thread Steven Meadows
Where are at with this port to Nonstop On Thursday, June 10, 2021 at 7:24:39 PM UTC-4 Ian Lance Taylor wrote: > On Wed, Jun 9, 2021 at 6:16 AM Shiva wrote: > > > > I have now duped all of the linux files and created nsx variants, I've > also set the environment variables GOOS to nsx and GOARCH

[go-nuts] Re: net/icmp: Echo.ID and Echo.Seq are defined as int, but Marshal converts them to uint16

2025-05-11 Thread Jason E. Aten
Hi Yuen Sun, Your question is a fine one, but better directed to the Go development team than to general users of Go. If its going to be fixed, it will need issue anyway, so I suggest simply filing an issue and/or asking on golang-dev. https://github.com/golang/go/issues https://groups.google.com

Re: [go-nuts] Re: [security] Go 1.24.3 and Go 1.23.9 are released

2025-05-11 Thread 'Dan Kortschak' via golang-nuts
On Sun, 2025-05-11 at 13:30 +, 'Eric Jacksch' via golang-nuts wrote: > > > How to build go from source The instructions at https://go.dev/doc/install/source should help with this. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

Re: [go-nuts] Re: Goroutines and channels optimization

2025-05-11 Thread Kanak Bhatia
Thanks, I'll check it out. On Sun, 11 May 2025, 22:44 Robert Engels, wrote: >  > This seems to be a decent meta reference > https://www.linkedin.com/advice/0/what-key-skills-tools-cloud-performance-tuning?utm_source=share&utm_medium=member_ios&utm_campaign=share_via#:~:text=Cloud%20performance%

Re: [go-nuts] Re: Goroutines and channels optimization

2025-05-11 Thread Kanak Bhatia
Thanks for the tip! Could you suggest some resources for the same regarding these design considerations if you know of any ? On Sun, 11 May 2025, 21:48 Robert Engels, wrote: > Of that I’m not sure. It is based on deep knowledge of how these things > are built from the hardware to the kernel to

Re: [go-nuts] Re: Goroutines and channels optimization

2025-05-11 Thread Robert Engels
Of that I’m not sure. It is based on deep knowledge of how these things are built from the hardware to the kernel to network protocols to the service layers. It broadly falls under performance tuning of which there is lots of literature. The key element of how channels and go routines play into thi

Re: [go-nuts] Re: Goroutines and channels optimization

2025-05-11 Thread Kanak Bhatia
Does we have any kind of documented material or mathematical theory type stuff for these things or is it more like hit or try On Sun, 11 May 2025, 08:04 ren...@ix.netcom.com, wrote: > The two most likely limiters in performance will be your network pipe to > the cloud and the QPS quota offered b

[go-nuts] Re: [security] Go 1.24.3 and Go 1.23.9 are released

2025-05-11 Thread 'Eric Jacksch' via golang-nuts
How to build go from source -- Eric Jacksch, CPP, CISM, CISA, CISSP President and Principal Consultant e...@tenebris.com +1.613.454.8200 From: golang-annou...@googlegroups.com on behalf of Cherry Mui Sent: Tuesday, May 6, 2025 2:48:08 PM To: golang-nuts@google

  1   2   3   4   5   6   7   8   9   10   >