3,297 karma · joined Nov 15, 2012 (14y ago) · 1,171 submissions
comment 13y ago · link · parent
So the author wants to type "./foo.go" rather than "go run"? Why not just build your executable, "go build", then you can run/move the resulting executable ./foo.
This really doesn't seem like a big deal / why do I want to compile a utility program every-time I run it?
comment 13y ago · link · parent
In the wild what is more common in my experience is to use a formal specification language like Z or Object-Z and then recreate the the program in a "normal" language using pair programmers and/or extensive code review to attempt to ensure it conforms to the specification. While not perfect, for critical things this approach is far more time consuming and less bug prone than typical development.
I have also seen limited attempts at writing code generators that take Object-Z specifications as input. My understanding is that this is an area of ongoing research, but even a program that generates code for a subset of a Object-Z specification can save a lot of time.
Example research: http://www.jot.fm/issues/issue_2008_11/article6.pdf
comment 13y ago · link · parent
This invalidates my assumption that a shop like Intel probably uses formal verification in firmware development.
Its also scary to consider how many very important (nuclear/damn control, etc) systems while themselves might be formally verified are dependent on services of lower level software (OS, drivers) and hardware (firmware) that are not...
comment 13y ago · link · parent
Need to make your huge app faster?
1. Have a well structured, correct design.
2. Optimize IO (file, network, database, etc)
3. Minimize in memory usage and copying
4. Replace your algorithms with ones with better runtime complexity characteristics.
5. Verify the granularity of your multi-threading.
A. To big of "chunks" will lead to under utilization
B. To small of chucks will lead to excessive communication overhead.
6. Replace the 10% most executed portion of your program with java native method, cGo function, C/C++ inline assembly, SSE instructions, etc etc.
7. Analyze your program for cache sizing and interactions.
Ideally the application should be profiled between every step, don't be afraid to branch.Like fleitz said, don't skimp out on the hardware, but at the same time hardware improvements do not typically result in the same kind of multi-order of magnitude improvements that software changes do. But they are easier and cheaper and should be considered low hanging fruit. If performance is really the bottom line, running on non-virtual/phsyical hardware can help make some page table/hypervisor issues go away- as un-hip as that is.
comment 13y ago · link · parent
comment 13y ago · link · parent
When I read the title I thought maybe Ken Thompson's compiler hack was Go (golang), which he co-created, and I was going to hear a bunch of Python or Node fans talk about why Go is not a threat :)
comment 13y ago · link · parent
Even if that is the case, it seems like he should have been able to read how other people would read his comment. I'm not sure I buy it.
comment 13y ago · link · parent
But I think it comes down to people who hate JS lamenting it escaping from client side into the server side.
comment 13y ago · link · parent
if _, err := ioutil.ReadFile(path); err != nil {
return nil, err
}
Then I realized, programmers as detailed people are easily annoyed, because small details often matter. But in both the case of the author, and myself here, we need to realize when it truly doesn't matter.Sure these Go behaviours might annoy him, but they are important for large code bases and are easily worked around. Sure, repeating am overly verbose block several times annoys me, but the seven extra lines of code does not make him unreadable or incorrect-
Here is too not sweating the small stuff.
comment 13y ago · link · parent
...
ch := make(chan int)
defer close(ch) //I can timeout later if I want
go consumer(ch)
...
//I timeout down here and return
}
func consumer(input chan int) { //I will terminate when the input channel is closed
for x := range input {
fmt.Printf("I got %d!\n", x)
}
}comment 13y ago · link · parent
A program written in Go can deadlock, but the runtime detects deadlock and terminates the program, so at a system level, it does not deadlock.
P.S. "No locks at all, hence no deadlock", is this not true, any system with blocking operations can deadlock. You can construct a Go program that only uses channels and get it to deadlock...
comment 13y ago · link · parent
"and the decay heat from these products requires continuous cooling for weeks even after core shutdown. That cooling process also must be human managed and actively powereed."
My understanding is the reactors currently under construction in the US are being built with passive fail-safes that make them much safer than the 1960s/70s reactors. Is this incorrect?