[go-nuts] Re: GOTCHA: Just when you think you understand interfaces

2018-01-31 Thread 'simon place' via golang-nuts
also notice, if you haven’t encountered it, this makes []interfaces a bit awkward to handle with ellipsis functions... https://play.golang.org/p/JWuc4jt2uSP what i do is this; https://play.golang.org/p/O9Q4K_vXlul but you will need a convert for all combinations of interfaces and ellipsis fu

[go-nuts] Re: Extension for type assertion of interface array

2018-04-26 Thread 'simon place' via golang-nuts
i too didn't like this, although i get the reasons for it. but for me these are unaddressed points; 1. the language does not distinguish array types, as a group, in any way, except here. 2. you can have many types that simultaneously implement multiple interfaces, for these you need copying cod

[go-nuts] Re: Using variadic function / context in an interface?

2018-04-26 Thread 'simon place' via golang-nuts
does the init NEED to be in the interface? On Thursday, 26 April 2018 17:55:07 UTC+1, Nimrod Shneor wrote: > > Hey everyone, > I've encountered a design issue - > I have an the following interface - > > type Runner interface { > Run(x X,y Y) > } > > I want to add to it an Init(...) method which

[go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-20 Thread 'simon place' via golang-nuts
wouldn't the compiler be able to use the fact that a return value is known not to be being used in a particular call, somewhere one or more of the returned values are assigned to a blank, to be able to generate faster code for that call? or is it already being done? because, it seems to me, kno

Re: [go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-21 Thread 'simon place' via golang-nuts
UTC, Ian Lance Taylor wrote: > > On Sun, Jan 20, 2019 at 2:44 PM 'simon place' via golang-nuts > > wrote: > > > > wouldn't the compiler be able to use the fact that a return value is > known not to be being used in a particular call, somewhere one or more

Re: [go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-22 Thread 'simon place' via golang-nuts
thanks for the info, answered my OP, but raised some more questions... presumably the go runtime is compiled with gccgo? so would that mean there are possibly cloned functions in it? and i can see that gcc can clone for know value (constant) parameters, but can't see any other techniques, su

Re: [go-nuts] could functions returning multiple values make templates behind the scenes

2019-01-22 Thread 'simon place' via golang-nuts
thanks again. FWIW seems to me this might have some interesting effects, otherwise unobtainable, given the different 'clones' still all implement the same interface. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this gro

[go-nuts] Re: Channel from io.Reader

2019-02-03 Thread 'simon place' via golang-nuts
seems to me... channels are for language-handled concurrency which is able to then, transparently, be parallel, readers are a single threaded thing that mimics concurrency, they do it explicitly. so you need to 'drive' the readers by calling them all in a loop, handling any none zero length, t

Re: [go-nuts] Casting across types

2019-04-15 Thread 'simon place' via golang-nuts
may be missing the point, but why go thought an interface{}? https://play.golang.org/p/Ol7e6UrNAWq -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+u

[go-nuts] use of the new type aliasing

2017-09-30 Thread 'simon place' via golang-nuts
i have a type, just a named wrapper for a built-in, that amongst other things, changes the default print output. for example to hex,(not actual code) type Uint64 uint64 // string rep as hexadecimal, implementing Stringer func (x Uint64) String() string{ return fmt.Sprintf("% X",x) } then i

[go-nuts] Re: use of the new type aliasing

2017-09-30 Thread 'simon place' via golang-nuts
i think i have it, my fault basically, its due to me having several versions of go, on-the-go; when go get 'install', compilation of the package was done by go1.6.2, hence the slow down when i split code off into a package. when i used type aliasing, go build used a cached compiled package tha

[go-nuts] Re: use of the new type aliasing

2017-09-30 Thread 'simon place' via golang-nuts
yes, you are right, but i missed out code in-between, i thought to keep it simple!! actually its this; func (x Uint64) String() string{ b:=make([]byte,8,8) n,_:=x.Write(b) return fmt.Sprintf("% X",b[:n]) } the call to its own io.Writer implementation might look odd, in isolation, a

[go-nuts] various odd, to me, at best undocumented, behaviour of automatic formatting in go doc

2017-11-21 Thread 'simon place' via golang-nuts
see; https://play.golang.org/p/kPWJzm1rQi see comments for details, found more than i banked on whilst investigating a formatting issue on GitHub docs (turned out to be example 7.). -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscri

[go-nuts] Re: Efficient to copy Hash?

2017-11-21 Thread 'simon place' via golang-nuts
i found this code, and use it on hash.Hash // copy an interface value using reflect (here for pointers to interfaces) func clone(i interface{}) interface{} { indirect := reflect.Indirect(reflect.ValueOf(i)) newIndirect := reflect.New(indirect.Type()) newIndirect.Elem().Set(reflect.Valu

[go-nuts] Re: various odd, to me, at best undocumented, behaviour of automatic formatting in go doc

2017-11-22 Thread 'simon place' via golang-nuts
thanks for looking, you have understood and argued well against my points being significant. i was trying to show-up, and see if there was agreement, that this code could benefit from some re-factoring/simplification. but my problem is; i have an html doc that looks quite poor, but according t

[go-nuts] Re: various odd, to me, at best undocumented, behaviour of automatic formatting in go doc

2017-11-22 Thread 'simon place' via golang-nuts
trying to work around these issues, i find another undocumented 'feature' https://play.golang.org/p/dzcq5XKpgG -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to g

Re: [go-nuts] Re: Efficient to copy Hash?

2017-11-22 Thread 'simon place' via golang-nuts
Wednesday, 22 November 2017 13:16:01 UTC, rog wrote: > > On 21 November 2017 at 21:56, 'simon place' via golang-nuts > > wrote: > > i found this code, and use it on hash.Hash > > > > // copy an interface value using reflect (here for pointers to &

[go-nuts] Re: various odd, to me, at best undocumented, behaviour of automatic formatting in go doc

2017-11-23 Thread 'simon place' via golang-nuts
what you are describing is what i expected from the start, a form of duck-typing, in that if it looks like a Title then format it as a Title, fine, simple and efficient. i don't expect all the cases where the documentation is wrong that could easy, simply and usefully not be. -- You received

[go-nuts] benchmark a remote arch

2017-12-04 Thread 'simon place' via golang-nuts
is it possible, with the go tools, to build the benchmark executable, so i could copy and run it remotely? (for any given os/arch) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it,

[go-nuts] Re: are interface calls to empty methods optimized away - so there is no function call overhead beyond the dereference/jump?

2017-12-04 Thread 'simon place' via golang-nuts
in a very similar vein, something i have been wondering about for a while now; when an interface contains a pointer type, does Go double dereference or conflate the pointers? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from

[go-nuts] Re: are interface calls to empty methods optimized away - so there is no function call overhead beyond the dereference/jump?

2017-12-05 Thread 'simon place' via golang-nuts
nice, so from a users point of view, (apart from it making no functional difference.), having interfaces of pointer types incurs no run-time overhead (well apart from the storage for the type info.). -- You received this message because you are subscribed to the Google Groups "golang-nuts" gro

Re: [go-nuts] Re: are interface calls to empty methods optimized away - so there is no function call overhead beyond the dereference/jump?

2017-12-05 Thread 'simon place' via golang-nuts
for people possibly scanning this later; when you say; "it won't store the address of the value, but will make a copy." i think this is correct/clearer; "it won't store the address of the value, but will make a copy, and store its address." On Tuesday, 5 December 2017 07:41:51 UTC, Axel Wag

[go-nuts] resource cleanup in closure

2018-01-21 Thread 'simon place' via golang-nuts
i wrote the code below hoping that defer() would run when a funcs context was lost, not just when it ended.(which, without using closures, would always be the same thing, i think.) https://play.golang.org/p/HBrmBOkK1zJ as can be seen it doesn't, which begs the question; "how do you clean up ex

[go-nuts] Re: resource cleanup in closure

2018-01-21 Thread 'simon place' via golang-nuts
that might do it, the closures are actually being made by a New(type) call, and i was basically fixated by returning only the new instance (and maybe a error), but no reason not to return a callback destructor. maybe New isn't the right name anymore? the idea is to incrementally add a registry

[go-nuts] Re: resource cleanup in closure

2018-01-21 Thread 'simon place' via golang-nuts
after a bit of thought, its not ideal. it would work, but defeats part of the objective, which was for the optimisations to be transparent, having the defer, or callbacks, in the calling function breaks the isolation. i could insert callbacks in the base code which would just be redundant when

[go-nuts] Re: resource cleanup in closure

2018-01-24 Thread 'simon place' via golang-nuts
thanks for the interest, a Done method would be what i was thinking of by the type/object way to do it, rather than the closure way of handing-back/defering a func. but its the isolation i'm thinking about, without some way to get the garbage collector to call code,( like in the original post u

[go-nuts] Re: Is it possible to determine total number of bytes read/written for an HTTP request? (including headers)

2018-01-25 Thread 'simon place' via golang-nuts
i think there should be several tools to do this tracking by using kernel functions, probably X-platform. maybe in the design of the go package this was assumed to be the way its done. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubsc

[go-nuts] Re: Is it possible to determine total number of bytes read/written for an HTTP request? (including headers)

2018-01-26 Thread 'simon place' via golang-nuts
i was imagining the os/kernel (network stack) is controlling the routing of data, so knows the process handling the port, how many bytes go through to it and the ip it came from, plus the same for the response. i had a play with 'iptraf-ng' ( the older 'iptraf' only worked for local addresses f

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

2019-06-01 Thread 'simon place' via golang-nuts
just reading this, surprised no mention of this... d,_:=time.ParseDuration("5.671ms") Hz:=int(time.Second/d) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to gola

[go-nuts] Re: Why is there no " declared and not used" compile error?

2016-09-14 Thread 'simon place' via golang-nuts
what about when you're writing a lib, can't the importing code make use of constants? On Monday, 12 September 2016 13:57:15 UTC+1, Markus Zimmermann wrote: > > Hi gophers! > > I am wondering why we have a "declared and not used" compile error for > variables [https://play.golang.org/p/KLzHVO5L7

[go-nuts] Re: Fast conversion. Tell me why I shouldn't.

2016-09-19 Thread 'simon place' via golang-nuts
i thought strings were just byte[]s, when you 'cast' all you do is tell the compiler to change the way the underlying bytes can are used. it doesn't 'cost' anything. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group

Re: [go-nuts] Re: Fast conversion. Tell me why I shouldn't.

2016-09-19 Thread 'simon place' via golang-nuts
well, seems to me if you need to access a string by index, you are assuming 1 byte per char. say ASCII, so for me you should be using []byte to store it, then 'cast' to see it as a string. https://play.golang.org/p/2NMye8gnzg surely this doesn't do any copying? -- You received this message be

[go-nuts] Re: Slow compile times

2016-10-05 Thread 'simon place' via golang-nuts
none of those links work for me? On Tuesday, 4 October 2016 13:26:58 UTC+1, rene.z...@gmail.com wrote: > > Hi > > I use the following packages in a test file: > > import ( > "testing" > > "github.com/coreos/etcd/clientv3" > "github.com/coreos/etcd/integration" > "github.com/coreos/pkg/capnslog" >

Re: [go-nuts] fmt.Printf not respecting String() method of elements of a struct

2016-10-15 Thread 'simon place' via golang-nuts
you could expose it to fmt, through String(), and keep it non-settable: https://play.golang.org/p/5wGsFY3Fpc -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to gol

[go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-26 Thread 'simon place' via golang-nuts
i was playing with SIMD last year, the approach i took was to try to minimise the M/C, so; no attempt to support general formula, let people combine the, pre-made, most common/expensive functions, like SIMD designers did, only up the complexity of formula supported and make it x-platform. make

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-27 Thread 'simon place' via golang-nuts
> Something like that? short answer, Yes. however, from looking at it, couldn’t find documentation, that code is specific to speeding up graphics overlays? maybe? (accumulate) but it’s confusing me that its using templates, when there seems to only be one template. i was thinking of one, ve

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-28 Thread 'simon place' via golang-nuts
riday, 28 October 2016 01:23:53 UTC+1, Nigel Tao wrote: > > On Thu, Oct 27, 2016 at 9:24 AM, 'simon place' via golang-nuts > > wrote: > > the approach i took was to try to minimise the M/C, so; > > Sorry for the ignorant question, but what does M/C stand for?

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-28 Thread 'simon place' via golang-nuts
> > Take for instance the PSHUFB instruction, which allows a very fast > [16]byte lookup in SSSE3 capable machines. This is helpful in various ways, > but if it isn't available, it will have to commit the XMM register to > memory and do 16 lookups, which is at least an order of magnitude slower

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-10-28 Thread 'simon place' via golang-nuts
> Yes, speeding up an accumulation step, described at > > https://medium.com/@raphlinus/inside-the-fastest-font-renderer-in-the-world-75ae5270c445#.qz8jram0o > > > The generated code are SIMD implementations of very simple Go functions. > > For example, the fixedAccumulateOpSrcSIMD function i

Re: [go-nuts] Re: Float32 math and slice arithmetics using SIMD

2016-11-03 Thread 'simon place' via golang-nuts
> > > That's the sort of cheap checks that I had mind in the very first post > when I talked about "I envisaged a call to CPUID and then some bool tests > along the way to utilise SSE[2-4]/AVX[2] (or NEON on ARM) if available. All > in a static, portable package." Thanks for a good example of t

[go-nuts] Re: Interface vs first-class function

2016-11-20 Thread 'simon place' via golang-nuts
you'll need interfaces if you want your 'thing' to leave the programs context, to store/transmit it. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts

[go-nuts] Re: Disadvantage of Go

2017-01-13 Thread 'simon place' via golang-nuts
sorry but for me, excepting generics and maybe a float32 maths lib, these are all just your problem. particularly wrong is the idea of native conversion of bools to/from numbers, albeit widespread and long-standing, perpetuating these mistakes just means preventing any development of languages.

[go-nuts] benchmarking not working (always) go1.7beta

2016-06-18 Thread 'simon place' via golang-nuts
any ideas? i've run out. this only happens with one program, and only in go1.7beta1(and 2). (i notice PASS is now at the end rather than the start. FWIW) see below /* Hal3 Sat Jun 18 21:52:37 BST 2016 go version go1.7beta1 linux/amd64 BenchmarkPCM8bitEncode-220 0.

[go-nuts] Re: benchmarking not working (always) go1.7beta

2016-06-18 Thread 'simon place' via golang-nuts
thanks, i was guessing something like that, these are very short pieces of linear code. so i did try; using returned values, repeating the test 10x in the loop, and adding stop/start. the code's on github, (https://github.com/splace/signals) but this is a selective test, so its really buried,

[go-nuts] Re: benchmarking not working (always) go1.7beta

2016-06-18 Thread 'simon place' via golang-nuts
OK got it, i wasn't using a package level var to store the result. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For m

[go-nuts] Re: benchmarking not working (always) go1.7beta

2016-06-18 Thread 'simon place' via golang-nuts
and the conclusion is. Encoding got a decent bit faster. whilst, decoding got noticeably slower. earlier on i had already found conversion to int16 was a lot slower than int32, so I’d was already up. /* Hal3 Sun Jun 19 00:53:10 BST 2016 go version go1.7beta2 linux/amd64 BenchmarkPCM8b

[go-nuts] Re: Closures vs structs with embedded functions (I call 'em pseudo-closures)

2016-08-12 Thread 'simon place' via golang-nuts
aren't your "pseudo-closure"'s commonly know as "objects"? -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more opti

[go-nuts] Re: Cast interface{} to []string

2016-08-14 Thread 'simon place' via golang-nuts
could something like this help; https://play.golang.org/p/9tbiUY1w0d On Friday, 12 August 2016 19:41:26 UTC+1, Vasily Korytov wrote: > > Hi, > > I have an interface{} variable that can be either string or a list of > string (yes, that's bad design, I know). > > I need a []string to feed it to st

[go-nuts] Re: when an interface type embeds two other interface types, why the other two interface types can't have non-zero intersection?

2016-08-18 Thread 'simon place' via golang-nuts
this is an important concept in go. putting interfaces in interfaces is just shorthand/syntactic sugar, its never necessary, its purpose is having each set of method signatures only once, which should help conceptualisation, and aid progressive development. I doesn't care if its been built from

[go-nuts] Re: Google Grumpy (Python->Go)

2017-02-03 Thread 'simon place' via golang-nuts
just been taking a look, and wondered why i couldn't "go get" it, then i see the compiler is in python. which leads to the question; has anyone attempted to compile the compiler to go? On Wednesday, 4 January 2017 19:27:10 UTC, Shawn Milochik wrote: > > I'm surprised this hasn't hit this list

Re: [go-nuts] Re: Google Grumpy (Python->Go)

2017-02-04 Thread 'simon place' via golang-nuts
nce https://github.com/google/grumpy/pull/216 > is merged, I think we'll be very close to hosting the compiler in Grumpy. > At that point, supporting go get would be feasible. > > On Fri, Feb 3, 2017 at 8:42 AM 'simon place' via golang-nuts < > golan...@googlegroups.

[go-nuts] xattrib on symlinks and holes in syscall support

2017-02-13 Thread &#x27;simon place&#x27; via golang-nuts
i have been tidying up some xattrib (extended file attribute) code, and had what i thought was a cool idea. that idea used xattribs on symlinks. but when i tried this i found that syscall.Getxattr uses the sys call for following syslinks, (it wraps SYS_GETXATTR) and that the corresponding sysc

Re: [go-nuts] Re: int16 and float64 Multiplication

2017-02-19 Thread &#x27;simon place&#x27; via golang-nuts
if using fixed precision then don't use floats, just use int's with a fixed multiplier. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@g

[go-nuts] first try with templates

2017-02-24 Thread &#x27;simon place&#x27; via golang-nuts
https://play.golang.org/p/NGU4kstcT- just trying to put one var into one template and i'm failing!, see above, i've tried the docs, googling and randomly guessing. please someone put me out of my misery. -- You received this message because you are subscribed to the Google Groups "golang-nuts

Re: [go-nuts] first try with templates

2017-02-24 Thread &#x27;simon place&#x27; via golang-nuts
al stuff as pointer members. On Saturday, 25 February 2017 00:34:38 UTC, Ian Davis wrote: > > > On Fri, 24 Feb 2017, at 11:40 PM, 'simon place' via golang-nuts wrote: > > https://play.golang.org/p/NGU4kstcT- > > just trying to put one var into one template

[go-nuts] Re: first try with templates

2017-02-24 Thread &#x27;simon place&#x27; via golang-nuts
well option3 seems to work https://play.golang.org/p/XMih6ocmGY -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For mor

[go-nuts] Re: Goroutine in a for loop: Closure versus direct

2017-02-26 Thread &#x27;simon place&#x27; via golang-nuts
IFAIK they are the same, and could be compiled to the same thing. it seems to me a closure with its whole context just passed on, isn't doing anything. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop rece

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread &#x27;simon place&#x27; via golang-nuts
interesting, something i'm active around. just checking, the only dependency for the compiled result is opengl? On Sunday, 12 March 2017 14:52:51 UTC, leonsal wrote: > > Hi All, > > G3N is an OpenGL 3D Game Engine written in Go: > https://github.com/g3n/engine > Try out the game engine demo at:

[go-nuts] fixed precision formatting of floating point

2017-03-12 Thread &#x27;simon place&#x27; via golang-nuts
when trying to compare two floats, for testing, i ran into the usual problems with rounding. so, i thought, a nice way out would be to compare their fixed precision formatted strings. which works except, fmt "%f" fixed precision still contains an unnecessary rounding issue; when the float is

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread &#x27;simon place&#x27; via golang-nuts
OK, i see X server in there, unfortunately the target system i was currently looking at doesn't have x support, just egl. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an e

[go-nuts] Re: [ANN] G3N - Go 3D Game Engine

2017-03-12 Thread &#x27;simon place&#x27; via golang-nuts
thanks for confirming that, i was guessing you had done that for x-platform support anyway. i started making a 3d viewer myself with glfw last year, its as much shader as possible, not worked on it recently, apart from looking at non-x solutions. On Sunday, 12 March 2017 19:16:58 UTC, leonsal

[go-nuts] Re: fixed precision formatting of floating point

2017-03-12 Thread &#x27;simon place&#x27; via golang-nuts
this isn't a signed zero, this is a very small negative float rounded off by fmt. it has as little actual different to zero as is possible to get (in float64 in this case) so will make as little difference to further calculation as it is possible to get. so either "-0.00" or " 0.00" ar

[go-nuts] Re: fixed precision formatting of floating point

2017-03-12 Thread &#x27;simon place&#x27; via golang-nuts
thinking about it another way, its noise, no human reading the output would even need to know if the value were effectively zero from underneath or from above. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and s

Re: [go-nuts] RSQL, a lighweight clone of Microsoft SQL Server written in Go

2017-03-13 Thread &#x27;simon place&#x27; via golang-nuts
i see Apache 2 licence file in the root.(github) -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. For more options, visit

[go-nuts] Re: uint type safety in go

2017-03-16 Thread &#x27;simon place&#x27; via golang-nuts
this sort of thing came up for me recently, in that i was thinking nicer built-in's would operate like this; float32 * float32 = float64 so also uint - uint = int in a way, type safety (native type isolation) is kind of causing an issue, and that maybe always using big (long) numbers during d

Re: [go-nuts] Re: uint type safety in go

2017-03-17 Thread &#x27;simon place&#x27; via golang-nuts
n't fit in int's, with the same number of bits, anyway. On Friday, 17 March 2017 03:51:36 UTC, Nigel Tao wrote: > > On Fri, Mar 17, 2017 at 5:02 AM, 'simon place' via golang-nuts > > wrote: > > uint - uint = int > > Well, if the first uint is maxUint a

[go-nuts] can a program terminate, exit code 2, without an error?

2017-04-05 Thread &#x27;simon place&#x27; via golang-nuts
i've been sent an bug report saying my program crashed, (they say it paniced) it includes a running go-routine state dump, but NO error message, is this really possible or can i assume they just forgot to include it? -- You received this message because you are subscribed to the Google Groups

Re: [go-nuts] can a program terminate, exit code 2, without an error?

2017-04-05 Thread &#x27;simon place&#x27; via golang-nuts
thanks for the fast response, i couldn't see how this was possible, i'll push them to check. Simon On Wednesday, 5 April 2017 21:46:36 UTC+1, Ian Lance Taylor wrote: > > On Wed, Apr 5, 2017 at 1:35 PM, 'simon place' via golang-nuts > > wrote: > > i'v

[go-nuts] Re: can a program terminate, exit code 2, without an error?

2017-04-07 Thread &#x27;simon place&#x27; via golang-nuts
using 'kill' to simulate an out-of-memory, i only get the string 'terminated' and no go-routine dump. the user hasn't responded to my query, so i'm assuming a mistake. On Wednesday, 5 April 2017 23:54:43 UTC+1, Dave Cheney wrote: > > If it's running on Linux the oom killer could be to blame. Ask

[go-nuts] help with using %q in fmt

2020-02-21 Thread &#x27;simon place&#x27; via golang-nuts
basically i want to save a file name in a file (with some url styling for human readability); https://play.golang.org/p/sWYbyU7nuSo which works, but not with a space in the name; https://play.golang.org/p/sswqBRL8dZW it needs to be quoted, so i figure '%q' is for this; %q a double-quote

Re: [go-nuts] help with using %q in fmt

2020-02-22 Thread &#x27;simon place&#x27; via golang-nuts
:35 PM 'simon place' via golang-nuts > > wrote: > > > > basically i want to save a file name in a file (with some url styling > for human readability); > > > > https://play.golang.org/p/sWYbyU7nuSo > > > > which works, but not with a space

Re: [go-nuts] keep just 2 decimal places in a float64

2020-02-22 Thread &#x27;simon place&#x27; via golang-nuts
absolutely, though even an epsilon is a bit of a hack IMHO. given the more ops you do the greater the potential discrepancy, and, i guess, you get a normal dist. of values, so any epsilon only has a probability of working, albeit potentially astronomically high probability. so then why even hav

Re: [go-nuts] keep just 2 decimal places in a float64

2020-02-22 Thread &#x27;simon place&#x27; via golang-nuts
ermining if “something changed” (e.g. the > record has changed), you can also use float keys - the equality matters, > the actual value not so much. > > On Feb 22, 2020, at 1:50 PM, 'simon place' via golang-nuts < > golan...@googlegroups.com > wrote: > > absolutely

[go-nuts] Re: Sscanf() skip elements

2020-05-19 Thread &#x27;simon place&#x27; via golang-nuts
obviously, you could do this... https://play.golang.org/p/isqA3N0LBkn or better?... https://play.golang.org/p/8hXgZqBNyns On Friday, 10 April 2020 18:17:53 UTC+1, Daniel Gorbe wrote: > > Hi! > > > It is possible to skip elements of a string with Sscanf()? As in C with > *%*s.* > > Example: > >

[go-nuts] function multiple returned values signature, compiler optimisation/feature question

2020-06-10 Thread &#x27;simon place&#x27; via golang-nuts
when you have functions that return multiple values, because its more efficient to generate in one go when you are using ALL returned values; like in math, where you have Sin(), Cos() and Sincos() and when you also don't use all the returned values (using '_') does the compiler optimise? does i

Re: [go-nuts] function multiple returned values signature, compiler optimisation/feature question

2020-06-10 Thread &#x27;simon place&#x27; via golang-nuts
> Currently the compiler does not do the kind of optimization you > describe. A function is compiled once, and computes all of its > results. The caller receives all the results, and ignores ones that > it does not need. > yes, i suppose the code generation route might give some insight as

Re: [go-nuts] function multiple returned values signature, compiler optimisation/feature question

2020-06-10 Thread &#x27;simon place&#x27; via golang-nuts
ramming modes, an organic rule-driven rewrite system. (It is brilliant > at the task) > > Not something seen in general languages very much. Some flavor of it in C > metaprogramming. > > On Wed, Jun 10, 2020 at 11:28 AM 'simon place' via golang-nuts < > golan...@goo

[go-nuts] Re: GO on multi-processor systems

2020-06-10 Thread &#x27;simon place&#x27; via golang-nuts
seems to me whats relevant is that the core count is 'below' in the software stack, so transparent, so here it will be 24. but, like all progs, go progs use what they're told about, so you could 'see' less or you COULD be running inside an emulator that mimics, potentially very slowly, any numb

[go-nuts] [Arm32] float/NaN/int issue (fixed for me, posting for info/discussion/bug report?)

2020-07-08 Thread &#x27;simon place&#x27; via golang-nuts
summary: converting to int from NaN results in arch dependent values. use case: i'm using ints (scaled) for a type where this is the real underlying meaning. but to avoid rounding issues in intermediate comp, i convert to float for these, and then back. this seemed fine. but for a par

Re: [go-nuts] [Arm32] float/NaN/int issue (fixed for me, posting for info/discussion/bug report?)

2020-07-08 Thread &#x27;simon place&#x27; via golang-nuts
i understand, but think that since Go particularly allows these conversations transparently, consistency should be covered by language specification. it potentially causes bugs that doesn't fail fast, didn't for me anyway. how much code out there would break if you changed the existing returned

Re: [go-nuts] [Arm32] float/NaN/int issue (fixed for me, posting for info/discussion/bug report?)

2020-07-08 Thread &#x27;simon place&#x27; via golang-nuts
i was just reading that! does it mean (or just imply) that constant conversions are not implementation dependent? i remember wondering, a while ago, why it was that NaN etc. weren't constants, after-all their encoding is unique and can't vary. seems the reason for this is. "Numeric consta

Re: [go-nuts] [Arm32] float/NaN/int issue (fixed for me, posting for info/discussion/bug report?)

2020-07-08 Thread &#x27;simon place&#x27; via golang-nuts
wait a minute, so this... https://play.golang.org/p/x5SQVgSJsIs could return anything! On Wednesday, 8 July 2020 19:57:30 UTC+1, Ian Lance Taylor wrote: > > The spec is not particularly helpful, but it is not entirely silent. > It says: "In all non-constant conversions involving floating-point

Re: [go-nuts] [Arm32] float/NaN/int issue (fixed for me, posting for info/discussion/bug report?)

2020-07-09 Thread &#x27;simon place&#x27; via golang-nuts
yes, agreed, just pushing to the extrema. On Thursday, 9 July 2020 01:32:13 UTC+1, keith@gmail.com wrote: > > > > On Wednesday, July 8, 2020 at 4:50:30 PM UTC-7, simon place wrote: >> >> wait a minute, so this... https://play.golang.org/p/x5SQVgSJsIs >> >> could return anything! >> >> > I thi

[go-nuts] custom type wrapping errors; what am i missing?

2020-09-02 Thread &#x27;simon place&#x27; via golang-nuts
https://play.golang.org/p/REagqrWDb-6 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web

[go-nuts] Re: custom type wrapping errors; what am i missing?

2020-09-02 Thread &#x27;simon place&#x27; via golang-nuts
import "github.com/pkg/errors" should be import "errors" left over from testing, but makes no difference, as expected. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an

Re: [go-nuts] Re: custom type wrapping errors; what am i missing?

2020-09-02 Thread &#x27;simon place&#x27; via golang-nuts
the example compares the print output of a fmt.errorf wrapped error and a custom-error type wrapped error, the custom one isn't showing the wrapped error., On Wednesday, 2 September 2020 16:58:31 UTC+1, burak serdar wrote: > > On Wed, Sep 2, 2020 at 9:48 AM 'simon place&

Re: [go-nuts] Re: custom type wrapping errors; what am i missing?

2020-09-02 Thread &#x27;simon place&#x27; via golang-nuts
error: > > func (e MyErr) Error() string { >return "My wrapping:"+ e.error.Error() > } > > > > > > > On Wednesday, 2 September 2020 16:58:31 UTC+1, burak serdar wrote: > >> > >> On Wed, Sep 2, 2020 at 9:48 AM 'simon place

Re: [go-nuts] Re: custom type wrapping errors; what am i missing?

2020-09-02 Thread &#x27;simon place&#x27; via golang-nuts
OK, i think i have it; basically he root of it was i wasn't thinking properly about how errors need/should be implemented as immutable. Unwrap is basically a state getter. (no setter for the wrapped error.) so it seems to me that custom and fmt.Prinf("%w") wrappers have different use cases:

Re: [go-nuts] Re: custom type wrapping errors; what am i missing?

2020-09-02 Thread &#x27;simon place&#x27; via golang-nuts
> %w is not a formatting verb, so fmt.Prinf("%w") is not valid. yes, i thought i was pasting fmt.Errorf("%w",err) err1:= errors.New("error") > err1= fmt.Errorf("fmt wrapping: %w",err1) > fmt.Println(err1) > > err2:=errors.New("error") > err3= fmt.Errorf("Wrapped: %w",err2) > // Here, er

[go-nuts] Re: Go 1.16 is released

2021-02-23 Thread &#x27;simon place&#x27; via golang-nuts
nothing compiles any more! i seem to be being forced to add, to some projects 9 years old (unnecessary) module support, or, add notes to all their docs that they need to be compiled in versions older than 1.16, or have to have an obscure parameter set. there really wasn't a non-breaking way to

[go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-23 Thread &#x27;simon place&#x27; via golang-nuts
On Wednesday, 24 February 2021 at 02:26:39 UTC Kurtis Rader wrote: > On Tue, Feb 23, 2021 at 5:03 PM 'simon place' via golang-nuts < > golan...@googlegroups.com> wrote: > >> nothing compiles any more! >> >> i seem to be being forced to add, to some pr

[go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-23 Thread &#x27;simon place&#x27; via golang-nuts
you could just make non-modules repos 'look like' a module with one version. On Wednesday, 24 February 2021 at 03:23:47 UTC simon place wrote: > On Wednesday, 24 February 2021 at 02:26:39 UTC Kurtis Rader wrote: > >> On Tue, Feb 23, 2021 at 5:03 PM 'simon place&

Re: [go-nuts] Re: Cannot build after upgrading to Go 1.16

2021-02-24 Thread &#x27;simon place&#x27; via golang-nuts
On Wednesday, 24 February 2021 at 08:10:01 UTC jonr...@gmail.com wrote: > i had a similar experience where i ended up pull-requesting the addition > of mod&sum into a dependency. fair enough for actively maintained packages > or packages you've contributed to before but could be problematic >

Re: [go-nuts] Re: testing examples printing to stdout not working for global var

2022-05-02 Thread &#x27;simon place&#x27; via golang-nuts
i see, thanks the implementation of 'go test' (which the playground runs auto-magically.) replaces os.Stdout with a new reference behind the scenes before running the func, but after making global vars, so the code as written isn't strictly 'go' anymore. https://go.dev/play/p/3FBjOmzYIiz?v=gop

Re: [go-nuts] Re: testing examples printing to stdout not working for global var

2022-05-02 Thread &#x27;simon place&#x27; via golang-nuts
actually just changing Example's to Test's with a string comparison seems to have the least friction. On Monday, 2 May 2022 at 21:57:29 UTC+1 simon place wrote: > i see, thanks > > the implementation of 'go test' (which the playground runs > auto-magically.) replaces os.Stdout with a new refere

[go-nuts] fmt.Formatter and '%w'

2022-10-27 Thread &#x27;simon place&#x27; via golang-nuts
you can use the fmt.Formatter interface to make your own 'verbs', makes sense as expected, except for 'w' where you just get the error: > fmt.Printf format %w has arg ??? of wrong type seems trying to make your own formatting for the verb 'w' is blocked, presumably because it checks for an i

[go-nuts] just started using modules, what have i missed?.

2024-05-02 Thread &#x27;simon place&#x27; via golang-nuts
*simon@fedora:~$ go get github.com/vulkan-go/vulkan* *go: go.mod file not found in current directory or any parent directory. 'go get' is no longer supported outside a module. To build and install a command, use 'go install' with a version, like 'go install example.com/cmd@latest' For mor

[go-nuts] Re: just started using modules, what have i missed?.

2024-05-02 Thread &#x27;simon place&#x27; via golang-nuts
thanks for the reply, yes a library, that i want to investigate, i don't have a project until after. this is whats ive been doing for years, but in 1.22 seems this way of working has stopped being supported. On Thursday 2 May 2024 at 19:31:53 UTC+1 Carla Pfaff wrote: > It's not clear what your

Re: [go-nuts] Re: just started using modules, what have i missed?.

2024-05-02 Thread &#x27;simon place&#x27; via golang-nuts
On Thursday 2 May 2024 at 22:45:55 UTC+1 burak serdar wrote: You can simply clone the github repo. You don't need go get for this. When you're ready, import it and then go mod tidy. ummm, could be the best way, i'll compare with the script, (dummy) route. -- You received this message becau

[go-nuts] just started using modules, what have i missed? (continuation..)

2024-05-06 Thread &#x27;simon place&#x27; via golang-nuts
OK, i had thought, (without understanding why), you can't/don't install non-main packages, as the error message says. ( as mentioned in previous post) *simon@fedora:~$ go install github.com/vulkan-go/vulkan@latest* *package github.com/vulkan-go/vulkan is not a main package* but it works someti

  1   2   >