pillaiindu

pillaiindu

Are garbage-collected languages good for system programming?

I have heard many times that languages with a garbage collector aren’t great for system programming. Today I saw a book titled “Hands-On System Programming with Go”.

Is Go or any other garbage collected language good for system programming? What are the pros and cons of using a garbage collected language for system programming?

Is the development of Docker (which is developed in Go) considered as system-programming? Or does system programming only mean developing things like Kernel and other low level things etc.

Most Liked

OvermindDL1

OvermindDL1

It’s not necessarily overhead in some terms. Some GC’s try to keep memory low, often using things like stop-the-world collection or eating up another thread needlessly to keep it down. Some GC’s try to keep pauses minimal (like Go) so their memory can grow unbounded in many situations (and low pause is not no-pause). Python is interesting as most of its memory allocation is handled by smart pointers so they get evicted immediately, but it still has a loop scanner that runs on occasion for when people make memory loops. Many/most GC languages also don’t let you control when memory is released, or even from where you can get the memory in the first place, which is extremely important on some arch’s.

In short, GC’s just add some cost to a program that you generally don’t want on system languages. As well as GC’s only handle the resource known as ‘memory’, other resources like file or socket handles, PIN access, etc… still have to be done either manually, or if the language allows some kind of finalizer then you can let the resource be GC’d “eventually”, which is really bad on some resources.

Having a language that can handle any resource with no runtime cost is preferred.

AstonJ

AstonJ

I think it’s because of the overhead impacting memory and performance. Languages like C and Rust operate much closer to the metal, so trade convenience and features for speed and performance.

I don’t have much experience here so maybe @OvermindDL1, @NobbZ, @Qqwy or others can offer a better explanation :smiley:

pillaiindu

pillaiindu

Thank you @OvermindDL1 for the insights! :heart:

Where Next?

Popular Backend topics Top

New
New
New
First poster: bot
The Emerging Architectures for Modern Data Infrastructure. Five years ago, if you were building a system, it was a result of the code yo...
New
DevotionGeo
How Dgraph was running out of memory for some users, and how Go’s Garbage collector wasn’t enough, and Dgraph team used jemalloc to manag...
New
AstonJ
Inspired by this post by @stefan.jarina, I’m curious about the kind of Bash scripts you’ve written and whether you still use Bash given t...
New
Jsdr3398
I love how elixir works and some of its perks, but I’m still pretty uncomfortable, especially when mix/hex gets involved. Did anyone els...
New
kelvinst
I have being some Elixir open-source contributions and side projects. Oh, and I’m doing them on livestreams on my twitch channel, follow ...
New
OvermindDL1
Woooooooo! This is such a huge release for it, and 2 years incoming! In short, the library is now using an updated hyper backend (not j...
New
apoorv-2204
I’m experimenting with Hexagonal / Clean Architecture in Elixir. The classic Behaviour + Impl split works great for mocking and isolating...
New

Other popular topics Top

AstonJ
A thread that every forum needs! Simply post a link to a track on YouTube (or SoundCloud or Vimeo amongst others!) on a separate line an...
New
New
PragmaticBookshelf
Rust is an exciting new programming language combining the power of C with memory safety, fearless concurrency, and productivity boosters...
New
AstonJ
Do the test and post your score :nerd_face: :keyboard: If possible, please add info such as the keyboard you’re using, the layout (Qw...
New
Margaret
Hello content creators! Happy new year. What tech topics do you think will be the focus of 2021? My vote for one topic is ethics in tech...
New
AstonJ
In case anyone else is wondering why Ruby 3 doesn’t show when you do asdf list-all ruby :man_facepalming: do this first: asdf plugin-upd...
New
AstonJ
Was just curious to see if any were around, found this one: I got 51/100: Not sure if it was meant to buy I am sure at times the b...
New
PragmaticBookshelf
Author Spotlight Jamis Buck @jamis This month, we have the pleasure of spotlighting author Jamis Buck, who has written Mazes for Prog...
New
First poster: bot
The overengineered Solution to my Pigeon Problem. TL;DR: I built a wifi-equipped water gun to shoot the pigeons on my balcony, controlle...
New
AstonJ
If you’re getting errors like this: psql: error: connection to server on socket “/tmp/.s.PGSQL.5432” failed: No such file or directory ...
New