Re: [go-nuts] Diagnose

2019-02-02 Thread Michael Jones
Original was January 22. On Fri, Feb 1, 2019 at 3:56 PM Michael Jones wrote: > This looks like the question asked a week ago. Look at the first post for > answers. > > On Fri, Feb 1, 2019 at 3:44 PM John wrote: > >> Dear Gophers, >> I have made a connect five ga

Re: [go-nuts] Diagnose

2019-02-01 Thread Michael Jones
This looks like the question asked a week ago. Look at the first post for answers. On Fri, Feb 1, 2019 at 3:44 PM John wrote: > Dear Gophers, > I have made a connect five game, and am planning to make it a website. > But first, there is a diagnostic problem. My win function depends on if a >

Re: [go-nuts] When initializing variables, copies of values are made?

2019-01-31 Thread Michael Jones
No. These are variable declarations not assignment statements. In the assignment “a = b” there is a copy implied but for the variable declaration the “=“ should not be read as “is copied to” but rather “of this kind”. var a is of the kind [3]bytes which happen to be 2, 4, and 6. Size = 3

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-31 Thread Michael Jones
You deserve extra credit for getting the phrase "ouroboros data structure" in there. ;-) On Thu, Jan 31, 2019 at 10:20 AM roger peppe wrote: > On Thu, 31 Jan 2019 at 16:22, Michael Jones > wrote: > >> Agree. I’ve never had that level of imbalance but yes. >&

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-31 Thread Michael Jones
Agree. I’ve never had that level of imbalance but yes. On Thu, Jan 31, 2019 at 4:06 AM roger peppe wrote: > On Thu, 31 Jan 2019 at 00:06, Michael Jones > wrote: > >> note that my code sidesteps this problem generally >> > > I'm not sure that that's true. A

Re: [go-nuts] Re: Memory usages

2019-01-31 Thread Michael Jones
Yes. Now you can answer this question when the next person asks. On Wed, Jan 30, 2019 at 10:56 PM 伊藤和也 wrote: > OK, I want to make it clearer. > > Whether constants are untyped or typed, constants are treated at compile > time and originary there is no idea of how much memory constants take but

Re: [go-nuts] Re: Memory usages

2019-01-30 Thread Michael Jones
very close. One more idea: typed constants only exist during compilation. In the generated executable they are all typed because they have been used somewhere and that defined their size and type (int, float, ...) On Wed, Jan 30, 2019 at 6:55 PM 伊藤和也 wrote: > OK, I understand it somehow but I

Re: [go-nuts] Memory usages

2019-01-30 Thread Michael Jones
On Wed, Jan 30, 2019 at 4:05 PM 伊藤和也 wrote: > : > So in this case below, Is the memory usage "12" bytes in total? (Question > 1) > > var num int32 = 100 >> | | >> 4 bytes + 8 bytes = 12 bytes > > no. the literal "100" has no specific size and is conformed to the

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-30 Thread Michael Jones
note that my code sidesteps this problem generally On Wed, Jan 30, 2019 at 3:48 PM roger peppe wrote: > On Wed, 30 Jan 2019 at 20:07, 'Bryan Mills' via golang-nuts < > golang-nuts@googlegroups.com> wrote: > >> The code to sequence the results using a channel is not much more verbose. >> >> That

Re: [go-nuts] What does a deadlock mean in golang?

2019-01-30 Thread Michael Jones
fantastic read! On Wed, Jan 30, 2019 at 12:42 PM Bakul Shah wrote: > On Wed, 30 Jan 2019 12:21:46 -0800 Tom Mitchell > wrote: > > > > On Tue, Jan 29, 2019 at 12:55 AM =E4=BC=8A=E8=97=A4=E5=92=8C=E4=B9=9F > > a.ito.dr...@gmail.com> wrote: > > > > > I know the general meaning of a deadlock, but

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-27 Thread Michael Jones
wrote: > Even with 64 cores your process takes 3hrs… unless they are all external > requests - so essentially unlimited cores. > > > On Jan 27, 2019, at 2:32 PM, Michael Jones > wrote: > > Glad you saw it. Lots of ways to do it but small-seeming details shape the >

Re: [go-nuts] Existing code for order-preserving concurrent work queue?

