[go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Compiler
tanks you. i not found complate book pdf file. you not have file?! On Wednesday, December 13, 2017 at 11:22:50 PM UTC+3:30, David Chase wrote: > > I think one of the best references to this is "BCPL: The Language and Its > Compiler". > It is shorter than the Dragon Book, accessible, historical,

[go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread 'David Chase' via golang-nuts
I think one of the best references to this is "BCPL: The Language and Its Compiler". It is shorter than the Dragon Book, accessible, historical, and very well written. I think you can find the PDF online (maybe, not sure). On Tuesday, December 12, 2017 at 4:03:08 PM UTC-5, Compiler wrote: > >

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Compiler
i am undrestand compiler steps. only have problem in code generation step. so best way is this then compiler generate code is ASM. GOLANG also generate ASM. yeah? On Wednesday, December 13, 2017 at 8:27:41 PM UTC+3:30, Bruno Albuquerque wrote: > > It directly generates a binary suitable for the

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Bruno Albuquerque
It directly generates a binary suitable for the target platform, yes. Again, you do not need a C compiler to compile a Go program unless you are using CGO. On Wed, Dec 13, 2017 at 8:54 AM Compiler wrote: > please answer this. > > > On Wednesday, December 13, 2017 at

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Compiler
please answer this. On Wednesday, December 13, 2017 at 4:30:52 PM UTC+3:30, Compiler wrote: > > are you sure GoCompiler/GoLang generate ASM code for build executable file > from .go? > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Volker Dobler
On Wednesday, 13 December 2017 13:40:18 UTC+1, erfang...@gmail.com wrote: > > How can write a compiler Using C as test.exe then can use from test.exe > compiler any where... so can write a input file like hello world > application and generate executable file using test.exe. > > undrestand? >

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread John McKown
On Wed, Dec 13, 2017 at 6:53 AM, wrote: > you are tell then generate a ASM code?! this may be hard And waste of time. > > At the top of the conversation, it was said that only the C language could > write compiler without any tools/another compiler. > so why now tell

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
are you sure GoCompiler/GoLang generate ASM code for build executable file from .go? On Wednesday, December 13, 2017 at 4:23:24 PM UTC+3:30, erfang...@gmail.com wrote: > > you are tell then generate a ASM code?! this may be hard And waste of time. > > At the top of the conversation, it was said

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
you are tell then generate a ASM code?! this may be hard And waste of time. At the top of the conversation, it was said that only the C language could write compiler without any tools/another compiler. so why now tell ASM?! On Wednesday, December 13, 2017 at 4:17:05 PM UTC+3:30, Chris Hopkins

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
if you write a software then can lex and parse a input file and next AST and generate a code. so need another compiler for final compile... so your software will need another tools/compiler. On Wednesday, December 13, 2017 at 4:17:05 PM UTC+3:30, Chris Hopkins wrote: > > > > On Wednesday, 13

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Chris Hopkins
On Wednesday, 13 December 2017 12:40:18 UTC, erfang...@gmail.com wrote: > > How can write a compiler Using C as test.exe then can use from test.exe > compiler any where... so can write a input file like hello world > application and generate executable file using test.exe. > > the compiler is

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
mean a compiler like golang , then for use no need any another compiler and tools. only itself. hello.go file : package main import "fmt" func main() { fmt.Println("hello world!") } -- $ go build hello.go On Wednesday, December 13, 2017 at 4:10:18 PM UTC+3:30, erfang...@gmail.com

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Chris Hopkins
On Wednesday, 13 December 2017 12:35:17 UTC, erfang...@gmail.com wrote: > > i am not tell interpreter. > I'm not sure if you mean interpreter here in the context of interpreted language, or interpreter, someone who translates between human languages. > i am tell compiler for generate a

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
How can write a compiler Using C as test.exe then can use from test.exe compiler any where... so can write a input file like hello world application and generate executable file using test.exe. undrestand? On Wednesday, December 13, 2017 at 4:05:52 PM UTC+3:30, Chris Hopkins wrote: > > I think

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Chris Hopkins
I think we have a misunderstanding. If we don't clear up this misunderstanding then we will keep going around in circles. Not wishing to offend, this comes across as a fishing expedition not as a request for specific help; however under the assumption that this is not the case, I'll try and

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
i am not tell interpreter. i am tell compiler for generate a cross executable file. may be show me a *tutorial*/video or a sample small compiler Using C Without Assembly? On Wednesday, December 13, 2017 at 3:59:16 PM UTC+3:30, Gianguido Sorà wrote: > > The compiler does produce an executable

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Jan Mercl
On Wed, Dec 13, 2017 at 1:20 PM wrote: > Could you first answer this question? The problem is that so far no one seems to be able to understand some/most of your questions. Please try asking using more words of explanation. The added context may hopefully help others to

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Gianguido Sorà
The compiler does produce an executable without any C involved. Il 13 dic 2017 13:20, ha scritto: Could you first answer this question? They question may also be answered. *how can make a new compiler programming language using c without assembly?(a compiler then can

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
Could you first answer this question? They question may also be answered. *how can make a new compiler programming language using c without assembly?(a compiler then can produce executable file) ??* On Wednesday, December 13, 2017 at 3:40:05 PM UTC+3:30, Chris Hopkins wrote: > > Before I answer

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Chris Hopkins
Before I answer anything else, I don't understand what you are saying with: On Wednesday, 13 December 2017 11:49:06 UTC, erfang...@gmail.com wrote: > > i want research about gocompiler and want recompile main go-compiler in > gnu/linux operation system.(ubuntu/arch) > not recompile golang. > To

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
*how can make a new compiler programming language using c without assembly?(a compiler then can produce executable file) ??* On Wednesday, December 13, 2017 at 3:19:58 PM UTC+3:30, Chris Hopkins wrote: > > You keep asking the same question, I think we have a misunderstanding > here. To grossly

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Chris Hopkins
You keep asking the same question, I think we have a misunderstanding here. To grossly simplify: Way back when, the first C compilers were written in Assembly. Then someone produced a C compiler that was written in C. Now you use a C compiler to build a C compiler. Some time ago the go

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
i want research about gocompiler and want recompile main go-compiler in gnu/linux operation system.(ubuntu/arch) not recompile golang. On Wednesday, December 13, 2017 at 3:13:22 PM UTC+3:30, Jérôme Champion wrote: > > I think it would be better if you explain what you want to do. > > As

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
now i am have question about golang/go-compiler work. On Wednesday, December 13, 2017 at 3:13:22 PM UTC+3:30, Jérôme Champion wrote: > > I think it would be better if you explain what you want to do. > > As example : "I want to compile a go program on a ppc64 architecture with > operating

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread Jérôme Champion
I think it would be better if you explain what you want to do. As example : "I want to compile a go program on a ppc64 architecture with operating system XY version Z." Le mercredi 13 décembre 2017 12:30:53 UTC+1, erfang...@gmail.com a écrit : > > ?!! how may be? > a software , for this then

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
for compile a test,hello world application (.go file) with golang. alwayse need cgo compiler or c compiler? cgo compiler only generate c file. not generate binary executable file. like https://github.com/xlab/c-for-go On Wednesday, December 13, 2017 at 4:41:24 AM UTC+3:30, Bruno Albuquerque

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
?!! how may be? a software , for this then generate a binary file. need Asm or Assembler or another Compiler. if gocompiler not use c-compiler for generate binary file.(for a test hello world golang appliaction) so GoCompiler how generate binary file for any platform?! may be explain me

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
i am want test Main Go Compiler. and check and test compilers. not GoLang. On Wednesday, December 13, 2017 at 4:41:02 AM UTC+3:30, Bruno Albuquerque wrote: > > Why do you want to explicitly use an old go version? Why not 1.9.2? > > You can find pre-compiled packages for various platforms here:

[go-nuts] Re: Go Compiler How Work?!

2017-12-13 Thread erfangnulinux
in GO 1.4 , grammer/lexer is write at GO or C or both? On Wednesday, December 13, 2017 at 3:43:00 AM UTC+3:30, Dave Cheney wrote: > > In all the supported versions of Go, that is Go 1.9 and soon Go 1.10, the > grammar is written in Go. You will find the source here >

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
Why do you want to explicitly use an old go version? Why not 1.9.2? You can find pre-compiled packages for various platforms here: https://golang.org/dl/ On Tue, Dec 12, 2017 at 3:22 PM wrote: > im want test main go compiler. > > so should try >

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
No the compiler does not generate C code. The compiler compiles Go code to the actual final binary. On Tue, Dec 12, 2017 at 2:28 PM wrote: > so go compiler is made with c. > > so go compiler how work : > -- > so in current golang version , golang generate c

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
What is expected (assuming the code is correctly written). An executable file is generated and can be run normally. I am sorry but I could not parse your following questions, but I will try some general answers: 1 - No, you do not need a C compiler to compile recent Go versions. You do need an

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
Go will work fine without a C compiler. Only if you use CGO ( https://blog.golang.org/c-go-cgo) you need one. On Tue, Dec 12, 2017 at 2:51 PM wrote: > so GOLANG will not work, if not install C-Compiler on system. > > yeah? > > > On Wednesday, December 13, 2017 at

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Bruno Albuquerque
Most likely not. The current version was compiled with a previous version that was also written in Go. it you continue going down this chain you eventually get to a Go version that was compiled with a C compiler but this is only needed for platforms that do not have a Go version yet (which is also

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
In all the supported versions of Go, that is Go 1.9 and soon Go 1.10, the grammar is written in Go. You will find the source here https://github.com/golang/go/tree/master/src/cmd/compile/internal/syntax On Wednesday, 13 December 2017 10:53:45 UTC+11, erfang...@gmail.com wrote: > > im for test ,

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
example input: testpackage main import "fmt" func main() { fmt.Println("hello world") } On Wednesday, December 13, 2017 at 3:23:45 AM UTC+3:30, erfang...@gmail.com wrote: > > im for test , want change > > package token lex , to another text. > > example change package to testpackage. > >

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
im for test , want change package token lex , to another text. example change package to testpackage. --- lexer/grammer is write at C or GO? On Wednesday, December 13, 2017 at 3:18:11 AM UTC+3:30, Dave Cheney wrote: > > Sorry, Go 1.4 is no longer supported, it is only

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Sorry, Go 1.4 is no longer supported, it is only used for bootstrapping. We will not fix /home/guest/go1.4/src/cmd/cc/cc.y On Wednesday, 13 December 2017 10:41:57 UTC+11, erfang...@gmail.com wrote: > > at go1.4 version. > compiler and lexer,parser is write at C? or GO? > > can check and change

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Follow all the steps here, https://groups.google.com/d/msg/golang-nuts/24pSm-B3FqU/a0XYG4SBCgAJ then do this cd $HOME/go/src env GOOS=linux GOARCH=ppc64 ./bootstrap.bash scp ../../go-linux-ppc64-bootstrap.tbz _your host_ ssh _your host # now on the ppc64 host tar xfj

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
at go1.4 version. compiler and lexer,parser is write at C? or GO? can check and change grammer at /home/guest/go1.4/src/cmd/cc/cc.y ? -- 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

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
~/go1.4/bin$ ./go version go version go1.4-bootstrap-20170531 linux/amd64 go1.4 installed. On Wednesday, December 13, 2017 at 3:08:37 AM UTC+3:30, erfang...@gmail.com wrote: > > but i want not install use GOLANG. > only want Go Compiler. > not may? > > On Wednesday, December 13, 2017 at 3:02:10

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
but i want not install use GOLANG. only want Go Compiler. not may? On Wednesday, December 13, 2017 at 3:02:10 AM UTC+3:30, Dave Cheney wrote: > > You need to install Go on an intel computer before preparing the bootstrap > compiler for ppc64. Follow the steps above, you will find bootstrap.bash

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Yup. This comes from the heritage of the plan 9 compilers. The plan 9 c compilers were 6c for amd64, 8g for 386, 5g for arm, and so on. Because the go compiler can compile for all those targets it was called gc. People call it gc (lower case) and use GC (upper case) for "garbage collector"

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
Wooow. Question : Name of main go compiler is GC? On Wednesday, December 13, 2017 at 2:59:46 AM UTC+3:30, Dave Cheney wrote: > > Do this > > cd $HOME > curl https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz > | tar xz > mv go go1.4 > cd go1.4/src > env CGO_ENABLED=0

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
You need to install Go on an intel computer before preparing the bootstrap compiler for ppc64. Follow the steps above, you will find bootstrap.bash in the go 1.9.2 sources. On Wednesday, 13 December 2017 10:30:06 UTC+11, erfang...@gmail.com wrote: > > *tutorial* :

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
*tutorial* : *https://golang.org/doc/install/source#go14 is say then run : * $ GOOS=linux GOARCH=ppc64 ./bootstrap.bash - bootstrap.bash filethis file not available at go https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz this file only available at new version of golang.

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Do this cd $HOME curl https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz | tar xz mv go go1.4 cd go1.4/src env CGO_ENABLED=0 ./make.bash cd $HOME git clone https://go.googlesource.com/go cd go/src git checkout go1.9.2 env GOROOT_BOOTSTRAP=$HOME/go1.4 ./make.bash echo

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
at https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz source , not available bootstrap.bash file. so bootstrap.bash only available at new version of golang. not at go 1.4. On Wednesday, December 13, 2017 at 2:52:14 AM UTC+3:30, erfang...@gmail.com wrote: > > im want test

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
im want test main go compiler. so should try https://storage.googleapis.com/golang/go1.4-bootstrap-20170531.tar.gz ? and tutorial at https://golang.org/doc/install/source#go14 name of main go compiler is GC? On Wednesday, December 13, 2017 at 2:45:34 AM UTC+3:30, Dave Cheney wrote: > >

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Hello, I appreciate that you're frustrated, but you need to follow the installation instructions _exactly_ to the letter or you will not succeed. The installation instructions are quite long, but they are well tested and if you follow them precisely you will be able to install Go on your

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
go-go1.4.3/src/cmd/gc$ make go tool dist install -v make: go: Command not found ../../Make.dist:13: recipe for target 'install' failed make: *** [install] Error 127 so gc also need go!? : On Wednesday, December 13, 2017 at 2:45:34 AM UTC+3:30, Dave

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Dave Cheney
Hello, Thanks for posting. To answer your question 1. The Go compiler used to be written in C, but was rewritten in Go in release 1.5 2. This means that to build a version of Go later than 1.4, you need a Go compiler. 3. The easiest way to do this is to us a version of Go from the golang.org

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
example , when you want write a hello world application. after this then you are write a `.go` file. you should enter : go build hello.go if not installed c-compiler at now, what happen?! c-compiler need at building golang? or alwayse? also when need use from golang? On Wednesday, December 13,

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread C Banning
Well, there are binary releases for the most HW/OS combinations - https://golang.org/dl/ On Tuesday, December 12, 2017 at 3:51:43 PM UTC-7, erfang...@gmail.com wrote: > > so GOLANG will not work, if not install C-Compiler on system. > > yeah? > > On Wednesday, December 13, 2017 at 2:16:23 AM

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
so GOLANG will not work, if not install C-Compiler on system. yeah? On Wednesday, December 13, 2017 at 2:16:23 AM UTC+3:30, C Banning wrote: > > Well, GO_BOOTSTRAP lets you use any compiler after go1.4. I usually > build/install Go using the previous Go-built version - thus, I >

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread C Banning
Well, GO_BOOTSTRAP lets you use any compiler after go1.4. I usually build/install Go using the previous Go-built version - thus, I built/installed Go1.9 using the Go1.8.1 compiler. On Tuesday, December 12, 2017 at 2:48:57 PM UTC-7, erfang...@gmail.com wrote: > > so Main compiler is at

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
so go compiler is made with c. so go compiler how work : -- so in current golang version , golang generate c code and compile with c-compiler? On Wednesday, December 13, 2017 at 1:49:07 AM UTC+3:30, Shawn Milochik wrote: > > On Tue, Dec 12, 2017 at 4:48 PM,

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
how can use from them? i want not use from GOLANG. only use from GO COMPILER. main compiler of Go: go-go1.4.3/src/cmd/gc/go.y (parser) On Wednesday, December 13, 2017 at 1:49:07 AM UTC+3:30, Shawn Milochik wrote: > > On Tue, Dec 12, 2017 at 4:48 PM, > wrote: > >> so

Re: [go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Shawn Milochik
On Tue, Dec 12, 2017 at 4:48 PM, wrote: > so Main compiler is at previous version and made with C? > > Yes. https://www.youtube.com/watch?v=QIE5nV5fDwA -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
so Main compiler is at previous version and made with C? On Wednesday, December 13, 2017 at 1:09:13 AM UTC+3:30, Tamás Gulácsi wrote: > > Yes. It compiles itself with a previous verson of the compiler first. -- You received this message because you are subscribed to the Google Groups

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Tamás Gulácsi
Yes. It compiles itself with a previous verson of the compiler first. -- 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.

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread erfangnulinux
How may a compiler made with itself!? this need a tools at first to build... On Wednesday, December 13, 2017 at 1:00:22 AM UTC+3:30, Ondrej Fabry wrote: > > Not sure what you mean but if you are asking if go compiler generates C > code which is then compiled by gcc then not really. Since version

[go-nuts] Re: Go Compiler How Work?!

2017-12-12 Thread Ondrej Fabry
Not sure what you mean but if you are asking if go compiler generates C code which is then compiled by gcc then not really. Since version go 1.5 even the compiler itself is written in pure Go and since then no C code is needed anymore. On Tuesday, December 12, 2017 at 10:03:08 PM UTC+1,