Programming thread

  • 🔧 Actively working on site again.
Yeah, stack memory due to its very nature tends to be packed closely together like that. When it comes to heap allocation, shit gets allocated just about anywhere that works.
Well, not only because of that, it's also just dereferencing a single pointer, and since the size of the array is known at compile-time, the compiler can just generate code that produces the correct offset. To get something like that dynamically, you could malloc a single flat chunk of memory large enough to hold the entire 2D array and then calculate the 2D offsets manually. Or you could define an array that holds pointers to the rows, and instead of another malloc for each row, point them at row offsets in that flat array.
 
I find the idea of something like a segmentation fault being renamed to consent accident hilarious.
I love this.

Also if you don't mind sharing or you want to save it until/if you actually make the language what else would you rename?
I haven't put a ton of thought into it yet, but I was thinking of basing it around a sense of denialism in typing where class hierarchy is convoluted because subclasses would deny any relation to the classes they inherit, implying they transitioned from a super to their new sub type. Maybe I can find ways for it to scold you if you try to violate this core policy, idk. I have some rough ideas of how I could manage it all logically as well as under the hood.

And probably just stupid stuff like rename true and false to isMan and isWoman, respectively. Also rename general exceptions to acks.

Well, not only because of that, it's also just dereferencing a single pointer, and since the size of the array is known at compile-time, the compiler can just generate code that produces the correct offset. To get something like that dynamically, you could malloc a single flat chunk of memory large enough to hold the entire 2D array and then calculate the 2D offsets manually. Or you could define an array that holds pointers to the rows, and instead of another malloc for each row, point them at row offsets in that flat array.
That's what I was alluding to, albeit phrased very poorly on my part. The packed, reasonably predictable nature of stack memory allows for such tricks. Having such guarantees regarding memory allocation in a language like C is a godsend.
 
Last edited:
I have heard good things about Odin specifically for Game Dev. I know Odin was also inspired by Jai which is made specifically for game dev by a programmer with something like 20 years experience.
John Blow and his Jai language has been the butt of jokes for years now. Dude talked about how his language revolutionizes the industry and how easy writing a compiler is and what is it? 5 years later, we still got nothing.

I'll only take Odin seriously if it gets a dedicated error type. We're supposed to go forward with language evolution, not backwards. Fucking C++ has Exceptions. Is it that hard?
 
John Blow and his Jai language has been the butt of jokes for years now. Dude talked about how his language revolutionizes the industry and how easy writing a compiler is and what is it? 5 years later, we still got nothing.

I'll only take Odin seriously if it gets a dedicated error type. We're supposed to go forward with language evolution, not backwards. Fucking C++ has Exceptions. Is it that hard?
There's no real reason for Jai to exist, its only purpose is too simplify game development compared to c++.
But some game engines like Unity already support c#, which is basically easier C++.
If you want an easier language with less control why not just use that.
 
  • Agree
Reactions: Hall of Cost Payer
John Blow and his Jai language has been the butt of jokes for years now. Dude talked about how his language revolutionizes the industry and how easy writing a compiler is and what is it? 5 years later, we still got nothing.
Tbqh I can't evaluate Jon Blow on gamedev programming because I have very little experience with it. But I like some of his opinions about things that I do know a lot about.
If you want an easier language with less control why not just use that.
Less control is bad especially for people that are experienced. Having more control allows you to do exactly what you want how you want it. I'm not that experienced and I can tell you I don't enjoy the experience of fighting a language to try and do something.

To link to what I said above Complexity is bad and you should try and have the lowest amount possible of it while still doing what you are trying to do. This is one of Jon Blow's opinions I agree with.
 
Some homeless guy I gave money to told me he's learning to program with ChatGPT.

I guess the story was meant to make me inspired but I just left slightly perturbed at the wave of competition those of us in the tech sector may be facing from LLM jockeys.
They're always going to need guys to verify the AI code output. If you hate reviewing others' code now, then God help you when the convincingly incorrect LLMs take over all low-level corporate positions :|.
 
God help you when the convincingly incorrect LLMs take over all low-level corporate positions :|.
I'm not worried, I'd rather review a convincingly incorrect LLM than illiterate pajeets kindly doing the needful and setting the project up to crash and burn 3 years down the line. An LLM has a comparable level of sentience plus the ability to learn.

I've recently decided to finally try and implement an 8086 emulator, in C instead of my usual favorite C++. Not much clue what I'm doing but so far it's been a very enlightening learning experience.
 
