Re: [go-nuts] Unmarshalling and tags

2016-06-20 Thread roger peppe
I feel your pain - we quite often have tags with entries for three formats (JSON, YAML and BSON) - but I'm not sure that collapsing them is necessarily a good idea, as the named tags indicate that the object is explicitly intended to be able to be marshaled with those formats. That said, it's quit

Re: [go-nuts] [?] emulating an opengl shader in cpu bound functions

2016-06-20 Thread Christian Mauduit
Hi, Using OpenGL to draw something that will end up on paper might prove somewhat complicated. As for "translating" a shader to something cpu bound, since a shader is more or less a program in some language that "has some remote parentness with C", you could probably do it. But the most pragmatic

[go-nuts] Re: Result is sometimes different despite using same value when encode by encoding/gob

2016-06-20 Thread Harry
Thank Dave and Jan. I understood completely. I'd consider another solution to manage that next. Thanks again. Harry. 2016年6月21日火曜日 14時58分39秒 UTC+9 Dave Cheney: > > To serialise the keys and values of a map and code would have to iterate > over it > > for k,v := range m { >// serialise k

Re: [go-nuts] Result is sometimes different despite using same value when encode by encoding/gob

2016-06-20 Thread Jan Mercl
On Tue, Jun 21, 2016 at 7:44 AM Harry wrote: > Why serialized value is not invaliable when using map value. Map keys are comparable but they are not required to be ordered , ie. sorting them before serializing is not only costly, but in the gener

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread as . utf8
Security has little to do with this. It's a "legal" problem: Unfortunately, this code has to be removed due to legal concerns. We > apologize for any inconvenience this causes you. https://lists.stg.fedoraproject.org/archives/list/gol...@lists.fedoraproject.org/thread/RDAHDK4RKN477G2ZDSX4DZT5ED

[go-nuts] Re: Result is sometimes different despite using same value when encode by encoding/gob

