Re: [go-nuts] Re: why defer function with parentheses

2018-01-29 Thread Michael Jones
w you want to > call a function later > > > > On Monday, January 29, 2018 at 12:29:56 AM UTC+8, Michael Jones wrote: >> >> Flying, another way to think of it is that fn is not a function call, it >> is a function pointer value--a value just like 3.14 or "true.&qu

Re: [go-nuts] Working with Floating-Point numbers

2018-02-12 Thread Michael Jones
Do you have particular questions? The overall situation is that floating point arithmetic is good, but not like real numbers or symbolic algebra; it is its own world and respecting the details is important (NaNs, representability, tolerance in comparison, etc.) On Mon, Feb 12, 2018 at 10:24 AM, Ia

Re: [go-nuts] Re: Proposal: return if any not nil

2018-02-17 Thread Michael Jones
The notion of "return X if Y" is fun...it means I'm waking up to SNOBOL in 2018. Fantastic flashback but awkward here. Changing formatting to allow single line "if X { trivial Y }" seems natural. On Sat, Feb 17, 2018 at 6:05 AM, wrote: > The OP's idea is the best one so far. What about the foll

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Michael Jones
much better! i suggest Google searches about bootstrapping, self-hosting, and security. On Sun, Feb 18, 2018 at 3:59 PM, Compiler wrote: > I have some experience in writing lexer,parser,interpreter,optimize. > I've also worked generate output code(example one language to another). > > currently

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Michael Jones
3:40:54 AM UTC+3:30, Compiler wrote: >>> >>> whats difference between self-hosting compiler vs Bootstrapping compiler? >>> >>> https://en.wikipedia.org/wiki/Bootstrapping_(compilers) >>> >>> On Monday, February 19, 2018 at 3:34:48 AM UTC+3:30, Micha

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Michael Jones
...you might also want to read the papers about META II. This was memorably inspired work from 1965 that is still marvelous. http://www.ibm-1401.info/Meta-II-schorre.pdf On Sun, Feb 18, 2018 at 5:46 PM, Pierpaolo Bernardi wrote: > On Mon, Feb 19, 2018 at 1:44 AM, Compiler wrote: > > Performance

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-19 Thread Michael Jones
Matthew Juran wrote: *"...but if you use maps, slices, append, make, you are already using generics."* This seems deeply insightful to me. Perhaps a better question than the self-defeatingly open question of "how should Go embrace generics?" would be "what change would allow maps, slices, append,

Re: [go-nuts] Float multiplication bug?

2018-02-22 Thread Michael Jones
https://play.golang.org/p/0XRLg6-6uPk On Thu, Feb 22, 2018 at 1:09 PM, andrey mirtchovski wrote: > in the first Printf "area" is truncated. try %.40f to see the real > value, which is more like: > > 262256.4523014638689346611499786376953125 > > plugging that in as h2 will result in > 39709429597

Re: [go-nuts] Float multiplication bug?

2018-02-22 Thread Michael Jones
finished. Steve, this may help explain. https://play.golang.org/p/tcy1QFZb-Fp On Thu, Feb 22, 2018 at 5:35 PM, Michael Jones wrote: > https://play.golang.org/p/0XRLg6-6uPk > > On Thu, Feb 22, 2018 at 1:09 PM, andrey mirtchovski > wrote: > >> in the first Printf "are

Re: [go-nuts] Re: Float multiplication bug?

2018-02-23 Thread Michael Jones
One subtle thing is the difference between an ideal number, its floating-point representation, and its printed form. On Fri, Feb 23, 2018 at 5:46 AM, wrote: > Thanks guys. That's very helpful. I forgot that what I saw (and re-used) > as the "height" was not precise enough to make it comparable.

Re: [go-nuts] Re: Float multiplication bug?

2018-02-23 Thread Michael Jones
This question is already answered, but i was on a plane and added a bit to the printing and the comments. in case anyone ever refers to this thread in the future, this is the better version of the program to run: https://play.golang.org/p/EK0XMnMUKwv On Fri, Feb 23, 2018 at 8:06 AM, Michael Jones

