Better HN
topnewbestaskshowjobs
Log inSign up

voidlogic

3,297 karma · joined Nov 15, 2012 (14y ago) · 1,171 submissions

Submissions

comment 13y ago · link · parent

That is not quite right, before 1.1 int was 32-bit on all platforms and post 1.1 an int is 32-bit on 32-bit platforms and 64-bit on 64-bit platforms.

You are supposed to use int when you don't care about its size (int = native word size). If you are writing a program where it matters you should explicitly use int32 or int64.

comment 13y ago · link · parent

Never mind its trivial to call C from Go.... http://blog.golang.org/2011/03/c-go-cgo.html

P.S. Lots of people including me write lots of real world applications in Go...

comment 13y ago · link · parent

Many people seem to be asserting just because the OP's algorithm was sub-optimal, that it means his Ruby code running slow vs Go is a non-issue. The problem is even well written Ruby vs Go has the same kind of performance divide:

http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te... (All the usual benchmark disclaimers apply, your mileage may very, your app is always the best bench, etc etc.)

comment 13y ago · link · parent

All the usual benchmark disclaimers apply, but Scala appears to compare pretty favourably in the Programming Language Shootout:

http://benchmarksgame.alioth.debian.org/u64q/benchmark.php?t...

Generally Scala appears to use less time, less memory and less code. I have not ever used either so I cannot anecdotally confirm this.

comment 13y ago · link · parent

It is interesting to read and compare both, but I would avoid a simple LOC comparison as the Go versions have a lot of extra lines (newlines, unneeded selects, redundant case statements) that could easily be eliminated.

comment 13y ago · link · parent

Not to mention the bikes will help you live longer.

comment 13y ago · link · parent

http://en.wikipedia.org/wiki/Final_%28Java%29#Final_methods

comment 13y ago · link · parent

I thought my only edit had been to replace might with probably. If this was not the case I'm sorry. Maybe I edited it to add that right after posting and forgot-

comment 13y ago · link · parent

You mean like final in Java? I don't believe there is. Go has a different way of handling OO and so far I have never needed "final". In Go embedding is not common and interfaces are used much more.

In Go, having final in an embedded struct affect the containing struct seems wrong IMHO- this would allow embeded fields to dictate the behaviour of things that embed them. I don't think most programmers would be happy with adding a field to a struct and as a consequence be prevented from implementing a given method signature.

comment 13y ago · link · parent

Looks like overkill for a simple one time task that can easily be handled the UNIX way. Worth looking into if you need to do this alot-

comment 13y ago · link · parent

That is one (good) way to handle the encryption.

You don't want to leave out the compression or block size however, so add those back in. Most WAN links are low bandwidth enough that compression will not slow things down (this is usually true even on 1 GBE LAN links for pigz) and in my experience the speed-up is substantial.

pigz is much faster than using ssh compression as it is multicore. apt-get it or http://zlib.net/pigz/

comment 13y ago · link · parent

>>Shouldn't you at least do this over SSH?

Yeah, I mentioned that at the bottom of my post. Using ssh or some other inline encryption would be a good idea if it is a system you care about. If you have a site to site VPN tunnel between your systems, you can skip adding the encryption.

comment 13y ago · link · parent

If your using lvm you can create a snapshot to do this while online, if not just read from your disk (assuming sda here):

   1. (offline) Boot new and old VM servers from live CD
   2. old server: dd if=/dev/sda bs=8M | pbzip2 -c | netcat <newhost> <random high port>
   3. new server: netcat -l <same port> | pbzip2 -cd | dd of=/dev/sda bs=8M
Compression: You can use something besides pbzip2, maybe pigz of if you only have a single core use bzip2 or gzip. Security: You probably want to add encryption to this pipeline.

comment 13y ago · link · parent

So Go has embedding not inheritance because SubClass is not an instance of SuperClass, there is no hierarchy, only composition.

BUT what you might not realize is that any method defined on SuperClass (and only defined on SuperClass) can be called on SubClass, but it operates on SuperClass data. This allows SubClass to use SuperClass to help it fulfil an interface for example.

See it in action: http://play.golang.org/p/8kiwu1PlW_

comment 13y ago · link · parent

That is not inheritance, it is embedding: http://golang.org/doc/effective_go.html#embedding

comment 13y ago · link · parent

I would like to see more internal Google stats as well but-

"and from what I can see, the language is hardly every used outside Google as well."

3 Months ago Go was more popular on github by number of unique committers than Lua, Clojure, Haskell, Erlang, D, OCaml, Lisp/Scheme, Rust, Delphi, Prolog, F#, Ada etc [1]. Surely you consider some of those languages as being relevant? That is not a perfect metric, but those stats don't fit your narrative of Go being unused very well.

1: https://gist.github.com/igrigorik/4440674

comment 13y ago · link · parent