2019-01-27 Thread Michael Jones
ble For Legal Reasons > > Viewing and/or sharing code snippets is not available in your country for > legal reasons. This message might also appear if your country is > misdetected. If you believe this is an error, please file an issue > <https://golang.org/issue>. > > 在 2019年1

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-27 Thread Michael Jones
: > Yes, I did, thank you! My reply was to the previous message (robert > engels' post about it being "straightforward" but not providing code) and I > think we just both hit send at about the same time. > > On Sat, 26 Jan 2019 at 02:52, Michael Jones > wrote: > &g

Re: [go-nuts] Re: Existing code for order-preserving concurrent work queue?

2019-01-25 Thread Michael Jones
Did you notice that I sent you the complete code above? On Fri, Jan 25, 2019 at 2:48 PM wrote: > For what it's worth > http://www.golangpatterns.info/concurrency/parallel-for-loop > implements an order-preserving parallel map, but does not limit the number > of workers. > > In my case, I want

Re: [go-nuts] Existing code for order-preserving concurrent work queue?

2019-01-25 Thread Michael Jones
code snippet: https://play.golang.org/p/pphzr6QKiQ3 here I have an existing serial process (using channels in preparation) for a run-time switch between serial and parallel evaluation. the snippet is that switch. N desired to be used cpus N worker goroutines N work chan N answer chan distribute

Re: [go-nuts] The performance comparation of Golang and Java

2019-01-24 Thread Michael Jones
Also...pseudo-random number generation is not a specific computation; there are many ways to do it--some faster some slower, some better some worse. If you want to time a general poisson disc simulation you would be better with a grid than calls to rand() because now you are testing the speed of

Re: [go-nuts] Producer-Consumer with Goroutines

2019-01-24 Thread Michael Jones
It works correctly. What you see is the race between the printf calls at each iteration On Thu, Jan 24, 2019 at 2:40 PM diego patricio wrote: > Hi, I just want to achieve that one goroutine send a data and another > goroutine receive it and print it consequently, for instance o, 1, 2, 3. > > Is

Re: [go-nuts] Re: How concatenate more type of formatting for the same variable (fmt.Printf)

2019-01-22 Thread Michael Jones
Antonio, The first example has three format verbs and just two values. That is usually wrong. Use "go vet" to be warned of such errors. Sam's answer explains how you can print two values three ways using indexing "[1]" and "[2]". Your new example has two format verbs and two values. This is

Re: [go-nuts] This Makes No Sense

2019-01-22 Thread Michael Jones
or a 15x15 board, rows and columns are > numbered 0..14). > > [1] I suspect this is a homework problem. > > On Jan 22, 2019, at 11:37 AM, Michael Jones > wrote: > > I could not decode the question, so I just wrote a program to do it all. > John, does this help? &g

Re: [go-nuts] Re: This Makes No Sense

2019-01-22 Thread Michael Jones
I could not decode the question, so I just wrote a program to do it all. John, does this help? Change the constants for whatever board geometry and n-in-a-row victory rule you want. https://play.golang.org/p/JtouiOlkGCO P.S. the progression from 3 to 4 to 5 in a row is a great way to teach kids

Re: [go-nuts] Re: GO lang not able to decrypt the xor-base64 text

2019-01-21 Thread Michael Jones
Another way to think about it... https://play.golang.org/p/XtfFgwYw3f8 On Mon, Jan 21, 2019 at 10:26 AM wrote: > Like Christian said, your main problem is how Javascript and how Go > iterate. > > In your Javascript example, you use: > > for(var i=0;i > so you iterate in a +1 increment

Re: [go-nuts] Re: What are the reasonable reasons to use pointers?

2019-01-07 Thread Michael Jones
I am honored to have shared a bug with Rob Pike. On Mon, Jan 7, 2019 at 3:36 PM Rob Pike wrote: > I think every Fortran programmer has a version of that story. Mine > involved the number 3. > > -rob > > > On Mon, Jan 7, 2019 at 8:01 AM Michael Jones > wrote: > >

Re: [go-nuts] Re: What are the reasonable reasons to use pointers?

2019-01-06 Thread Michael Jones
My hardest-to-debug ever bug was because of this. Because FORTRAN is pass by reference, the compiler must do something special for the four in "SQRT(4.0)" -- and the PDP-10 (TOPS-10) FORTRAN compiler used a global literal table for this. I had a function that modified an argument, erroneously

Re: [go-nuts] Adding &&= and ||= operators for working with bools

2019-01-05 Thread Michael Jones
g, and C got along fine without it. Your regularity argument >> carries some weight but it still seems worth it. >> >> If you disagree, file a proposal explaining the argument. >> >> -rob >> >> >> On Sun, Jan 6, 2019 at 3:28 PM Michael Jones >> wr

Re: [go-nuts] Adding &&= and ||= operators for working with bools

2019-01-05 Thread Michael Jones
not Rob but rather Ian... (6/22/2012) https://mail.google.com/mail/u/0/#label/go%2Fgolang-nuts/FMfcgxwBTsjnkHgqhvQfLqrXsJdHZRxC On Sat, Jan 5, 2019 at 7:52 PM Michael Jones wrote: > I brought it up early on, wanting AND (&) and OR (|) as well as AND-ASSIGN > (&=)

Re: [go-nuts] Adding &&= and ||= operators for working with bools

