[go-nuts] Re: Pug-->Html. I need the lib fot this

2021-05-06 Thread thomas.b...@gmail.com
Hello, I use it in: https://github.com/tbellembois/gochimitheque See the top of the main.go file for the generate command and the jade files in static/templates including the use of mixins. Regards, Thomas Le mercredi 5 mai 2021 à 23:04:31 UTC+2, muhorto...@gmail.com a écrit : > Does anyone

[go-nuts] Go: pointer bit stealing technique

2021-05-06 Thread Vitaly Isaev
In a well-known book "The Art of Multiprocessor Programming" by Herlihy, Shavit some of lock-free and wait-free algorithms utilize Java's template AtomicMarkableReference type. It allows to perform single atomic CAS operation on the pair consisting of T reference and boolean mark. There is n

Re: [go-nuts] Go: pointer bit stealing technique

2021-05-06 Thread Robert Engels
The Java implementation does not use bit stealing - it uses an atomic pointer to an immutable struct - the same can be done in Go. > On May 6, 2021, at 6:16 AM, Vitaly Isaev wrote: > >  > In a well-known book "The Art of Multiprocessor Programming" by Herlihy, > Shavit some of lock-free and

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Jesper Louis Andersen
On Wed, May 5, 2021 at 11:34 PM Bakul Shah wrote: > > Imagine that the latency between the device detecting a disconnect > signal and a user hitting a disconnect button is D ns while the fire > detection latency is F ns. So if D > F the device would raise the > alarm even if you implement it all

Re: [go-nuts] time.Format with "Month Year" format incorrectly displayed

2021-05-06 Thread Marvin Renich
* Kurtis Rader [210505 23:35]: > On Wed, May 5, 2021 at 8:23 PM Bagas Sanjaya wrote: > > > On 06/05/21 04.37, Ian Lance Taylor wrote: > > > You wrote 2009 where you need to write 2006. > > > > Wouldn't it possible to define arbitrary reference time and format it > > according to what it would

[go-nuts] Re: Still "missing" priority or ordered select in go?

2021-05-06 Thread Øyvind Teig
torsdag 6. mai 2021 kl. 04:27:06 UTC+2 skrev tapi...@gmail.com: > older threads: > * https://groups.google.com/g/golang-nuts/c/ZrVIhHCrR9o/m/JMJ0fGqhCgAJ > * https://groups.google.com/g/golang-nuts/c/lEKehHH7kZY/m/gCjjBviJBwAJ > Thanks a lot! I'll try to have a look through them! Øyvind On T

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

2021-05-06 Thread Shiva
Thank you, that helps. Now, as I continue to work on 'porting', I have a question. The go compiler that will be used for creating this 'bootstrap' version of go1.16 - does this come from the go1.16 windows binary or the go1.4 windows binary? I ask because I have 'produced' both of them on diff

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

