[go-nuts] panic: runtime: unknown pc

2018-05-03 Thread andrey mirtchovski
I believe I've never encountered this nor seen anyone mention this error before. It occurred while fuzzing a C library that we interface with: PC=0x7fffbafc847c m=0 sigcode=0 goroutine 0 [idle]: runtime: unknown pc 0x7fffbafc847c stack: frame={sp:0x7fff5fbff088, fp:0x0} stack=[0x7fff5fb80888,0x7f

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Bakul Shah
On Thu, 03 May 2018 20:46:59 -0700 Lucio wrote: > > I never felt the need to join an APL fan club, but you sure tempt me, Bakul! > > Is there one, or do we need to start one? What would be the minimal entry > qualification? There are some mailing lists and websites that you can check out (if y

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Louki Sumirniy
urgh. Wile I think the C shorthand if/then notation is kinda cool, I really think you can easily go too far with programming where all the time you save on keystrokes you pay by using the shift key a lot more and having to really carefully read. Maybe after a time it would be cool but I prefer m

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-03 Thread Louki Sumirniy
The reason I am trying to avoid using a code generator is because it isn't integrated into VScode. I write a small section of code, then I write tests that I have set to show logging output, so I can quickly figure out when something is wrong. Code generation adds a lot of manual work to this.

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-03 Thread Tamás Gulácsi
Without generics, the usual solution is code generation. There are several helper utilities, but you can create your own, too. Write one version with a specific type, and replace it with the concrete one. -- You received this message because you are subscribed to the Google Groups "golang-nuts"

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Michael Jones
J is the beautiful result of the APL road. On Thu, May 3, 2018 at 8:47 PM Lucio wrote: > I never felt the need to join an APL fan club, but you sure tempt me, > Bakul! > > Is there one, or do we need to start one? What would be the minimal entry > qualification? > > APL is the only language I le

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-03 Thread Louki Sumirniy
The specifics of how it is done is not as important as why to do it: I am writing this for a later project. It will need at least 5 different, sometimes nearly not very different, short data types. They all have the property of being comparable. The code that keeps them stored and sorted does n

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Lucio
I never felt the need to join an APL fan club, but you sure tempt me, Bakul! Is there one, or do we need to start one? What would be the minimal entry qualification? APL is the only language I learnt that to this day feels like it shifted my mindset much more than one notch. I didn't pay much a

[go-nuts] Re: Vision as SDK

2018-05-03 Thread db
Hi, There is an SDK for Cloud vision(go get -u cloud.google.com/go/vision/apiv1) but I don't think it will allow you to run it offline. Regards Deepak On Friday, 4 May 2018 04:26:07 UTC+5:30, Durval Vieira wrote: > > Hi all > > Do you know whether exist a *SDK for Google Vision API* or somethin

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Steven Blenkinsop
loop could be used as syntax for Roger Peppe's loop: loop if x = next(); x != nil { ... } I guess you could also call that for if, but that makes me think of for if me, ok := i().(OscarMayerWeiner); ok { for _, person := range everyone { love[person] = me } } On T

Re: [go-nuts] Re: Upcoming Go protobuf release

2018-05-03 Thread Tharaneedharan Vilwanathan
Hi All, Can someone share some details on this code merge? Has this happened? How can I play with it? Thanks dharani ** *Hello gophers,* *This is an announcement that we will be merging the dev branch of github.com/golang/protobuf into mast

[go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Jamie Clarkson
I agree with the first part, but not the second - 'for' is far more 'Go like' in terms of clarity and meaning Compare the first few meanings of 'loop': http://www.dictionary.com/browse/loop?s=t with 'for': http://www.dictionary.com/browse/for?s=t Although I think 'desirous' would be an excelle

[go-nuts] Vision as SDK

2018-05-03 Thread Durval Vieira
Hi all Do you know whether exist a *SDK for Google Vision API* or something similar. I need to run it local because of performance and also bad internet connection in some places. Than you Durval. -- You received this message because you are subscribed to the Google Groups "golang-nuts" grou

Re: [go-nuts] Implementing method overloading using first class functions

2018-05-03 Thread Jan Mercl
On Thu, May 3, 2018 at 10:14 PM Louki Sumirniy < louki.sumirniy.stal...@gmail.com> wrote: > As some here may know, I am implementing a novel binary tree based on complete trees and using ideas from B-heaps in order to achieve maximum data cache locality in a search and sort algorithm. ... > Note

[go-nuts] Implementing method overloading using first class functions

2018-05-03 Thread Louki Sumirniy
I have been struggling with getting the most optimal, non-reflective and performant way of implementing something that is a bit like OOP method overloading. As some here may know, I am implementing a novel binary tree based on complete trees and using ideas from B-heaps in order to achieve max

[go-nuts] Re: Go could really use a while statement

2018-05-03 Thread matthewjuran
> > These threads are akin to bike shedding thus a waste of time. In storytelling relief is part of good tragedy. I consider the overloading of for to be a plus because for, while, do-while are just loops with conditions. Maybe ‘loop’ is a more Go-like keyword. loop i, e := range c { Matt O

Re: [go-nuts] gccgo produces much slower code than gc

2018-05-03 Thread Tamir Duberstein
Looks like performance is virtually identical in GCC 8.1: ValueSetBytes-16 39.1ns ± 1% 104.5ns ± 0% +167.26% (p=0.029 n=4+4) ValueSetFloat-16 25.9ns ± 1%67.8ns ± 0% +161.78% (p=0.029 n=4+4) ValueSetBool-16 27.5ns ± 0%54.0ns ± 1% +96.18% (p=0.029 n=4+4) ValueSetInt-

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Bakul Shah
Perhaps you mean “the functional side has done away with loops” or “made do with recursion”? I still remember that as a newbie I was confused about while loops but not recursion. I thought that the while was being *continuously* monitored during the entire execution of the while and not just

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread 'Axel Wagner' via golang-nuts
On Thu, May 3, 2018 at 3:46 PM wrote: > And for those who compare if and switch arguing it is equivalent, you > can't do type switches with an if statement. > Yes, you can if r, ok := r.(*bytes.Buffer); ok { // Use r as a *bytes.Buffer } else if r, ok := r.(*os.File); ok { // Use r as a

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread roger peppe
> do { ... } while is the only construct I some times miss, but then > again, it occurs fairly rarely in my code, so for now I'm rather happy to > just rewrite it in another style. When I programmed in C, I found it pretty rare to use do...while. These days I think of it more as a special case

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread roger peppe
On 3 May 2018 at 14:46, wrote: > Can anybody point me to a single discussion on golang-nuts that led to a > significant syntax change? These threads are akin to bike shedding thus a > waste of time. I can think of a couple, although I haven't got the time to delve for links. The map key deletion

Re: [go-nuts] Re: Go could really use a while statement

2018-05-03 Thread Jesper Louis Andersen
The reason is simply that good syntax is a really hard problem which incorporates both tech and people. In principle, you can get away with very few things in a language before it is turing complete. It is enough to have eg 'WHILE do ' where stmts can form a block of statements. Or just have recu

Re: [go-nuts] proposal: embed static assets

2018-05-03 Thread John Unland
On Wednesday, May 2, 2018 at 3:12:58 PM UTC-5, Manlio Perillo wrote: > Yes, but many developers may need a "debug" mode or more options available > to where to store the assets. > Why should a "standard" tool or API be restricted to where to store assets? > I can kinda see where your going with

[go-nuts] Re: Go could really use a while statement

2018-05-03 Thread prades . marq
Can anybody point me to a single discussion on golang-nuts that led to a significant syntax change? These threads are akin to bike shedding thus a waste of time. Adding while provide nothing of value in a language that supports basic looping. And for those who compare if and switch arguing it

Re: [go-nuts] go vet complains about wrong struct?

2018-05-03 Thread Mustafa Arıcı
Unable reproduce the problem with the tip. For my case I confirm that it's fixed in the tip. On Wed, May 2, 2018 at 7:54 PM Ian Lance Taylor wrote: > On Wed, May 2, 2018 at 4:34 AM, Mustafa Arici > wrote: > > > > Consider this code. > > > > package main > > > > var foo = func (){ > > type A

Re: [go-nuts] How to change the GBK with golang default charset?

2018-05-03 Thread alex . rou . sg
Go only has support for UTF-8, so you need to convert the file. e.g. package main import ( "fmt" "golang.org/x/text/encoding/simplifiedchinese" ) func main() { gbk := simplifiedchinese.GBK.NewDecoder() s, err := gbk.String("a\xfe\xfeb") if err != nil { panic(err)

Re: [go-nuts] Go could really use a while statement

2018-05-03 Thread Louki Sumirniy
yes I made a bunch of errors in my examples... no need for outer scope declaration with initialiser in the initialiser clause (one or the other, you know what I mean) There is a reason why in Go an assignment statement does not also evaluate, but I am not aware of it, and this excludes this fro

Re: [go-nuts] Go could really use a while statement

2018-05-03 Thread Louki Sumirniy
I am writing code in which I pondered exactly using this kind of thing, it involves tree walking on a binary tree, but I decided to scrap this approach because, although you can't see it so clearly in that C code, it's executing a function every loop that probably doesn't need to be. your next(

Re: [go-nuts] Go could really use a while statement

2018-05-03 Thread Sokolov Yura
четверг, 3 мая 2018 г., 11:25:34 UTC+3 пользователь rog написал: > > FWIW, the thing I miss sometimes is the equivalent of C's: > > while((x = next()) != nil) { > something() > } > > In Go you need to do either: > > for x = next(); x != nil; x = next() { > som

Re: [go-nuts] Go could really use a while statement

2018-05-03 Thread roger peppe
FWIW, the thing I miss sometimes is the equivalent of C's: while((x = next()) != nil) { something() } In Go you need to do either: for x = next(); x != nil; x = next() { something() } which duplicates the per-iteration expression, or: for {

Re: [go-nuts] Go could really use a while statement

2018-05-03 Thread Louki Sumirniy
I just think that: for { ... } condition() would be a useful addition to the language because minimum one run of the for block is a common need. Or to avoid any confusion, create a new reserved word: until condition() { ... } The lack of explicit minimum one-run in my opinion runs counter to

Re: [go-nuts] How to change the GBK with golang default charset?

2018-05-03 Thread Able
I want to call a DDL file in windows XP or 7 32bit system, and the DDL file was encoded by GBK. Is there any expert knows what is the best solution to call this GBK encoded DDL file by GO? In GCC, i can use gcc -finput-charset=GBK -fexec-charset=GBK -- You received this message because you are su

Re: [go-nuts] Go could really use a while statement

2018-05-03 Thread Dan Kortschak
Yeah, that's not `for {} else {}`. This is spelled ``` var done bool for condition() { done = true body() } if !done { outOfBody() } ``` On Wed, 2018-05-02 at 22:45 -0700, Sokolov Yura wrote: > >     for { >     Body() >     if !Condition() { >     break >