pkill

joined 1 year ago
[–] pkill@programming.dev 3 points 9 months ago (2 children)

idk as an ADHDer I might not have a hard time learning keyboard shortcuts (i uSe VIm bTw, fr in many cases for text docs I'd rather write them using markdown and maybe add some html styling then convert with pandoc than deal with the sensory overload that RTEs can give me) I need more time to navigate solely text-based menus with lots of items than a ribbon.

[–] pkill@programming.dev 8 points 9 months ago* (last edited 9 months ago) (1 children)

20 years ago 32-bit systems, CRT monitors, dial-up modems, single core processors or HDDs with most people having 160 GB of storage at most were common. And laptop battery life and thermal performance was just ridiculous in most cases.

Moore's law is mostly dead for commercial crap, i.e. JS-heavy 3rd party spyware filled websites with comparably slow and costly backends and Electron/React Native bloat on desktop/mobile, because shorter time to market and thus paying the devs less is often much cheaper for a lot of companies.

I'd argue free software luckily proves this theorem wrong. There are still a lot of actively maintained, popular programs in C and C++ and a lot of newer ones written in Rust, Dart or Go.

[–] pkill@programming.dev 1 points 9 months ago

I'm using a sligntly modified Niro layou (in a way that makes it more ergonomic with vim). Though I might need to adjust it since lately I began feeling disproportionate strain on my right ring finger.

[–] pkill@programming.dev 2 points 9 months ago

syntax is pretty neat but if OP wants something with similar syntax that performs better instead of type checking unit tests alone taking more time to complete than compiling a C++ AAA game, then Elixir might be a better choice. Also it's functional approach could really provide a fun challenge. I mean, you can even see that by comparing the performance and resource consumption of akkoma/pleroma vs mastodon. Above 10k users or so you have to either scale your instance horizontally or shut it down.

[–] pkill@programming.dev 2 points 9 months ago (1 children)

I am the only person that feels like snake casing belongs in declarative stuff, data serialization etc. (SQL, protobuf, JSON, YAML...) while camel case elsewhere?

[–] pkill@programming.dev 3 points 9 months ago (2 children)
[–] pkill@programming.dev 0 points 9 months ago

why is this getting downvoted?

[–] pkill@programming.dev 2 points 9 months ago (1 children)

Rust's memory safety is much different (ownership, lifetimes, immutability). Also Rust has null safety while Go doesn't. Go has some uninitialized variable use protection, but you can still screw up if you do stuff like accessing a struct field that hasn't been assigned a value. In C there's much higher chance of segfaults, use-after-free precisely due to manual memory management (malloc and free, which do not exist in Go). For example earlier versions of Java and most interpreted languages of the past whilst offering memory safety, consumed a lot of system resources, making them unsuitable for performance critical things like games, drivers etc.

Then innovations in memory management and the resulting safety improvements and easier development these new languages offer allowed using them for writing performance critical code. Hope that answers your question.

[–] pkill@programming.dev 1 points 9 months ago* (last edited 9 months ago) (3 children)

In short when a program runs, it allocates memory for the data it is using. Then the garbage collector which you can think of a 'program' (though not in a strict sense, just a part of the runtime), takes care of freeing the memory which is no longer needed. In languages with manual memory management, like C or C++ it is up to the programmer to properly (de)allocate memory, which might result in issues like dangling pointers (references to already freed memory, which might cause unpredictable behavior and compromise your whole system's security) or memory leaks (gradually increasing memory usage over time in absence of user action that would prompt that, like e.g. opening more and more browser tabs, which is also partly why in the past you've often had to restart your PC every once in a while to free some trashed memory. In Go most of the stuff is done by GC and only code that uses the unsafe package or relies on external resources, like reading a file or database connection needs to have programmatic termination of access to these (usually by calling something like defer db.Close() ).

Also Go is a nice balance between low and high level, one of such examples is the use of pointers. They might be complicated for most beginner coders, but in reality there is seldom any use of uintptr, double pointers and even slice (list) pointers, but it has a tremendous performance amount since when you do some operation, especially loops where without a pointer you would copy the data you're iterating through by value instead of just it's memory address.

Which is especially important with large sets of data, where 160 bytes might seem miniscule with one call, but if you loop over 1 million records, that's 160 MB (for example in some database used by municipal authorities of a large city). That's one of the reasons some databases like CockroachDB were written in Go.

[–] pkill@programming.dev 4 points 9 months ago* (last edited 9 months ago) (5 children)

static linking is probably the word you're looking for

also one of the most efficient garbage collectors

view more: ‹ prev next ›