2019-01-05 Thread Michael Jones
I brought it up early on, wanting AND (&) and OR (|) as well as AND-ASSIGN (&=) and OR-ASSIGN (|=). Not enthusiastic about shortcut operators on assignment form. Rob posted here that he was ok/open to the idea. On Sat, Jan 5, 2019 at 5:55 PM Caleb Spare wrote: > Sometimes when working with

Re: [go-nuts] Re: C++ 11 to Golang convertor

2019-01-05 Thread Michael Jones
A rewrite will be better. Really. On Sat, Jan 5, 2019 at 10:11 AM Abhishek Tiwari wrote: > Hi Jake & Friends, > > Thank you so much for awesome response and great help. I am going through > all replies in detail one by one. > Actually, I am working on solving a job assignment : 8-10 C++ files

Re: [go-nuts] Re: Are defered function calls executed?

2019-01-04 Thread Michael Jones
As was said above, the defer becomes active when executed, so defer func() *before* the potential returns. Also as was said just before that, the power is clear in more complex situations. Imagine three things that must be set-up in advance and closed down properly (open/close network link,

Re: [go-nuts] Re: if/switch statements as expressions

2019-01-03 Thread Michael Jones
yes. lisp was early (first?) to support unevaluated arguments via hold and other mechanisms. quite useful for this situation. On Thu, Jan 3, 2019 at 3:33 PM Milan Zamazal wrote: > alanfo writes: > > > Some languages which don't support the conditional operator or if/else > > expressions have

Re: [go-nuts] What are the reasonable reasons to use pointers?

2019-01-01 Thread Michael Jones
in fact... array indices and fortran's call by address rules make it a pointer language in the sense you mean. when i was a mere boy i had to decode brian kernighan's magical packing of triangular arrays using such a scheme. ;-) On Tue, Jan 1, 2019 at 5:23 PM Drew Derbyshire wrote: > > > On

Re: [go-nuts] What are the reasonable reasons to use pointers?

2019-01-01 Thread Michael Jones
Most of the answers have been shared already. I'll add only the meaning: Basic variables associate names with the value of data, but pointer variables associate names with the location of data. In an array or slice the name and index serve similar purposes, where the 5 in m[5] is a kind of

Re: [go-nuts] Trouble with exiting a for loop that contains bufio.NewScanner.Scan()

2018-12-30 Thread Michael Jones
You are ignoring an important situational fact...the serial port is not an infinite stream to you, but a sequence of serial ports divided by connection closings. In this situation, the thing to be scanned is experiencing EOF at close events but this is not being communicated. That is the problem.

Re: [go-nuts] regexp: is there a way to match single byte ?

2018-12-30 Thread Michael Jones
I woke up at 2am here bugged about my former reply. Here's version 2... https://play.golang.org/p/lky_W20CKnM ...should have sent this the first time. Sorry! On Sat, Dec 29, 2018 at 9:09 PM Kurtis Rader wrote: > On Sat, Dec 29, 2018 at 8:47 PM Michael Jones > wrote: > >> Nev

Re: [go-nuts] regexp: is there a way to match single byte ?

2018-12-29 Thread Michael Jones
oops! typo: https://play.golang.org/p/VYo9GTz63Hc On Sat, Dec 29, 2018 at 8:47 PM Michael Jones wrote: > Never use a cannon as a fly swatter. > A regular expression is heavy artillery. > A for-loop will do just fine: smaller, simpler, faster, land ess > dependencies: > > https

Re: [go-nuts] regexp: is there a way to match single byte ?

2018-12-29 Thread Michael Jones
Never use a cannon as a fly swatter. A regular expression is heavy artillery. A for-loop will do just fine: smaller, simpler, faster, land ess dependencies: https://play.golang.org/p/2nr4VdkqaNF On Sat, Dec 29, 2018 at 8:17 PM Matt Harden wrote: > I don't believe the regexp package allows

Re: [go-nuts] if/switch statements as expressions

2018-12-21 Thread Michael Jones
s.utexas.edu/users/EWD/transcriptions/EWD02xx/EWD230.html > > (no comment!) > > Jamie > > On Friday, December 21, 2018 at 7:57:07 AM UTC, Tom Mitchell wrote: >> >> >> On Thu, Dec 20, 2018 at 2:48 PM Michael Jones >> wrote: >> >>> interesting! i

Re: [go-nuts] if/switch statements as expressions

2018-12-20 Thread Michael Jones
interesting! i wish algol 68 had had its chance. On Thu, Dec 20, 2018 at 2:40 PM Bakul Shah wrote: > On Thu, 20 Dec 2018 13:13:04 -0800 Michael Jones > wrote: > > > > There is an inelegant but highly effective "hack" in GCC/G++ in thuas > area. > > Since

Re: [go-nuts] if/switch statements as expressions

