[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y ] [Home]
4chanarchives logo
golang
Images are sometimes not shown due to bandwidth/network limitations. Refreshing the page usually helps.

You are currently reading a thread in /g/ - Technology

Thread replies: 16
Thread images: 2
File: go.jpg (23 KB, 354x241) Image search: [Google]
go.jpg
23 KB, 354x241
is Go a meme language? ken thompson created it, which makes me want to learn it. but im also afraid development on the language could try up at any second
>>
its good shit my nigga
>>
Go is pleasing in a lot of ways.
It's easy for CS freshmen to pick up because the language is so goddamn simple.
It's nice for experienced programmers because much like Scheme, you can hold the entire spec in your head. Beyond that, not only is the compiler self-hosting, but packages related to parsing the language exist in the standard library and are the same ones the compiler itself uses. Writing assembly and calling between C and Go is as easy as piss (and you can also call between Go and C++ or Objective-C if you're into masochism). The entire thing just feels very clean, very self-contained, and very comfy. [spoiler]the one really messy part is the implementation of the syscall package[/spoiler] But I could shill for hours. It's something you really have to experience for yourself.
>>
It's being used by huge corps, it's not going anywhere soon
>>
File: 1459300814132.gif (498 KB, 320x240) Image search: [Google]
1459300814132.gif
498 KB, 320x240
>>53846058
splendid post m8
>>
>>53846058
nice.

the reason i really like C is because i can fit the entire language in my head. those are my own words. when i read that one of the creators literally used the same words as me to describe this language, i knew i had to at least check it out. it was also attractive that the name of this language didn't end in *.js.

ive been playing around with it over the weekend. goroutines and channels are kind of cool, but the C programmer in me wonders about the overhead of creating and calling a pthread and keeping the channel open.

the binary size is also bigger than i expected. a "hello world" binary is 2.2MB. im guessing that golang must statically link all of their libraries, since a "hello world" c program would probably be like 10KB. i suppose there's also garbage collection logic bolted into every go program, too.
>>
>>53846872
Goroutines aren't pthreads. They multiplex onto OS threads, sure, but they're much, much cheaper.

And yes, everything is statically linked and includes a garbage collector. glibc is actually so bloated that a static C "hello world" on the average Linux system is like 3.6 meg.
>>
If you like speed, expressiveness, or safety especially with regards to threading, Go is not the language for you.
>>
>>53844219
It's a C clone. I want it to replace C outside of kernels.
>>
>>53848623
>static C "hello world" on the average Linux system is like 3.6 meg
Not quite

$ echo 'int main() { puts("hello"); }' >test.c
$ gcc -static test.c
test.c: In function ‘main’:
test.c:1:14: warning: implicit declaration of function ‘puts’ [-Wimplicit-function-declaration]
int main() { puts("hello"); }
^
$ ./a.out
hello
$ size a.out
text data bss dec hex filename
726158 7572 9016 742746 b555a a.out
$
>>
There are zero Go jobs available in my region when there are even a few Haskell and F# jobs available. There are even a few Swift jobs, which is just as new as Go.
>>
>>53848840
>ignoring warnings
pls
>>
>>53848909
>muh jobs
>>
>>53848840
Try printf("hello %s\n", argv[0]). The benchmarks I recall involved explicit printf like that that couldn't possibly be optimized into puts.
>>
>>53849886
% cat test.c
#include <stdio.h>

int main(int argc, char *argv[])
{
printf("hello %s\n", argv[0]);
}
% gcc -static -O3 -o test test.c
% size test
text data bss dec hex filename
717786 7284 8824 733894 b32c6 test
>>
>>53850003
Ah, okay. Looks like I misremembered the 3, but the .6 appears about right. Yeah, not as bad as Go with the GC included.
Thread replies: 16
Thread images: 2

banner
banner
[Boards: 3 / a / aco / adv / an / asp / b / biz / c / cgl / ck / cm / co / d / diy / e / fa / fit / g / gd / gif / h / hc / his / hm / hr / i / ic / int / jp / k / lgbt / lit / m / mlp / mu / n / news / o / out / p / po / pol / qa / r / r9k / s / s4s / sci / soc / sp / t / tg / toy / trash / trv / tv / u / v / vg / vp / vr / w / wg / wsg / wsr / x / y] [Home]

All trademarks and copyrights on this page are owned by their respective parties. Images uploaded are the responsibility of the Poster. Comments are owned by the Poster.
If a post contains personal/copyrighted/illegal content you can contact me at [email protected] with that post and thread number and it will be removed as soon as possible.
DMCA Content Takedown via dmca.com
All images are hosted on imgur.com, send takedown notices to them.
This is a 4chan archive - all of the content originated from them. If you need IP information for a Poster - you need to contact them. This website shows only archived content.