[go-nuts] NOSPLIT on Go assembler defined functions

2018-02-25 Thread Pablo Rozas Larraondo
Hi, I started learning about Go assembler and I'm having problems with the NOSPLIT symbol, which makes the compilation fail with error message: "illegal or missing addressing mode for symbol NOSPLIT" I've found a blog post which describes the same problem and proposes removing the symbol in order

Re: [go-nuts] NOSPLIT on Go assembler defined functions

2018-02-26 Thread Pablo Rozas Larraondo
Thank you very much Ian, I didn't notice the imported headers file in the examples I was looking at. My code is compiling perfectly fine after I added that line. Cheers, Pablo On Tue, Feb 27, 2018 at 8:46 AM, Ian Lance Taylor wrote: > On Sun, Feb 25, 2018 at 11:27 PM, Pablo Rozas L

[go-nuts] Licensing terms when using Go code

2018-05-02 Thread Pablo Rozas Larraondo
Hi gophers, I have created a new library reusing some code from the Go standard library. I want to make this project open source and I would like to know if there are requirements in terms of the license for this software. Should I use the same Go BSD license, use BSD without mentioning the Go te

Re: [go-nuts] Licensing terms when using Go code

2018-05-02 Thread Pablo Rozas Larraondo
Thank you Lutz, then, if I understand this right, new projects containing parts of Go code have to include the original Go BSD license. There are a couple of aspects that remain unclear to me: - The copyright notice, list of conditions and disclaimer have to be included in every file of the pr

[go-nuts] Re: Licensing terms when using Go code

2018-05-02 Thread Pablo Rozas Larraondo
Thanks Ian, that is very helpful. I've also googled for reusing BSD software and, as you said, there is plenty of information. On Wednesday, May 2, 2018 at 7:04:34 PM UTC+10, Pablo Rozas Larraondo wrote: > > Hi gophers, > > I have created a new library reusing some code fro

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

2018-09-04 Thread Pablo Rozas Larraondo
hings are constantly evolving, so > any information you get may not apply to the latest version of the > language. > > Good luck. > > > > On Tuesday, September 4, 2018 at 10:50:03 AM UTC-4, thwd wrote: >> >> A virtual machine has its own instruction set. Go compil

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

2018-09-05 Thread Pablo Rozas Larraondo
This is awesome, thank you all very much for the background information and great examples that you've provided. I think it is quite clear now what the difference is between these two runtimes. Cheers, Pablo On Thursday, September 6, 2018 at 3:16:59 AM UTC+10, Michael Jones wrote: > > These a

[go-nuts] Understanding least significant byte operation

2017-07-23 Thread Pablo Rozas Larraondo
I have seen Go code using this function to find out the least significant byte of unsigned integers: func LSB(ci uint64) uint64 { return uint64(ci) & -uint64(ci) } This function works fine but I wonder why, if call the same AND operation, it results in an error: "constant -X overflows uint64" He

Re: [go-nuts] Understanding least significant byte operation

2017-07-24 Thread Pablo Rozas Larraondo
4 { return x&-x } works too. In your > example you get an error because in Go literal constants are untyped. It is > a pragmatic decision -- see https://blog.golang.org/constants > > On Jul 23, 2017, at 5:50 AM, Pablo Rozas Larraondo < > p.rozas.larrao...@gmail.com> wrote: >

Re: [go-nuts] Understanding least significant byte operation

2017-07-25 Thread Pablo Rozas Larraondo
, the title should say Bit instead of Byte, sorry about the confusion. On Wed, Jul 26, 2017 at 11:35 AM, Matt Harden wrote: > Both statements are true for both signed and unsigned integers. > > On Mon, Jul 24, 2017, 04:11 Pablo Rozas Larraondo < > p.rozas.larrao...@gmail.com>

Re: [go-nuts] Understanding least significant byte operation

2017-07-25 Thread Pablo Rozas Larraondo
an int as a signed int or an > unsigned one. > > I would suggest reading up on how computers do arithmetic. Programming > languages are merely syntactic sugar on top of processor instruction sets > :-) > > On Jul 25, 2017, at 8:16 PM, Pablo Rozas Larraondo < > p.roza

Re: [go-nuts] Understanding least significant byte operation

2017-07-25 Thread Pablo Rozas Larraondo
Thanks Matt. That's a very good explanation about the internal bit representation of integers and answers perfectly my question. I really appreciate your help in understanding these operations. Cheers, Pablo On Wed, Jul 26, 2017 at 2:07 PM, Pablo Rozas Larraondo < p.rozas.larrao...@g

[go-nuts] Re: [ANN] gopig

2017-10-15 Thread Pablo Rozas Larraondo
Thanks for sharing. You might be interested in this nice implementation of the same game implemented by the Go team a few years ago. It contains a great demonstration of hoe to solve this problem elegantly using functions as returned values: https://golang.org/doc%2Fcodewalk%2Fpig.go Cheers, Pa