2018-12-20 Thread Michael Jones
There is an inelegant but highly effective "hack" in GCC/G++ in thuas area. Since C/C++ are expression language as Rob put it (e.g. a statement like "3" compiles where in Go it fails with "3 evaluated but not used") GCC took this a step further and implemented that the last expression evaluated in

Re: [go-nuts] Channels: selecting the last element

2018-12-18 Thread Michael Jones
Unbuffered channels are not dangerous. They just mean that “done sending” is not the same as “done receiving.” I have done many variations of these approaches and all work...but I’ve never used select. On Tue, Dec 18, 2018 at 5:25 PM wrote: > > feel unbuffered channels are safer to use

Re: [go-nuts] Pure functions and Go2

2018-12-14 Thread Michael Jones
as it was for Diogenes to find an honest man. On Fri, Dec 14, 2018 at 1:28 PM Bakul Shah wrote: > > > > On Dec 14, 2018, at 1:17 PM, Michael Jones > wrote: > > > > I don't actually prefer marking a func as pure. best if it is a > discovered attribute during compilation. > > Yo

Re: [go-nuts] Pure functions and Go2

2018-12-14 Thread Michael Jones
I don't actually prefer marking a func as pure. best if it is a discovered attribute during compilation. Not sure what you mean about complexity. The compiler would not be obligated. On Fri, Dec 14, 2018 at 1:12 PM Bakul Shah wrote: > On Dec 14, 2018, at 12:50 PM, Michael Jones >

[go-nuts] Pure functions and Go2

2018-12-14 Thread Michael Jones
Have been thinking about pure functions (in the Scheme sense of no externalities other than constants and pure functions and no side effects) in the context of weak metaprogramming and compiler optimization. Here is the idea. : a := math.Sin(0.1234) : b := bits.RotateLeft64(0x12345678, 7) : func

Re: [go-nuts] Homoiconic metaprogramming in Go

2018-12-14 Thread Michael Jones
I've been thinking about a related idea for the past while ... "pure functions" ... i'll post an email about it now. On Fri, Dec 14, 2018 at 6:06 AM roger peppe wrote: > On Fri, 14 Dec 2018 at 14:01, wrote: > >> Not sure where you got this impression - commands run by go generate have >> only

Re: [go-nuts] Plan9 reborn as a guest OS atop of Golang runtime

2018-12-14 Thread Michael Jones
regards, > Charlton Trezevant > > > On Monday, December 10, 2018 at 9:24:43 PM UTC, Michael Jones wrote: >> >> Read about Biscuit: >> https://pdos.csail.mit.edu/papers/biscuit.pdf >> >> https://www.usenix.org/sites/default/files/conference/protected-files/osdi18_s

Re: [go-nuts] Plan9 reborn as a guest OS atop of Golang runtime

2018-12-10 Thread Michael Jones
oops. left out a key link: https://github.com/mit-pdos/biscuit On Mon, Dec 10, 2018 at 1:23 PM Michael Jones wrote: > Read about Biscuit: > https://pdos.csail.mit.edu/papers/biscuit.pdf > > https://www.usenix.org/sites/default/files/conference/protected-files/osdi18_slide

Re: [go-nuts] Plan9 reborn as a guest OS atop of Golang runtime

2018-12-10 Thread Michael Jones
Read about Biscuit: https://pdos.csail.mit.edu/papers/biscuit.pdf https://www.usenix.org/sites/default/files/conference/protected-files/osdi18_slides_cutler.pdf This is encouraging--smart people making the most of Go in a new area, as it is today, without an active iterative feedback loop.

Re: [go-nuts] Strange behaviour of left shift

2018-12-05 Thread Michael Jones
Another way of saying it: "Go has Schrödinger's Constants." This captures the notion that a constant is of every type until you use it, whereupon it settles to the appropriate type based on the expectations of the use site. On Wed, Dec 5, 2018 at 2:55 PM Rob Pike wrote: > Most of this is

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Michael Jones
kage > to quickly see all of the supported types. > > Thus is why having a “rule” is tough to do in practice. > > > > On Dec 1, 2018, at 8:22 AM, Michael Jones wrote: > > I'll also add that personally I saw a lot of "change this" commentary with > rather l

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Michael Jones
ryone always started with that. You deserve it as does your code. Thank you! Michael On Sat, Dec 1, 2018 at 6:17 AM Michael Jones wrote: > I can see why you're feeling that. My sense is that what causes flare-ups > is when people (universally rather than just here) get the feeling that th

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Michael Jones
I can see why you're feeling that. My sense is that what causes flare-ups is when people (universally rather than just here) get the feeling that the discussion is becoming personal rather than technical. Go is lots of people's work / tool / job / fun / etc., so passions may be strong, but I've

Re: [go-nuts] [ANN] fixed point math library