Re: [go-nuts] Is there some kind of memory write protection mechanism?

2018-02-25 Thread Michael Jones
Digg: If (thought experiment) Go had "const" for variables meaning "you can only set this once"... var x const int = 32 ...and you tried to use unsafe to get the address of x and remove its const-ness and then assign through it the value to x, what do you think would and should happen? a.

Re: [go-nuts] Is there some kind of memory write protection mechanism?

2018-02-27 Thread Michael Jones
Indeed. The concern here is unfounded. The original question was “why does it break?” and the answer is “because you used dangerous tools in a disallowed way.” That answer was not acknowledged; the subject was changed to “how can I trust anything that uses dangerous tools?” This time the answer

Re: [go-nuts] w, x += i, i+i

2018-02-28 Thread Michael Jones
AssignOp across seems far better than gang increment. Better yet... Thing1 += Thing2 With things being [3]float64 or struct{ r,g,b float64} which I do constantly The dream would be: Thing1 += f*Thing2 Which is the full desire, vs: P := fb[y*stride+x] P.r += f*fragment.r P.g += f*fragment.g P.

Re: [go-nuts] fast small prime checker

2018-03-04 Thread Michael Jones
ProbablyPrime() is for when the number is too big to test authoritatively. For numbers smaller than that, there are two schools of thought. The first is to do what you did, doing a primality test for the number at hand. The second is to use a table of results.The table generally needs to be of si

Re: [go-nuts] fast small prime checker

2018-03-04 Thread Michael Jones
indeed. i never uploaded that to github. but i could. will look into it. On Sun, Mar 4, 2018 at 1:40 PM, Bakul Shah wrote: > > > On Mar 4, 2018, at 12:43 PM, ralphdoncas...@gmail.com wrote: > > > > I am curious to see how you implemented the table lookup. Is the code > posted somewhere? > > Th

Re: [go-nuts] fast small prime checker

2018-03-04 Thread Michael Jones
...if that's how you feel, you'll enjoy the current discussion of vgo. On Sun, Mar 4, 2018 at 10:24 PM, wrote: > > > On Monday, 5 March 2018 02:13:18 UTC-4, Jan Mercl wrote: >> >> >> On Mon, Mar 5, 2018 at 12:55 AM wrote: >> >> > For my use case, I'll only be checking numbers > 2^18 and < 2^25.

Re: [go-nuts] Re: why is the "1" in the code demoed in Go spec deduced as a "float64" value instead of an "int" value?

2018-03-07 Thread Michael Jones
of course you can force it: https://play.golang.org/p/QIWDeMDJlAq On Wed, Mar 7, 2018 at 1:36 PM, wrote: > > > On Wednesday, March 7, 2018 at 4:26:19 PM UTC-5, di...@veryhaha.com wrote: >> >> get it almost. >> >> But I feel >> >> var v = float32(1<> is a little different to >> var v floa

Re: [go-nuts] fixed random number trouble

2018-03-15 Thread Michael Jones
As it turns out, repeatability of "random" experiments is very important, especially during development. On Wed, Mar 14, 2018 at 11:35 PM, Andrea Alessandrini wrote: > > > Il giorno mercoledì 14 marzo 2018 18:38:51 UTC+1, Burak Serdar ha scritto: >> >> It is explained here: >> >> https://golang.

Re: [go-nuts] Goroutines, Nonblocking I/O, And Memory Usage

2018-03-15 Thread Michael Jones
What about: "wait, then get a buffer from a pool, and return. client uses buffer, then restores it." The present API could be used if the input buffer was presumed to go directly to that pool if not null, or, if a null pool argument means what i suggest and a new ReadWithReturnedBufferToSubmitToYou

Re: [go-nuts] Re: Long running task in select case

2018-03-17 Thread Michael Jones
these are excellent answers. i offer a harsher one:* the wrong answer faster is not optimization. *the law of programming has correctness at its core--imagine reasoning about a program where "if 5 < 7{stuff}" executed 50% of the time, or even 99.% of the time. if it was faster, that simply wou

