Re: [go-nuts] io.Reader can return (n, err), both non-zero

2024-03-19 Thread Nigel Tao
On Wed, Mar 20, 2024 at 2:13 PM Ian Lance Taylor wrote: > Some earlier discussions: > > https://groups.google.com/g/golang-nuts/c/b78eRMOS0FA/m/jq8lAQhenaoJ > https://groups.google.com/g/golang-nuts/c/WGYJx3ICCW4/m/1L0WcN8eqmkJ > > See in particular this message from Russ: >

[go-nuts] io.Reader can return (n, err), both non-zero

2024-03-19 Thread Nigel Tao
The ubiquitous io.Reader interface's Read method returns a (int, error). Surprisingly (for programmers coming from other languages with a built-in or idiomatic Result type), it's possible for both return values to be non-zero. There's (often overlooked??) commentary in https://pkg.go.dev/io#Reader

Re: [go-nuts] shiny, windows, and goroutines

2023-10-18 Thread Nigel Tao
On Wed, Oct 18, 2023 at 9:55 PM SuperTXT Team wrote: > I'm experimenting with shiny, trying to develop a wire protocol for > it. I have some questions about the interfaces. > > It seems from some of the examples in the documentation and some > tutorials that everything except perhaps sending

[go-nuts] Why is foo in my go.sum file?