2018-12-01 Thread Michael Jones
Which reminds me...these kinds of name changes deserve a thread/list in the Go2 proposals On Sat, Dec 1, 2018 at 12:17 AM Anthony Martin wrote: > Nigel Tao once said: > > Well, there's already context.Context, hash.Hash, image.Image and > > time.Time in the standard library. > > All of which

Re: [go-nuts] Is there a way to clear a map similar to slice = slice[:0]?

2018-11-28 Thread Michael Jones
[old post...bumping] why not delete(map) with the obvious meaning On Mon, Aug 13, 2018 at 7:43 AM Peter Edge wrote: > Yes, actually saw that a bit after I sent this email. Thanks for the link > though, appreciate it :-) > > On Mon, Aug 13, 2018 at 11:08 AM roger peppe wrote: > >> I believe

Re: [go-nuts] switch fallthrough as continue

2018-11-27 Thread Michael Jones
Absolutely what I was going to say. On Tue, Nov 27, 2018 at 6:32 AM Robert Engels wrote: > Breaks backwards compatibility as the switch may already be in a for loop > and using continue... > > On Nov 26, 2018, at 11:50 PM, Göcs Jëss wrote: > > We might as well reduce a one rarely used keyword

Re: [go-nuts] Trivial(?) Go v2 proposal: Named goroutines and/or named nested funcs

2018-11-25 Thread Michael Jones
also show up > in graphvis in the same manner) via comments might be best. A > post-processing tool to catch these comments and fix up the graphviz .dot > output is already showing promise in achieving what I am after. > > -Russ > > On Sun, 25 Nov 2018 at 20:13, Michael Jo

Re: [go-nuts] Trivial(?) Go v2 proposal: Named goroutines and/or named nested funcs

2018-11-25 Thread Michael Jones
just saying the we could make it so. the full name (for a func local var) would be funcName_varName_instanceNumber in some formatting. i think you're up against a "go attitude" decision here but it could help support the tooling spirit...would be nice to see the list if these at exit to quickly

Re: [go-nuts] Trivial(?) Go v2 proposal: Named goroutines and/or named nested funcs

2018-11-25 Thread Michael Jones
ahem, yes, an idea at that. still you'll need On Sun, Nov 25, 2018 at 4:36 PM Dan Kortschak wrote: > A way around that might be to use the name of the variable that holds > the anonymous function, defaulting to func#n when it's a func literal. > This should be able to be gleaned from the

Re: [go-nuts] Re: GoAWK: an AWK interpreter written in Go

2018-11-22 Thread Michael Jones
and always: https://www.cs.princeton.edu/~bwk/btl.mirror/awkc++.pdf On Thu, Nov 22, 2018 at 8:24 PM Tong Sun wrote: > > > On Tuesday, August 28, 2018 at 9:06:22 AM UTC-4, Ben Hoyt wrote: >> >> Once you have some proper benchmarks, it might be fun to compare GoAWK's >>> performance to that of my

Re: [go-nuts] Trivial(?) Go v2 proposal: Named goroutines and/or named nested funcs

2018-11-22 Thread Michael Jones
It is possible and easy to create named functions and launch them. a := func(stuff){morestuff} go a(args) On Thu, Nov 22, 2018 at 7:38 PM Russtopia wrote: > Perhaps this is actually supported in Go v1 and I'm just missing something > simple, but it appears one can do > > func A() { > go

Re: [go-nuts] Inconsistency in the casting int to byte

2018-11-18 Thread Michael Jones
It feels awkward...I’ve always felt the limit should be removed after the innermost cast because that’s when the programmer has said “treat this as type A” and then says “treat an A as a B with every implication that a narrowing conversion causes.” On Sun, Nov 18, 2018 at 9:55 AM Jan Mercl

Re: [go-nuts] [RFC] Dynamically instrumentation Go binaries

2018-11-15 Thread Michael Jones
You could study Rob Pike’s coverage/profiling tool to see how he adds and exploits basic block counting. Good work as always. On Thu, Nov 15, 2018 at 9:34 AM Robert Engels wrote: > AFAIK dtrace support is compiled in. If not enabled there are some tricks > to make is essentially zero cost, but

Re: [go-nuts] Re: Go 2 Proposal Comments

2018-10-28 Thread Michael Jones
To ground this last comment, every Java execution is a recompile in the sense that the JVM holds all the magic and applys it to a Java “binary” before and/or during execution. The “write once run anywhere slogan” is at best a statement of “you code once and we’ll localize and concreteize for you

Re: [go-nuts] Q16.16 fixed point numbers in go

2018-10-25 Thread Michael Jones
Guilty. ;-) It's also more complicated because of the desire for saturating arithmetic. On Thu, Oct 25, 2018 at 9:57 AM Scott Cotton wrote: > > > On Wednesday, 24 October 2018 18:52:27 UTC+2, Michael Jones wrote: >> >> https://en.wikipedia.org/wiki/Q_(number_format) says

