Live data from Hacker News

Less is exponentially more

commandcenter.blogspot.com

51–60 of 124 posts

Re: Less is exponentially more

#51
post #29
post #16

Earlier quoted context omitted.

I agree that it's always a target conflict. I'm just not convinced that gc is the way to go in an environment where optimization might become important. GC lets you get a correctly working program easier, but once you are into optimizing runtime performance you quickly loose that advantage, often by simulating memory management with pools. Take a look at the new Obj C with automatic reference counting. It lets you fo…

1986 - Brad Cox and Tom Love create Objective-C, announcing "this language has all the memory safety of C combined with all the blazing speed of Smalltalk." http://james-iry.blogspot.com/2009/05/brief-incomplete-and-m... Once you're optimizing the runtime performance of Objective-C code, you're suddenly writing in C. The "close to hardware" thing is an illusion created by the "-C" part.

While that blog post is a fun read, it's a bit of a stretch to quote it in this context don't you think? ;)

"Once you're optimizing the runtime performance of Objective-C code, you're suddenly writing in C."

1) in idiomatic obj c you have already more control over runtime behavior than in managed environments, simply because you don't have to worry about a GC kicking in at a bad time (like "user has touched my interface, expects immediate GUI response").

2) If you do want to dig deeper, yes you go into C programming. However, I don't see what's wrong with that. In a managed environment it's not even possible to do that.

"The "close to hardware" thing is an illusion created by the "-C" part."

It always depends what you mean by "close". In Obj C it's abstracted away but accessible. In a managed language it's hidden by the runtime environment and not accessible anymore. Don't get me wrong, I think that managed languages certainly do have their merrit for many applications. It's just pretty obvious to me that they won't replace languages like C or C++ in the near future. Obj C is something in between - and I like its balance. Obviously it's not well suitable for cross platform development, but that doesn't defy the idea behind it.

Re: Less is exponentially more

#52
post #7

Its not just that many programmers want more control. Its also the case that many programmers want more complication. They really prefer the most complicated and difficult way to do things. They don't trust things that are easier or simpler. I think that maybe they believe deep down that ease-of-use versus power is truly a zero-sum game, and you just can't get more of one thing without giving up some of the other. Al…

Some people don't trust black boxes because they have been burned too many times in the past. I don't want to make this an age thing, but in my observation the people who are chomping at the bit to jump on the next big thing are generally those who haven't yet really suffered because of someone else's mistake.

Cryptography's got the right attitude. Don't use things that are proven to be broken, but at the same time don't trust anything that hasn't been under the harsh glare of professional scrutiny for a while.

Re: Less is exponentially more

#53
post #34

I'm still of the opinion they made a mistake by not having exceptions. When programming in Python exceptions are wonderful because they let me put error handling code in the appropriate place without having to litter all the intermediary code to where errors happen with error flags. (Panic is not the same thing.) The usual complaint about exceptions is "expense", but the same claims can be made about gc. The Go FAQ i…

After using Go for a while (and Python and Java and many other languages with exceptions for years), lack of exceptions is one of my favorite things about Go. Handling errors is not something magical that you have to worry might happen when and where you least expect it. Exceptions are specially bad in Python, because often they are not even documented as part of the API, so you are never sure when you call a library…

I agree that exceptions done badly are poor. That is especially the case with C++ where they were introduced later, and they are one of the things some people omit when picking the subset of C++ they use. I also don't think exceptions should be done without GC. Java's checked exceptions are very annoying.

My experience in Python is the opposite than yours, but then I've only been using it for 12 years :-) Undocumented serious exceptions are no different than Go's panic - they will probably terminate the program. But the usual case is extremely useful and not littering intermediate functions with error handling is wonderful.

And sure they can be abused, but virtually any functionality gives you "power" and that power can be used wrong. That isn't a good reason to take something away from the developers who would use them right.

Re: Less is exponentially more

#54
post #49

I'm still of the opinion they made a mistake by not having exceptions. When programming in Python exceptions are wonderful because they let me put error handling code in the appropriate place without having to litter all the intermediary code to where errors happen with error flags. (Panic is not the same thing.) The usual complaint about exceptions is "expense", but the same claims can be made about gc. The Go FAQ i…

One school of thoughts is that exception is a non-local goto that might span many levels of calls, and that can be non-trivial to understand. Languages without exception has clear paths of return in a function.

True, but so what. The code I like the best is the code I don't even have to write. Having to write all the intermediary code between where an exception happens and where I'd like to handle it is annoying.

And the "understanding" argument applies to other things, such as using a compiled language instead of assembly or GC instead of manual memory allocation.

Re: Less is exponentially more

#55

Earlier quoted context omitted.

