[go-nuts] Re: Question about casting

2018-02-18 Thread Krzysztof Kowalczyk
2 things: 1. plus() returns interface{}. "%T" prints underlying dynamic type of interface{} value, but static type of returned value of plus is interface{} You can assign any type to interface{} without a cast by definition (see e.g.

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
:like: tanks you. so go.y is for go compiler and cc.y is for go-c compiler. all `.go` files require go compiler. and what files require go-c compiler? may tell some example file then is go-c? On Monday, February 19, 2018 at 2:32:02 AM UTC+3:30, Dave Cheney wrote: > > In Go 1.4 the project

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
I feel like we’ve had this same discussion a few months ago. Ian has mentioned that go 1.4 is no longer in use (it exists only in a very special case or bootstrapping from source). Can you please give some context to your questions so we may assist you better. -- You received this message

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
Can build only c(own) compiler using a c compiler(like gcc) without go from this source?! On Monday, February 19, 2018 at 2:48:26 AM UTC+3:30, Dave Cheney wrote: > > I feel like we’ve had this same discussion a few months ago. > > Ian has mentioned that go 1.4 is no longer in use (it exists

[go-nuts] Re: Dero: CryptoNote protocol + smart contracts using golang

2018-02-18 Thread Dave Cheney
Is there a reason DERO chose to go with their own licence rather than a BSD, MIT, or Apache 2 licence? On Monday, 19 February 2018 16:10:14 UTC+11, 867crypt...@gmail.com wrote: > > Hello, my name is Serena, I’m the Community Manager at a blockchain > project called Dero. We use a protocol

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Michael Jones
...you might also want to read the papers about META II. This was memorably inspired work from 1965 that is still marvelous. http://www.ibm-1401.info/Meta-II-schorre.pdf On Sun, Feb 18, 2018 at 5:46 PM, Pierpaolo Bernardi wrote: > On Mon, Feb 19, 2018 at 1:44 AM, Compiler

[go-nuts] Dero: CryptoNote protocol + smart contracts using golang

2018-02-18 Thread 867cryptocurrency
Hello, my name is Serena, I’m the Community Manager at a blockchain project called Dero. We use a protocol called CryptoNote that was originally written in C++. The developers at the Dero Project have rewritten most of the (CryptoNote) codebase to golang and we would like to start some

Re: [go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Henrik Johansson
Thx, Why I wondered was because to build script (a tiny settings file really) for Archlinux uses this flag to build it's Go packages. Is it available as a paranoia "i really need all the tests run"? Will it be removed later on? sön 18 feb. 2018 kl 23:04 skrev Ian Lance Taylor

[go-nuts] Re: Client certificate in request missing

2018-02-18 Thread Miha Zoubek
Hello just for puicture: Dne petek, 16. februar 2018 17.01.40 UTC+1 je oseba Miha Zoubek napisala: > > Hello > > this is my code: >

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
/go/src/cmd/cc/ this directory is base of c-compiler. so not `.c` file in /src/. On Monday, February 19, 2018 at 3:01:35 AM UTC+3:30, Compiler wrote: > > mean all `.c` file in /src/ compile using own c-compiler?! > > On Monday, February 19, 2018 at 2:49:40 AM UTC+3:30, Dave Cheney wrote: >> >> >

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
If you want to learn more about the Go compiler then you must stop living in the past. Go 1.4 is _dead_. The current compiler is written in pure go and you can find the sources here https://github.com/golang/go/tree/master/src/cmd/compile/internal We cannot help you use the old Go 1.4 c

Re: [go-nuts] printing a struct fields that implements an error interface

2018-02-18 Thread Jamil Djadala
On Sat, 17 Feb 2018 16:05:42 -0800 (PST) Joseph Lorenzini wrote: > Hi all: > > Per documentation: > > "If an operand implements the error interface, the Error method will > be invoked to convert the object to a string, which will then be > formatted as required by the verb

Re: [go-nuts] Re: Question about casting

2018-02-18 Thread Jan Mercl
On Sun, Feb 18, 2018 at 8:06 PM Bill Wood wrote: > I thought that the plus operator would return an int, not a myInt. expr1 + expr2 works iff types of expr1 and expr2 are the same and the result has the same type as both of the operands. Analogically for the subtraction,

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
In Go 1.4 the project contained both .go files and .c files. It shipped with two compilers, a go compiler, called gc, and a c compiler called cc. > /go/src/cmd/gc/go.y This is the input file for the yacc grammar for the Go 1.4 go compiler > /go/src/cmd/cc/cc.y This is the input file for the

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Michael Jones
much better! i suggest Google searches about bootstrapping, self-hosting, and security. On Sun, Feb 18, 2018 at 3:59 PM, Compiler wrote: > I have some experience in writing lexer,parser,interpreter,optimize. > I've also worked generate output code(example one language

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Pierpaolo Bernardi
On Mon, Feb 19, 2018 at 1:44 AM, Compiler wrote: > Performance of C with Optimize not better of Go at more time?! > so why re-write golang in go? Because a lot of people, obviously including Go implementors, think that Go is a better language than C for writing a

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
Show me some files at https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz then require go-c compiler. On Monday, February 19, 2018 at 2:35:18 AM UTC+3:30, Compiler wrote: > > :like: > tanks you. > > so go.y is for go compiler and cc.y is for go-c compiler. > > all `.go` files

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
Performance of C with Optimize not better of Go at more time?! so why re-write golang in go? On Monday, February 19, 2018 at 3:54:08 AM UTC+3:30, Compiler wrote: > > When Golang using *bootstrapping **technique* , performance not Decrease? > > On Monday, February 19, 2018 at 3:42:18 AM UTC+3:30,

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Michael Jones
At the core of this is the simple fact that you have to start somewhere. The founding Go team had experience (UNIX, B, C, Plan 9, Pic, Blit, GNU C/C++, ...) and well-understood code on hand from prior work (assembler, compilers, and a linker that all worked together). Also, it is dangerous to

Re: [go-nuts] Re: Question about casting

2018-02-18 Thread Krzysztof Kowalczyk
I'm far from the expert on the spec but the behavior seems to follow the rules. https://golang.org/ref/spec#Arithmetic_operators "Arithmetic operators apply to numeric values and yield a result of the same type as the first operand." myInt + myInt returns myInt because it's the type of first

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
Example : - /go/src/fmt/print.go - /go/src/io/multi.go this files require go compiler (go.y). - which files require go-c compiler(c.y) ?? On Monday, February 19, 2018 at 2:40:36 AM UTC+3:30, Compiler wrote: > > Show me some files at >

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
Assembly?! but not exist many `.asm` files at source. Also, I had already asked ... And they said they were not with the assembly and is generate executable file using object file. On Monday, February 19, 2018 at 3:08:51 AM UTC+3:30, Dave Cheney wrote: > > > > On Monday, 19 February 2018

Re: [go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Ian Lance Taylor
On Sun, Feb 18, 2018 at 11:22 AM, Henrik Johansson wrote: > The GOCACHE variable. What is it's effect when building Go itself? > It doesn't disable test caching when using the resulting go tools right? Right. Ian -- You received this message because you are subscribed to

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
yeah , in go1.4 version,i want know difference between files. ?! On Monday, February 19, 2018 at 2:04:09 AM UTC+3:30, Ian Lance Taylor wrote: > > On Sun, Feb 18, 2018 at 9:23 AM, Compiler > wrote: > > #Question > > > > What is the difference between using the following

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
> which files require go-c compiler? The ones in the go 1.4distributuon that end in .c. -- 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] About Go Compiler!

2018-02-18 Thread Dave Cheney
> what files require the c compiler? The c files in the go 1.4 distribution. -- 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] About Go Compiler!

2018-02-18 Thread Dave Cheney
On Monday, 19 February 2018 10:42:12 UTC+11, Compiler wrote: > > Assembly?! > but not exist many `.asm` files at source. > By tradition assembly files have .s and .S extensions > Also, I had already asked ... > Already asked what? It might be easier if you give more background to the

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
How can trying this? Do not have an idea about it? On Monday, February 19, 2018 at 3:10:04 AM UTC+3:30, Dave Cheney wrote: > > In theory, yes. In practice, I doubt it. > > On Monday, 19 February 2018 10:37:14 UTC+11, Compiler wrote: >> >> Can build only c(own) compiler using a c compiler(like

[go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Lucio
On Sunday, 18 February 2018 04:20:39 UTC+2, Dmitriy Cherchenko wrote: > > I like how the Go team isn't trying to support very old operating systems. > We should focus on modern systems and expect people to try to stay up to > date. Thank you! > > And be restricted to shrinking bio-diversity.

[go-nuts] Re: Question about casting

2018-02-18 Thread Bill Wood
Thanks, my question is about this line in your expanded plus function: res := aInt + bInt // type: myInt It's not clear to me why *aInt + bInt* results in a type myInt. I thought that the plus operator would return an int, not a myInt. On Sunday, February 18, 2018 at 3:00:00 AM UTC-5,

Re: [go-nuts] Re: Question about casting

2018-02-18 Thread Bill Wood
Thanks. Why is the plus operator defined on myInt? Or if it simply treats a myInt as an int, why isn't the result an int? Sorry if this is a stupid question; I think either there is something deeper to this or else the arithmetic operators just have a special processing for this case. On

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Ian Lance Taylor
On Sun, Feb 18, 2018 at 9:23 AM, Compiler wrote: > #Question > > What is the difference between using the following two files? > > /go/src/cmd/gc/go.y > /go/src/cmd/cc/cc.y > > - > #Question > > What is the difference between using the following two files? > >

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
In theory, yes. In practice, I doubt it. On Monday, 19 February 2018 10:37:14 UTC+11, Compiler wrote: > > Can build only c(own) compiler using a c compiler(like gcc) without go > from this source?! > > > On Monday, February 19, 2018 at 2:48:26 AM UTC+3:30, Dave Cheney wrote: >> >> I feel like

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
Woow, for Generate output file(executable file) Using only Asm? So GoLang Using : 1. *Go: *Runtime Libs 2. *ASM: Only *Generate output file(executable file) 3. *OwnC: * On Monday, February 19, 2018 at 3:14:48 AM UTC+3:30, Dave Cheney wrote: > > By tradition assembly files have

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
Stop. What do you want to do? Do you want to write a C compiler ? On Monday, 19 February 2018 10:47:24 UTC+11, Compiler wrote: > > https://groups.google.com/forum/#!topic/golang-nuts/24pSm-B3FqU > > On Monday, February 19, 2018 at 3:14:48 AM UTC+3:30, Dave Cheney wrote: >> >> >> Who is they?

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
On Monday, 19 February 2018 10:33:16 UTC+11, Compiler wrote: > > /go/src/cmd/cc/ > this directory is base of c-compiler. > yes, that is where the shared parts of the c compiler lives, the architecture specific parts were in 5c, 6c, 8c, etc. > > so not `.c` file in /src/. > You can answer

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
whats difference between self-hosting compiler vs Bootstrapping compiler? https://en.wikipedia.org/wiki/Bootstrapping_(compilers) On Monday, February 19, 2018 at 3:34:48 AM UTC+3:30, Michael Jones wrote: > > much better! i suggest Google searches about bootstrapping, self-hosting, > and

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
*bootstrapping* is the technique for producing a self-compiling compiler On Monday, February 19, 2018 at 3:40:54 AM UTC+3:30, Compiler wrote: > > whats difference between self-hosting compiler vs Bootstrapping compiler? > >

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
When Golang using *bootstrapping **technique* , performance not Decrease? On Monday, February 19, 2018 at 3:42:18 AM UTC+3:30, Compiler wrote: > > *bootstrapping* is the technique for producing a self-compiling compiler > > > On Monday,

Re: [go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Henrik Johansson
The GOCACHE variable. What is it's effect when building Go itself? It doesn't disable test caching when using the resulting go tools right? sön 18 feb. 2018 kl 19:55 skrev Lucio : > > > On Sunday, 18 February 2018 04:20:39 UTC+2, Dmitriy Cherchenko wrote: >> >> I like how

Re: [go-nuts] Re: Question about casting

2018-02-18 Thread Bill Wood
Thanks! :) On Sunday, February 18, 2018 at 3:11:45 PM UTC-5, Krzysztof Kowalczyk wrote: > > I'm far from the expert on the spec but the behavior seems to follow the > rules. > > https://golang.org/ref/spec#Arithmetic_operators > > "Arithmetic operators apply to numeric values and yield a result

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
mean all `.c` file in /src/ compile using own c-compiler?! On Monday, February 19, 2018 at 2:49:40 AM UTC+3:30, Dave Cheney wrote: > > > which files require go-c compiler? > > The ones in the go 1.4distributuon that end in .c. > -- You received this message because you are subscribed to the

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
yes, up to Go 1.4, part of the go runtime was compiled using a c compiler which derived from the plan 9 c compilers. In fact, the c frontend and the go frontend shared the same code generation backends. On Monday, 19 February 2018 10:31:35 UTC+11, Compiler wrote: > > mean all `.c` file in /src/

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
I have some experience in writing lexer,parser,interpreter,optimize. I've also worked generate output code(example one language to another). currently example i'm design a interpreter and for final step( generate output file) using another compiler. i'm want know more about compiler... and

Re: [go-nuts] About Go Compiler!

2018-02-18 Thread Dave Cheney
I recommend watching this presentation from Russ Cox about why the Go team decided to rewrite the compiler from C to Go. https://www.youtube.com/watch?v=QIE5nV5fDwA On Monday, 19 February 2018 11:44:23 UTC+11, Compiler wrote: > > Performance of C with Optimize not better of Go at more time?! >

Re: [go-nuts] Re: All Forms of Wishful Generics

2018-02-18 Thread dc0d
Lars, That's nice! Yet it's a sandboxed execution context. The Safe Packages mentioned above are just Go packages, with source code. And when the day comes for a proper dependency manager, I would like to be able to tell the DM fail on import any unsafe packages - except for a list that I

[go-nuts] Re: printing a struct fields that implements an error interface

2018-02-18 Thread jake6502
There may be another way, but this is one way to print the struct fields: https://play.golang.org/p/sGZMBGG7r79 See line 17. On Sunday, February 18, 2018 at 8:57:02 AM UTC-5, Diego Medina wrote: > > using %#v > > as in > > https://play.golang.org/p/VVqUVsfzx6e > > > > log.Printf("Hello,

[go-nuts] About Go Compiler!

2018-02-18 Thread Compiler
#Question What is the difference between using the following two files? /go/src/cmd/gc/go.y /go/src/cmd/cc/cc.y - #Question What is the difference between using the following two files? /go/src/cmd/gc/lex.c /go/src/cmd/cc/lex.c -- You received this message because you are

[go-nuts] Re: Go 1.10 is released

2018-02-18 Thread Compiler
https://golang.org/pkg/plugin/ Not Forget this : Currently plugins are only supported on Linux and macOS. On Friday, February 16, 2018 at 11:06:22 PM UTC+3:30, Andrew Bonventre wrote: > > Hello gophers, > > We just released Go 1.10. > > You can read the announcement blog post here: >

Re: [go-nuts] printing a struct fields that implements an error interface

2018-02-18 Thread Jan Mercl
On Sun, Feb 18, 2018 at 1:06 AM Joseph Lorenzini wrote: > Is there anyway to force fmt.Print to output the struct fields, even when it implements the error interface? What exactly do you mean by "to output the struct fields"? -- -j -- You received this message because

[go-nuts] Re: Proposal: return if any not nil

2018-02-18 Thread John Roth
On Sunday, February 18, 2018 at 12:47:09 AM UTC-7, Krzysztof Kowalczyk wrote: > > Even simpler: > > r, err := try os.Open("blah.text") > > Similar to Swift and what Rust used to have. > > "try foo()" means: if "foo()" returns an error, return the error to the > caller. > If function returns

[go-nuts] Re: printing a struct fields that implements an error interface

2018-02-18 Thread Diego Medina
using %#v as in https://play.golang.org/p/VVqUVsfzx6e log.Printf("Hello, playground %#v\n", ret) On Saturday, February 17, 2018 at 7:05:42 PM UTC-5, Joseph Lorenzini wrote: > > Hi all: > > Per documentation: > > "If an operand implements the error interface, the Error method will be >