Re: [go-nuts] Go 2 Proposal Comments

2018-10-24 Thread Michael Jones
hanges. If they have to happen (regrettably) then maybe it is good to make them in such a way that bon confusion between new and old was possible, or at least to the degree that is practical. On Wed, Oct 24, 2018 at 2:04 PM Ian Lance Taylor wrote: > On Wed, Oct 24, 2018 at 10:05 AM, Michael Jones

Re: [go-nuts] Go 2 Proposal Comments

2018-10-24 Thread Michael Jones
Agree on the industry dynamics observation--I remember too--but want to raise another point of view on 100% backwards compatibility: when Go was just a baby, in pre-1.0 days, there was exploration and new ideas. There was also "Go Fix" to rewrite "go of the past" as "go of today." This seemed

Re: [go-nuts] Q16.16 fixed point numbers in go

2018-10-24 Thread Michael Jones
https://en.wikipedia.org/wiki/Q_(number_format) says it all. you can use fixed point all the way...just shift after multiplies and before divides and use double-width (int32) or wider math. On Mon, Oct 22, 2018 at 3:24 PM Vasiliy Tolstov wrote: > Thanks for suggestions. > If somebody can look

Re: [go-nuts] While implement ssh client using golang, record keyboard input

2018-10-22 Thread Michael Jones
Seems natural to have an architecture where one loop reads the input and passes complete lines to a consumer. This reading loop would store lines in a list (array, buffer,...) and thus be able to resubmit them to the consumer. On Mon, Oct 22, 2018 at 1:57 PM Sun Frank wrote: > Hi Everyone: > >

Re: [go-nuts] Go language should become an ANSI and ISO standard.

2018-10-10 Thread Michael Jones
I was the engineering director for OpenGL’s birth and growth at SGI and have perspective on that process, and was for a long time a board member of the Open Geospatial Consortium (OGC) and have views from those ISO-related adventures. I’m with Ian on this—I quite deeply respect standards but see

Re: [go-nuts] Traverse directory without infinite loops while following symlinks

2018-10-09 Thread Michael Jones
Well, I only have myself to blame for the complexity then. ;-) There is no visible difference, but there is an invisible one--the visitor functions are now potentially parallel so they must not access shared variables casually. One choice is to use a channel, one is to use mutual exclusion. On

Re: [go-nuts] Traverse directory without infinite loops while following symlinks

2018-10-08 Thread Michael Jones
I was wrong too. Though I’m now puzzled about the UCLA book. It’s in my library. Will look. On Mon, Oct 8, 2018 at 4:06 AM Rob Pike wrote: > No, I was thinking of Occam but being wrong. > > -rob > > > On Mon, Oct 8, 2018 at 9:52 PM roger peppe wrote: > >> On 8 October 2018 at 08:53, Rob Pike

Re: [go-nuts] Traverse directory without infinite loops while following symlinks

2018-10-07 Thread Michael Jones
these comments help. > > > > ...Marvin > > > I'm a newbie at Go. These comments help me a lot. I appreciate all the > time these comments took. > > But it will take a little longer for me to grok Michael Jones' parallel > code. > > Thanks. > &g

Re: [go-nuts] Traverse directory without infinite loops while following symlinks

2018-10-07 Thread Michael Jones
%) in 1.1883 seconds celeste:since mtj$ ...changes in my last minute, each invisible to me. On Sun, Oct 7, 2018 at 9:10 AM Michael Jones wrote: > impressively patient response! > > choosing a serial vs concurrent approach matters too in terms of > performance. > > celeste:tour4

Re: [go-nuts] Traverse directory without infinite loops while following symlinks

2018-10-07 Thread Michael Jones
impressively patient response! choosing a serial vs concurrent approach matters too in terms of performance. celeste:tour4 mtj$ tour4 ~ Go walker [/Users/mtj] walked 293426 files containing 512174988291 bytes in 4.895 seconds walked 293426 files containing 512174988537 bytes in 4.918 seconds

Re: [go-nuts] pytogo 1.2 has shipped

2018-10-07 Thread Michael Jones
Goimports will scrub unneeded imports. On Sun, Oct 7, 2018 at 4:50 AM Eric Raymond wrote: > I am pleased to announce the release of pytogo 1.2. > > https://gitlab.com/esr/pytogo > > New features in this release: > > * PEP484 type hints are now converted into Go type signatures. > * Without

Re: [go-nuts] Build breaks for me since yesterday

2018-10-05 Thread Michael Jones
Thanks, I'll check it out. On Fri, Oct 5, 2018 at 10:00 AM Ian Lance Taylor wrote: > On Fri, Oct 5, 2018 at 9:57 AM, Michael Jones > wrote: > > > > Works for the last five or six years but now... > > > > --- FAIL: TestLldbPython (0.23s) > > runtime

