Programming thread

  • 🔎 If you see an alert for analytics.usips.org, this is a self-hosted system I am running as a test. It is GDPR compliant and collects no invasive information.
  • Want to keep track of this thread?
    Accounts can bookmark posts, watch threads for updates, and jump back to where you stopped reading.
    Create account
Instead of writing a tree in some abstract language why not work with the machine as it is?

If it was practical (it's almost certainly possible) to automagically go from arbitrary semantics to machine-optimal code sure fine do it. But ECS is right there.
If I want a performant tree implementation, assuming binary tree, i'd just use a linear array. If its a tree with arbitrary many nodes, i'd still use a linear array but store the links to the child nodes as index and count, with some padding, between the various lists of child nodes to allow for growth if necessary (and move the nchild odes within that array if it outgrows the space available for it). Though, i guess this could end up necessitating resguffling the lists of childnodes at some point if they grow to be too much like random accesses.

Source: I barely know anything about proper optimization, so please correct me if I stated anything wrong
 
Source: I barely know anything about proper optimization, so please correct me if I stated anything wrong
You're actually onto something, I use this trick in my own AST to have a uniform layout of links and to avoid pointers for easier serialization
 
Everyone knows this is the best:

View attachment 9272554
LMAO
This reminded me of a submission I graded where students had to write a simple bash script and the school's servers went down the night it was due. This one student was on Windows and instead of using WSL, cygwin, literally anything else- he types it up in DrJava. Couldn't run it obviously, just submitted it and prayed it worked and informed me in the comment box of what he did and why. The formatting was horrendous.

I did send him an email asking if he was okay and informed him of alternatives in the event that the servers go down again. DrJava though?????? The students are creative! He was a good kid and regularly reached out for help after that. Called him Dr Java for the rest of the semester though.
 
You're actually onto something, I use this trick in my own AST to have a uniform layout of links and to avoid pointers for easier serialization
It’s an array backed heap.

ECS lets you do this too; a component array could just be parents. Scanning it is so fast in cache finding children is far faster than a single pointer chase.

And yes I’d you have fixed children/arity you could have a component array of a fixed wide holding n handles for child nodes etc.

It’s still just a stack of arrays. The api can make it look like a super fast tree to end users.
 
Anywho, does this mean you enjoy malware analysis too?!
No. The closest I've got is understanding the behaviours of some old machine code programs distributed in magazines as hexadecimal, without running them beforehand. The next targeting of my little machine code development tool, using a very different design, is 6502.

Modern machine codes are a fucking mess with hundreds or thousands of instructions, and processors from the same batch don't behave consistently like they did in the old days, all of which makes them much less interesting to me. Intel and AMD have made an impressive clusterfuck. Still, I may walk up the ladder to get closer. I've got a routine I want to write in machine code, as a demonstration for some planned work, but it'd be a better use of my time to tweak an Ada subprogram until GNAT generates the machine code I want, as an example.
 
Using multiple different gates is cheating. Do it all with NAND gates like you're supposed to.
Modern machine codes are a fucking mess
A few years ago, like 20+ I designed some stuff with PIC 12F and 16F processors. The first thing I did was print out the assembly manual. Not nearly as simple as 6502, but still fun. Reading the ADC in interrupts with yields so you could bit-bang async serial because you felt that using a chip with both an ADC AND UART would be too easy was fun.

That project a second PIC read the serial data and displayed it. Now an RP2040 could do the ADC and display it on a full color screen with touch controls and have enough cycles left over to do a web server for remote access to the data.
 
Last edited:
I fucking LOVE Odin.

The syntax is so nice. Creating interfaces for C libraries is easy. Batteries included for all the libraries I use anyway (SDL, Box2D). Compiles fast. No package manager shenanigans. The community doesn’t seem as pozzed as Rust or insane.

Remind me in a year and I’ll tell you all about how Odin sucks and it’s the worst language in the world, but right now I’m in the honeymoon phase.
 
Remind me in a year and I’ll tell you all about how Odin sucks and it’s the worst language in the world, but right now I’m in the honeymoon phase.
The language is created by a NAZI CHUD!!!
1784566925341.png
Source
References this article: Archived
The article first goes over some Wikipedia edit conflicts and Bill's Xitter posts.
From there on it's about hecking unsavory political opinions.
I know that as of now, GingerBill follows: Matt Walsh, Tucker Carlson, Jordan Peterson, The Babylon Bee, Dave Rubin, Tim Pool and Libs of TikTok.
The author then leaks his clitty on Libs of TikTok and calls Matt Walsh a white supremacist.
GingerBill called Andrew Kelley a communist and then refused to elaborate it.
I can only assume that GingerBill called Andrew Kelley a communist due one of his proposals being the organization of labor unions as a way to fight software deterioration, if that's the case, then GingerBill is cartoonishly more simple minded than I would expect, challenging the likes of a McCarthyist propaganda poster.
GingerBill's politics are quite simple: he doesn't like being challenged or having people telling him what to do. It's the mindset of a libertarian eternally stuck at 14 years old.
Wikipedia is a well-made system
Nigger
 
Does this have a free play or sandbox mode?

Honestly, I have been wishing for a free-form electrical engineering/logic gate/whatever simulator for years, anything better than Minecraft, to make little computers in. Any sims that resemble "real life" always look like they were ripped straight out of the 90's and are unusable trash.
I fucking LOVE Odin.

The syntax is so nice. Creating interfaces for C libraries is easy. Batteries included for all the libraries I use anyway (SDL, Box2D). Compiles fast. No package manager shenanigans. The community doesn’t seem as pozzed as Rust or insane.

Remind me in a year and I’ll tell you all about how Odin sucks and it’s the worst language in the world, but right now I’m in the honeymoon phase.
I like it a lot, for a lot of reasons. I always find very simple languages like C to be the best solution to most problems, but also inherently imperfect due to some bad, historical syntax decisions made 50 years ago. The fact that Odin didn't exist sooner is what blows my mind. A "better" C language that isn't bogged down by having a heavy/significant run-time and is more than a toy language is like a dream.

The language is created by a NAZI CHUD!!!
View attachment 9298308
Source
References this article: Archived
The article first goes over some Wikipedia edit conflicts and Bill's Xitter posts.
From there on it's about hecking unsavory political opinions.

The author then leaks his clitty on Libs of TikTok and calls Matt Walsh a white supremacist.




Nigger
I always had a good feeling about Bill, but I didn't know he was one of us. My respect and admiration for him has gone up.

As a general rule, I've found anyone who is dedicated to "craft" and improving real quality of life is usually conservative - something about conservatives caring about quality of life, aesthetics, etc. while lefty types are jealous, spiteful mutants who hate good and beauty? "Decline is a choice" type vibes.
 
They'll claim to know five languages—say C, C++, Python, Java, and JavaScript—without understanding how these are really just the same language five times with ultimately minor differences.

yeah bro these two low level langs that compile to machine code are basically the same as the one that runs on the JVM lol
also these other two scripting languages that run on interpreters and in browsers are just like that too haha

bill.jpg
 
The language is created by a NAZI CHUD!!!
View attachment 9298308
Source
References this article: Archived
The article first goes over some Wikipedia edit conflicts and Bill's Xitter posts.
From there on it's about hecking unsavory political opinions.

The author then leaks his clitty on Libs of TikTok and calls Matt Walsh a white supremacist.




Nigger
Only tangentially related, but I think the hostility that Rustroons have to other languages has slowed down its adoption. I see snippy LinkedIn posts from Rust evangelists, whining about how not everyone is using uv yet, even though uv is Written In Rust and is Therefore Just Better. Never mind that Python is a fairly old language, and even though it has a lot of parts that suck, lots of business software depends on it and there are tens of thousands of people who know how to work around the warts from shit like conda and poetry in their sleep. No, that doesn't matter. You need to be using the Rust thing!
yeah bro these two low level langs that compile to machine code are basically the same as the one that runs on the JVM lol
also these other two scripting languages that run on interpreters and in browsers are just like that too haha

View attachment 9298676
I briefly considered going into front end about a decade ago, but after the second or third doc page on MDN that basically said "the ECMAScript standard says it should work like this, but each browser + Node does it its own way" I decided fuck that. And that's just the tip of the iceberg of JS' bullshit. Horror language.
 
yeah bro these two low level langs that compile to machine code are basically the same as the one that runs on the JVM lol
Correct. I call them C-flavoured ALGOL clones. They're more similar than dissimilar when contrasted with a truly different language, such as APL or Prolog.
also these other two scripting languages that run on interpreters and in browsers are just like that too haha
Implementation matters much less than this implies. I'm closer to arguing it matters in no way to this particular discussion than at all.
 
Something that kind of grinds me gears about new languages is that so many of them are just custom syntax + LLVM
Like the barrier to entry for making a compiled language is super low now and it's kind of uninspired
 
yeah bro these two low level langs that compile to machine code are basically the same as the one that runs on the JVM lol
also these other two scripting languages that run on interpreters and in browsers are just like that too haha

View attachment 9298676
In fairness, all of them are "the same" in that they're built around sequences of statements (resolved and arranged at varying times with varying complexity.) Something like Prolog, Forth, or Haskell is a lot more different from all of those than any of them are from each other. In the big scheme of languages, all of the ones people actually use are pretty similar.
 
Back
Top Bottom