Live data from Hacker News

Alan Donovan and Brian Kernighan Answer Questions on Go

features.slashdot.org

51–60 of 110 posts

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#51
post #41

Earlier quoted context omitted.

Found it: https://github.com/Microsoft/vscode-go

Thanks.

Remember to install the dlv (which requires fiddling with certs on OS X) if you want to launch and debug programs. If you don't, Code won't complain, only silently fail to launch the program.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#52

Kernighan's response to the C question was rather odd -- where is this myth that C is only used in embedded systems and drivers coming from? The Linux kernel is still written in C. Ben Klemens, author of 21st Century C, leads the statistical computing group for the research arm of the U.S. Census Bureau. He models complex systems and computations in C. The entire Python scientific computing stack is resting on C. A h…

Kernighan wasn't the one claiming that C was mostly used for embedded systems and drivers; that was the guy who posed the question. Kernighan only agreed that C is still popular in that space. As for C99, I would love to see some hard stats about rate of adoption. Personally I can't imagine starting out on a new project and not use C99, but then the hard-core C contingency is a pretty conservative bunch. (Are there s…

You're right -- Kernighan didn't say that and I didn't intend to imply that he had. Apologies for those confused.

The rate of adoption question is interesting. If only there were a foundation or group out there shepherding the community and keeping tabs on such developments. If there is I'd appreciate being pointed to the right address.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#53

Kernighan's response to the C question was rather odd -- where is this myth that C is only used in embedded systems and drivers coming from? The Linux kernel is still written in C. Ben Klemens, author of 21st Century C, leads the statistical computing group for the research arm of the U.S. Census Bureau. He models complex systems and computations in C. The entire Python scientific computing stack is resting on C. A h…

Kernighan wasn't the one claiming that C was mostly used for embedded systems and drivers; that was the guy who posed the question. Kernighan only agreed that C is still popular in that space. As for C99, I would love to see some hard stats about rate of adoption. Personally I can't imagine starting out on a new project and not use C99, but then the hard-core C contingency is a pretty conservative bunch. (Are there s…

> Are there still systems where you can't get a C99 compiler?

In windows it's pretty annoying to get a C99 compiler. The "standard" compiler to do Windows development is Microsoft's, and it doesn't support C99.

Of course you can install MinGW (gcc); most open source software on Windows uses it, but it's very unusual for the average Windows developer to even have gcc, and completely unheard of in the commercial space.

I will also note that installing MinGW in Windows is a pretty painful experience as well, which doesn't help.

For most Windows developers, if it doesn't ship in Visual Studio, it doesn't exist.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#54

Kernighan's response to the C question was rather odd -- where is this myth that C is only used in embedded systems and drivers coming from? The Linux kernel is still written in C. Ben Klemens, author of 21st Century C, leads the statistical computing group for the research arm of the U.S. Census Bureau. He models complex systems and computations in C. The entire Python scientific computing stack is resting on C. A h…

Also of course Python itself is in C as well. Other language VM/runtimes are developed in C as well (Erlang, Lua?)

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#55
post #53

Earlier quoted context omitted.

Kernighan wasn't the one claiming that C was mostly used for embedded systems and drivers; that was the guy who posed the question. Kernighan only agreed that C is still popular in that space. As for C99, I would love to see some hard stats about rate of adoption. Personally I can't imagine starting out on a new project and not use C99, but then the hard-core C contingency is a pretty conservative bunch. (Are there s…

> Are there still systems where you can't get a C99 compiler? In windows it's pretty annoying to get a C99 compiler. The "standard" compiler to do Windows development is Microsoft's, and it doesn't support C99. Of course you can install MinGW (gcc); most open source software on Windows uses it, but it's very unusual for the average Windows developer to even have gcc, and completely unheard of in the commercial space.…

That's insane. Though I suspect it's because C++ has so much more traction in the Windows world, and that seasoned C developers forced to work on the Windows platform will immediately reach for MinGW or Cygwin. Last I checked, a lot of Unix software has to be compiled with GCC, anyway.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#56
post #15
post #6

> In general, Go strongly encourages being explicit about errors. That's completely incorrect: it's trivial (and common) to just ignore errors in Go: ok, _ := Foo() Checked exceptions don't let you get away with this kind of sloppy programming.

You've never seen the Java "pattern" of try { foo(); } catch (Exception e) { ; } ?

This is not idiomatic Java code and in my experience not many competent people will do this. New Java programmers who ask for help with a piece of code that ignores the error are told immediately to check the error. And experienced Java programmers simply do not ignore the error.

Also, you don't need the semicolon.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#57
post #56
post #15

Earlier quoted context omitted.

You've never seen the Java "pattern" of try { foo(); } catch (Exception e) { ; } ?

This is not idiomatic Java code and in my experience not many competent people will do this. New Java programmers who ask for help with a piece of code that ignores the error are told immediately to check the error. And experienced Java programmers simply do not ignore the error. Also, you don't need the semicolon.

It's not idiomatic, or good, but neither is ignoring the return value from a go function call. Both languages fail to provide better affordances for error checking.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#58

Go is as far removed from "extreme abstraction" as any other language I know. I don't know how it can even for a second be considered to have that desireable attribute. I, for one, don't like abstraction and power just because I'm a PL geek. I admit those are also reasons, but the truth is I use them to make my codebase smaller, simpler, and easier to reason about. For some, achieving that goal means writing for loop…

It would be a shame if you are only making some things easier to reason about instead of everything.

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#59

I never knew that the decision to not have versioning built into go was because of the diamond dependency problem. This makes a lot of sense now that I think about it. I wonder what alternatives to manually versioning things the go team is considering. Also, at the beginning the Go team wasn't all that enthusiastic about an IDE, but its great to see that Go will get an IntelliJ grade IDE soon, so that works for me :)

I really am not a fan of the lack of versioning, even with that explanation. Of course diamond dependencies are a problem. But they haven't actually fixed that problem; they've just declared a method for picking one of the two dependencies that is ill defined ("whichever one you happen to have pulled in first"). At least with versioning I get told that there's an incompatibility in the expectations between two librar…

I think that the solution to this problem is one of the few things that nodejs got right. Instead of declaring a global dependency on `require("D")`, you assign it a variable name. Then, each package can declare its sub-dependencies, and even when the versions differ, the different versions are kept in a different scope.

https://nodejs.org/api/modules.html

  // Package A:
  import B from "B"; // A/node_modules/B/1.0.0
  import C from "C"; // A/node_modules/C/1.0.0

  // Package B:
  import D from "D"; // A/node_modules/B/1.0.0/node_modules/D/1.0.0


  // Package C:
  import D from "D"; // A/node_modules/C/1.0.0/node_modules/D/2.0.0

Re: Alan Donovan and Brian Kernighan Answer Questions on Go

#60
Here's a solution to the diamond dependency problem: Imports can only be done for a specific lexical scope. Also, imports must specify a particular version. Lastly, calls to a package go to a specific version of the package, and types are defined in a specific version. (This is why all imports must be done for a specific lexical scope.)

The same scheme could be used to resolve diamond dependencies in multiple inheritance as well.

Post reply on HN