If you ever did make it I know a lot of people would laugh at it. I find the idea of something like a segmentation fault being renamed to consent accident hilarious.
In all seriousness this reminds me of the whole bullshit "master" controversy in computing, especially in regards to Git and GitHub. It has about as much to do with slavery as "master bedroom" or "master's in African-American Studies" and meanwhile no one thinks twice about such grisly language as "terminate" or killall and how such terms seem to endorse homicide, even mass homicide. Until computers one day "awake and realize who they are", as Harlan Ellison put it, it goes almost without saying that any sort of language involving the processes that go on in or end in them will involve coercion in some way.
 
In all seriousness this reminds me of the whole bullshit "master" controversy in computing, especially in regards to Git and GitHub. It has about as much to do with slavery as "master bedroom" or "master's in African-American Studies" and meanwhile no one thinks twice about such grisly language as "terminate" or killall and how such terms seem to endorse homicide, even mass homicide. Until computers one day "awake and realize who they are", as Harlan Ellison put it, it goes almost without saying that any sort of language involving the processes that go on in or end in them will involve coercion in some way.
The master/slave thing being replaced by parent/child doesn't bug me as much as the renaming of git's master branch. Sure, it's all a bit silly to focus on renaming that shit instead of tackling real problems, but git's case fundamentally makes no sense.

I always had the interpretation that it's like masters in music (which we still call masters), where it just means the master copy and implies it's more refined than some random dev branch. Changing this in particular because some man of melanin on fent couldn't breathe makes no fucking sense; there isn't even a tangential relationship between the two. Who the fuck woke up one morning and thought "Hmm.... Based on the name of git's master branch, all other branches must be nigger branches. This is what needs fixing in the software development scene."?

The term "robot" also has slave connotations. Someone go write an article in the NYT, quick!
Now I'm imagining a world where people use "niggers" instead of "bots" when talking about Internet spam. The return of the Nigerian prince :story:
 
Last edited:
Who the fuck woke up one morning and thought "Hmm.... Based on the name of git's master branch, all other branches must be nigger branches. This is what needs fixing in the software development scene."?
Some moral busybody who can't spend their time actually doing productive things.
 
Who the fuck woke up one morning and thought "Hmm.... Based on the name of git's master branch, all other branches must be nigger branches.
Me
1714763231062.png
 
I always had the interpretation that it's like masters in music (which we still call masters), where it just means the master copy and implies it's more refined than some random dev branch. Changing this in particular because some man of melanin on fent couldn't breathe makes no fucking sense; there isn't even a tangential relationship between the two. Who the fuck woke up one morning and thought "Hmm.... Based on the name of git's master branch, all other branches must be nigger branches. This is what needs fixing in the software development scene."?
That all had to do with the coof madness, such that leaving your dwelling for any reason was unconscionable unless to riot and loot and commit arson because some piece of shit died of a drug overdose while resisting arrest and violating every single coof restriction in so doing. JAW FLOY wasn't "staying the fuck home" (else the overdose smell would have been noticed a few days later), wasn't wearing a mask and wasn't socially distancing AND he had coof in his system when he OD'd which means he was out "killing grandma". Meanwhile you were a Typhoid Mary for wanting to exit your home.

Also I would not be surprised if changing "master" to "main" had its own death toll.
The term "robot" also has slave connotations. Someone go write an article in the NYT, quick!

c. 1300, sclave, esclave, "person who is the chattel or property of another," from Old French esclave (13c.) and directly from Medieval Latin Sclavus "slave" (source also of Italian schiavo, French esclave, Spanish esclavo), originally "Slav" (see Slav); so used in this secondary sense because of the many Slavs sold into slavery by conquering peoples.

Reparashunz for Slavs?
 
Aside from needing to free memory after malloc, what are some other issues with using malloc?
Not really sure what you'd run into, but aside from having to free it, you have to make sure you don't ever reference it after you've freed it. If you only had one reference to it, that's probably easy enough, but if you've got other pointers that point into the same memory, you've got to keep track of whether they're gone or not.
 
Aside from needing to free memory after malloc, what are some other issues with using malloc?
It's pretty rare, but malloc can fail to allocate memory. If any problems do arise, malloc and co. will return a NULL pointer; be sure to check your pointer isn't NULL before proceeding with using the memory you tried to allocate.

This fits with the more general principle that you should always check your pointers before their first use in a function. There's nothing stopping a NULL pointer from being passed to or returned by a function, and this can really fuck your shit up if you don't plan around it.
 
Back