Re: [go-nuts] Re: Long running task in select case

2018-03-17 Thread Michael Jones
; being >> > an educator. Thinking quickly and making it work even with mistakes >> > can be >> > a valid approach sometimes. >> > >> > Matt >> > >> > On Saturday, March 17, 2018 at 2:05:55 PM UTC-5, Michael Jones wrote: >> > > &

Re: [go-nuts] Re: Would this race condition be considered a bug?

2018-03-18 Thread Michael Jones
Subtle observation--it is not fundamentally the memory model theorized in Go or C++ specifications that causes this--rather it is the *least strong guarantee of the hardware *on which these languages promise that *standard programs will work as specified, *and following that, the decision of langua

Re: [go-nuts] Re: Language is a platform, which golang still does not pay attention to !!!

2018-04-07 Thread Michael Jones
The question of "what does Go learn/take from C++" is subtle. I claim that Go takes everything the authors value in the change from C to C++. On Fri, Apr 6, 2018 at 9:42 PM, T L wrote: > > > On Friday, April 6, 2018 at 11:24:20 PM UTC-4, Hoo Luu wrote: >> >> >> >> 在 2018年4月7日星期六 UTC+8上午12:48:56,

Re: [go-nuts] Sorting slice of structs

2018-04-10 Thread Michael Jones
Change I i to I j On Tue, Apr 10, 2018 at 11:29 AM Sankar wrote: > Hi > > I have the following code: > > type Point struct { > Xint > Name string > } > > arr := []Point{ > Point{1, "One"}, > Point{3, "Three"}, > Point{2, "Two"}, > Point{4, "Four"}, > } > > log.Println("Before Sorting: ", arr

Re: [go-nuts] Sorting slice of structs

2018-04-10 Thread Michael Jones
We all saw it immediately ... because ... we remember having done it too. :-) On Tue, Apr 10, 2018 at 11:38 AM, Sankar wrote: > ah damn. Thanks everyone :) > > On Wednesday, 11 April 2018 00:05:00 UTC+5:30, Jan Mercl wrote: >> >> >> On Tue, Apr 10, 2018 at 8:29 PM Sankar wrote: >> >> > Any hel

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-27 Thread Michael Jones
Yuval, There are fundamental issues here. 1. That equation (de Moivre, Binet) is from the algebra of ideal numbers. Numbers of infinite precision. Not the realm of computer arithmetic. It works fine with double precision (go: float64, c/c++: double) up to F(75) but must fail for F(76) due to the

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Michael Jones
ee that in your > snippet)? > > (4) Wanted to compare "double" in C++ to "float64" in go. As they should > consume same amount of memory, have similar algorithms etc. but good to > know about the "big" package in go > > (5) Thanks for the reference

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-29 Thread Michael Jones
wever, if >>> i try to apply it on the C++ one (where there is no rounding), it makes >>> some of the tests fails. So, I guess that without rounding, the psi part is >>> needed >>> >>> (3) Is there a way to print the map ordered (didn't see that

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-30 Thread Michael Jones
Andrey, that's great! On the Fibonacci series evaluation, let's make sure that we're all doing the same calculation. For completeness and safety, let's skip all library values and derived values. Here are more-than-sufficient versions of the three constants in Yuval's code: // 40-decimal digit ap

Re: [go-nuts] float accuracy when calculating Fibonacci numbers

2018-04-30 Thread Michael Jones
using an optimally-precise Pow: 1: rounded = 1, both = 1., delta = +0.e+00 2: rounded = 1, both = 1., delta = +0.e+00 3: rounded = 2, both = 2.00

Re: [go-nuts] Go could really use a while statement

2018-05-01 Thread Michael Jones
Maybe he meant "until" aka "do {...} while cond" -- this is a valuable and missing mechanism. The argument back in the day was that having just one looping construct was more friendly to tooling. On Tue, May 1, 2018 at 5:45 AM Ian Lance Taylor wrote: > On Tue, May 1, 2018 at 4:11 AM, Hugh Fisher

Re: [go-nuts] Go could really use a while statement

2018-05-01 Thread Michael Jones
t simpler > to understand. > > On Tue, 1 May 2018 at 14:56, Michael Jones > wrote: > >> Maybe he meant "until" aka "do {...} while cond" -- this is a valuable >> and missing mechanism. The argument back in the day was that having just >> one looping con

Re: [go-nuts] Re: Go could really use a while statement

2018-05-01 Thread Michael Jones
The 'do' in this could be a 'for' if for allowed an optional 'while' after the close brace. On Tue, May 1, 2018 at 9:08 PM Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: > I have a preferred methtod for emulating do-while: > > notdone:=true > for notdone { > > if { > notdone

Re: [go-nuts] Go could really use a while statement

2018-05-02 Thread Michael Jones
Ok, weird proposal: Make the per-iteration update part of a for loop change from "assignment to assignment or boolean expression" to allow: *while COND do {...}:* for i:=0; x[i]<4; {...} *do {...} while COND:* for i:= 0; ; x[i]<4 { ...} On Wed, May 2, 2018 at 12:33 PM Louki Sumirniy < louki.

Re: [go-nuts] Go could really use a while statement

2018-05-02 Thread Michael Jones
but not this... https://play.golang.org/p/cZnSNvi7dNU On Wed, May 2, 2018 at 3:33 PM roger peppe wrote: > On 2 May 2018 at 22:06, Michael Jones wrote: > > Ok, weird proposal: Make the per-iteration update part of a for loop > change > > from "assignment to assignment or

Re: [go-nuts] Go could really use a while statement

2018-05-02 Thread Michael Jones
i code that often and comfortably. On Wed, May 2, 2018 at 10:45 PM Sokolov Yura wrote: > > for { > Body() > if !Condition() { > break > } > } > > It is thats simple, guys. > > -- > You received this message because you are subscribed to the Google Grou

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Michael Jones
J is the beautiful result of the APL road. On Thu, May 3, 2018 at 8:47 PM Lucio wrote: > I never felt the need to join an APL fan club, but you sure tempt me, > Bakul! > > Is there one, or do we need to start one? What would be the minimal entry > qualification? > > APL is the only language I le

Re: [go-nuts] what is the binary code share mechanism of golang ?

2018-05-04 Thread Michael Jones
Hello. Trying to understand your question. JAR files are the result of compiling source to a "ready for execution" state (using a CPU and OS-specific interpreter). DLL and SO are the result of compiling source to a specific, "ready for execution on a particular CPU and with a particular OS." Go pr

Re: [go-nuts] Re: Go could really use a while statement

2018-05-09 Thread Michael Jones
I was serious this time and the first time (years ago now) that this came up. My motivation was not really core to the Go manifesto; in addition to all the good Go usage model things, I also like using it to teach or show algorithms. In this use I wanted to be able to naturally present both: while

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Michael Jones
Maybe the central issue here has been lost because of the confusion between English words and the keywords of various languages. Let's be explicit: *a controlled looping construct may test the control condition before or after the iterated body of code. Go's 'for' tests before and and Go does not p

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Michael Jones
So sorry to learn of your mistreatment. I've never been struggled in an anti-do-while cultural revolution, though I can imagine the lasting emotional harm. I always* thought that C's "do {stuff} while (cond);" was a victim of syntax. The cond is far away and hidden from the do. An idea from the Go

Re: [go-nuts] Re: Go could really use a while statement

2018-05-10 Thread Michael Jones
*always as in, from learn on 6th edition at BTL in 1977. On Thu, May 10, 2018 at 3:29 PM Michael Jones wrote: > So sorry to learn of your mistreatment. I've never been struggled in an > anti-do-while cultural revolution, though I can imagine the lasting > emotional harm. > &g

Re: [go-nuts] Re: Please help me solve a bug with my licencing system!

2018-05-11 Thread Michael Jones
helping is not wasting time. glad you are using Go! On Fri, May 11, 2018 at 3:35 PM wrote: > solved, hex.encode in server. simple mistake, sorry to waste you guys time! > > On Thursday, May 10, 2018 at 11:23:43 PM UTC-5, ati...@mail.ccsf.edu > wrote: >> >> Hello all, >> >> I am creating a simple

Re: [go-nuts] Re: Go could really use a while statement

2018-05-12 Thread Michael Jones
I bet Rob wishes he'd done that after the code reviewer's objections. On Sat, May 12, 2018 at 8:20 AM wrote: > It's certainly diverged from my original post, which is why I'm staying >> quiet. > > > I was hoping to get back on track after you sent this so you’d want to > participate. > > goto is

Re: [go-nuts] Re: Go license and fitness for purpose

2018-05-17 Thread Michael Jones
perhaps some context will make this clearer. no reference is being made to any actual persons or events. 1. It is the observed habit of people (plaintiff's) bring suit in court when something goes wrong. Ex: airplane crash, dark spot on potato chip, food is too hot, etc. 2. Plaintiff's attorneys

Re: [go-nuts] Re: Having difficulty converting []byte to float

2018-05-18 Thread Michael Jones
yes, the example there is perfect: https://play.golang.org/p/QvPm90SUgiX On Fri, May 18, 2018 at 7:44 PM Tashi Lu wrote: > There is a function for this in the math lib Float64Frombits, a similar > question: > https://stackoverflow.com/questions/22491876/convert-byte-array-uint8-to-float64-in-gol

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

2018-08-12 Thread Michael Jones
What does it mean to clear a map? Even if Go admitted that a map was a specific form of hash table with certain chaining/bucket choices, what would an empty one be that is different than a new one? I can think of answers to this but if you say what behavior you want to optimize by clearing and reus

Re: [go-nuts] Re: Ternary ... again

2018-08-15 Thread Michael Jones
Mark, Some considerations that may be unclear when approaching Go and considering anything familiar from other languages that is not in Go... MAKING DECISIONS Go's designers are experienced. with central roles in UNIX, C, GCC, Modula, etc., and also across teams of various scales and diversities

Re: [go-nuts] Old fashioned Unix password crypt

2018-08-23 Thread Michael Jones
https://minnie.tuhs.org//cgi-bin/utree.pl?file=V6/usr/source/s1/crypt.c On Thu, Aug 23, 2018 at 10:32 AM Lucio wrote: > Am I missing something altogether too trivial, or is the modified DES > encryption used in the old fashioned Unix /etc/passwd file just not > implemented in Go at all, not eve

Re: [go-nuts] Re: function's argument default value

2018-08-24 Thread Michael Jones
Reinforcing comments above: defaults are not *missing*, they have been *avoided*. One can argue default arguments are either a mistake in API design or neglect in code refactoring. On the mistake side, the argument is that making "cook(n)" mean "make pizza if n is missing or cook n if otherwise" a

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 w

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] 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 othe

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-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 p

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 sta

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 r

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 genera

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 Clapp

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 'g

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 function/me

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] 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 assignable

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&q=ecies+golang&oq=ECIES+go&gs_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 interest

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, thro

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 d

[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 cod

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 ma

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] 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 f

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] 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 t

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 bad.

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

2018-09-23 Thread Michael Jones
; >>> Equals(T) bool > >>> } > >>> > >>> 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

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. > >

[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 loca

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) > > ru

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 PEP4

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 walk

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
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. >

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 w

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 Tu

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 t

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: > > I

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 a

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 geniu

Re: [go-nuts] Go 2 Proposal Comments

2018-10-24 Thread Michael Jones
e for changes. 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

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)

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 a

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] 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 <0xj...

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 func

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-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 analys

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 sp

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

2018-11-25 Thread Michael Jones
s (and defer blocks which 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 201

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] 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 thi

  1   2   3   4   5   6   >