Programming thread

  • 🐕 I am attempting to get the site runnning as fast as possible. If you are experiencing slow page load times, please report it.
You should really work on your bait detection strategies.
you should really work on your point making strategies because they are almost indistinguishable from your bait
The things you need to do just to get what rust gives you by default is insane. Just use a gorillion third party tools to make up for what the compiler should be doing.
and yet rust projects also use stuff like fuzzers, because rust can't protect against a myriad other errors like hangs and some retard hitting > instead of < in an edge case of an edge case
good software development practices will always be more good at preventing bugs than any compiler you can think of
i bet if you subjected the average rust program (and its hundreds of libraries, since we really need that "high developer velocity") to sqlite standards you would find hundreds of nasty bugs (and even some vulnerabilities) before you could say "muh borrow checker"
Sqlite3 is the prime example of good software development practices with C so posing a challenge to find buffer overflows in it is clearly in bad faith, even so, let me direct your attention to two memory safety bugs in sqlite3 that rust would have prevented, from just this year.
https://nvd.nist.gov/vuln/detail/CVE-2025-3277 https://nvd.nist.gov/vuln/detail/CVE-2025-29088 The average C program is nowhere near as robust as sqlite3 is, very few C projects even reach that level, but even when they do, they still have the same flaws that just happen to manifest everywhere C is used.
one of these is in some internal interface that probably wouldn't be that exploitable, and the other one is the single other bug of such nature i can find on sqlite's cve page, and is actually kind of bad. you got me
but this just proves that it's not completely impossible to write a very large c program that does all sorts of string and buffer handling without having a new cve every month

and i will not even talk about all the stuff that c++ has so you can easily write memory-safe programs. wow this Box<T> shit is such a neat feature, if only c++ had this...

anyway, if rust was such a perfect replacement for c, i'd think stuff like sqlite3 and openbsd, these projects full of very security-minded individuals, would be a lot more enthusiastic about it. since they aren't, it's the job of rust supporters such as yourself to figure out why (and it's not solely gay political forces at work here, i know for a fact that most c programmers would absolutely love a better c (and to these people, rust is not a better c))
 
Yeah but sqlite is christian software and therefore written by God acting through men.

rust programmers are godless troons and thus incapable of such a feat.
And funnily enough, since LISP was a topic of the thread a couple of pages back, CLISP has a menorah as its icon:
1750050228705.webp
 
Last edited by a moderator:
Not really programming, but I wrote a GUI oriented PowerShell script for large address aware executable checking and patching as a little exercise.
Code:
Add-Type -AssemblyName System.Windows.Forms
$FileBrowser = New-Object System.Windows.Forms.OpenFileDialog -Property @{ InitialDirectory = [Environment]::GetFolderPath('Desktop') }
$null = $FileBrowser.ShowDialog()
$filepath = $FileBrowser.FileName
$wshell = New-Object -ComObject Wscript.Shell
if ((Test-Path "$filepath") -eq $false) {
    return
}
$bytes = $bytes_laa  = [System.IO.File]::ReadAllBytes("$filepath")
if (($bytes[0] -ne 77) -and ($bytes[1] -ne 90)) {
        $wshell.Popup("File is not an executable.",0,"Error",16)
    return
}
$laa_flag = $bytes[150]
if ($laa_flag -eq 15) {
    $Output = $wshell.Popup("Binary is not large address aware. Do you wish to patch it?",0,"Question",4+48)
    if ($output -eq 6) {
    Move-Item "$filepath" "$filepath.bak"
    $bytes[150] = 47
    [System.IO.File]::WriteAllBytes("$filepath", $bytes)
    $wshell.Popup("Binary has been patched to be large address aware.",0,"Information",64)
    }
}
if ($laa_flag -eq 47) {
    $wshell.Popup("Binary is already large address aware.",0,"Information",64)
}
Primitive, uncommented, but does what it's meant to do. Also, a CLI version:
Code:
$wshell = New-Object -ComObject Wscript.Shell
if ((Test-Path "$args") -eq $false) {
    Write-Host "No such file found, exiting..."
    return
}
$bytes = $bytes_laa  = [System.IO.File]::ReadAllBytes("$args")
if (($bytes[0] -ne 77) -and ($bytes[1] -ne 90)) {
    Write-Host "File is not an executable, exiting..."
    return
}
$laa_flag = $bytes[150]
if ($laa_flag -eq 15) {
    Write-Host -NoNewLine "Binary is not large address aware. Do you wish to patch it? (Y/N): "
    $selopts = @('Y', 'N')
    while (($selopts | Where-Object { ($_ -ne $null) }) -notcontains $sel ) {
        $sel = [string]$Host.UI.RawUI.ReadKey('NoEcho, IncludeKeyDown').character
    }
    Write-Host $sel.ToUpper()
    if ($sel -eq "Y") {
    Move-Item "$args" "$args.bak"
    $bytes[150] = 47
    [System.IO.File]::WriteAllBytes("$args", $bytes)
    Write-Host "Done"
    }
    else {
        Write-Host "Exiting..."
    }
}
if ($laa_flag -eq 47) {
    Write-Host "Binary is already large address aware, exiting..."
}
 