[go-nuts] Build breaks for me since yesterday

2018-10-05 Thread Michael Jones
Works for the last five or six years but now... --- FAIL: TestLldbPython (0.23s) runtime-lldb_test.go:39: bad lldb --version output: lldb-1000.11.37.1 Swift-4.2 panic: runtime error: index out of range [recovered] panic: runtime error: index out of range Is this something wrong

Re: [go-nuts] What's the difference between local variables and fields when it comes to ignoring errors?

2018-10-02 Thread Michael Jones
I’m so glad to read this! I’m away from my computer but feeling like I’d failed a Go skill test...I could not imagine a problem either. On Tue, Oct 2, 2018 at 6:38 AM Ian Lance Taylor wrote: > On Tue, Oct 2, 2018 at 6:21 AM, wrote: > > > > I'd like to understand the reasoning in Go better. >

Re: [go-nuts] Re: Generic alternatives: new basic types?

2018-09-23 Thread Michael Jones
} > >>> > >>> What I am suggesting is merely that `==` desugars to a use of this > >>> interface. > >>> > >>> An important litmus test for any operator we consider for overloading > is > >>> whether we can come up with

Re: [go-nuts] Re: Generic alternatives: new basic types?

2018-09-22 Thread Michael Jones
the reason i wrote something like "...operator overloading, but wait, don't get excited..." was to bring awareness of a core problem without (hopefully) having people bring the burden of experience. i say burden because bad experiences can shadow the 'why' that was good with the 'how' that was

Re: [go-nuts] Re: Generic alternatives: new basic types?

2018-09-21 Thread Michael Jones
these seem excellent points all around. one area of difficulty seems to me the lack of operator overloading. now, hold your breath, i'm not arguing for it here. but it highlights a kind of structural issue that is in the air around the discussion of generics. consider: i instantiate a tree type

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-20 Thread Michael Jones
[Apologies to Dave Cheney, timely pushback for David Collier-Brown] David, I disagree and suggest your remark is not well considered. Three replies, one per sentence. *"Right now, this looks like the third draft of an academic project."* Not to me. This reads like years of thought and discussion

Re: [go-nuts] why does go reverse the order of name and type? "i int" vs "int i"

2018-09-20 Thread Michael Jones
the other answer is: "for c it made sense to ken and dennis, alas, we are not them" On Thu, Sep 20, 2018 at 1:32 AM Eric S. Raymond wrote: > Dan Kortschak : > > To avoid having to have something like this: > > > > http://c-faq.com/decl/spiral.anderson.html > > OK, we now have another candidate

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-18 Thread Michael Jones
the way to explain it is this: *support for using type-specific-but-parameterized written by A by caller B with their own types not anticipated or known by A; the ability for B to easily say, "I want A's excellent feature and I want to use it with my special B-only data type."* this cannot happen

Re: [go-nuts] Re: I am not in favor of generics.

2018-09-18 Thread Michael Jones
Thomas, Good morning old friend. Yes the implementation of axiomized arithmetic has proven difficult. Not that it is too hard, but because (I think) it requires a mindset alien to most developers. It works very well in the symbolic algebra system Axiom which is the acme; A matrix is not just "a

[go-nuts] A test for generics

2018-09-17 Thread Michael Jones
Firstly, my compliments to Russ, Robbert, and Ian, for patience, thoughtfulness, and insight. Whatever the best answer is, no doubt your intellectual process is an excellent way to find it. My comment is a meta-comment, a question/proposal: *if generics arrive in Go 2 then can we "go fix" Go 1

Re: [go-nuts] Re: Perf : Multithreaded goroutines files I/O

2018-09-16 Thread Michael Jones
don't be confused about internal process time and external wall clock time here. On Sun, Sep 16, 2018 at 11:27 AM Thomas Solignac wrote: > I think the concurrent read overhead compensates the process > parallelization ! > > Both files are in attachment. > > Thank you for helping :-) > > > > Le

Re: [go-nuts] Generics - Min challenge

2018-09-12 Thread Michael Jones
Compile-time logic feels like a baby/bathwater issue to me. With M4 and then CPP on the scene, new kinds of adaptable code became possible in C. It was such a compelling benefit (I still have the CSTRs) that it grew to ubiquity and finally to a monsterous horror in C++ that in recent decades,

Re: [go-nuts] Why GO do not have implemetion of algorithm ECIES

2018-09-11 Thread Michael Jones
https://www.google.com/search?ei=AsqXW9-zEIfc8APmmJ_oBA=ecies+golang=ECIES+go_l=psy-ab.1.0.0j0i22i30j0i22i10i30.39647.40358..42045...0.0..0.132.299.1j2..01..gws-wiz...0i71j0i20i263j0i67.6G44ZqkH1sA On Tue, Sep 11, 2018 at 4:46 AM Ally Dale wrote: > Hi everyone, > I'm interesting in