2016-06-20 Thread Dave Cheney
To serialise the keys and values of a map and code would have to iterate over it for k,v := range m { // serialise k and v } But map iteration does not have a guaranteed ordering. This is why the result is not stable. On Tuesday, 21 June 2016 15:44:05 UTC+10, Harry wrote: > > Hello guys, >

[go-nuts] Result is sometimes different despite using same value when encode by encoding/gob

2016-06-20 Thread Harry
Hello guys, I'm trying to use encoding/gob package to know how it works. And I wrote below codes. import "encoding/gob" func ToGOB64(data interface{}) (string, error) { b := bytes.Buffer{} e := gob.NewEncoder(&b) err := e.Encode(data) if err != nil { fmt.Println(`failed gob Encode`, err

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread Henrik Johansson
The second one, the redhat Bugzilla does. They only want to ship a select set of curves distro wide apparently. If it is motivated by security or something else is less clear. On Tue, Jun 21, 2016, 07:08 Ian Lance Taylor wrote: > On Mon, Jun 20, 2016 at 9:18 PM, wrote: > > > > Nothing is stop

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 9:18 PM, wrote: > > Nothing is stopping them, but people aren't going to go to the distribution > docs for the Go standard library - they're going to go to the official docs. It is not sustainable for us to provide distro-specific docs for changes made by distros. They

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread as . utf8
Go should not encourage distribution builder shenanigans. The effective way to solve this problem is by submitting it as an issue to the appropriate community it affects. A high search rank will accumulate based on the popularity of this issue, and the feedback (blame) will flow to the right

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 9:15 PM, wrote: > I am guessing the same efficiency should be possible. Except, each call to a > chained Transform > would involve a couple of allocations (to create the state). On the good > side, this simplifies concurrent > code sharing the same object (no locks), avoid

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread jcjoshuachase
Nothing is stopping them, but people aren't going to go to the distribution docs for the Go standard library - they're going to go to the official docs. On Monday, June 20, 2016 at 9:13:18 PM UTC-7, as@gmail.com wrote: > > If the distribution builders can take it out, what is preventing the

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread alkemir
I am guessing the same efficiency should be possible. Except, each call to a chained Transform would involve a couple of allocations (to create the state). On the good side, this simplifies concurrent code sharing the same object (no locks), avoids the original problem (concurrency corruption) a

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread as . utf8
If the distribution builders can take it out, what is preventing them from adding their own documentation? On Monday, June 20, 2016 at 9:06:26 PM UTC-7, Joshua Chase wrote: > > Yep, that's exactly what I'm saying. > > > https://lists.stg.fedoraproject.org/archives/list/gol...@lists.fedoraproject.

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread Joshua Chase
Yep, that's exactly what I'm saying. https://lists.stg.fedoraproject.org/archives/list/gol...@lists.fedoraproject.org/thread/ZLKQK7BOBVQVZ5B2ACQSXCOAOKLVRSTL/ https://bugzilla.redhat.com/show_bug.cgi?id=1038683 Supposedly patent/legal reasons? On Mon, Jun 20, 2016 at 9:03 PM, Ian Lance Taylor

[go-nuts] Re: Example for using JWT with SermoDigital/jose/jws

2016-06-20 Thread macmillan . josh09
Thanks Scott. Even after changing it to RS256 I get the same error. On Monday, June 20, 2016 at 7:14:10 PM UTC-7, macmilla...@gmail.com wrote: > > I get this error 'Error serializing the key. json: error calling > MarshalJSON for type jws.Claims: unexpected end of JSON input' > I believe that I n

Re: [go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 6:59 PM, wrote: > > Should there be a note in the documentation that this has been removed by > the Fedora packagers? > > It would help assure developers that they're not insane when they get a > compile error claiming that something that > https://golang.org/pkg/crypto/el

Re: [go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 8:09 PM, Matt Harden wrote: > OK, wait. You mentioned namespaces. It is definitely not supported in any > way to have different threads or goroutines running in different namespaces > within a single Go process. The Go scheduler can move a goroutine from one > thread to ano

[go-nuts] Re: Example for using JWT with SermoDigital/jose/jws

2016-06-20 Thread Scott
You're loading in an RSA key but signing with HS512, try changing: signMethod := jws.GetSigningMethod("HS512") to signMethod := jws.GetSigningMethod("RS256") On Monday, June 20, 2016 at 10:14:10 PM UTC-4, macmilla...@gmail.com wrote: > > I get this error 'Error serializing the key. json: er

Re: [go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 5:57 PM, Bryan Reynaert wrote: > > the following code panics with: runtime error: slice bounds out of range > > > var testTransform = transform.Chain(norm.NFD, norm.NFC) > > func main() { > for i := 0; i < 200; i++ { > go func() { > transform.String(testTransform, "nonempty

[go-nuts] Fedora and crypto/elliptic.P224

2016-06-20 Thread jcjoshuachase
Should there be a note in the documentation that this has been removed by the Fedora packagers? It would help assure developers that they're not insane when they get a compile error claiming that something that https://golang.org/pkg/crypto/elliptic says should be there, isn't there. -- You r

Re: [go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Matt Harden
OK, wait. You mentioned namespaces. It is definitely not supported in any way to have different threads or goroutines running in different namespaces within a single Go process. The Go scheduler can move a goroutine from one thread to another at any time and it is not aware of namespaces. In fact,

Re: [go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Matt Harden
Nothing about using the network requires new goroutine creation. I wouldn't expect Dial to create new goroutines, except perhaps temporarily during DNS lookup or something. On Mon, Jun 20, 2016 at 6:38 PM Manohar Kumar wrote: > > > On Monday, June 20, 2016 at 9:31:08 AM UTC-7, Ian Lance Taylor w

[go-nuts] Example for using JWT with SermoDigital/jose/jws

2016-06-20 Thread macmillan . josh09
I get this error 'Error serializing the key. json: error calling MarshalJSON for type jws.Claims: unexpected end of JSON input' I believe that I need to find the function that sign the token. The docs don't have any usage exampl - https://godoc.org/github.com/SermoDigital/jose/jws Any working

Re: [go-nuts] Re: Is there a bug in path.Dir?

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 5:59 PM, <18126523...@163.com> wrote: > Package "filepath" works well, but the "path" package is not recommended ? The path package is for slash-separated packages such as appear in URLs. The path/filepath package is for paths in the file system. Ian > 在 2016年6月20日星期一

[go-nuts] golang.org/x/text/transform.Chain is not thread safe

2016-06-20 Thread Bryan Reynaert
Dear all, the following code panics with: runtime error: slice bounds out of range var testTransform = transform.Chain(norm.NFD, norm.NFC) func main() { for i := 0; i < 200; i++ { go func() { transform.String(testTransform, "nonemptystring") }() } time.Sleep(time.Second) } The reason is transf

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread gordonbgood
On Monday, June 20, 2016 at 6:33:29 AM UTC-7, gordo...@gmail.com wrote: Further to the subject of compiler efficiency, the following is the assembler code output with array bounds checking turned off (-B) the the inner tight composite culling loop of FasterEratspeed above (generated with go tool

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread gordonbgood
On Monday, June 20, 2016 at 6:33:29 AM UTC-7, gordo...@gmail.com wrote: Further to the subject of compiler efficiency, the following is the assembler code output with array bounds checking turned off (-B) the the inner tight composite culling loop of FasterEratspeed above (generated with go tool

Re: [go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Manohar Kumar
On Monday, June 20, 2016 at 9:31:08 AM UTC-7, Ian Lance Taylor wrote: > > On Sat, Jun 18, 2016 at 10:17 PM, Manohar Kumar > wrote: > > > > Is it possible that a net.ListenTCP or ListenUDP call can result in new > go > > routine/OS thread creation ? I guess not all system calls result in a

[go-nuts] Re: Is there a bug in path.Dir?

2016-06-20 Thread 18126523585
Package "filepath" works well, but the "path" package is not recommended ? 在 2016年6月20日星期一 UTC+8下午1:40:55,徐新华写道: > > Package path implements utility routines for manipulating > slash-separated(/) paths. > > So, you should use "path/filepath" > -- You received this message because you are subscr

[go-nuts] Re: A proposal for generic in go

2016-06-20 Thread xingtao zhao
That was my original thought. While later I realized that we still need some parameter check in the callee code to satisfy the interface matching (the generic version of each function in my proposal). And we need special assembler function for dynamic interface cast. On Monday, June 20, 2016 at

Re: [go-nuts] A proposal for generic in go

2016-06-20 Thread Rodrigo Kochenburger
Micky, I'm not sure where you're quoting from but they never said it's never gonna happen. >From the FAQ: "Generics may well be added at some point." and "This remains an open issue". https://golang.org/doc/faq#generics On Mon, Jun 20, 2016 at 4:54 PM Micky wrote: > It's never going to happen

Re: [go-nuts] A proposal for generic in go

2016-06-20 Thread Micky
It's never going to happen! To quote the powers-to-be, "The language is done". Good luck! On Wed, Jun 15, 2016 at 6:04 AM, xingtao zhao wrote: > Here is my proposal for generic in go: > https://docs.google.com/document/d/1nO7D15c2B3eq2kF62C0yUs_UgpkyPL2zHhMAmlq1l98/edit?usp=sharing > > Many parts

[go-nuts] Re: Discussion on "Vendoring edge case, critical problem"

2016-06-20 Thread Dave Cheney
On Tuesday, 21 June 2016 00:42:54 UTC+10, Chad wrote: > > But if you vendor, you don't really need type equality do you? > That sounds like a lot to give up. > Maybe it's a design flaw when types or interfaces with unexported methods > from the vendored pkg are visible to the end user of the

Re: [go-nuts] Re: Currying in Go

2016-06-20 Thread Tyler Compton
Thank you, Jesper, that's very interesting. On Sunday, June 19, 2016 at 8:15:13 AM UTC-7, Jesper Louis Andersen wrote: > > > On Sat, Jun 18, 2016 at 5:32 AM, Tyler Compton > wrote: > >> I don't pretend to be proficient in this realm of functional programming, >> but I would be very surprised if

[go-nuts] Re: A proposal for generic in go

2016-06-20 Thread andrew . mezoni
Overhead at runtime will be not very big; 1. Generate each time an instance of specific generic type with arguments 2. Perform generic specific type checks before any kind of an assignements 1. The first overhead can be reduced (eleminated) by the static code generation of specified generic types

[go-nuts] Re: A proposal for generic in go

2016-06-20 Thread andrew . mezoni
As for me then everything is much more simple if Go language (as the starting point) will introduce a non-reified generics. Non reified generics does not requires a complex runtime support (static code which was generated by the compiler will be enough). Type checking of the type arguments perfo

Re: [go-nuts] Unmarshalling and tags

2016-06-20 Thread Jakob Borg
2016-06-19 12:42 GMT+02:00 'Mihai B' via golang-nuts : > I have a struct that needs to be marshalled/unmarshalled using various > serialization formats(xml, json, name/value). The tags start to represent a > considerable effort[0] so I'm wondering if this is a common use case and if > a change[1] t

Re: [go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread Jason E. Aten
On Mon, Jun 20, 2016 at 1:08 PM, Ian Lance Taylor wrote: > On Mon, Jun 20, 2016 at 10:39 AM, Jason E. Aten > wrote: > > This does raise an interesting question: how should one detect cycles in > a > > graph of Go objects, in a garbage-collection safe manner? > > > > I am using reflect.ValueOf(x)

Re: [go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread Ian Lance Taylor
On Mon, Jun 20, 2016 at 10:39 AM, Jason E. Aten wrote: > This does raise an interesting question: how should one detect cycles in a > graph of Go objects, in a garbage-collection safe manner? > > I am using reflect.ValueOf(x).Pointer() at the moment (which gives an > uintptr), but this seem vulner

Re: [go-nuts] Unmarshalling and tags

2016-06-20 Thread Ian Lance Taylor
On Sun, Jun 19, 2016 at 3:42 AM, 'Mihai B' via golang-nuts wrote: > > I have a struct that needs to be marshalled/unmarshalled using various > serialization formats(xml, json, name/value). The tags start to represent a > considerable effort[0] so I'm wondering if this is a common use case and if >

Re: [go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread Jason E. Aten
This does raise an interesting question: how should one detect cycles in a graph of Go objects, in a garbage-collection safe manner? I am using reflect.ValueOf(x).Pointer() at the moment (which gives an uintptr), but this seem vulnerable to having the garbage collector move the object in the mi

[go-nuts] KW Go Developers - First meetup August 9

2016-06-20 Thread Cameron . Smith
Hi everyone, I would like to announce the first meetup of the KW Go Developers group in Waterloo, Canada. The first meeting's topic is "Why Go?". We'll discuss the problems that new languages such as Go, Rust, and Swift are trying to solve and why we settled on Go for some of our new developm

Re: [go-nuts] WebAssembly as a target

2016-06-20 Thread Ian Lance Taylor
On Sat, Jun 18, 2016 at 11:16 PM, 'Mihai B' via golang-nuts wrote: > I don't think we can expect anything before wasm supports GC (i.e. Phase 3 on > wasm roadmap). Once GC is supported(not very soon) Go could be compiled > through llgo[0]. One issue could be the binary size(.i.e due /reflect) G

[go-nuts] Re: better understanding of * and & in go

2016-06-20 Thread andrew . mezoni
In Go arguments (function parameters) passed by value. This means that when you call function you pass copy of the instances. If you modify (received copy) then original instance remains unchanged. Pointer points to the storage of the instance. When you pass pointer as an argument then you pass a

Re: [go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread andrew . mezoni
>> Keeping a a pointer in a uintptr as a "reference" to something is safe iff it will never be casted back to a pointer. I think this means that the safe case is useless. Storing any reference (read: address) of Go instance is unsafe because after when this operation ends then a stored address

Re: [go-nuts] better understanding of * and & in go

2016-06-20 Thread Shawn Milochik
Here's a short video I made. I hope this helps explain it: https://www.youtube.com/watch?v=hMSYabOnA3M -- 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-nut

Re: [go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread Kyle Stanly
Thank you for re-opening and answering the question. The original reason why I closed it was because after looking it up in the unsafe package documentation (as I was skimming through source-code originally) it states in Section 2, Paragraph 4 (I feel li

Re: [go-nuts] better understanding of * and & in go

2016-06-20 Thread Konstantin Khomoutov
On Mon, 20 Jun 2016 09:28:05 -0700 (PDT) JM wrote: > Can someone answer the question below in the first comment of the > ChangeRefValue function? Also can anyone provide better explanations > of waht's going on here, or a link that explains? Thanks. Could you start with, say, [1]? I think we

Re: [go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Ian Lance Taylor
On Sat, Jun 18, 2016 at 10:17 PM, Manohar Kumar wrote: > > Is it possible that a net.ListenTCP or ListenUDP call can result in new go > routine/OS thread creation ? I guess not all system calls result in a new go > routine (and OS thread if necessary) creation. But ListenTCP & UDP does many > thi

[go-nuts] better understanding of * and & in go

2016-06-20 Thread JM
Can someone answer the question below in the first comment of the ChangeRefValue function? Also can anyone provide better explanations of waht's going on here, or a link that explains? Thanks. playground version: https://play.golang.org/p/8dYdYoL0WI package main import "fmt" func main() {

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread 'Keith Randall' via golang-nuts
On Monday, June 20, 2016 at 6:33:29 AM UTC-7, gordo...@gmail.com wrote: > > Further to the subject of compiler efficiency, the following is the > assembler code output with array bounds checking turned off (-B) the the > inner tight composite culling loop of FasterEratspeed above (generated wit

Re: [go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread Jan Mercl
On Mon, Jun 20, 2016 at 5:45 PM Kyle Stanly wrote: The GC is precise, it will not confuse an integer and a pointer. Keeping a a pointer in a uintptr as a "reference" to something is safe iff it will never be casted back to a pointer. I think this means that the safe case is useless. > Finally,

[go-nuts] Re: Gomobile: Large .so/aar file size on Android

2016-06-20 Thread nsajko
Did you try the beta https://groups.google.com/forum/#!topic/golang-announce/ITzPaJnZGZw ? It should be a lot better than go 1.6 at code elimination. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiv

[go-nuts] Re: Gomobile: Large .so/aar file size on Android

2016-06-20 Thread nsajko
If it's still too much a bit can be saved on code size by disabling bounds checking. -- 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...@goog

[go-nuts] Is there any overhead to casting a pointer (or uintptr) to and from unsafe.Pointer? Can uintptr be safely used to reference an object?

2016-06-20 Thread Kyle Stanly
I was just wondering about something right now. The original issue I thought using a uintptr would have over an unsafe.Pointer is because the Garbage Collector wouldn't associate it with an actual reference to an object and hence, if it was the the only reference to an object, it would get garb

[go-nuts] [?] emulating an opengl shader in cpu bound functions

2016-06-20 Thread blueblank
I am attempting to generate a random starfield, in go. This is something that will need to printed on actual paper, but that is another issue and I only mention it to

Re: [go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Jesse McNelis
On 21 Jun 2016 12:42 a.m., "Manohar Kumar" wrote: > > I am mainly interested in Linux and have to make these calls in a part of the code where new OS thread creation isn't desirable. Please note that changing that aspect of the design itself is not an option for me. If you have a requirement that

[go-nuts] net.ListenUDP, ListenTCP & new go routine creation

2016-06-20 Thread Manohar Kumar
Hello, Is it possible that a net.ListenTCP or ListenUDP call can result in new go routine/OS thread creation ? I guess not all system calls result in a new go routine (and OS thread if necessary) creation. But ListenTCP & UDP does many things underneath and its not clear if it can lead to new

[go-nuts] [ANN]: Unigornel: Clean-slate unikernels for Go

2016-06-20 Thread henriverroken
To all Go and unikernel enthousiasts, We are happy to announce the [unigornel project](https://github.com/unigornel/unigornel) to the Go and unikernel community. Unigornel is a clean-slate approach to unikernels for the Go programming language. It is built on Xen's Mini-OS and a fork of Go. Ou

[go-nuts] Re: Discussion on "Vendoring edge case, critical problem"

2016-06-20 Thread Chad
But if you vendor, you don't really need type equality do you? Maybe it's a design flaw when types or interfaces with unexported methods from the vendored pkg are visible to the end user of the vendoring pkg. On Sunday, June 19, 2016 at 10:52:34 PM UTC+2, Dave Cheney wrote: > > If you mean forkin

[go-nuts] Re: Discussion on "Vendoring edge case, critical problem"

2016-06-20 Thread contin673
So, is the solution really two-part? The vendoring tools would display a warning when you vendor some code and then directly expose that type in your API, either as function parameters or as a return type, stating that this will make it harder to consume downstream. Secondly, the user of the l

[go-nuts] Re: Discussion on "Vendoring edge case, critical problem"

2016-06-20 Thread Zellyn
I made a proposal here , which seems to be generating generally positive discussion. On Sunday, June 19, 2016 at 1:14:57 AM UTC-4, Tyler Compton wrote: > > A user brought up a problem with the current vendoring setup regarding > ex

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread gordonbgood
Further to the subject of compiler efficiency, the following is the assembler code output with array bounds checking turned off (-B) the the inner tight composite culling loop of FasterEratspeed above (generated with go tool compile -B -S FasterEratspeed.go > FasterEratspeed.asm): 0x005

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread gordonbgood
Further to the subject of compiler efficiency, the following is the assembler code output with array bounds checking turned off (-B) the the inner tight composite culling loop of FasterEratspeed above (generated with go tool compile -B -S FasterEratspeed.go > FasterEratspeed.asm): 0x005

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread gordonbgood
Edit: Corrected, forgot to change the new count routine to 48 from 8... We have proven with the straight translation of Daniel Bernstein's C code to golang that the Sieve of Eratosthenes (SoE) eratspeed runs about the same speed as the Sieve of Atkin (SoA) primespeed for the same range with the

Re: [go-nuts] [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread Michael Jones
Your code (with slightly changed print formatting) on my MacBook Pro: $ go install $ time fasterEratspeed Init: 2.885352ms Search: 284.849689ms, found 8621475 primes up to 1018429650 Total: 287.735041ms real0m0.302s user0m0.287s sys 0m0.007s It is pretty complicated to me so I

Re: [go-nuts] Re: [ANN] primegen.go: Sieve of Atkin prime number generator

2016-06-20 Thread gordonbgood
We have proven with the straight translation of Daniel Bernstein's C code to golang that the Sieve of Eratosthenes (SoE) eratspeed rans about the same speed as the Sieve of Atkin (SoA) primespeed for the same range with the same optimizations and with John Barham's multi-treading for primespeed