[go-nuts] Inconsistency in gofmt

2017-12-12 Thread Pablo Rozas Larraondo
Hello, I'm curious to know if this is intended: https://play.golang.org/p/t353t8ZvL1 Line 9 is formatted with spaces but line 10 has no spaces. It seems like adding +1 to the expression changes the behaviour of "gofmt". Wouldn't it be simpler for "gofmt" to always add spaces between the operator

[go-nuts] [ANN] A blog post series on serving big satellite imagery with Go

2017-12-18 Thread Pablo Rozas Larraondo
Hi, For those interested on serving or using satellite imagery, I've just published the first of a three part series on this subject using Go: https://medium.com/@p.rozas.larraondo/divide-compress-and-conquer-building-an-earth-data-server-in-go-part-1-d82eee2eceb1 Any feedback or comment that yo

[go-nuts] Re: [ANN] A blog post series on serving big satellite imagery with Go

2017-12-19 Thread Pablo Rozas Larraondo
code. I wonder if the performances can be > compared to something like `vips` (https://jcupitt.github.io/libvips). > > Le lundi 18 décembre 2017 22:51:49 UTC+1, Pablo Rozas Larraondo a écrit : >> >> Hi, >> >> For those interested on serving or using satellite imag

Re: [go-nuts] Re: [ANN] A blog post series on serving big satellite imagery with Go

2017-12-20 Thread Pablo Rozas Larraondo
ghts. None of them would help make what you've done any > clearer or more helpful to the reader. > > Best, > Michael > > > On Tue, Dec 19, 2017 at 3:37 PM, Pablo Rozas Larraondo < > p.rozas@gmail.com > wrote: > >> Thank you Thomas for the link to the vips l

Re: [go-nuts] Re: [ANN] A blog post series on serving big satellite imagery with Go

2018-01-04 Thread Pablo Rozas Larraondo
;sane" developers to expect. > :-) > > On Wed, Dec 20, 2017 at 3:33 PM, Pablo Rozas Larraondo < > p.rozas.larrao...@gmail.com> wrote: > >> Hi Michael, >> >> Thanks for your comments, I totally agree with them. File systems will >> struggle with t

[go-nuts] What 'select' is doing here?

2016-09-06 Thread Pablo Rozas Larraondo
I'm trying to understand how the 'select' statement works internally. The execution process of select as described in https://golang.org/ref/spec#Select_statements says on number 2: "If one or more of the communications can proceed, a single one that can proceed is chosen via a uniform pseudo-rando

[go-nuts] Re: What 'select' is doing here?

2016-09-06 Thread Pablo Rozas-Larraondo
Thanks Dave. It seems though that whatever select chooses to run (A or B) the program takes 1000 ms to complete. I would expect the program to finish in 100 ms if A is chosen or 1000 ms in the case of B. I wonder if both functions are evaluated concurrently no matter which case select chooses.

[go-nuts] Re: What 'select' is doing here?

2016-09-06 Thread Pablo Rozas-Larraondo
ll the > work to evaluate the RHS of the select cases happens "before" the select > statement, so if A() sleeps for 100ms, then B() sleeps for 1000ms, the > select statement is not executed until both operations have happened. > > > On Wednesday, 7 September 2016 1

Re: [go-nuts] What 5 things does Go need in 2017?

2016-09-11 Thread Pablo Rozas-Larraondo
Hi Mark, I can also suggest you to look into the open discussion that's currently happening on how multidimensional slices should be implemented in future versions of Go. I particularly find that area and the proposed ideas very interesting: https://github.com/golang/go/issues/6282 Cheers, Pab

[go-nuts] Videos from DotGo 2016

2016-11-08 Thread Pablo Rozas Larraondo
Does anyone know when videos from the DotGo 2016 conference are going to be made available? if they are... I can only find 3 of the talks at their news site. http://www.thedotpost.com/conference/dotgo-2016 I'm looking forward to watch Robert Griesemer's talk on prototyping multidimensional slices

[go-nuts] Idiomatic way of handling http requests in separate goroutines

2016-12-07 Thread Pablo Rozas Larraondo
Hi gophers, I'm designing a service exposed through a http server which uses a pool of workers to process requests. At the moment my handlerFunc look similar to this: func aHandler(w http.ResponseWriter, r *http.Request) { var wg sync.WaitGroup wg.Add(1) reqQueue <- &Reque

[go-nuts] Re: Idiomatic way of handling http requests in separate goroutines

2016-12-08 Thread Pablo Rozas-Larraondo
Thank you Tamás, I like the concept of blocking on select in the handler until a worker closes the channel. I don't know why but every time I use a WaitGroup I have the impression that the same thing can be done better. I'll try to implement it with the context library first as I'm very intri

[go-nuts] Re: Idiomatic way of handling http requests in separate goroutines

2016-12-12 Thread Pablo Rozas-Larraondo
uot;cancel", f) reqChan <- contC <-contC.Done() } func main() { http.HandleFunc("/", rootHandler) reqChan = make(chan context.Context) go ConcPrinter(reqChan) http.ListenAndServe(":8080", nil) } Cheers, Pablo On Wednesday, December 7, 2016 at 4:01:18 PM UTC-8, Pablo Rozas-L

[go-nuts] Debug memory leaks in cgo calls

2016-12-14 Thread Pablo Rozas Larraondo
I've seen this question asked before in the mail list but with no clear answers. I'm just asking it again in case someone has come up with a new way of doing this: Does anyone know about a good tool or method to detect memory leaks happening on C code being called by cgo? Cheers, Pablo -- You r

Re: [go-nuts] Debug memory leaks in cgo calls

2016-12-15 Thread Pablo Rozas Larraondo
M, Pablo Rozas Larraondo > wrote: > > > > I've seen this question asked before in the mail list but with no clear > > answers. I'm just asking it again in case someone has come up with a new > way > > of doing this: > > > > Does anyone know about a

[go-nuts] image Gray16 endianness

2017-01-10 Thread Pablo Rozas Larraondo
Hi, I'm confused with image.Gray16 having pixel values represented in the wrong order. It seems to me that image.Gray16 considers numbers to be big endian instead of little endian. I've created a small playground example to illustrate this: https://play.golang.org/p/bhYbuIkkOz Is there something

Re: [go-nuts] image Gray16 endianness

2017-01-10 Thread Pablo Rozas Larraondo
t; dan.kortsc...@adelaide.edu.au> wrote: > On Wed, 2017-01-11 at 16:21 +1100, Pablo Rozas Larraondo wrote: > > I'm confused with image.Gray16 having pixel values represented in the > > wrong order. It seems to me that image.Gray16 considers numbers to be > > big endian inst

Re: [go-nuts] image Gray16 endianness

2017-01-11 Thread Pablo Rozas Larraondo
n Wed, 2017-01-11 at 16:46 +1100, Pablo Rozas Larraondo wrote: > > Thanks Dan. I'm just surprised that Gray16 uses big endian when, for > > example, Go's uint16 type uses the little endian convention. > > On *most* supported architectures. > > > I guess I find

[go-nuts] [ANN] Gleam now supports distributed pure Go Map Reduce

2017-01-21 Thread Pablo Rozas-Larraondo
That's great news Chris! Is it documented anywhere with some more detail this pure Go implementation? I'd love to know more about how you overcame the initial problems such as external code execution that lead you to choose LuaJit in the first place. Thanks, Pablo -- You received this message

Re: [go-nuts] Automatic type assertion

2016-06-28 Thread Pablo Rozas-Larraondo
Nice one! Thanks for sharing Pablo On Friday, June 24, 2016 at 6:56:58 AM UTC+10, Jose Luis Aracil wrote: > > > I use my own "automatic" type assertion library: > > https://github.com/jaracil/ei > > El jueves, 9 de junio de 2016, 22:39:46 (UTC+2), Pablo Rozas-Larra

Re: [go-nuts] [ANN] Gleam now supports distributed pure Go Map Reduce

2017-01-22 Thread Pablo Rozas Larraondo
But Go code is more manageable and can have more > complicated logic with libraries. Sacrificing the readability with extra > type casting from interface{} seems a small cost to pay. > > Chris > > > On Sat, Jan 21, 2017 at 11:36 PM, Pablo Rozas-Larraondo < > p.rozas.lar

[go-nuts] net/rpc result types

2017-01-23 Thread Pablo Rozas Larraondo
Hi, The rpc documentation says that a remote rpc method can be registered if the second argument (response) is a pointer. https://golang.org/pkg/net/rpc/#Server.Register Does anyone know if there is a way of having an interface declared as this response type and then assign pointers to it that s

[go-nuts] netutil.LimitListener(lis, n) limits to n-2 requests

2017-05-23 Thread Pablo Rozas Larraondo
Hi gophers, I'm using netutil.LimitListener to limit the number of concurrent requests that can be handled in a server to limit the memory usage of the service. I've noticed that when I send a bunch of requests it serves the number passed to the LimitListerner but after that it serves n-2 requests

[go-nuts] Re: How to point to pointer struct

2017-05-23 Thread Pablo Rozas Larraondo
I'm thinking about the possibility of having something like [][]Volume in Go. Do you know the size or number of Volumes in your struct? There's an example of converting **char into []string that might be useful: https://stackoverflow.com/questions/36188649/cgo-char-to-slice-string On Tuesday,

Re: [go-nuts] netutil.LimitListener(lis, n) limits to n-2 requests

2017-05-24 Thread Pablo Rozas Larraondo
ssible you've found a poor interaction beetween connection pooling and > connection limiting. You might try running your experiment again with keep > alive disabled on your HTTP client. > > On Tue, May 23, 2017, 05:57 Pablo Rozas Larraondo < > p.rozas.larrao...@gmail.com> w