Re: [go-nuts] Re: Link: Getting specific about generics

2018-09-10 Thread Michael Jones
also...if you want to get really specific...for float32 and float64, x==x may not be true. (NaNs) On Mon, Sep 10, 2018 at 7:02 AM Jonathan Amsterdam wrote: > >> The problem is that the spec says that the operands of == have to be the >> same type >> > > Correction: one operand must be

Re: [go-nuts] Operator Overloading Implies Generics?

2018-09-09 Thread Michael Jones
can enter MakeCircle(...) but on save, that will become MakeCircleThreePoints(...). Easy for developer, clear for all future readers. No change to the language. Think of it as "continuous govet rewrites" On Sun, Sep 9, 2018 at 9:54 PM Lucio wrote: > > > On Sunday, 9 September

Re: [go-nuts] Operator Overloading Implies Generics?

2018-09-09 Thread Michael Jones
It is a good example of good and bad. NewCircle(details) is conceptually optimal. Everyone knows what is intended, and it is easier to type. On the down side, if things go wrong, you don't know what source code to go look at. I admit being confused before (C++) as to which overloaded

Re: [go-nuts] Re: Opening brace can't be placed on a separate line killing the language for me

2018-09-08 Thread Michael Jones
odsh97, More than a million Go programmers agree with you that format and readability is everything. We have a standard tool, go fmt, to ensure it. All Go code conforms. You'll like the uniformity. Michael On Sat, Sep 8, 2018 at 7:50 AM alanfo wrote: > I've never been able to understand why

Re: [go-nuts] Why can't we use unicode? [Go2 Generics]

2018-09-07 Thread Michael Jones
I brought this up way back in the early days. There will be an old post. The fear is mental inertia and muscle memory -- a new-to-beginners character set would not "sell". An easy compromise is go vet: it can translate between '>=" to '≥' rather easily. On Fri, Sep 7, 2018 at 6:17 AM Larry

Re: [go-nuts] Re: Go’s runtime vs virtual machine

2018-09-05 Thread Michael Jones
These are all great! If Pablo gets these points across to students, they will be well-informed. There is an interesting parallel to human languages. When I was a boy my father told me "you don't know a word if you can't define it." Sometimes people are comfortable with words they understand

Re: [go-nuts] Re: Go’s runtime vs virtual machine

2018-09-04 Thread Michael Jones
I might tell students step by step: machine code is understood and executed by a machine. -> the intel instruction to increment a register is decoded and executed by the CPU's hardware. virtual code is understood and executed by a program that pretends to be some virtual CPU. -> a Java VM might

Re: [go-nuts] Re: What am I missing here? FYI, I'm completely new to golang xD

2018-09-04 Thread Michael Jones
Block scope is a superpower since Algol. On Tue, Sep 4, 2018 at 7:29 AM Robert Engels wrote: > The real gotcha is this though, > > var x int > if blah { >x,err := somefunc() > } > > Probably does not do what you think as the value from somefunc() will not > be available outside of the if

Re: [go-nuts] Re: Are Go floats smarter?

2018-09-02 Thread Michael Jones
for money there is a natural limit to the number of digits that are useful, with certain exceptions . add to this the number of digits of fractional

Re: [go-nuts] Are Go floats smarter?

2018-09-02 Thread Michael Jones
Decimal arithmetic is good for money. Decimal fixed point is good for money. Decimal floating point may not be. Dividing 7 pennies by 4 is a good example. 7/4 = 1 3/4, so the 3/4 is accurately expressed in d fractional digits where base^d mod 4 == 0. For base-10 decimal arithmetic, this means two

Re: [go-nuts] Re: Are Go floats smarter?

2018-08-31 Thread Michael Jones
yes. another way to say it is that money is best considered integral in terms of some chosen "minimum accounting unit" which in the case of USD might be a dollar, a cent (1/100 dollar), or a finer thing, such as 1/100 or 1/1000 of a cent. This allows crossfooting to work, balances to zero, and

Re: [go-nuts] Character Replacement/Algorithm for Replacement

2018-08-30 Thread Michael Jones
Always true. But hard to believe that a map could be faster. The array will be on the stack. On Thu, Aug 30, 2018 at 9:31 AM Marvin Renich wrote: > * Michael Jones [180830 11:44]: > > The task to "translate a string through a table" is common. It is a > single > &

Re: [go-nuts] Character Replacement/Algorithm for Replacement

2018-08-30 Thread Michael Jones
The task to "translate a string through a table" is common. It is a single computer instruction (TR) in the IBM 360 and was extended over time with related instructions for conversion in and out of UTF-8, testing before and after translation, and expanded character sizes. Tamás Gulácsi's approach

<    1   2   3   4   5   6   >