2023-08-18 Thread Nigel Tao
The go.sum file in the golang.org/x/image repo has a line that is not another golang.org.x/* module: github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY= https://github.com/golang/image/blob/2b687b56714d59d061135c735913a64fe2b70778/go.sum#L1 That line was

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Nigel Tao
On Tue, Apr 4, 2023 at 8:06 AM Ian Lance Taylor wrote: > Some of the select statements in net/http/transport.go are non-trivial. Yeah, net/http (and its transport.go) is probably equally good an example of selects as golang.org/x/net/http2 (and its transport.go). But that's not really

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Nigel Tao
On Tue, Apr 4, 2023 at 7:56 AM Skip Tavakkolian wrote: > mux9p, Fazlul Shahriar's port of Russ' 9pserve (plan9port) > https://github.com/fhs/mux9p/search?q=clientIO > > ... > > select { > case v, ok := <- counts: > // collect samples > case reporting <- Stats{ stats }: >

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Nigel Tao
On Mon, Apr 3, 2023 at 8:14 PM Rob Pike wrote: > select { > case <-ticker.C: > case <-pauseC: > <-pauseC > } This one is more interesting. You can't combine the ticker.C and the pauseC into a single heterogenous channel because you want to wait for the

Re: [go-nuts] Interesting "select" examples

2023-04-03 Thread Nigel Tao
On Mon, Apr 3, 2023 at 3:40 PM Konstantin Kulikov wrote: > select { > case <-ctx.Done(): > case linksCh <- links: > } On Tue, Apr 4, 2023 at 1:15 AM burak serdar wrote: > select { > case <-pause: > case <-done: > return > } Thanks, but I think both

[go-nuts] Interesting "select" examples

2023-04-02 Thread Nigel Tao
I'm working on a multi-threaded C++ project. We have the equivalent of Go's channels, and are considering whether we also need to implement the equivalent of Go's select. Does anyone have interesting, non-trivial examples of a Go select statement in real code? By non-trivial, I mean that a lot

Re: [go-nuts] overriding image.Decode image type detection

2023-03-05 Thread Nigel Tao
On Sun, Feb 26, 2023 at 12:43 PM 'Dan Kortschak' via golang-nuts wrote: > The alternative is to > replicate the image.Decode functionality, including registration which > seems ugly. It may seem ugly but that is what I'd recommend. https://go.dev/src/image/format.go is only 110 lines of code.

Re: [go-nuts] How to cast *interface{} into *T ?

2022-11-24 Thread Nigel Tao
Possibly relevant: https://go.dev/doc/faq#pointer_to_interface -- 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

[go-nuts] Should io.WriterTo "seek to the end"?

2022-10-26 Thread Nigel Tao
The io.WriterTo interface has come up in a code review discussion. ``` // WriterTo is the interface that wraps the WriteTo method. // // WriteTo writes data to w until there's no more data to write or // when an error occurs. The return value n is the number of bytes // written. Any error

Re: [go-nuts] Go Fonts v2.010

2022-06-20 Thread Nigel Tao
On Sat, Jun 18, 2022 at 6:24 PM Shulhan wrote: > Do you know any public CDN for gofont/ttfs? I don't know of any public CDN for gofont/ttfs. Sorry. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop

[go-nuts] Go Fonts v2.010

2022-06-16 Thread Nigel Tao
The Go Fonts were originally released in 2016 and version 2.008 came out in 2017. It's taken longer that we'd have liked, but we have just released version 2.010 as of commit 41969df7

Re: [go-nuts] Nil could be the zero value for type variables

2022-06-05 Thread Nigel Tao
On Tue, May 31, 2022 at 1:39 AM Will Faught wrote: > Why not allow nil to be used as the zero value for type variables, to fill > this gap? > > return nil // == V(nil) > See also: https://github.com/golang/go/issues/35966 https://github.com/golang/go/issues/19642 -- You received this message

Re: [go-nuts] Re: When will the official encoding/json package support parsing json5?

2022-03-20 Thread Nigel Tao
On Mon, Mar 21, 2022 at 6:00 AM jan.f...@gmail.com wrote: > Just googled for "json5 golang" and there seem to be several 3rd party > implementations available. > Can you not use one of those? See also HuJSON, also known as "JSON With Commas and Comments": https://github.com/tailscale/hujson

Re: [go-nuts] Implementation of image.NRGBA64

2021-09-28 Thread Nigel Tao
On Tue, Sep 28, 2021 at 3:53 AM Scott Pakin wrote: > I'm curious: Why does image.NRGBA64 define Pix as a []uint8 and > perpetually pack pairs of uint8 values into a uint16? Wouldn't it have > been easier and faster to define Pix as a []uint16 and Stride to be a > stride in uint16s rather than

Re: [go-nuts] Graphics/Image example programs

2021-06-27 Thread Nigel Tao
On Sun, Jun 27, 2021 at 8:44 AM Tharaneedharan Vilwanathan < vdhar...@gmail.com> wrote: > But I need something that displays images and accepts mouse input, etc but > not vector graphics (say, in OpenGL) for now. Can you please provide some > pointers? >

Re: [go-nuts] Error handling

2021-02-23 Thread Nigel Tao
If you're proposing exceptions, be aware of how complicated the control flow for correct handling can be. Look for what follows `The statement "RESULT = yield from EXPR" is semantically equivalent to...` in https://www.python.org/dev/peps/pep-0380/ -- You received this message because you are

Re: [go-nuts] x/image/font: Font serialization

2021-02-10 Thread Nigel Tao
On Mon, Feb 8, 2021 at 8:40 PM Sebastien Binet wrote: > SGTM, and make Source implement io.Reader or io.WriterTo. > > or directly return an io.Reader (either from the underlying []byte, or as > an io.SectionReader - wrapping the io.ReaderAt+size) ? On further thought, since a Source (and its

Re: [go-nuts] x/image/font: Font serialization

2021-02-05 Thread Nigel Tao
On Sat, Feb 6, 2021 at 9:18 AM Nigel Tao wrote: > It doesn't have any in-memory representation of the not-frequently-used > parts, including the actual glyph vectors. > Correction: it doesn't have not-frequently-used or too-big-to-cache parts, and glyph vectors are the latter. Avoidi

Re: [go-nuts] x/image/font: Font serialization

2021-02-05 Thread Nigel Tao
On Fri, Feb 5, 2021 at 8:56 PM Sebastien Binet wrote: > ‐‐‐ Original Message ‐‐‐ > On Friday, February 5th, 2021 at 2:10 AM, Nigel Tao > wrote: > > Two []byte values aren't double the memory if the slices share the same > backing array. > > sure, I was thinking

Re: [go-nuts] x/image/font: Font serialization

2021-02-04 Thread Nigel Tao
On Fri, Feb 5, 2021 at 7:00 AM Sebastien Binet wrote: > but as I wrote in the OP, it's not completely satisfying. > one needs to keep track of the association font.Face/[]byte. > so that's either double the memory (give or take), or a filename/io.Reader > handle to keep around. > Two []byte

Re: [go-nuts] Re: [Feature Request] x/mobile: support for gamepad/joystick/controller events

2020-09-21 Thread Nigel Tao
On Fri, Sep 18, 2020 at 6:02 AM Ben Lubar wrote: > I'd appreciate feedback on the potential future existence of gamepad input > support in x/mobile x/mobile is not a very active project. Sorry. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group.

Re: [go-nuts] [generics] () instead of (type T)

2020-06-22 Thread Nigel Tao
On Sun, Jun 21, 2020 at 3:45 AM David Anderson wrote: > It's covered in the generics design doc, and by about a dozen threads on > golang-nuts at this point. I think that the suggestion was for F(), not F. If so, that suggestion isn't covered by the generics design doc or the other golang-nuts

Re: [go-nuts] Generics: More on parens

2020-06-18 Thread Nigel Tao
Heh, I also run GMail+Chrome, but I see rectangles instead of blank spaces (see attachment), which only reinforces your point. On Fri, Jun 19, 2020 at 8:28 AM David Anderson wrote: > Here's one reason to not do that (screenshot from gmail, in a chrome with > a ton of unicode-ready fonts,

Re: [go-nuts] Image Resize and Crop

2020-05-10 Thread Nigel Tao
On Mon, May 11, 2020 at 4:28 AM robert engels wrote: > All of the code to do scaling and cropping in the ‘image’ package in the > stdlib. Cropping is in the stdlib but scaling is not. Various scaling algorithms (e.g. nearest neighbor, Catmull-Rom) are in the golang.org/x/image/draw package

Re: [go-nuts] Re: Language proposal: labelled "with" statements to help make test code easier to write

2020-03-06 Thread Nigel Tao
On Thu, Mar 5, 2020 at 10:32 AM Warren Stephens wrote: > There is a bunch of "goto nonsense" added to get the Go compiler to accept > the 4 labels Well then, don't use labels, so you don't need nonsense (or the dummy parameter). Cutting them out (https://play.golang.org/p/SUalTGaAxmx) runs

Re: [go-nuts] Language proposal: labelled "with" statements to help make test code easier to write

2020-03-01 Thread Nigel Tao
On Mon, Mar 2, 2020 at 8:06 AM Warren Stephens wrote: > It could made to look more Go-like... > >internal mystep2(lines, thing2): (mymap, err) Ian isn't talking about the particular syntax (e.g. punctuation or keywords). He is talking about the semantics (statements that hide scope, hidden

Re: [go-nuts] Bound checks elimination hint.

2020-02-22 Thread Nigel Tao
On 2/23/20, Bruno Albuquerque wrote: > Would adding an explicit len() check before the loop help the > compiler in any way (can not test right now)? I don't know. Sorry. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this

Re: [go-nuts] Bound checks elimination hint.

2020-02-22 Thread Nigel Tao
On 2/22/20, Bruno Albuquerque wrote: > https://play.golang.org/p/P2JPI42YJa8 > > ... > > So, in this simplified case, if the step divides the length evenly, then > there are no bound checks. If it does not, then bound checks are inserted. > > This seems to be an unnecessary check If the step

Re: [go-nuts] Bound checks elimination hint.

2020-02-22 Thread Nigel Tao
On 2/22/20, Bruno Albuquerque wrote: > https://play.golang.org/p/Y7ICg7t4_nd > > ... > > Unfortunately, I could not find an incantation that would remove the bound > checks. The code from that play.golang.org link is: func NRGBA(rgbData []byte) []byte { nrgbaData := make([]byte,

Re: [go-nuts] Go without garbage collector

2020-02-13 Thread Nigel Tao
On 2/13/20, robert engels wrote: > See this paper/project https://github.com/hundt98847/multi-language-bench > that was done by Google > in 2011. > > ... > > Or Java is almost 2x faster than C++, and Go is nearly the same performance > as C++.

Re: [go-nuts] Re: Experience report on a large Python-to-Go translation

2020-02-04 Thread Nigel Tao
On Sun, Jan 26, 2020 at 9:16 AM Eric Raymond wrote: > And that's the insight that led be to the extension I proposed. I asked > myself what the most natural way to pass out a soft close might be. If you're proposing combining generators and exceptions, be aware of how complicated the exact

Re: [go-nuts] Re: Experience report on a large Python-to-Go translation

2020-02-04 Thread Nigel Tao
On Tue, Feb 4, 2020 at 8:56 PM Jason E. Aten wrote: > b := helper(i: 2) > > would give you the whole new {x:0, y:0, i:2} back in b. I'm not sure how helpful that really is, given that you can already write: b := {i: 2} -- You received this message because you are subscribed to the Google

Re: [go-nuts] Experience report on a large Python-to-Go translation

2020-01-29 Thread Nigel Tao
On Wed, Jan 29, 2020 at 11:05 PM Axel Wagner wrote: > On Wed, Jan 29, 2020 at 12:57 PM Nigel Tao wrote: >> For example, the https://golang.org/pkg/io/#LimitedReader struct just >> exports its fields, and you use it like this >> (https://go.googlesource.com/go/+/ref

Re: [go-nuts] Re: Experience report on a large Python-to-Go translation

2020-01-29 Thread Nigel Tao
On Mon, Jan 27, 2020 at 3:23 PM Eric Raymond wrote: > Consider a parser in which your handler function for a given token or subtree > consists of a bunch of if/then returns, and not matching one of them means > you should throw upwards to an error handler. FWIW,

Re: [go-nuts] Experience report on a large Python-to-Go translation

2020-01-29 Thread Nigel Tao
Great write-up. > Keyword arguments should be added to the language. In idiomatic Go, we often use struct literals (together with "make the zero value useful", e.g. allocate map-typed fields lazily) instead of object-creation functions: x := { A: a, B: b.c(), } instead of x =

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-28 Thread Nigel Tao
On Wed, Aug 28, 2019 at 7:11 PM Klaus Post wrote: > TLDR; LZ4 is typically between the default and "better" mode of s2. Nice! Just a suggestion: rename "better" to either "betterSize / smaller" (i.e. better compression ratio, worse throughput) or "betterSpeed / faster", otherwise it's not

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
On Mon, Aug 26, 2019 at 8:29 PM Klaus Post wrote: > This package is aimed at replacing Snappy as a high speed compression > package. If you are mainly looking for better compression zstandard gives > better compression, but typically at speeds slightly below "better" mode in > this package.

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
On Tue, Aug 27, 2019 at 7:25 PM Klaus Post wrote: > Can the concurrent decompression run on a pure stream, or does it need to > read the index first? It cannot run a pure stream. As the https://github.com/google/wuffs/blob/master/doc/spec/rac-spec.md Overview section says, an explicit non-goal

Re: [go-nuts] S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
Nice work, Klaus! On Mon, Aug 26, 2019 at 8:29 PM Klaus Post wrote: > Concurrent stream compression - several GB/sec. > Faster decompression A number of modern compression formats and implementations allow for concurrent *compression*. Coincidentally, I've been working on a format that allows

Re: [go-nuts] Re: S2: High speed compression with upgrade path from Snappy.

2019-08-27 Thread Nigel Tao
On Mon, Aug 26, 2019 at 9:49 PM Jason E. Aten wrote: > It sounds like it does, but just to be clear: does S2 also replace/upgrade > the snappy *streaming* format (the outer format that is different from snappy > itself; e.g. https://github.com/glycerine/go-unsnap-stream )? Tangential, but the

Re: [go-nuts] Re: golang.org/x/text/language does not match sr-Latn (Serbian in a Latin script) with hr (Croatian) as it documents that it should

2019-03-01 Thread Nigel Tao
CC'ing mpvl@, the blog post author. On Sat, Mar 2, 2019 at 1:16 AM wrote: > > I did a bit more digging and found this: > > https://go-review.googlesource.com/c/text/+/55331/ > > Which states: > > "language: remove manual hr -> sr mapping was removed in CLDR for > geo-political reasons" > >

Re: [go-nuts] Re: Go vs C speed - What am I doing wrong?

2019-02-12 Thread Nigel Tao
On Wed, Feb 13, 2019 at 11:23 AM Nigel Tao wrote: > Yes, both the Go code and the C code will panic if y is zero. Still, > "-2147483648 % -1" has a sensible mathematical definition (zero), and > C fails to calculate it. I forgot to mention that, even with a mod-by-zero,

Re: [go-nuts] Re: Go vs C speed - What am I doing wrong?

2019-02-12 Thread Nigel Tao
On Mon, Feb 4, 2019 at 5:34 AM Miki Tebeka wrote: > A bit of profiling shows that the modulo operator takes most of the time: C's modulo operator is faster, but can crash if you look at it funny. $ cat x.c #include int main(int argc, char** argv) { int x = -2147483648; int y = -1;

Re: [go-nuts] Re: Wuffs: a new, memory-safe programming language

2019-01-11 Thread Nigel Tao
On Fri, Jan 11, 2019 at 5:46 PM Nigel Tao wrote: > On Fri, Jan 11, 2019 at 4:22 AM robert engels wrote: > > Again, what is wrong with the bounds checking/memory protection > > library/technique for C I referred you to? Even a decrease in performance > > will probably stil

[go-nuts] Wuffs: a new, memory-safe programming language

2019-01-08 Thread Nigel Tao
Spun out of the "C++ 11 to Golang convertor" thread... On Mon, Jan 7, 2019 at 12:27 AM Eric S. Raymond wrote: > Perry and I have two different target languages in mind. Perry's > target language is basically a repaired C - type-safe, almost > upward-compatible. He and I have the same strategic

Re: [go-nuts] [ANN] fixed point math library

2018-11-29 Thread Nigel Tao
On Thu, Nov 29, 2018 at 9:20 PM Jan Mercl <0xj...@gmail.com> wrote: > - To me type name 'fixed.Fixed' sounds like Javaism. Well, there's already context.Context, hash.Hash, image.Image and time.Time in the standard library. Perhaps, in a parallel universe, we could have settled on the testing.T

Re: [go-nuts] Failed iterator proposals?

2018-10-25 Thread Nigel Tao
On Fri, Oct 26, 2018 at 6:04 AM robert engels wrote: > Barring that, I don’t see how > > for(i:=c.Iterator();i.HasNext();) { > v := i.Next() > } > > is that much more difficult to use Yes, an iterator with a Next method (possibly with another name) is the idiomatic way to present

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-07 Thread Nigel Tao
Building on Todd's example, you can add a little more type safety (having the map value type be a "func etc" instead of "reflect.Value) by Curry'ing the receiver: https://play.golang.org/p/n3sDpxfd2td I've also split up the single run function into two: one binds strings to functions, the second

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-06 Thread Nigel Tao
On Fri, Sep 7, 2018 at 1:53 PM Eric Raymond wrote: > ...provided, that is, that it's possible to get from the member name to a > function pointer that can be called like a closure. Does the reflection > system support such a call-indirect method? Yep. No embedding or other inheritance-like

Re: [go-nuts] Reflecting on an outer struct from a method of an inner one.

2018-09-06 Thread Nigel Tao
On Fri, Sep 7, 2018 at 9:34 AM Eric Raymond wrote: > The attached program lists For future reference, it would probably be easier for the mailing list to discuss example code via a link to the Go playground, especially for runnable code. In this case: https://play.golang.org/p/IripNZNYIgo > In

Re: [go-nuts] Re: Generics as builtin typeclasses

2018-09-06 Thread Nigel Tao
On Fri, Sep 7, 2018 at 9:29 AM 'Axel Wagner' via golang-nuts wrote: > On Fri, Sep 7, 2018 at 12:37 AM Ian Lance Taylor wrote: >> Interesting point. But is there any way to solve it short of >> explicitly listing types? Is there any generics system in any >> language that avoids this problem? >

Re: [go-nuts] Space-optimization question

2018-09-05 Thread Nigel Tao
On Thu, Sep 6, 2018 at 12:22 AM Eric Raymond wrote: > Matters in my case because the deserialization of a repository history can > contain hundreds of thousands of constants like "M", "D", "R", and "C" > representing fast-export stream file operation types. I could intern them > explicitly but

Re: [go-nuts] Reference to type satisfying a specified interface

2018-08-30 Thread Nigel Tao
On Fri, Aug 31, 2018 at 11:41 AM Eric Raymond wrote: > On Thursday, August 30, 2018 at 8:31:44 PM UTC-4, Ian Lance Taylor wrote: >> Which docs did you look at? Just wondering what could be updated. > > This: https://research.swtch.com/interfaces I'm only guessing, but I think Ian's "which docs

Re: [go-nuts] Reference to type satisfying a specified interface

2018-08-30 Thread Nigel Tao
On Fri, Aug 31, 2018 at 4:18 AM Burak Serdar wrote: > If b is an interface to a *Blob, what's stored in the slice is {Type: > *Blob, Value: pointer to the object}. A copy of this interface value > is also in the map. So you have two copies of the interface value, > both pointing to the same Blob

Re: [go-nuts] [ANN] oksvg and rasterx; SVG 2.0 path compliant renderer and rasterizer

2018-04-23 Thread Nigel Tao
Nice! On Mon, Apr 23, 2018 at 3:41 AM, Steven Wiley wrote: > I refactored and enhanced the raster package from the golang translation > of freetype, > It'd be a bunch of work, but you might consider basing off of

Re: [go-nuts] Re: http "alt" attribute value for img tag?

2018-04-21 Thread Nigel Tao
package main import ( "fmt" "log" "strings" "golang.org/x/net/html" ) func main() { const src = ` message ` doc, err := html.Parse(strings.NewReader(src)) if err != nil { log.Fatal(err) } var f func(*html.Node) f = func(n *html.Node) { if n.Type == html.ElementNode && n.Data == "img" {

Re: [go-nuts] Re: iconvg: a compact, binary format for simple vector graphics

2018-01-17 Thread Nigel Tao
On Thu, Jan 18, 2018 at 1:53 AM, wrote: > I'm wondering if you know any c/cpp implementation of your renderer I don't know of a C/C++ implementation, sorry. If you find (or write) one, let me know! -- You received this message because you are subscribed to the Google

Re: [go-nuts] The side effect of calling html.Token()

2018-01-15 Thread Nigel Tao
On Sun, Jan 14, 2018 at 4:33 PM, Tong Sun wrote: > Not being able to do that, I have to save all the Token() info to different > variables, then pass all those variables to my function separately, instead > of passing merely a single tokenizer. Instead of using different

Re: [go-nuts] The side effect of calling html.Token()

2018-01-13 Thread Nigel Tao
On Fri, Jan 12, 2018 at 2:24 PM, Tong Sun wrote: > but I really suggest that you give it a test. It is already tested directly by func TestTokenizer in token_test.go The Tokenizer.Text method implementation does not call Tokenizer.Next, and only the Next method moves on to

Re: [go-nuts] The side effect of calling html.Token()

2018-01-11 Thread Nigel Tao
On Wed, Jan 3, 2018 at 1:03 PM, Tong Sun wrote: > Shouldn't Token() be better returning the current on > instead of the next? You're right. I sent out https://go-review.googlesource.com/c/net/+/87515 -- You received this message because you are subscribed to the Google

Re: [go-nuts] Re: Learning Go: suggestions for code review?

2017-12-13 Thread Nigel Tao
On Thu, Dec 14, 2017 at 1:44 AM, Ben Hoyt wrote: > I used the "dot" import for tokenizer so I can just use "if p.tok == COMMA" > instead of "if p.tok == tokenizer.COMMA" everywhere. As per https://golang.org/doc/effective_go.html#mixed-caps ALL_CAPS names are unusual Go style.

Re: [go-nuts] [ANN] Frame - Plan9 libframe in Go

2017-10-11 Thread Nigel Tao
On Wed, Oct 11, 2017 at 2:30 PM, as wrote: > https://github.com/as/frame Nice! -- 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

Re: [go-nuts] Go Fonts: Double double copyright notice in gomono.TTF and friends

2017-10-05 Thread Nigel Tao
On Sun, Oct 1, 2017 at 8:50 AM, as wrote: > The official go fonts contain two identical copyright notices inside the TTF > data slice. One in UTF-8 and one in UTF16 format. These make their way into > the final go binary. Bug or intentional TTF standard? Intentional,

Re: [go-nuts] Re: How to read multi-page TIFF image?

2017-09-28 Thread Nigel Tao
On Thu, Sep 28, 2017 at 10:28 AM, Michael Jones wrote: > Not quite related, but if changes are going to happen, I want to add (or see > someone add) colorspace tags to the PNG code and the TIFF code. It's not exactly what you're asking for, but there are already issues

Re: [go-nuts] Re: How to read multi-page TIFF image?

2017-09-27 Thread Nigel Tao
On Tue, Sep 26, 2017 at 1:55 AM, Guy Allard wrote: > Adding support for multiple IFDs to the go package being discussed seems not > too difficult (reading the existing code). > > Suggest trying to contact the package authors. Hi, I'm one of the authors of the

[go-nuts] Re: Why is Shiny's text rendering quantizes to the pixel grid?

2017-09-21 Thread Nigel Tao
On Sat, Sep 16, 2017 at 2:26 AM, David Crawshaw wrote: > On Fri, Sep 15, 2017 at 7:35 AM, Elias Naur wrote: >> Is there a fundamental reason to quantize the baseline? The >> golang.org/x/image/font package offers (fixed point) subpixel accuracy, so >>

Re: [go-nuts] Re: error handling needs syntactical sugar

2017-09-07 Thread Nigel Tao
On Thu, Sep 7, 2017 at 4:00 PM, Tim Uckun wrote: > I don't see anything wrong with the try catch paradigm, Try-catch makes for shorter code when you're just passing the buck, but it can be quite complicated when you actually need to handle the buck. My showcase example for

Re: [go-nuts] shiny driver.Main not returning

2017-09-07 Thread Nigel Tao
For the record, the OP filed https://github.com/golang/go/issues/21796 -- 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.

Re: [go-nuts] new project: pixels to svg

2017-09-01 Thread Nigel Tao
On Sat, Sep 2, 2017 at 12:50 AM, wrote: > Feel free to give me feedback on how I can improve the code or the project > setup, etc. I had a quick look. Some thoughts on style, in no particular order: 0. Run gofmt. Your code mixes tabs and spaces, amongst other issues. Gofmt

Re: [go-nuts] License for x/image/testdata and x/image/font/testdata files

2017-08-19 Thread Nigel Tao
se like the rest of the repo. For the x/image/font/testdata/fixed subdirectory, there is a README that contains license notes. For x/image/testdata, I think "git log" is the best source of per-file license notes. For example: $ git log testdata/tux.png commit 94ba43c4786221df328229f6

Re: [go-nuts] Is x/exp/shiny dead?

2017-07-31 Thread Nigel Tao
On Tue, Aug 1, 2017 at 6:25 AM, fazal wrote: > It was one of the things I was looking forward to, but I see almost no > activity there, which makes me sad. It's certainly not very active right now. I work part time, for uninteresting reasons, and shiny is unfortunately

Re: [go-nuts] Why does this program carry test flags once compiled?

2017-07-22 Thread Nigel Tao
On Sat, Jul 22, 2017 at 7:08 PM, Howard Guo wrote: > https://github.com/HouzuoGuo/laitos It's tangential to your question, but out of curiousity, I skimmed the source code. In things like func TestUDPServer in

Re: [go-nuts] Initializing aliased map

2017-07-07 Thread Nigel Tao
On Sat, Jul 8, 2017 at 8:08 AM, wrote: > How do I initialize `b` here to have the zero value of `aliased`? To be precise, b is already initialized by default to its zero value, which is nil. If you want a non-nil but empty map, then as Shawn said, you can use "b:

Re: [go-nuts] AI-first?

2017-06-01 Thread Nigel Tao
On Fri, Jun 2, 2017 at 7:17 AM, Ian Lance Taylor wrote: > The golang-nuts mailing list is a good place to talk about Go-first > (or Go-second or Go-last). It's not a good place to talk about AI. > Thanks. In case there is any confusion, this list is about Go the programming

Re: [go-nuts] x/term: go-keycodes

2017-05-17 Thread Nigel Tao
On Sun, May 14, 2017 at 6:02 PM, anatoly techtonik <techto...@gmail.com> wrote: > On Fri, May 12, 2017 at 7:54 AM, Nigel Tao <nigel...@golang.org> wrote: >> On Fri, May 12, 2017 at 3:11 AM, anatoly techtonik <techto...@gmail.com> >> wrote: >>> I am n

Re: [go-nuts] x/term: go-keycodes

2017-05-11 Thread Nigel Tao
On Fri, May 12, 2017 at 3:11 AM, anatoly techtonik wrote: > I am new to Go and I need a cross-platform value for keyboard key codes to > make sure I can react to user key presses regardless of operating system > layer. FYI, there's already the key.Code type defined in

Re: [go-nuts] Weird performance with exp/shiny

2017-04-28 Thread Nigel Tao
On Fri, Apr 28, 2017 at 12:28 PM, Zellyn wrote: > I'm sure I'm doing something hideously wrong with shiny, since my emulator > runs three times faster on my MacBook if I run it under VirtualBox/Ubuntu. > Yes, you read that right. > Here, I tweeted an animated gif of them running

[go-nuts] New Smallcaps Go Fonts; other Go Fonts updated

2017-03-29 Thread Nigel Tao
Bigelow & Holmes have prepared new versions of the Go Fonts that we released late last year (https://blog.golang.org/go-fonts). The version numbers have changed from 2.004 to 2.008. ChangeLog: * New! 2 new fonts, bringing the total to 12: Go Smallcaps and Go Smallcaps Italic. * New! U+FFFD

Re: [go-nuts] golint if/else stmt and early returns

2017-03-16 Thread Nigel Tao
This is tangential, but if we're talking about style, you might be able to simplify this line ret = PropertiesList(ret).Append(PropertiesList(temp)) to be ret = PropertiesList(ret).Append(temp) if the PropertiesList underlying type and the temp variable's type are what I'm guessing they are:

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

2017-03-16 Thread Nigel Tao
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 and the second uint is minUint (i.e. zero), then the difference between them will overflow an int. -- You received this message because you

Re: [go-nuts] json.Unmarshal and modifications to copies of structs

2017-03-13 Thread Nigel Tao
On Mon, Mar 13, 2017 at 9:10 AM, george.robinson via golang-nuts wrote: > Can someone explain to me how this prints "test world" twice? I had expected > to see "test hello" and "test world". > > https://play.golang.org/p/E7CRQNE6oT m1 is not a pointer, but m1.S is a

Re: [go-nuts] Shiny gldriver Texture.Fill

2017-02-24 Thread Nigel Tao
On Sun, Feb 19, 2017 at 6:11 PM, Dmitry Kravchenko wrote: > When will Texture.Fill be implemented in Shiny gldriver? I mailed out https://go-review.googlesource.com/37415 -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] ycbcr.go YCbCrToRGB implementation.

2017-02-09 Thread Nigel Tao
On Fri, Feb 10, 2017 at 10:50 AM, wrote: > It seems that all constants above are multiplied by 2^16 to allow the > calculation to be performed with integer arithmetic, before being shifted > back into an 8 bit range. But Y' is multiplied by 0x010100 which is >

Re: [go-nuts] Problems drawing on frames of an animated gif

2017-02-04 Thread Nigel Tao
On Mon, Jan 23, 2017 at 6:03 AM, kalekold via golang-nuts wrote: > Hmm.. the source gif I'm using must be compressed. Doesn't Go handle > compressed gifs in the same way? When you say 'I may get unexpected results' > is that because the current gif package doesn't

Re: [go-nuts] Go Fonts: request for feedback

2017-02-04 Thread Nigel Tao
On Sun, Feb 5, 2017 at 12:40 AM, Konstantin Khomoutov wrote: > Compare this to how a set of ubiquitous fonts from Microsoft is > rendered with the same settings: ms-alias-none-no-hinting.png -- they > look just great. Yeah, I believe that Microsoft put a *lot* of

Re: [go-nuts] Go Fonts: request for feedback

2017-02-04 Thread Nigel Tao
On Sat, Feb 4, 2017 at 12:12 PM, roger peppe wrote: > More unicode coverage would also be nice. Selfishly I'd like characters for > all those in plan 9's lib/keyboard file > (https://github.com/0intro/plan9/blob/master/lib/keyboard) so I can read the > characters that I can

[go-nuts] Go Fonts: request for feedback

2017-02-02 Thread Nigel Tao
Bigelow & Holmes, the designers of the Go Fonts, are preparing an update to those fonts. The changes so far are: • adjusted box/chart/shade/split-integral to align vertically • adjusted shade characters to align vertically & horizontally (more or less aesthetically) • merged the contours of ring

Re: [go-nuts] bug report?: go font box drawing is wrong

2016-12-21 Thread Nigel Tao
On Mon, Nov 28, 2016 at 5:28 PM, wrote: > The ascenders for blocks, lines, etc are all wrong and it's very > distracting. I'm enjoying go mono in the terminal so far but it's tedious to > go through every file and delete the problematic character ranges. Can these > be

Re: [go-nuts] Packaging Test Utilities in a Project

2016-12-18 Thread Nigel Tao
On Sun, Dec 18, 2016 at 1:51 PM, Henry wrote: > I have reusable test utilities in a project. They are used by various > packages in the project for testing purposes, and at the same time I don't > want to expose these utilities as public APIs. Since it is impossible to

Re: [go-nuts] gob ignores default values, bug or feature?

2016-12-14 Thread Nigel Tao
On Sat, Dec 10, 2016 at 11:14 PM, Matthew Zimmerman wrote: > Yes, it makes them smaller I agree, however shouldn't the lack of a value on > decoding be considered like a zero value was encoded? I think that is the > question here. It's pretty much academic at this point,

Re: [go-nuts] Trouble with fonts

2016-12-07 Thread Nigel Tao
On Wed, Dec 7, 2016 at 5:49 PM, Lucio wrote: > The first issue is one of documentation. It says in > that: > > DrawBytes draws s at the dot and advances the dot's location. > > But it leaves the question of what exactly those bytes

Re: [go-nuts] Re: database/sql and custom column types

2016-12-03 Thread Nigel Tao
On Sat, Dec 3, 2016 at 4:26 AM, wrote: > A quick aside regarding the code that you posted. Postgres (bizarrely, IMHO) > stores longitude first, then latitude, so: Well, the usual order is "latitude, longitude", but on the standard visualization (North is 'up' on typical maps),

Re: [go-nuts] Processing Images with baked data

2016-11-30 Thread Nigel Tao
On Wed, Nov 30, 2016 at 4:46 AM, wrote: > I know there is an image package that exist in Golang that implements encode > and decode functionality, but how can I get other data from an image?. For > example I am trying to get iTXt chunks from PNG images, is there any

Re: [go-nuts] bug report?: go font box drawing is wrong

2016-11-28 Thread Nigel Tao
On Mon, Nov 28, 2016 at 5:28 PM, wrote: > Sorry if this is the wrong place. This place is as good as any other. Thanks for the bug report. I'll pass it on to Bigelow & Holmes. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: Suggestion: port golang.org/x/mobile/exp/audio/al to Windows

2016-11-20 Thread Nigel Tao
On Mon, Nov 21, 2016 at 10:24 AM, wrote: > How to submit a change request? If you're asking about how to submit code that you have written yourself, the contribution guidelines are at https://golang.org/doc/contribute.html If you are asking how to file a feature request,

Re: [go-nuts] Problem with alpha blending using image/draw

2016-11-08 Thread Nigel Tao
On Wed, Nov 9, 2016 at 4:14 AM, wrote: > I'm trying to write out a png with an alpha component as a jpeg. As I > understand it, I should be able to use the draw package to do this. > > // src is an image.RGBA > newImg := image.NewRGBA(src.Bounds()) > >

Re: [go-nuts] iconvg: a compact, binary format for simple vector graphics

2016-11-06 Thread Nigel Tao
On Tue, Oct 25, 2016 at 9:30 PM, roger peppe wrote: > Would there be some advantage in making the Rasterizer > types in shiny/iconvg and image/vector somewhat more > uniform in the types they use? For example, vector.Rasterizer > seems to use f32.Vec2 pairs everywhere, but

  1   2   >