Speaking of Rust vs C, I'm learning C as of today. Should I learn it alongside C++, or learn C++ after I have a solid understanding of C?
C and C++ are two different languages
learn C first as it's infinitely simpler
then learn C++ since it borrows only a few things from C

the biggest difference is that in C++ theres not much manual memory management from what I know thanks to std::unique_ptr and std::shared_ptr
C doesn't have that, all you have is [cm]alloc, free, raw pointers and only structs (and unions)

also compile times are much faster (g++ is slow at least with mingw from winlibs on windows)

Rust is way closer to C++ than to C
modern C++ is somewhat closer to Rust than C, except the compilers arent sperging about everything
 
the future of programming is in X, because real software needs real guarantees
This is patently retarded if you know fuck all about the history of programming because these "real guarantees" are older than most of the languages spoken about in this thread. See Ada, formal verification, Prolog, math languages, Lisp, ad nauseum.
 
C and C++ are two different languages
learn C first as it's infinitely simpler
then learn C++ since it borrows only a few things from C
It's both true and untrue. Your C++ code should look vastly different than C, however to truly write good C++ code you should good get grasp how C works.
the biggest difference is that in C++ theres not much manual memory management from what I know thanks to std::unique_ptr and std::shared_ptr
C doesn't have that, all you have is [cm]alloc, free, raw pointers and only structs (and unions)
And that's the reason why. You want to learn RAII and apply it to things you do. Sure you can get far with std containers and smart pointers. But you should be able to write your own resource management classes. And often it means that you write very C-like code.
Modern C++ is very similar to Rust. But it quirks and inconsistencies are because C++ is (((almost))) superset of C.

Focusing on modern C++ is imho detrimental to learning.
Speaking of Rust vs C, I'm learning C as of today. Should I learn it alongside C++, or learn C++ after I have a solid understanding of C?
That's why I think learning C before C++ is imho always good decision. Afterwards you can learn RAII, move semantics etc. And it will make more sense.
 
That's why I think learning C before C++ is imho always good decision.
I think learning C first should be a standard. Is it hard? Yes, but C is the granddaddy of all the modern programming languages. Master that, and the rest should come easy.
 
  • Like
Reactions: ADHD Mate
I learned straight C a decade later than C++ (gay C?), which was taught in my undergrad. Admittedly, I learned Turbo Pascal (ie. Object Pascal), Java, and x86 ASM before either. The best language to learn is the language you're most interested in learning--for whatever reason. But I'd stick to one language at a time; at least get a project to "works well enough" state before starting another.
 
I need a hecking fastest language!
Does SEVEN consecutive round trips to database to gather data from different rows of same table.

Yeah, I don't think Rust can solve real issues in software development.
99% of the performance in a lot of programs is io, so a shitty slow interpreted language can end up being ten times as fast as a "blazingly fast" rust program if it's smart about high-latency transactions and properly colludes with the host operating system
I think learning C first should be a standard. Is it hard? Yes, but C is the granddaddy of all the modern programming languages. Master that, and the rest should come easy.
not quite, a good programmer should probably also learn lisp, the mother of all the modern programming languages
there are many valuable things to learn from both languages
there's probably a bit of value in learning weird shit like prolog too
 
"If C is so good, why is there no C 2?"
C 2:
View attachment 7516024
"So, there was a nigger, who came up with this idea:(...)"
If Terry had used "kike" instead, would people think he was namecalling Stallman instead? Because I feel like that would improve the comparisons (White men doing good things, and Jews doing overly complicated things, and the "niggerlicious" being more akin to Indian tech). The so called John Von Neumann machine seemed to have its start on German WWII tech.

Hrm, whatever - food for thought; maybe "don't fix what's not broken". I do miss Terry Davis, that's for sure!
 
Random: is there seriously not one single implementation of XPath 2.0 or newer for C/C++, except a proprietary library written by the one guy who wrote the XPath spec?
https://www.saxonica.com
And even that seems to be transpiled from Java (!!)
xml is a shitty clone of s-expressions and it kind of sucks, but it's not quite as niggerlicious as all the people who are now reinventing s-expressions again because they don't like xml
xml documents themselves are mercifully easy to understand and parse but there's a bunch of weird specifications everywhere around it, and the namespace shit feels a bit overengineered
I’ve decided to learn COBOL
enjoy fixed point arithmetic, business-oriented stalker
 
xml documents themselves are mercifully easy to understand and parse
Yes and no, there's a lot of extraneous horseshit in the spec, and you run into this behavior regularly, which is, in part, why JSON is replacing it in a lot of data serialization contexts.

This is a place where I have felt significant corporate pain. The MS Office and MS Visual Studio groups had their own, non-interoperable XML specifications (was working with Sharepoint 2013 at the time; Microsoft specified data queries in Sharepoint using an XML dialect called CAML) and it required weird monkey patching to make them work together. Boss hated when I'd spend time to make my life easier in the long run, which required doing things like this. He'd been basically a nocoder for a decade or two. Horrid workplace unless you know how he likes his cock sucked.

XML seems straightforward because most programmers worth a hoot has tried their hands at doing HTML, usually when young.
 
Back