Those results are from the x86-64 machine with one core (because the multi-core 64-bit machine is still running Go 1.0.3). Once Go 1.1 is realized and the multicore machine is updated, run the comparison again there. Javascript fairs even worse against Go when multiple cores are available. Gos support for parallel processing blows JS away.

comment 13y ago · link · parent

I've always informally thought of a scripting language as anything the executes by interpreting source code or bytecode (lacking JIT compilation).

comment 13y ago · link · parent

"If it really was impossible to measure development/support speed, then we'd still use hex code with switches on a console. :-)"

Of course it can be quantified. Some people use gzipped source code size to approximate this. I just meant that this is more subjective, has more variables and sometimes must be decided per organization or team.

"And yeah, kids today often don't learn C at school, it is a pity."

Most C-S programs I have interacted with still teach C, but yes that is a problem. I was more thinking of the "too cool for school" portion of the startup crowd, those who learn only learn scripting languages, etc

comment 13y ago · link · parent

"But he didn't touch the important question -- is the development time for Go faster than for scripting languages + C?"

That is a good question, but- Isn't that going to vary a lot by the person/team involved? Calculating "effort" is far more difficult than run-time or complexity characteristics.

Doesn't that question also assume that people writing in the scripting language can write (correct/decent/secure) C. Ironically, I have a strong feeling that many more Go developers can write C than say Ruby or PHP devs.

comment 13y ago · link · parent

Since the author uses Go as a basis of comparison. I thought these benchmarks from The Computer Language Benchmarks Game might be interesting:

Go vs. Ruby: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...

Go vs. Python: http://benchmarksgame.alioth.debian.org/u64/benchmark.php?te...

Note: These results are from the 64-bit single core machine since it has already been updated to Go 1.1 beta 1. There is also a faster Go regex program (#7) that hopefully can be made to work again after 1.1 is released (in place of #1).

Although still using Go 1.0.X ,the recent TechEmpower benchmarks might be interesting if you have not seen them: http://www.techempower.com/blog/2013/03/28/framework-benchma... (It looks like Go 1.1 might be 3x faster: https://gist.github.com/errnoh/5320784)

P.S. As always your own program is always the best benchmark to use, your millage may very, take your gain of salt, etc etc.

comment 13y ago · link · parent

What about attending a new University with an empty slate?

comment 13y ago · link · parent

To be clear I said I thought the Go crypo was suitable for some production uses. The text you put it quotes was not anything I ever said. I would rather use OpenSSL for a banking app for example.

Since Go is >= version 1.0 and the crypo libraries in the standard library and not in go/exp, etc Go is implicitly endorsing them for some production use.

I found closed issues that might be the ones you mentioned. If you are aware of issues, you should file them: http://code.google.com/p/go/issues/list?can=2&q=crypto&#...

comment 13y ago · link · parent

"You are confusing the Java applet sandbox with the JVM" I tried to be clear I was expressing common views customers and people I have interacted with have expressed, not my own. In the context of marketing, perception matters.

But I hope you are not saying the server side JVM has never has security bugs..

comment 13y ago · link · parent

I disagree, Go is slightly more verbose, but it leads to very clear code that is easily understood. Go code is beautiful.

Javascript's dynamic typing, extensive use of callbacks, its approach to OO, inconsistent braces and semicolons, etc are all felt by a lot of people to be messy.

For me lack of something like gofmt and a compile time errors also greatly detract.

comment 13y ago · link · parent

I would agree that OpenSSL is safer than using Go crypto. But I haven't seen any compelling evidence that it is any less secure than other non-Open SSL solutions. Like anything else, find a bug, report it/fix it.

comment 13y ago · link · parent

I have heard some security researchers are not pleased with Oracles security fix response time.

Other people feel the JVM is highly targeted. Or has more security bugs than it should. Or is too bloated for the limited services they use it for and could be smaller and this present a smaller target. etc

I'm not saying these concerns are necessarily valid, but I have had customers who had no JVM rules...

comment 13y ago · link · parent

Agreed. If Google stopped working on Go, it would live on.

comment 13y ago · link · parent

I'm not familiar with their product, is their back-end choice going to limit their customers?

I think that a lot of developers that didn't start with front-end work find Javascript disgusting, maybe this team is in that group. When I worked at a consulting firm (that used a lot of C#) and we talked about node.js when it came out, everyone agreed they hated the idea of having to write more yucky JS than they had too. I think node.js was high on hype for a while and is less loved (esp outside of CA) than you might expect.

I've ported node.js apps to Go 1.0.1 and even back then the result was better performing, used less memory, about the same LOC and IMHO much cleaner, straight-forward and maintainable code.

comment 13y ago · link · parent

Many people, right or wrong, do not feel comfortable running the JVM for patent, ideological and/or security reasons.
1
323334
40