Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
agentS
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
10 ms
·
31.
▲
by
agentS
13y ago
I guess you could roll your own... or use the one from the standard library: http://golang.org/pkg/net/http/#ListenAndServe
32.
▲
by
agentS
13y ago
I vaguely remembered minux suggesting a way to do this more efficiently, and dug it up: golang.org/issue/3035 Maybe it'll work for your use case.
33.
▲
by
agentS
13y ago
I believe Kernighan acknowledged that: "[snip] The depth of recursion is no more than the length of the pattern, which in normal use is quite short, so there is no danger of running out of space. [/snip]". If you're going to judge this code
34.
▲
by
agentS
13y ago
https://developers.google.com/glass/downloads/#client_librar...
35.
▲
by
agentS
13y ago
To be fair, I would rather write this: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast... rather than this: https://github.com/TechEmpower/FrameworkBenchmarks/blob/mast... (not to mention the 2 other Java files to setup the
36.
▲
by
agentS
14y ago
> Not sure how hard or efficient this would be (just using one process) as I haven't tried an app in this style in go, have only been playing with it so far. I would be really interested to see a Go server implementation that managed a
37.
▲
by
agentS
14y ago
It's worth noting that the time on the go side includes the time to run the compiler, and linker, since you're using `go run`, instead of `go build`. Not saying that's bad, just something to keep in mind when benchmark numbers are in the se
38.
▲
by
agentS
14y ago
> I do wish the documentation convention included not only a brief description each function, etc., but also a brief example. It is getting there. If you run godoc locally with tip, you will find many more examples than there were previ
39.
▲
by
agentS
14y ago
> json_decode() without the second param or with it as false will create an object for you that is typed, loosely only if you mess with it afterwards. First, let me point out that we have moved on to a slightly different topic. The tool
40.
▲
by
agentS
14y ago
Indeed JSON is not strongly typed. However, in practice, every API, every data exchange format I've ever seen or used has used JSON in a strongly typed fashion. i.e. they say "the returned object will have a key of 'foo' with a number as th
41.
▲
by
agentS
14y ago
Package encoding/json from the standard library can decode to objects ("Object" in the Java sense, "void *" in the C++ sense) like json_decode does. It also can decode directly into typed structures. An example from the documentation (you'l
42.
▲
by
agentS
14y ago
It's not as if it needs to become opaque to developers. If people need a way to introspect a SPDY connection, someone will write a tool. This is in the same vein as TCP, TLS, or DNS. Developers use these technologies all the time, and it ex
43.
▲
by
agentS
14y ago
You are absolutely correct. Indeed, it is rather trivial to do so. Pushing onto a stack is equivalent to `s = append(s, obj)`. Checking if the stack is empty is equivalent to `len(s) == 0`. Peeking at the top (assuming its non-empty) is equ
44.
▲
by
agentS
14y ago
Not sure if you know this (or anything about Go), but the go tool just uses a bunch of other programs to accomplish what it does (including git, bzr, the compiler and the linker). If you want to do your own thing, you're free to ignore the
45.
▲
by
agentS
14y ago
Or, you could have multiple projects in a single workspace... Personally, I keep 2; one for external packages, and one for ones I'm working on.
46.
▲
by
agentS
14y ago
You mean it cannot be expressed using Go's (non-existent) preprocessor. I am relatively confident that you'd be able to express it in Go (perhaps sacrificing speed, in the process).
47.
▲
by
agentS
14y ago
Considering one of the goals of the language is simplicity, I don't see how D has solved this problem.
48.
▲
by
agentS
14y ago
http://blog.golang.org/2010/07/gos-declaration-syntax.html
49.
▲
by
agentS
14y ago
I think it would be mindblowingly difficult to cause this DOS. If you think it possible, you can setup a demo on appengine. You even get to upload the source code, so you have that advantage, that you wouldn't ordinarily have. Gist of the t
50.
▲
by
agentS
14y ago
> Doesnt that just imply you can not use these types of languages in any mission critical context. No more so than with C++. There is a relatively high probability of you having left a memory leak in an average C++ server. > Monitor
51.
▲
by
agentS
14y ago
> The child process approach is viable, but in fairness you should note that shared address space provides efficiencies that the RPC approach does not. This approach is IMO quite interesting in context multi-core and certain problem dom
52.
▲
by
agentS
14y ago
It seems I wasn't clear enough; I apologize for the confusion. I fully admit that Java has dynamic loading and a security model and the Go does not. I was responding to "you can't have an app that loads plugins much less one where the app c
53.
▲
by
agentS
14y ago
> Oh, I don't know, maybe dynamic code loading or secure sandboxing of code? For instance you can compile a custom Google Go without disk IO, but you can't have an app that loads plugins much less one where the app can do IO but the plu
54.
▲
by
agentS
14y ago
> I'll start worrying if people adopt the "it's OK to reinvent some wheels" philosophy when they start building higher level frameworks in Go... I certainly don't have this philosophy, and I don't know thats its a thing amongst Go progr
55.
▲
by
agentS
14y ago
As far as I can tell, there are 2 advantages to the separated header file, implementation file pattern in C. First, you get easy documentation of a library's API, and second, the advantage that you mentioned (implementation changes do not n
56.
▲
by
agentS
14y ago
> Go codebases by non experts are peppered with magical incantation (sleeps, etc.) to avoid the dreaded "all goroutines are sleep". I'm confused. This is indicative of a deadlock, where no goroutine can make progress. Sleeps would mask
57.
▲
by
agentS
14y ago
> I try to force myself to write socket code like I did when I was 13, reading a line, parsing it, and writing its response, but that code is brittle and harder to follow than a sane set of handler functions. Do like the http library do
58.
▲
by
agentS
14y ago
To be clear, the two-valued cast I used in my example never panics. It returns (casted value, true) or (nil, false). No need to write any reflective functions. As to your example of io.ReadFull: what about it? If it gets an EOF before filli
59.
▲
by
agentS
14y ago
> With RAII types that have value semantics (ala shared_ptr) what is so difficult about memory management in C++? For me, C++ memory management becomes challenging in the face of concurrency. Particularly when you write applications tha
60.
▲
by
agentS
14y ago
Not sure what buffer overruns you are referring to, or why this case requires reflection at all. err := readMessage(reader) if n, ok := err.(net.Error); ok && n.Timeout() { // handle timeout } else if err != nil {
More ›