You might be less curious if you had read and understood the talk. Relevant text: "That way of thinking just isn't the way Go operates. Zero cost isn't a goal, at least not zero CPU cost. Go's claim is that minimizing programmer effort is a more important consideration." In a language with closures and Go-style goroutines and channels, the amount of programmer effort required to manage memory would be absolutely imme…

> In a language with closures and Go-style goroutines and channels... Is that also filed under doing less? I believe C/C++ programmers aren't flocking to Go because it isn't strictly less. Every language that has tried to replace C/C++ always ends up doing too much. I'd love to see a replacement for C that solves the obvious flaws but doesn't add to much to the basic premise.

We're certainly hoping that Rust is that language.

In particular, we're trying to get the raw no-compromises performance of idiomatic C++ in a practical, memory-safe (and data-race-free) language. That means that our type system is more complex than that of C or Go, but it also lets us squeeze performance out of the machine without sacrificing safety.

We do have an optional per-thread garbage collector (it doesn't stop the world, only the thread), but it's more like shared_ptr than what you'd usually think of as a GC; it's there if you want it on your objects, and you don't have to use it.

(Disclaimer: I work on Rust.)

(Second disclaimer: Go is an awesome language and, as this talk illustrates, we aren't competing with Go; Go and Rust have totally different goals and Rob Pike's languages were quite the influence on Rust.)

Re: Less is exponentially more

#56
post #14

Earlier quoted context omitted.

There seems to be plenty of people that trust Go even if they are not the main compiler and runtime developers, Canonical, Heroku, the BBC, not to mention many startups that have completely bet their business on Go: http://go-lang.cat-v.org/organizations-using-go

Atlassian is on that list but I know that last year we rewrote our Go code to Python after our main Go developer left.

I've never understood this kind of action. Go is so small you could hold the spec in your hand and it's going to be faster and more efficient than python as well as safer to modify thanks to type safety. If it were haskell, or a similarly difficult language to wrap your head around, I could see wanting to rewrite to something easier to understand. But Go has none of those problems. What could possibly motivate a rewrite?

Re: Less is exponentially more

#57

I think as working programmers, we end up torn between two opposing perspectives with our tools (i.e. programming languages, editors, language features): On one side, there's the aesthetic of minimalism. Visualize the master Japanese calligrapher seated in an otherwise empty room, table before him. One parchment, one pot of ink, one brush. And he creates the most flawless art one could imagine. Mastery means removing…

If you are willing to accept language as one of the calligrapher's tools I think you will find his workshop to be equally cluttered.

Re: Less is exponentially more

#58
post #26

Earlier quoted context omitted.

His claim as I understood it is that the fundamental building blocks should not be types (what something is ), but functional capabilities (what something can do ). Type abstractions are fundamentally hierarchical (from an abstraction to multiple concrete versions), whereas capabilities are fundamentally about composition (I can do A, B and C).

Type abstractions are fundamentally hierarchical In C++ or Java they certainly are, but Haskell's type classes, for instance, are much more similar to Go's interfaces.

I don't think anyone is going to say that Haskell's type classes in any way fit the traditional notion of a type. It's more the exception that proves the rule in this case.

Re: Less is exponentially more

#59
Go has some really great features, I've written a few thousand lines in it and enjoyed it, but there are some strange hangups that the go designers have that in the end make me think its going to go nowhere.

1. Rob Pike is immensely proud that the language has no generics, but this means that in the last 2 years, there isnt a proper implementation of a linked list that can hold an arbitrary type, or a min-heap, an ordered map, or a b-tree, or any one of countless data structures that one can take for granted in every other language. And yes, there are implementations that take interfaces, but you have to very odd-looking casts to coerce values in and out of them.

2. Go - or its testing support - doesnt allow a simple assert or EQUALS macro, simply because Rob believes everything should be done with if/then structures. Along with error handling, this makes go tests painful to read.

3. Idiosyncratic handling of pointers and values, leading to confusion everywhere and accidental copies and bugs where people pass by value accidentally because its extremely easy to.

4. Channels aren't really that useful beyond small programs (IMHO, maybe I'm wrong), and by making them synchronous any non-trivial go concurrent program has to reason very carefully to avoid deadlocks.

There are countless similar things. People will put up with these idiosyncracies for a while but move on in the end.

Re: Less is exponentially more

#60
> Early in the rollout of Go I was told by someone that he could not imagine working in a language without generic types. As I have reported elsewhere, I found that an odd remark.

What I find odd is that he makes this statement, but then doesn't explain which of the following he prefers:

1. Rewriting algorithms again and again for each minor variation of a data type

2. Downcasts everywhere

3. Contorting code to work with the two magic data structures, array and map

Instead he goes on to rant about type hierarchies, which is awfully non-sequitur.

Post reply on HN