Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-19 Thread Michael Jones
You sure seem eager to post negative things from your gmail account. Do you troll only, or is there anything of substance? If there is something about the Go language or computer programming that you wish to share it would be welcome: perhaps open source software you’ve written and want

Re: [go-nuts] Does reducing capacity of a slice return memory?

2019-07-19 Thread Michael Jones
There is a difference in the meanings of terms in this discussion, maybe that’s confusing to some. (That is, Ian went right to the heart of the matter but maybe a simpler fact needs to be made plain to others.) When you think of the memory used by a slice and of maybe using less of it and

Re: [go-nuts] Need help to learn go lang

2019-07-19 Thread Michael Jones
Veeresh, Welcome to the world of programming. It is a beautiful world and has been my joy for fifty years. It is magical to have a robot friend to multiply your abilities by millions of times. Learning about programming at the very start is a small group of tasks: learning a few details like

Re: [go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-18 Thread Michael Jones
Ha! https://github.com/rstuven/vscode-iferrblocks On Thu, Jul 18, 2019 at 10:32 AM Jim Robinson wrote: > Is it named try? :P > > On Wednesday, July 17, 2019 at 8:37:53 PM UTC-7, Michael Jones wrote: >> >> There is a special “collapse if err != nil blocks plugin for VS co

Re: [go-nuts] mutexes, etc

2019-07-17 Thread Michael Jones
Go has an unusual (clever!) property that anything whose address “escapes” from your routine will magically be allocated on the heap _no matter if it looks like heap or local allocation. Conversely, even explicit heap allocations that don’t escape will/may be local (will up to 10 MiB). Is data

Re: [go-nuts] Do Any Editors Support Customisable Code collapsing?

2019-07-17 Thread Michael Jones
There is a special “collapse if err != nil blocks plugin for VS code. On Wed, Jul 17, 2019 at 5:37 PM wrote: > Context: > 1. Golang can be very verbose, for example checking if err != nil after a > function call takes 3 lines: > if err != nil { >return nil, fmt.Errorf("some context: %v",

Re: [go-nuts] Re: About the Google logo on the new Go website

2019-07-17 Thread Michael Jones
. It feels base and unseemly to me. Maybe you could reconsider your posture. Michael Jones Ever grateful for manna from heaven On Tue, Jul 16, 2019 at 9:05 PM Anca Emanuel wrote: > @all, what do you think of Oracle ? > That is not an company, that is an monster. > > On Monday, July 15,

Re: [go-nuts] Go for Data Science

2019-07-16 Thread Michael Jones
Leo, R is implemented in C and FORTRAN plus R on top of that. SAS is in C (and some Go here and there) plus the SAS language in top of that. Mathematica is implemented in C/C++ with the "Wolfram Language" on top of that. PARI/GP is implemented in C plus some GP-language code. Macsyma, Maple,

Re: [go-nuts] How to store the address of C struct on Go side in an array (cgo)

2019-07-12 Thread Michael Jones
It is really impossible to help you debug what is to the thousands of readers here an invisible unseen program. You have a logic error. You don't know where it is (of course, you are busy trying to find it) but we can't know either as we don't see the code. General advice, as always, is to "trap"

Re: [go-nuts] Re: [ANN] VictoriaMetrics - fast open source time series database written in Go

2019-07-11 Thread Michael Jones
:05:35.408417 time 3.975375 sec elapsed, 25.803189 sec user + 0.985283 system 2019/07/11 10:05:35.408424 rate 189 242 887 bytes/sec, 42 839 444 tokens/sec, 5 767 273 lines/sec, 44 files/sec 2019/07/11 10:05:35.408431 cpus 7 workers (parallel speedup = 6.74x) celeste:gg mtj$ There is no doubt

Re: [go-nuts] Re: [ANN] VictoriaMetrics - fast open source time series database written in Go

2019-07-11 Thread Michael Jones
I use Klaus' library to decompress ~GiB files that have been compressed by zstd command line (c/c++ code) at level 19. Works great. On Thu, Jul 11, 2019 at 9:10 AM Klaus Post wrote: > On Thursday, 11 July 2019 17:37:09 UTC+2, Aliaksandr Valialkin wrote: >> >> >> >> This is really great idea!

Re: [go-nuts] Avoiding resource leaks with racing channels

2019-07-10 Thread Michael Jones
unbuffered means nothing is sent until is is simultaneously received, so there is no limbo or race or uncertainty. one sender "wins" the select and the others remain blocked waiting. On Wed, Jul 10, 2019 at 6:24 AM Dan Eloff wrote: > Maybe I'm wrong here in my understanding of unbuffered

Re: [go-nuts] new godoc layout

2019-07-09 Thread Michael Jones
color change, from aqua to teal, was jarring to me. On Tue, Jul 9, 2019 at 2:14 PM mh cbon wrote: > ... is awesome. so much better to read. much much more enjoyable. > > > Thank you! > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To

Re: [go-nuts] Re: net/http and the GC

2019-07-08 Thread Michael Jones
Very fortunate! On Mon, Jul 8, 2019 at 1:20 PM B Carr wrote: > > > On Monday, July 8, 2019 at 1:01:26 PM UTC-6, Burak Serdar wrote: >> >> >> > I'll need to study this a bit more. Can you give me a pointer? >> >> I don't know really, other than the obvious ones like: >> >>

Re: [go-nuts] Re: ioutil.ReadDir sort order

2019-07-06 Thread Michael Jones
Indeed, you have two choices: create file names with fixed width numbers: Printf “file%08dv%02d.dat”, f,v Or do a string/number parse of the names before sorting and separate the numbers, you can insert spaces/zeroes and then string sort, or you can parse the numbers and compare them

Re: [go-nuts] Re: Announcing gg ("gigi") your new friend

2019-07-04 Thread Michael Jones
ote: > What's your recommended strategy for installing it on linux? I guess it'll > take a few years before distributions have easy-to-install packages just > listed in their indices. > > On Thursday, July 4, 2019 at 6:11:47 PM UTC+2, Michael Jones wrote: >> >> Recent

[go-nuts] Announcing gg ("gigi") your new friend

2019-07-04 Thread Michael Jones
Recently I shared my Survey program, saying that it was a sidestep from what I was working on but interesting and hopefully useful to others. Here is the real thing, named gg, that Survey was a test for. GG combines lexical analysis and Go-native pattern

Re: [go-nuts] Re: `on err` alternative to `try()` has traction...?

2019-07-03 Thread Michael Jones
Any form of restraining gofmt has my vote. One that I despise is ruining: switch v { case ‘a’: doA = true case ‘b’: doB = true : case ‘z’: doZ = true } Just had this two days ago. So sad to see it balloon up On Wed, Jul 3, 2019 at 11:36 AM Aston Motes wrote: > This proposal is not very much

Re: [go-nuts] OOM occurring with a small heap

2019-07-02 Thread Michael Jones
process memory size. > > On Jul 1, 2019, at 9:11 PM, Mighty Guava wrote: > > I don't understand. What would adding runtime.Goscheduled() do here? I > don't have any explicit loops in this service. > On Jul 1, 2019, 9:11 PM -0400, Michael Jones , > wrote: > > Does addi

Re: [go-nuts] OOM occurring with a small heap

2019-07-01 Thread Michael Jones
; I don't understand. What would adding runtime.Goscheduled() do here? I > don't have any explicit loops in this service. > On Jul 1, 2019, 9:11 PM -0400, Michael Jones , > wrote: > > Does adding runtime.GoSched() calls make any difference? > > On Mon, Jul 1, 2019 at 5:37 PM 'Yun

Re: [go-nuts] OOM occurring with a small heap

2019-07-01 Thread Michael Jones
Does adding runtime.GoSched() calls make any difference? On Mon, Jul 1, 2019 at 5:37 PM 'Yunchi Luo' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Following that logic, a leak of TCP connections should manifest as a file > descriptor leak. We have the process_open_fds metric from

[go-nuts] Counter-counter-counter proposals

2019-06-30 Thread Michael Jones
With so many strongly worded emotional emails flying it might be helpful to remember that language design is about other people and other use cases than your own. The truly good answer meets the needs of many and harms few, anticipates that no answer is final, and is flexible. Here is a nice way

Re: [go-nuts] The "leave "if err != nil" alone?" anti-proposal

2019-06-30 Thread Michael Jones
It seems to me that the try() mechanism could easily be undone by gofmt. That is, if it does not work out it could be changed with low pain. This is a virtue. Maybe the lesson is lost on some, but Go 1.0 was incompatible with primordial Go and the Go team provided GoFix to mutate code. That was

Re: [go-nuts] YAEHI (Yet another error-handling idea)

2019-06-29 Thread Michael Jones
My personal thought, though it may seem strange, is that the best argument for it lies in the single word sentence at the bottom of your email. You write "Thoughts?" -- and that is very expressive in English in just the way that you mean above in your examples. I don't know enough other languages

[go-nuts] Go language survey tool

2019-06-28 Thread Michael Jones
Announcing *Survey*, a general purpose utility that may be of interest to those curious about how how the Go language is used at a token level. When I posted a survey of the Go 1.13 source tree and of the Go Corpus a week ago, several people wrote and asked that I share. The program at that time

Re: [go-nuts] The Seven Finest Go Books (to popularize and 'socialize' Go).

2019-06-21 Thread Michael Jones
profound > enlightenment experience you will have when you finally get it; that > experience will make you a better programmer for the rest of your days, > even if you never actually use Lisp itself a lot.*" > > ~Akram > > On Thursday, June 20, 2019 at 6:12:51 PM UTC-5, Michael Jones wrote

Re: [go-nuts] The Seven Finest Go Books (to popularize and 'socialize' Go).

2019-06-20 Thread Michael Jones
There is a marvelous book that is about Go in a magical way...it explains and teaches Go’s personality and attitude...from before Go was born. Read Rob Pike and Brian Kernighan’s “The Practice of Programming.” After reading it carefully you will understand Go in a deeper way than would otherwise

Re: [go-nuts] Re: is there a goroutine scope global veriable ?

2019-06-19 Thread Michael Jones
For the OP: A thought to share on the general topic: Go is pioneering a sufficiently different model of concurrent computation that it may not make much sense to ask for or seek equivalencies with classic thread/process models. This says nothing against the standard model, nor against the

Re: [go-nuts] Re: Go Language Survey

2019-06-16 Thread Michael Jones
lance (1:1) [0:0] {2:0}» 2019/06/16 17:57:59.844871 bad /Users/mtj/go/test/syntax/semi5.go «balance (1:1) [0:0] {1:0}» 2019/06/16 17:57:59.844879 bad /Users/mtj/go/test/syntax/vareq.go «balance (1:1) [1:1] {2:1}» On Thu, Jun 13, 2019 at 12:00 AM Michael Jones wrote: > The "src"

Re: [go-nuts] Newbie question on slice bound checking

2019-06-16 Thread Michael Jones
It has been, yes, and unless it changed in the last few weeks, it still is. I use to to measure cost as an awareness metric, but seldom run that way. Go is safe until you do that, then it becomes unsafe. Too risky for serious use. On Sun, Jun 16, 2019 at 4:53 AM Ugorji Nwoke wrote: > I know

Re: [go-nuts] Re: Go Language Survey

2019-06-13 Thread Michael Jones
now which files have issues. I am here working on it at this very moment... // Survey gathers and reports simple statistics about Go code by lexical analysis // Author: Michael Jones // // Survey files named in the file list of the "-f" argument and then those listed in command line // argum

Re: [go-nuts] Re: Go Language Survey

2019-06-12 Thread Michael Jones
Volker, did you see a few posts back that I did the run Roger asked about, on RSC’s huge corpus? It is about 10x the size and its parens, braces, and brackets match just fine, all *7476284* of them On Wed, Jun 12, 2019 at 2:13 PM Michael Jones wrote: > They matched up until yesterday. W

Re: [go-nuts] Re: Go Language Survey

2019-06-12 Thread Michael Jones
re ] than [ ? > > Are you parsing testfiles with deliberate errors? > > V. > > On Wednesday, 12 June 2019 15:08:44 UTC+2, Michael Jones wrote: >> >> I've been working on a cascade of projects, each needing the next as a >> part, the most recent being rewriting text

Re: [go-nuts] Go Language Survey

2019-06-12 Thread Michael Jones
this, I am going to make a local version and hook it to vs code. Why did I not think of this before! Wow. On Wed, Jun 12, 2019 at 9:24 AM Bakul Shah wrote: > On Jun 12, 2019, at 8:24 AM, Michael Jones > wrote: > > > > Bakul, these are good points. > > > > On t

Re: [go-nuts] Go Language Survey

2019-06-12 Thread Michael Jones
ParallelMode] ...oh to dream. On Wed, Jun 12, 2019 at 7:56 AM Bakul Shah wrote: > On Jun 12, 2019, at 7:36 AM, Michael Jones > wrote: > > > > 128640 If statements, and just 8034 else, a 16:1 ratio. I'd like to > understand this better, > > There are two patterns

Re: [go-nuts] Go Language Survey

2019-06-12 Thread Michael Jones
p;& ch <= '9') ... there are some extra '0's in there. On Wed, Jun 12, 2019 at 6:49 AM Ian Lance Taylor wrote: > On Wed, Jun 12, 2019 at 6:08 AM Michael Jones > wrote: > > > > I've been working on a cascade of projects, each needing the next as a > part, the most r

[go-nuts] Go Language Survey

2019-06-12 Thread Michael Jones
I've been working on a cascade of projects, each needing the next as a part, the most recent being rewriting text.Scanner. It was not a goal, but the existing scanner does not do what I need (recognize Go operators, number types, and more) and my shim code was nearly as big as the standard library

Re: [go-nuts] Allow methods on primitives

2019-06-10 Thread Michael Jones
The Go2 proposal process is open minded. Suggest that every well-considered suggestion be made. Personally, I’m no fan of idiomatic as an argument, it seems more of a consequence—like bare earth paths worn through grassy parks—when the paved sidewalks are in the wrong place, the idiomatic path

Re: [go-nuts] Allow methods on primitives

2019-06-08 Thread Michael Jones
To emphasize the wisdom: With an implicit conversion like you mentioned, the F(x) invocation at the bottom expects B.SomeFunc() will be called but in fact, A.SomeFunc() will be called. That's why this is an error. You can still do F(A(x)), which explicitly makes a copy of x as an A. This is not

Re: [go-nuts] Re: How to control go routine numbers in function call

2019-06-07 Thread Michael Jones
Here’s a helper... https://github.com/korovkin/limiter/blob/master/README.md You can do it using several other mechanisms as well. On Fri, Jun 7, 2019 at 6:31 PM Joseph Wang wrote: > I mean at same time only 4 go routines run and then creat another 4 etc. > > On Fri, Jun 7, 2019 at 6:27 PM

Re: [go-nuts] There are post-quantum public key cryptograph in Go ? or binds to Go? Thanks.

2019-06-07 Thread Michael Jones
Your question is maybe a decade premature. Post-quantum cryptography, as in, “now that quantum encryption is here and understood, we have tools to build public key mechanisms provably safe for 50+ years in this post-quantum environment,” is mostly a sentence from the future. I have patents

Re: [go-nuts] Acquiring database new connections slow using pgx and pq

2019-06-07 Thread Michael Jones
Are you saying that it takes 7 seconds to make a connection? On Thu, Jun 6, 2019 at 5:26 PM wrote: > I noticed that when executing concurrent db queries against my Postgres > db, the response time gets slower linearly with the number of goroutines > (at the order of O(N)). The first connection

Re: [go-nuts] Pattern Syntax in Golang

2019-06-05 Thread Michael Jones
Nadim, from what you have written I sense that you appreciate (or will enjoy learning about) the style of programming that emerged with SNOBOL some time ago. The notion of programming not just by saying "do this, then this, then..." but at a higher and more conceptual level of *matching*

Re: [go-nuts] How can I debug high garbage collection rate cause high CPU usage issue in golang

2019-06-04 Thread Michael Jones
Perhaps this is obvious, but suddenly heavy garbage *collection* operations suggest heavy garbage *creation* operations; that new code or structure is allocating and discarding more than the old. You've gone from single to multiple caches, so my thoughts go to: is data cached redundantly? (is the

Re: [go-nuts] Announcing NSWrap -- a comprehensive Objective-C binding generator for MacOS

2019-05-31 Thread Michael Jones
This is impressive. Thank you. On Fri, May 31, 2019 at 9:33 AM Greg Pomerantz wrote: > Also I don't think an API is going to assume or require ARC -- as far as I > understand it, ARC is just a compiler shortcut that adds retain and release > calls so the programmer doesn't have to, it is not

Re: [go-nuts] Re: how to implement channel priorities?

2019-05-24 Thread Michael Jones
I see an easy* way to implement channel priorities in Go2 if that is desired. two steps: step 2: At lines 124 and 153-157 of src/runtime/select.go, an *order of channel testing* index table is created, then permuted. It is later visited in order. All that needs doing is to make the index table

Re: [go-nuts] Aggressive Golang Garbage Collection Issues When Using cgo?

2019-05-24 Thread Michael Jones
and when you change that "pass a pointer" to "have a shim c-side function return a uint32 that you just assign on the Go side," what happens? On Fri, May 24, 2019 at 8:52 AM Steven Estes wrote: > Thankyou Ian, > > I did try a few runs with GODEBUG set to "cgocheck=2" and just the > "normal"

Re: [go-nuts] constatnt conversion question

2019-05-21 Thread Michael Jones
ting to you, there are discussions about related matters and possible changes for Go 2 in various proposal threads. On Mon, May 20, 2019 at 11:50 PM wrote: > Could you please clarify which statement your example is meant to > confirm or refute? > > > > On 5/20/19, Michael Jones

Re: [go-nuts] constatnt conversion question

2019-05-20 Thread Michael Jones
ahem... https://play.golang.org/p/7gcb9Yv7c9e On Mon, May 20, 2019 at 2:45 AM wrote: > https://golang.org/ref/spec#Constants > > "A constant may be given a type explicitly by a constant declaration > or conversion, or implicitly when used in a variable declaration or an > assignment or as an

Re: [go-nuts] Re: the Dominance of English in Programming Languages

2019-05-18 Thread Michael Jones
'carcer' is the word. jail/gaol are just johnny-come-lately. On Sat, May 18, 2019 at 9:43 AM David Riley wrote: > On May 18, 2019, at 05:59, ma...@madra.net wrote: > > On Saturday, 18 May 2019 00:44:33 UTC+1, Rob 'Commander' Pike wrote: >> >> jail is a clear improvement over the ludicrous

Re: [go-nuts] Re: the Dominance of English in Programming Languages

2019-05-17 Thread Michael Jones
r", "centre", "programme", etc. > > I wonder if I'm am isolated case, or whether any other native English > speakers are slightly irked by having to code in "bad spelling" too? > > > On 17 May 2019 21:26:29 Michael Jones wrote: > >> I know tha

Re: [go-nuts] Re: the Dominance of English in Programming Languages

2019-05-17 Thread Michael Jones
I know that you joke here, but I had an interesting dinner conversation in London last year with erudite, scholarly friends who shared with me that recent research supports a different view of the "barbaric Americanised false English" that is the prevailing sentiment you share. According to the

Re: [go-nuts] Re: Go documentation - how to determine what implements an interface?

2019-05-16 Thread Michael Jones
The magical Go phrase is "implicitly implements." What you want is to make that explicit in the documentation. On Thu, May 16, 2019 at 1:16 AM 'White Hexagon' via golang-nuts < golang-nuts@googlegroups.com> wrote: > Thanks. Tools are fine, but a new developer has to know about them. So I >

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-05-14 Thread Michael Jones
On Mon, May 13, 2019 at 7:46 AM wrote: > Given the extent of responses to the original question by the Go community > (pro and con), hopefully those responsible for Go syntax will re-visit the > issue and decide whether Go statement "if test then {.. } else { .. }" > prevents any possible abuse

Re: [go-nuts] How to run a go method on multiple cores ?

2019-05-08 Thread Michael Jones
Can you share a little more of your motivation for saying: “I want two instances of syslog-ng engine running on two different processors.” Do you mean (minimum) that you want two independent instances, or (maximum) that you want to prove that there are two instances, two physical processors, and

Re: [go-nuts] Re: How to run a go method on multiple cores ?

2019-05-07 Thread Michael Jones
Perhaps you will find this blog post (and the related ones before and after) and the videos linked at the bottom to be faster. https://blog.golang.org/pipelines On Tue, May 7, 2019 at 6:22 AM wrote: > Can anyone recommend a good on-line doc for goroutines ? The best one I've > found so far

Re: [go-nuts] Re: Random panic in production with Sprintf

2019-05-02 Thread Michael Jones
Is any of this string data touched/from C via CGO? On Thu, May 2, 2019 at 3:09 PM Anthony Martin wrote: > Ian Lance Taylor once said: > > I don't *think* the format string is changing. I think the 0 is from > > the string being printed, not the format string. They both happen to > > be

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-27 Thread Michael Jones
Agree completely. Despite my reasoned comfort with Go’s rationale I miss quite a few “but I want to express this algorithm beautifully for the ages” features. I don’t miss the ternary syntax but miss the natural way to say “it is an assignment, first, but subject to logic, second.” Same as I miss

Re: [go-nuts] Go if else syntax .. suggested replacement

2019-04-26 Thread Michael Jones
The last time there was a big thread about this, I explained how GCC added “value of brace block is value of last expression” to allow great power, and a fellow poster explained how this came into being with Algol-68. There is long history in these ideas, and much value, but Go specifically chose

Re: [go-nuts] Re: Go if else syntax .. suggested replacement

2019-04-24 Thread Michael Jones
switch test { case true: //..code block for test=true case false: //..code block for test=false } On Wed, Apr 24, 2019 at 4:42 PM Dan Kortschak wrote: > How would you preclude it? > > On Wed, 2019-04-24 at 16:28 -0700, lgod...@gmail.com wrote: > > I am NOT in favor of allowing nested

Re: [go-nuts] how to get file's current offset

2019-04-19 Thread Michael Jones
I’ve been doing that since 6th Edition, 1976/77 On Thu, Apr 18, 2019 at 8:00 AM andrey mirtchovski wrote: > > offset, err := f.Seek(0, io.SeekCurrent) > > my code has been written so long ago i didn't even notice os.SEEK_CUR > is deprecated :) > > -- > You received this message because you are

Re: [go-nuts] Current Thinking on Explicit Memory Freeing?

2019-04-17 Thread Michael Jones
There are two issues here: 1. *"I'm done with this and I want to free it now."* It seems helpful as a programmer to say such things. I wanted that once. The problem with it is that the runtime can't trust you if you say it. At best it can put the address on a list to be examined, but only a GC

Re: [go-nuts] floating point question

2019-04-16 Thread Michael Jones
These "floating-point is weird" discussions tend to be unfair to the virtues of floating point. ;-) The numbers in computers are NOT the numbers of mathematics. They do not have the same properties, promises, and definitions. So instead of shaking our fists at the computer when we're reminded of

Re: [go-nuts] how to use an instance across functions in a package w/o global vars

2019-04-12 Thread Michael Jones
This is really about you, your taste in design, and your sensibilities for information hiding. If you have a global symbol, be it a function name or data item, then that's what it is, a global. Globals, r/w data especially, invite subtle sharing complications, can cause complexity in attempts at

Re: [go-nuts] Modifying the Runtime Scheduler

2019-04-08 Thread Michael Jones
I have no experience with this code...but a lot of debugging experience. Since you think you know the general problem and have both hands inside the patient already, why not (for now) modify the GC scanner to always look at your batch’s pointer list and explicitly avoid messing with them. Then

Re: [go-nuts] Re: [ANN] Gomail v2: sending emails faster

2019-04-07 Thread Michael Jones
If those black boxes represent Go language code, please share it here by pasting it into the Go Language Playground and then sharing a link in email here. It is impossible to understand these rectangles on my phone. On Sat, Apr 6, 2019 at 11:10 PM wrote: > hi, i use this code, I can't make it

Re: [go-nuts] What happens when you call another method within a method set at the end of a method

2019-04-06 Thread Michael Jones
The opportunity to optimize yb tail-call elimination comes up in my coding from time to time. It is generally trivial to do but sometimes less so, and this example by Ian Denhardt is one I'd never considered and one that would make doing the rewrite yourself impossible. Generally though it is

Re: [go-nuts] Re: proposal: Go 2: add untyped() type conversion for integer constants #31076

2019-03-29 Thread Michael Jones
I updated https://github.com/golang/go/issues/31076 to reflect the comments here. Thank you both. On Fri, Mar 29, 2019 at 9:57 AM Ian Lance Taylor wrote: > On Thu, Mar 28, 2019 at 11:17 PM Jan Mercl <0xj...@gmail.com> wrote: > > > > The Compatibility section of the proposal says: "I think that

[go-nuts] Re: proposal: Go 2: add untyped() type conversion for integer constants #31076

2019-03-29 Thread Michael Jones
Very helpful. Thank you. I will edit my proposal based on this. On Thu, Mar 28, 2019 at 11:17 PM Jan Mercl <0xj...@gmail.com> wrote: > The Compatibility section of the proposal says: "I think that this would > break no existing code, as a user function invocation untyped(EXPR) is not > at

Re: [go-nuts] Very long API call

2019-03-27 Thread Michael Jones
"*" On Wed, Mar 27, 2019 at 1:06 PM Michael Jones wrote: > You left off the "=" key. Must be "160 * 60 =" if you want the > calculator to display the result. (Or "160 enter 60 +" if using an HP > RPN calculator.) > > On Wed, Mar

Re: [go-nuts] Very long API call

2019-03-27 Thread Michael Jones
You left off the "=" key. Must be "160 * 60 =" if you want the calculator to display the result. (Or "160 enter 60 +" if using an HP RPN calculator.) On Wed, Mar 27, 2019 at 12:35 PM Kurtis Rader wrote: > On Wed, Mar 27, 2019 at 12:30 PM Alex Dvoretskiy > wrote: > >> I ran into a huge

Re: [go-nuts] Question regarding gob

2019-03-26 Thread Michael Jones
etween (custom). >> >> There is no reason Go can not achieve use the same paradigm. >> >> On Mar 26, 2019, at 11:48 AM, Michael Jones >> wrote: >> >> To be clear here as educators, it is important to point out that >> exporting / persisting / sending a p

Re: [go-nuts] Question regarding gob

2019-03-26 Thread Michael Jones
To be clear here as educators, it is important to point out that exporting / persisting / sending a pointer is an awkward concept. The normal meanings of sending data beyond an executing program have no direct use for the pointer’s literal value; “the thing at location 12345 in the memory of a

Re: [go-nuts] why the XOR between*(*[]uintptr)(unsafe.Pointer()) is fast then []byte

2019-03-19 Thread Michael Jones
Good point On Tue, Mar 19, 2019 at 6:15 AM roger peppe wrote: > On Tue, 19 Mar 2019 at 07:32, Michael Jones > wrote: > >> Ok, at my computer now so time for a longer answer. >> >> What you want is this: >> https://play.golang.org/p/QirBtj523Wu >> &g

Re: [go-nuts] why the XOR between*(*[]uintptr)(unsafe.Pointer()) is fast then []byte

2019-03-19 Thread Michael Jones
that with the original alternatives. Michael On Mon, Mar 18, 2019 at 9:58 PM Michael Jones wrote: > n%8 is not what you want. > > n - n%8 is what you want, best expressed as n &^0x7 > > On Mon, Mar 18, 2019 at 7:36 PM zhou yu wrote: > >> *Why the XOR between*(*[]uintpt

Re: [go-nuts] why the XOR between*(*[]uintptr)(unsafe.Pointer()) is fast then []byte

2019-03-18 Thread Michael Jones
n%8 is not what you want. n - n%8 is what you want, best expressed as n &^0x7 On Mon, Mar 18, 2019 at 7:36 PM zhou yu wrote: > *Why the XOR between*(*[]uintptr)(unsafe.Pointer()) is fast then > []byte?* > > I find a fast xor lib https://github.com/templexxx/xor, and write the > benchmark

Re: [go-nuts] protobuf and golang

2019-03-18 Thread Michael Jones
Yes, the way to think of the topic here is: first, write your own code to decode the legacy format, then arrange the data in a struct of your design, and *then* persist the struct or slice of structs using an encode/decode mechanism of choice, such as gob, protobuf, json, etc. Step one here is

Re: [go-nuts] Re: Go 1.12.1 and Go 1.11.6 are released

2019-03-18 Thread Michael Jones
I don't have direct feedback on this, but I do have an observation based on my own faster-sort code, which is that timing seems about the same, and scaling seems different than this report. The sorty_test.go file starts with "const N = 1 << 28" so we're talking about sorting a 268,435,456-element

Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-17 Thread Michael Jones
Upon reflection I see that this is as you say. Not only expressed hazards, but even such mysterious cases as file system modification yb external scripts invoked by one argument and visible to another. On Sat, Mar 16, 2019 at 10:03 PM T L wrote: > > > On Friday, March 15, 2019 at 2:25:44 PM

[go-nuts] modules and GoSublime

2019-03-16 Thread Michael Jones
Have not been able to rescue sublime text from module confusion. It is sad on startup with: | GoSublime error: MarGo build failed |> This is possibly a bug or miss-configuration of your environment. |> For more help, please file an issue with the following build

Re: [go-nuts] Order of evaluation need more definition in spec

2019-03-15 Thread Michael Jones
Great idea! On Fri, Mar 15, 2019 at 11:25 AM zshi via golang-nuts < golang-nuts@googlegroups.com> wrote: > Thanks for response, I'm new here still need do more research on existing > topics. > > I understand compiler can do more optimization with less order > restriction, and I agree it's best

Re: [go-nuts] Pointer declaration syntax

2019-03-10 Thread Michael Jones
If you consider lv and rv in BCPL, and see how that becomes * and & in B and stays that way in C/C++/... it may be more clear. The C declaration syntax was revolutionary for being inside out. “int *p” really means “p is the type of variable where *p means an int.” Your argument seems right, in

Re: [go-nuts] Performance comparison of Go, C++, and Java for biological sequencing tool

2019-03-07 Thread Michael Jones
9 at 7:22:41 PM UTC-8, Michael Jones wrote: >> >> There is another problem about these microbenchmarks as well--they often >> are ports of an originating C-version. >> > > Which microbenchmarks? > > You quoted a reply to a question about "Performanc

Re: [go-nuts] Performance comparison of Go, C++, and Java for biological sequencing tool

2019-03-06 Thread Michael Jones
There is another problem about these microbenchmarks as well--they often are ports of an originating C-version. I just implemented the Rabbit stream cipher and after reading the papers I reviewed several versions online in Java and two in Go, as well as the now open-source C version. It seems

Re: [go-nuts] efficient random float32 number generator?

2019-02-25 Thread Michael Jones
My instinct (for "please invent for me the fastest possible low fidelity floating point prng algorithm") is to look at RC4 for inspiration, permuting the order of a large table of float32s and constantly modifying them as well. This could be pared down to three index accesses, a floating

Re: [go-nuts] efficient random float32 number generator?

2019-02-25 Thread Michael Jones
My PCG library's 32-bit generator generates a 32-bit pseudo-random integer in 2.23 ns. https://github.com/MichaelTJones/pcg Just wrote this 32-bit float extension and that delivers a float32 in 2.75 ns. (363 million/good values/sec, period of 2**64 = 4 billion). The extra time is for the

Re: [go-nuts] Channel Feature Suggestion

2019-02-22 Thread Michael Jones
That they do not work is an important issue as has been explained here repeatedly. On Fri, Feb 22, 2019 at 7:59 PM Victor Giordano wrote: > Those idioms should be documented somewhere! > > I would use waiting groups for the rest of the job, i don't know.. have to > think a little more.. you got

Re: [go-nuts] Channel Feature Suggestion

2019-02-21 Thread Michael Jones
Serhat, imagine your feature in the context of a buffered channel that holds 10 elements, and a writer go routine that wants to send 1000 elements through that channel. It is natural to imagine a downstream go routine reading and working on the first element, and the writer filling the empty slot

Re: [go-nuts] inverse of time.Duration?

2019-02-15 Thread Michael Jones
start := time.Now() : // work to be timed : elapsed := time.Now().Sub(start).Seconds() hertz := 1.0/elapsed On Fri, Feb 15, 2019 at 11:49 AM Hemant Singh wrote: > This is an example of time.Duration I have: 5.671msec > > I need to convert the duration to rate = 1.0/5.671 msec. > > However,

Re: [go-nuts] reserved variable names

2019-02-14 Thread Michael Jones
looking back: https://stackoverflow.com/questions/2627511/why-do-c-compilers-prepend-underscores-to-external-names On Thu, Feb 14, 2019 at 8:54 AM Manlio Perillo wrote: > As far as I know, Go currently does not have a list of "reserved" variable > names, however some tools that generate code do

Re: [go-nuts] A Measure of Hash Function Collisions

2019-02-13 Thread Michael Jones
PM Serhat Şevki Dinçer wrote: > On Tuesday, February 12, 2019 at 9:51:17 PM UTC+3, Michael Jones wrote: >> >> Serhat, some ideas for you... >> https://play.golang.org/p/7QPy5wa-9eO >> > > Interestingly I found out input iteration order does matter :) 15,33 shift >

Re: [go-nuts] A Measure of Hash Function Collisions

2019-02-12 Thread Michael Jones
t 5:23:39 AM UTC-8, Serhat Şevki Dinçer > wrote: >> >> On Saturday, February 9, 2019 at 5:23:14 PM UTC+3, Serhat Şevki Dinçer >> wrote: >>> >>> On Fri, Feb 8, 2019 at 7:42 PM Michael Jones wrote: >>> > clustering: >>> > >>> https:

Re: [go-nuts] Alternative of defer?

2019-02-09 Thread Michael Jones
d IMO perfectly acceptable > practice... For example in a web server where you do not want a panic that > occurs while handling a request to affect other request, especially ones > that are in flight. > > > > > On Feb 9, 2019, at 6:48 PM, Michael Jones wrote: > &

Re: [go-nuts] Alternative of defer?

2019-02-09 Thread Michael Jones
The original question--the one I answered--was about a small block of user code and asked nothing about http or unexpected panics. The spirit of panic/recover, and with defer, includes in its use "local" panic, a kind of successor to setjump/longjump, that unwinds the stack, calls defers, and is

Re: [go-nuts] A Measure of Hash Function Collisions

2019-02-08 Thread Michael Jones
ng through parameter space works very well for many hash and similar goals. important to know how to model the input and measure output quality. On Fri, Feb 8, 2019 at 1:56 AM Serhat Sevki Dincer wrote: > 8 Şub 2019 Cum 11:57 tarihinde Michael Jones > şunu yazdı: > >> ...says th

Re: [go-nuts] A Measure of Hash Function Collisions

2019-02-08 Thread Michael Jones
cularly high but not terrible. A modification of FNV1a can get to 22 (almost: 2.200355e+01) here. On Thu, Feb 7, 2019 at 11:03 AM Serhat Şevki Dinçer wrote: > On Tuesday, February 5, 2019 at 12:29:32 AM UTC+3, Michael Jones wrote: > >> I recently did just this in an effo

Re: [go-nuts] Modules. A "new" system.

2019-02-05 Thread Michael Jones
n Tue, Feb 5, 2019 at 10:55 AM Jan Mercl <0xj...@gmail.com> wrote: > >> Just an of-by-one error. After all, Michael is also a programmer ;-) >> >> On Tue, Feb 5, 2019, 19:51 Dan Kortschak wrote: >> >>> Robert Griesamer *is* Niklaus Wirth? >>> >

Re: [go-nuts] Modules. A "new" system.

2019-02-05 Thread Michael Jones
of-by-one error. After all, Michael is also a programmer ;-) > > On Tue, Feb 5, 2019, 19:51 Dan Kortschak wrote: > >> Robert Griesamer *is* Niklaus Wirth? >> >> On Tue, 2019-02-05 at 09:19 -0800, Michael Jones wrote: >> > Go learns from Oberon via Go and Oberon in

Re: [go-nuts] Modules. A "new" system.

2019-02-05 Thread Michael Jones
Go learns from Oberon via Go and Oberon insider Robert Griesemer, whose Wirth-number is zero. On Tue, Feb 5, 2019 at 3:47 AM Gerard wrote: > Hello everyone. There has been one issue in Go that has never gotten out > of my head, so it went on and on. The problem is modules. > > In the beginning

Re: [go-nuts] A Measure of Hash Function Collisions

2019-02-04 Thread Michael Jones
There are many measures. One realm of them focus on the mixing properties of the design as would be a consideration in cypher systems. The other “experimentalist” realm considers how the hash performs compared to an ideal hash function. The latter approach is suitable for a broader range of

<    1   2   3   4   5   6   >