3 ms·
I’m not sure I like the word ‘register’ in that if you are singing a song you might choose to switch registers from time to time to hit all the notes whereas a
by PaulHoule 4y ago
I’m not sure I like the word ‘register’ in that if you are singing a song you might choose to switch registers from time to time to hit all the notes whereas a song is going to have certain music features consistent throughout the song.
In programming you might use different ‘registers’ in different parts of a program, but for all of the lower teachings about ‘encapsulation’, ‘information hiding’, and such programs as a whole have to have certain global invariants respected if they are going to work correctly…. Particularly when it comes to memory management!
Garbage collection is a great facilitator for encapsulation because it means you can just allocate and not think at all about deallocation. A strength of C is that each program can implement a custom optimal memory handling strategy but that’s a roadblock to reuse with libraries because any library has to adapt to the memory allocation strategy of the program as a whole.
Superficially it looks as if objects, inheritance, and polymorphism are the key features for code reuse in Java but I’d make the case that the garbage collector is more fundamental - you certainly lose some performance but neither C nor Rust has managed the feat that LISP and Java has of encapsulating memory management in a way that allows arbitrary code to work in the same runtime together.
- nerpderp82 4y agoArticle is worth a read, isn't referring to musical registers. https://without.boats/blog/the-registers-of-rust/ https://without.boats/blog/the-registers-of-rust/ https://en.wikipedia.org/wiki/Register_(sociolinguistics) https://en.wikipedia.org/wiki/Register_(sociolinguistics)
- PaulHoule 4y ago(1) I read that article, (2) I think the sociolinguistic term is derivative of the musical term or the other way around and it is the same in that you can change registers in the same document.
- JohnFen 4y agoI know this is a personal issue, but I find the use of "registers" in that article to be very confusing, because to me, a "register" is a slot in the CPU that holds a value to be operated on, or is the result of an operation. That's so deeply ingrained into my mind that I really struggle to interpret it differently.
- nerpderp82 4y agoHow about using Register Renaming to have a different set for different domains. Business registers, scientific registers, lolcat, etc? :)