5 ms·
I've been writing Go for the last 18 months, and seeing it dissected side-by-side with C [0] is causing some epiphanies that I wouldn't normally get to see in d
by bbrks 10y ago
I've been writing Go for the last 18 months, and seeing it dissected side-by-side with C [0] is causing some epiphanies that I wouldn't normally get to see in day-to-day programming.
Excellent resource.
http://hyperpolyglot.org/c http://hyperpolyglot.org/c
- imagist 10y agoI find it funny that the C code is in a larger font than the Go code.
- lgas 10y agoIt is not for me.
- pitaj 10y ago> capitalized top-level identifiers are exported I saw this and thought that it's just weird and confusing. Why would someone make case-sensitivity a syntax for exports?
- liveoneggs 10y agoit's also used in erlang and haskell, which happen to also use "_" for "don't care"
- tedunangst 10y agoOne less keyword in the language, and you can tell at the call site whether it's an internal function.
- Jabbles 10y agoIts discussion of stack vs heap is not entirely accurate: // memory allocated on heap: ptr := new(int) *ptr = 7 Depending on how ptr is used, escape analysis may place *ptr on the stack. Also note that the terms stack and heap are not directly comparable between languages anyway.
- zzzcpan 10y agoThe biggest difference is that you cannot actually force Go to allocate on stack (which is the only important use case in this context), the escape analysis only works for primitive cases, but throw a higher order function into it and it fails.
- foobiekr 10y agoThe stated integer divide-by-zero behavior of golang is incorrect. Whether the process is sent a SIGFPE or not, from the programmer's experience a x/0 will cause the offending goroutine to panic with a divide by zero runtime error (integer divide by zero) which, unlike a signal, can be recovered.
- tom_mellior 10y agoOut of interest, could you give some examples of these epiphanies?