|
|
| The Go Programming Language (by Google) |
|
Peter Wang
Member #23
April 2000
|
Profiling doesn't come for free, though, and I don't think runtime optimisation is that useful for the majority of programs, which seem to be IO/user bound anyway.
|
|
Thomas Fjellstrom
Member #476
June 2000
|
Of course thats just one mode. LLVM also supports regular compile/run scenarios. -- |
|
BAF
Member #2,981
December 2002
|
JIT compilers/VMs supporting compilation straight to binary sort of ruin the whole idea in the first place. Compiling to CIL or bytecode allows to you run it anywhere with one binary. Mono, though, does support taking a CIL binary and compiling it to native code (AoTC compilation), though, as expected, the output is very platform specific. |
|
bamccaig
Member #7,536
July 2006
|
Yes, but if I want the high-level abstraction of C# and .NET with the performance of C or C++, I can't get it because C# and Java are implemented through virtual machines. There's no need for it. If I know I'm only running the program on my machine there's no harm in compiling it right down to machine level. In fact, there's hopefully a performance gain. What I'm saying is that languages themselves shouldn't be limited to one runtime methodology. All languages should be able to be interpreted, compiled down to byte-code and JIT compiled, or compiled straight to machine level. There's no reason they can't. Eventually, they're executing code on the CPU one way or another. The only question is, how many layers are between the program and the CPU and what's the most optimal solution for a particular use case? Languages are just a way to communicate the instructions to the computer. The implementation determines how the computer interprets those instructions and there's no reason a language should only be used with one type of implementation. -- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
kazzmir
Member #1,786
December 2001
|
bamccaig said: Yes, but if I want the high-level abstraction of C# and .NET with the performance of C or C++, I can't get it because C# and Java are implemented through virtual machines. What are you talking about? C# and Java are converted to native code eventually. A virtual machine is just a run-time. You normally use a run-time for C/C++, its called libc. Anyway just look at the shootout numbers: http://shootout.alioth.debian.org/u64/summary.php Java is only 14% slower than g++ which isn't a heckovalot. Java's performance has been increasing over the past 10 years due to better compiler technology. This has nothing to do with using a VM. |
|
Peter Wang
Member #23
April 2000
|
bamccaig said: All languages should be able to be interpreted, compiled down to byte-code and JIT compiled, or compiled straight to machine level. There's no reason they can't. I don't understand what you are trying to say. Language implementors know this. It's just that some languages/features are easier to map to "native" code (itself a bit of a lie) than others.
|
|
BAF
Member #2,981
December 2002
|
You act as if it's an unnecessary abstraction of the CPU/runtime. Do you also statically link your stuff, to prevent the dynamic-linking taking up precious time? Right now, you can take any .NET (or java program) and run it mostly anyplace, no matter what system libraries, processor, etc. If you start allowing the compiler to produce machine-code output, you break this process. You also then have to do something about .NET itself (or, at least I assume, Java's standard library), seeing as how .NET is compiled to CIL and not native code (as far as I know, anyway). |
|
bamccaig
Member #7,536
July 2006
|
kazzmir said: A virtual machine is just a run-time. You normally use a run-time for C/C++, its called libc. I could be wrong, but I think you're confusing ambiguous terminology. The C run-time is, AFAIK, just a regular library that contains the C language implementation. Contrarily, Java's VM is a program that itself processes the Java program (originally, interpreting the byte-code, though now probably JIT compiling it; which it would seem still involves interpretation). One way or another, turning byte-codes into machine instructions. Peter Wang said: I don't understand what you are trying to say. Language implementors know this. It's just that some languages/features are easier to map to "native" code (itself a bit of a lie) than others. I'm not suggesting that it's some ground breaking idea. Google's Go seemed to be partially justified as a "dynamic"-like language that compiles down to native code, but they could have instead just developed a native compiler for Java or C# or Lua[1] (albeit, a new language might well have been a simpler undertaking). The language itself can be thought of independently of implementations (though they usually aren't). BAF said: You act as if it's an unnecessary abstraction of the CPU/runtime. Do you also statically link your stuff, to prevent the dynamic-linking taking up precious time? Dynamic linking is beneficial. It means I shouldn't have to rebuild my entire system when an integral library gets a minor update. The performance hit should be relatively minor (and more than likely, the virtual machines that .NET and Java run on probably have their own dynamic linking to do, so that's not exactly getting swapped out for something different). BAF said: Right now, you can take any .NET (or java program) and run it mostly anyplace, no matter what system libraries, processor, etc. If you start allowing the compiler to produce machine-code output, you break this process. You also then have to do something about .NET itself (or, at least I assume, Java's standard library), seeing as how .NET is compiled to CIL and not native code (as far as I know, anyway).
My point is, there's no technical reason C# has to be compiled to CIL. It could be compiled straight to machine code (as could the .NET CIL it uses) if that was desirable. I'm not suggesting .NET starts building platform specifics into its builds. I'm just saying that on top of the CIL route, Microsoft could implement a compiler that goes straight to native code (for when that's desirable). Considering .NET is mostly Windows only (Mono being the only notable exception I'm aware of), the abstraction is almost questionable. It would make sense if the executables were actually normally used on other platforms, but that doesn't seem to be the case (though it is a worthwhile goal to work towards, Microsoft seems like the last organization that would want to)... References
-- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
kazzmir
Member #1,786
December 2001
|
bamccaig said: I could be wrong, but I think you're confusing ambiguous terminology. The C run-time is, AFAIK, just a regular library that contains the C language implementation. Contrarily, Java's VM is a program that itself processes the Java program (originally, interpreting the byte-code, though now probably JIT compiling it; which it would seem still involves interpretation). The java vm is two things: a virtual machine and an interpreter/JIT compiler. You could in theory compile all your code directly to machine code but you would still need the VM to run it because things like memory allocation are handled by the VM, much like how malloc is inside libc. Whether or not there is a tool to compile java directly to native code, I don't know. But the source is open so you could write it yourself. |
|
bamccaig
Member #7,536
July 2006
|
kazzmir said: You could in theory compile all your code directly to machine code but you would still need the VM to run it because things like memory allocation are handled by the VM, much like how malloc is inside libc. That's an implementation feature, not a language feature[1]. The whole thing could be compiled directly to machine code, though it would probably be non-trivial to do (you'd need to generate appropriate memory allocation and management code). libc isn't a separate program like the Java VM is. It's part of your program when you link to it. The only reason it's separate is because there are advantages to dynamically linking. References
-- acc.js | al4anim - Allegro 4 Animation library | Allegro 5 VS/NuGet Guide | Allegro.cc Mockup | Allegro.cc <code> Tag | Allegro 4 Timer Example (w/ Semaphores) | Allegro 5 "Winpkg" (MSVC readme) | Bambot | Blog | C++ STL Container Flowchart | Castopulence Software | Check Return Values | Derail? | Is This A Discussion? Flow Chart | Filesystem Hierarchy Standard | Clean Code Talks - Global State and Singletons | How To Use Header Files | GNU/Linux (Debian, Fedora, Gentoo) | rot (rot13, rot47, rotN) | Streaming |
|
Peter Wang
Member #23
April 2000
|
You can compile Java to native code, with gcj. (and other compilers, I'm pretty sure)
|
|
axilmar
Member #1,204
April 2001
|
|
SiegeLord
Member #7,827
October 2006
|
So do most other languages. Just as I said earlier, Go is like D from who knows how many years ago. And it doesn't matter that Go is in alpha state, so is D2. D2 is heck of a lot better now than Go is, imho. I for one, think that the interest in this language is 90% based on the fact that it is made by Google, for if it was anything else, people would be all over D/D2 preferentially over Go, as those 2 (especially D2) are far better than Go. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
Trezker
Member #1,739
December 2001
|
Well I don't really care where the language comes from. If D2 had been presented with a tech talk video like Go was I'd have the same thoughts about it. |
|
Matthew Leverton
Supreme Loser
January 1999
|
Google may be second only to Apple in the "we can release a box of poo and people will still ogle over it" department. |
|
GullRaDriel
Member #3,861
September 2003
|
Do you have your period, Matt ? ;-) "Code is like shit - it only smells if it is not yours" |
|
MiquelFire
Member #3,110
January 2003
|
GullRaDriel said: Do you have your period, Matt ? ;-)
What? --- |
|
Billybob
Member #3,136
January 2003
|
bamccaig said: The whole thing could be compiled directly to machine code I agree with you, and as mentioned Java has a compiler that does so. The point I would make, and I think others are trying to make, is that it isn't necessary. A native binary would provide no significant speed improvement over a CIL binary. With .NET's cache, you don't even have the JIT overhead. You mentioned verification being a bottleneck, but that only requires a few, small comparison checks.
|
|
Kibiz0r
Member #6,203
September 2005
|
SiegeLord said: I for one, think that the interest in this language is 90% based on the fact that it is made by Google I can't speak for others, but I am interested in this because it covers language topics I am very interested in, namely channels and non-conventional type systems. However, I probably wouldn't have found out about it if it wasn't made by Google. --- |
|
Peter Wang
Member #23
April 2000
|
SiegeLord said: I for one, think that the interest in this language is 90% based on the fact that it is made by Google, For sure. But programming languages "succeed" for mainly non-technical reasons. Quote: for if it was anything else, people would be all over D/D2 preferentially over Go, as those 2 (especially D2) are far better than Go. Erlang-style concurrency primitives (and implementation!) in a lightweight, imperative language is interesting to me. I don't think D provides that.
|
|
BAF
Member #2,981
December 2002
|
bamccaig said:
It would make sense if the executables were actually normally used on other platforms, but that doesn't seem to be the case (though it is a worthwhile goal to work towards, Microsoft seems like the last organization that would want to)... The executables can run on 32 or 64-bit Windows, Windows CE/Windows Mobile (generally on ARM cpus), XBox 360 (through XNA, IIRC it's still x86, but the system libraries are likely different). I think Microsoft has done it well, and so has Mono for the most part. It's nice being able to run VS-produced binaries on Linux, and vice versa. Oh, and being able to target stuff at .NET CF for Windows Mobile, and being able to run that binary directly on Windows (assuming no WM specific libraries are used). |
|
SiegeLord
Member #7,827
October 2006
|
Peter Wang said: For sure. But programming languages "succeed" for mainly non-technical reasons. I am sure the posterity will appreciate us being blinded by marketing and then writing tons of software in a fundamentally flawed and inelegant language. Quote: Erlang-style concurrency primitives (and implementation!) in a lightweight, imperative language is interesting to me. I don't think D provides that. The niceness of writing the small percentage of the program that can be parallelized using 'goroutines' is outweighed by difficulty of writing the rest of it using the features (or lack thereof) that Go provides, in my opinion. While it is valid for one person in particular to strongly weigh the 'goroutines' feature such that any language with it will be considered better any other language without it, I question how valid this is for the programming community at large. "For in much wisdom is much grief: and he that increases knowledge increases sorrow."-Ecclesiastes 1:18 |
|
Billybob
Member #3,136
January 2003
|
BAF said: The executables can run on 32 or 64-bit Windows... and Zune!
|
|
Peter Wang
Member #23
April 2000
|
SiegeLord said: I am sure the posterity will appreciate us being blinded by marketing and then writing tons of software in a fundamentally flawed and inelegant language. Witness: ... any number of examples which I will not bring up, as it will just end up a flame war. Don't get me wrong. Go definitely has the feel of "worse is better" about it, and I hope some of the warts will be fixed in time. It just seems to me that, for non-technical reasons, Go has a (still small) chance of gaining some sort of traction in the space that C and C++ usually play in. I don't think it's the worst thing that could happen.
|
|
Billybob
Member #3,136
January 2003
|
Peter Wang said: Don't get me wrong. Go definitely has the feel of "worse is better" about it, and I hope some of the warts will be fixed in time. It just seems to me that, for non-technical reasons, Go has a (still small) chance of gaining some sort of traction in the space that C and C++ usually play in. I don't think it's the worst thing that could happen. I love coding in new languages, when time permits. I do not know about other coders, but I have no problem coding in any particular language, even multiple ones at the same time (fun). They are all mostly C-lineage anyway, and the ones that are not have fun little features that make them a joy to use in moderation. The more languages you use, the better you can decide which does a particular job effectively. So, Go might have unnatural backing, but does anyone really care? Besides, no programming language these days is going to succeed on its own unless it contains a fundamental improvement on current practices. Beyond that it will need the backing of a major corporation to make any headway. It's like starting a new airline. You succeed only if your services are a major improvement on the current condition or you're a major corporation.
|
|
|
|