2021-05-06 Thread Shiva
To give you a bit of a background - The question above was because I had set the go compiler as go1.4 and Visual Studio code complained that 'gopls requires at least go1.12.0' while I was in the process of 'porting'. On Thursday, May 6, 2021 at 2:16:24 PM UTC+1 Shiva wrote: > Thank you, that h

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Øyvind Teig
onsdag 5. mai 2021 kl. 22:29:50 UTC+2 skrev Jan Mercl: > On Wed, May 5, 2021 at 6:56 PM Øyvind Teig wrote: > > > hiPri is a disconnect message of a smoke detetector. loPri is a fire > alarm. If the disconnect hiPri is activated before (1 sec to 1 ns) or > simulatenously (same polling of "hw pi

Re: [go-nuts] time.Format with "Month Year" format incorrectly displayed

2021-05-06 Thread Howard C. Shaw III
Alternatives: Excel style formatter: https://github.com/metakeule/fmtdate bday, err := fmtdate.NewTimeDate("-MM-DD", "2000-12-04") C-library style formatter: https://github.com/lestrrat-go/strftime https://github.com/fastly/go-utils/strftime -- deprecated https://github.com/jehiah/go-strftime

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
FWIW after all this discussion I *am* curious about a more detailed argument for why we can't have a priority select that guarantees that *if* the high-priority case becomes ready before the low-priority one (in the sense of "there exists a happens-before edge according to the memory model"), the h

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
PS: And I'm not saying there is no argument. Maybe "select is not atomic" is such an argument. But if there is an argument and/or if this is that argument, I don't fully understand it myself. On Thu, May 6, 2021 at 3:40 PM Axel Wagner wrote: > FWIW after all this discussion I *am* curious about

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Øyvind Teig
Thanks for your comments. I'll try to respond to several here. They also all apply! (Even if I see while I write that two more have arrived.) This thread seems to have taken me to places where I didn't intend to go. Go is no language for this kind of application, not even with a pri select. I

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
On Thu, May 6, 2021 at 4:06 PM Øyvind Teig wrote: > If that confirmation really is a confirmation, then the "Mercl code" is > still not a pri select that matches the pri select I was querying about. > I don't believe it is. It took a while to wrap my head around it - apologies for that. But yes

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread roger peppe
On Thu, 6 May 2021 at 14:41, 'Axel Wagner' via golang-nuts < golang-nuts@googlegroups.com> wrote: > PS: And I'm not saying there is no argument. Maybe "select is not atomic" > is such an argument. But if there is an argument and/or if this is that > argument, I don't fully understand it myself. >

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
On Thu, May 6, 2021 at 4:43 PM roger peppe wrote: > > On Thu, 6 May 2021 at 14:41, 'Axel Wagner' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > >> PS: And I'm not saying there is no argument. Maybe "select is not atomic" >> is such an argument. But if there is an argument and/or if th

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Robert Engels
I already showed you - just change it to Select hi Default: Select hi,lo If lo: Select hi Default : Pass And enqueue the lo if a hi and lo are read. That is all that is needed. > On May 6, 2021, at 10:28 AM, 'Axel Wagner' via golang-nuts > wrote: > >  > > >> On

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
No, it is not. Your "if lo" branch implies that the communication happened - e.g. the sender was already unblocked. A `select` would not unblock the other side unless that's the actual branch taken. On Thu, May 6, 2021 at 7:32 PM Robert Engels wrote: > I already showed you - just change it to >

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Robert Engels
“If lo” means that if the lo channel was read. This code will prevent a lo from being processed if a hi is available at the happens before moment of a value being ready. That moment is somewhat arbitrary so it is only mildly different than Select hi: Default: Select hi Select

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
On Thu, May 6, 2021 at 8:22 PM Robert Engels wrote: > “If lo” means that if the lo channel was read. > Exactly. To fulfill the requirements and answering the question, it must not be read. This code will prevent a lo from being processed if a hi is available at > the happens before moment of a

[go-nuts] Go 1.16.4 and Go 1.15.12 are released

2021-05-06 Thread Carlos Amedee
Hello gophers, We have just released Go versions 1.16.4 and 1.15.12, minor point releases. This minor release includes a security fix according to the new security policy (#44918 ). ReadRequest and ReadResponse in net/http can hit an unrecoverable panic when readi

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Robert Engels
But that is not really true because there are no constraints on if the source channels are buffered - if they are then my code operates similarly. Even if using unbuffered channels there is buffering being done at a lower level (hardware buffers, network stack buffers, etc) - so not “unblocking

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
On Thu, May 6, 2021 at 9:40 PM Robert Engels wrote: > But that is not really true because there are no constraints on if the > source channels are buffered - if they are then my code operates similarly. > I was very clear. I was asking if it is possible to implement a priority select with the se

Re: [go-nuts] Go: pointer bit stealing technique

2021-05-06 Thread David Riley
On May 6, 2021, at 7:16 AM, Vitaly Isaev wrote: > > There is no similar type in C/C++/Go stdlib, but at least in C++ it's > possible to model it using bit stealing approach (see C++ example). On x86_64 > arch only 48 bits of 64 bits are actually used, so one can store arbitrary > data in the r

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Peter Wilson
Back in the days of transputers and occam, there was a desire to be able to manage all interesting events in a system in a within-language (language being occam) manner. Interrupts were a problem, because you can't describe interrupts as implemented by microprocessors (steal the PC and jump some

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
To clarify again: As a litmus test, a `select` construct like the one I'm talking about would mean that this code blocks forever: https://play.golang.org/p/LcWgDcX5ojl With the current `select`, it doesn't. With a different `select`, which uses source order to express priority and under the semanti

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Robert Engels
Yes, but barring the nanosecs of a window this is simply implemented as Ian wrote with Select hi Default: Select hi,lo If both channels are ready when the code is entered the high will always be taken. There is no such thing as simultaneous source events - even the first that occurred in

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
On Thu, May 6, 2021 at 11:38 PM Robert Engels wrote: > Yes, but barring the nanosecs of a window this is simply implemented as > Ian wrote with > > Select hi > Default: >Select hi,lo > No, it is not. "Barring a nanosecond" is not a guarantee. And that this is not actually doing what I'm aski

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Robert Engels
> On May 6, 2021, at 5:12 PM, 'Axel Wagner' via golang-nuts > wrote: > >  >> On Thu, May 6, 2021 at 11:38 PM Robert Engels wrote: > >> Yes, but barring the nanosecs of a window this is simply implemented as Ian >> wrote with >> >> Select hi >> Default: >>Select hi,lo > > No, it is no

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Robert Engels
To simply this :your request is easily accommodated if all channel state changes and all selects are synchronized. This is easily doable but would crush performance. > On May 6, 2021, at 6:11 PM, Robert Engels wrote: > >  > > >>> On May 6, 2021, at 5:12 PM, 'Axel Wagner' via golang-nuts >

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread Ian Lance Taylor
On Thu, May 6, 2021 at 6:40 AM 'Axel Wagner' via golang-nuts wrote: > > FWIW after all this discussion I *am* curious about a more detailed argument > for why we can't have a priority select that guarantees that if the > high-priority case becomes ready before the low-priority one (in the sense

Re: [go-nuts] Go: pointer bit stealing technique

2021-05-06 Thread Ian Lance Taylor
On Thu, May 6, 2021 at 4:16 AM Vitaly Isaev wrote: > > In a well-known book "The Art of Multiprocessor Programming" by Herlihy, > Shavit some of lock-free and wait-free algorithms utilize Java's template > AtomicMarkableReference type. It allows to perform single atomic CAS > operation on the p

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

2021-05-06 Thread Ian Lance Taylor
On Thu, May 6, 2021 at 6:16 AM Shiva wrote: > > Thank you, that helps. > > Now, as I continue to work on 'porting', I have a question. The go compiler > that will be used for creating this 'bootstrap' version of go1.16 - does this > come from the go1.16 windows binary or the go1.4 windows binary

Re: [go-nuts] Still "missing" priority or ordered select in go?

2021-05-06 Thread 'Axel Wagner' via golang-nuts
Thank you :) On Fri, May 7, 2021 at 4:10 AM Ian Lance Taylor wrote: > On Thu, May 6, 2021 at 6:40 AM 'Axel Wagner' via golang-nuts > wrote: > > > > FWIW after all this discussion I *am* curious about a more detailed > argument for why we can't have a priority select that guarantees that if > th