Programming thread

  • 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
It took me twenty five years of programming, with a decade or so of that being professionally, before the design of Lisp actually percolated into my brain. It took me developing a program that was deterministic and homoiconic in Prolog before it clicked that Lisp would have been superior, as I'm not using any of the non-determinism that Prolog is designed to provide. Now I firmly believe that "we've been doing it all wrong" in providing a multitude of operator conditions, like infix, postfix, et cetera. I think theoretical mathematics would do well to backport a consistent operator design into its theory. I believe it would make a lot of the awkward constructs mathematicians wrangle a lot more approachable. (But I'm mostly recapitulating the Metamath guys here.)

Almost all of today's Lisps focus on being run-time engines, but there's a really underserved niche for non-interpreted Lisp-like compiled languages, ie. without eval. There are some hints in this direction like Stalin Scheme and Chicken Scheme but these keep the interpreter.
I like lisp because code is data
You can write a lisp parser, and just load in the AST and snoop it, or you can evaluate it
It can be a scripting language, a data format, a preprocessor, you can compile it to bytecode, JIT compile it into assembly, or even regular compile it to assembly
It's ludicrously flexible, and you can write a program to parse lisp source into AST in very little time
 
A strategy you have these days is asking an LLM to explain it to you. Reading APIs is a skill. Learning it takes time and practice. Just keep on keepin' on.
IMO haskells API docs ( https://hoogle.haskell.org/ ) is top tier. You can just search for any function signature and find whatever you need, most likely.

But I disagree with you there a bit. LLM's are great for pointing you to the relevant API docs. Do NOT trust the LLM to actually explain the doc to you, but rather read the docs yourself, then, maybe, ask the LLM whether your understanding seems correct.
 
But I disagree with you there a bit. LLM's are great for pointing you to the relevant API docs. Do NOT trust the LLM to actually explain the doc to you, but rather read the docs yourself, then, maybe, ask the LLM whether your understanding seems correct.
I don't even disagree with you here. Just trying to find a bridge that might work is all. I agree with your position here. That said, LLMs have gotten really good at code lately. Gemini now beats the pet inadequacy I'd been using to test LLMs with. Gotta find a new one...

Anyhow, the notion is pretty foreign to me, as someone who self-taught at the beginning using Microsoft's QBASIC documentation. But I don't know many people who learn from docs like I do, so I'm probably the wrong guy to be commentating. Nevertheless, LLMs remain a useful resource for learning because they can get it right sometimes.
 
but it will run on any unix-like system with bash (even old versions like 3.2 on mac) and some sha256 checksummer.
Boom, fully dash compatible.
Bash:
(
        s="89a1b14a083c792c80b4e0ad9e223dbf_6974d89d"
        d=16
        n=45300
        target="$((1 << (32 - $d)))"

        until h=`printf "%s%d" "$s" "$n" | sha256sum | cut -c1-8` && [ $((0x$h)) -lt "$target" ]; do
                n=$(($n+1))
        done

        printf "%d\n" "$n"
)
Now you can solve it on your fucking toaster with busybox.
 
Last edited:
LLMs remain a useful resource for learning because they can get it right sometimes
I use Claude Code a lot for grunt work, go here refactor this, read all the code design 4 API options to refactor into, search the internet for x and compile a report (more reliable than using only its training data), build a prototype x from this document and then use it to define the APIs and data models up front so I can decide the best course, etc you can gain a lot of productivity doing this. It's viable to let it do the coding for real but you can't let it decide things, you always have to read every line of the change log and make corrections.
 
LLMs remain a useful resource for learning because they can get it right sometimes.
The number of times they get it wrong far outnumbers how often they get it right, so just RTFM yourself. Using it to find relevant sections of documentation is fair, especially considering how horrible people are at naming things, but past that point you should be reading it yourself. If it's good documentation you can understand it without an AI reading it to you; if it's bad documentation then the AI won't be able to "understand" it well enough to turn it into good documentation

It's viable to let it do the coding for real
The last few times I've messed around with AI it insisted every single time that you could return array types from functions in C, even coming up with its own niggerlicious syntax for it. I don't even know where it pulled such an idea in the first place (maybe some man page that uses puedo-C syntax) but that alone is enough to convince me it has no business doing anything outside of glorified searches for me

Maybe it's better for nusoi languages (jeet languages), dunno. Even if it is I find it more taxing to read someone else's code than to write my own so having to read every single thing it produces to make sure it's not wiping your project sounds awful
 
The last few times I've messed around with AI it insisted every single time that you could return array types from functions in C, even coming up with its own niggerlicious syntax for it
What model? It's gotten much better since those days, it will compile and see that their are errors and go fix them, or it'll run the tests to verify everything is still working
Maybe it's better for nusoi languages (jeet languages), dunno. Even if it is I find it more taxing to read someone else's code than to write my own so having to read every single thing it produces to make sure it's not wiping your project sounds awful
I use it for C C++, it's definitely a different way of working but it can be much more efficient or if it's something you don't want to do, like a refactor that touches 10,000 lines
if it's bad documentation then the AI won't be able to "understand" it well enough to turn it into good documentation
I think it's the opposite, if the documentation is shit then why would I want to read it instead of the LLM, at least it can make sense of it potentially
 
"Samir, you checked all 10k lines to make sure the LLM didn't introduce any unintended behaviour, remove essential behaviour, and the code it produced adheres to our project's guidelines and conventions?"
"Yes saar I did that saar"
The jeet doth protest too much. What kind of a white man can't command slaves?
 
How do you guys read documentation. I just started learning apis and the docs are so fucking dense that I reread them over and over but still dont comprehend them.
I usually like going for man pages. If it's not C you probably won't have man pages to use though, unfortunately. also glibc has it's documentation in texinfo, which is even more in depth. But again, obviously it's only going to be for linux, and C.

devdocs are what I tend to go for next. That or you can have your editor set up to popup with a bit of documentation on the function you are using. But that's not great for diving into things. And it can be a bit annoying sometimes.

I should add about devdocs. you can download them, and set them up to launch in w3m in your terminal. So you don't need to have internet, or open them in a full graphical web browser. Which is how I use them.
 
Last edited:
I have started work on a Discord Archival Tool that saves all exported Discord data to a Database. I wanted to use the Go programming language as speed is my main gripe with doing exports. I am also using this as an opportunity to try to pick up on programming languages in general. I have typed out a lot of this out, with a bit of consultation from ChatGPT and a lot of reading from the examples.

Here is my script so far, all it does is get a list of servers that the user is in. This is my first working code within this programming language. I am trying to learn little by little until I can finally stop using the AI for basic documentation.

C#:
package main

import (
    "encoding/json"
    "fmt"
    "io"
    "net/http"
    "os"
    "time"

    "github.com/joho/godotenv"
)

type Guild struct {
    ID          string   `json:"id"`
    Name        string   `json:"name"`
    Icon        string   `json:"icon"`
    Owner       bool     `json:"owner"`
    Permissions string   `json:"permissions"`
    Features    []string `json:"features"`
}

var cfg struct {
    Port int `env:"PORT"`
}

func main() {
    err := godotenv.Load()
    if err != nil {
        panic(err)
    }

    AuthToken := os.Getenv("authorization")
    println(AuthToken)

    client := &http.Client{
        Timeout: 10 * time.Second,
    }

    req, err := http.NewRequest(
        "GET",
        "https://discord.com/api/v10/users/@me/guilds",
        nil,
    )

    if err != nil {
        panic(err)
    }

    req.Header.Set("Authorization", AuthToken)
    req.Header.Set("Content-Type", "application/json")

    resp, err := client.Do(req)
    if err != nil {
        panic(err)
    }
    defer resp.Body.Close()

    if resp.StatusCode != http.StatusOK {
        body, _ := io.ReadAll(resp.Body)
        panic(fmt.Sprintf("Discord API error: %d - %s", resp.StatusCode, body))
    }

    body, err := io.ReadAll(resp.Body)
    if err != nil {
        panic(err)
    }

    var guilds []Guild
    if err := json.Unmarshal(body, &guilds); err != nil {
        panic(err)
    }

    for _, g := range guilds {
        fmt.Printf("Guild: %s (%s)\n", g.Name, g.ID)
    }
}

I do not like using VSC as it takes on a lot of system resources and integrates the Go language in a manner that tried to cucked me and piss me off. I liked using Notepad++ as that didn't put me into a totalitarian system but at the cost of the freedom, I would often make mistakes.
 
Last edited:
How do you guys read documentation. I just started learning apis and the docs are so fucking dense that I reread them over and over but still dont comprehend them.
How doable this is depends a bit on how well-written the docs are, but try to get a handle on the fundamental concepts first. Good software tends to be built around a few central definitions/datatypes, and without understanding those it's going to be really awkward to use; you're not going to get far with Numpy if you don't understand what an ndarray is. Especially good documentation will have a glossary or an intro section that explains these concepts. It's similar to how in mathematics, you're not going to understand the proofs of theorems if you don't understand the definitions.

E: A better example is probably Docker. Good luck doing anything there if you don't understand the difference between an image, a container and a service.
 
Last edited:
How do you guys read documentation. I just started learning apis and the docs are so fucking dense that I reread them over and over but still dont comprehend them.
I honestly just read the code in most cases and use the documentation as a backup. Unless the project in question has really amazing documentation with multiple examples per function.
 
What's a good LLM for programming?

Not generating chunks of code but feedback/etc.
Opus, Deepseek-Code, GLM 4.7, Gemini 3 Pro, Grok Code, Qwen3-Coder, Minimax-M2.1.. I personally recommend Opus, Gemini 3 Pro and GLM as they're the best ones in the market rn (these are my personal preferences, its really up to you depending on your goals and what you wanna do).

If you want any real-time insights, go on OpenRouter and check https://openrouter.ai/rankings#categories, it displays the most popular models for a determined category on the platform every week.

But under any circumstances, don't ever use ChatGPT. The world needs to move on from that and let it burn.
 
How do you guys read documentation. I just started learning apis and the docs are so fucking dense that I reread them over and over but still dont comprehend them.
I start with their examples and get something working. I try to extract the author's intent from how they use classes and types and functions or whatever language features are on hand, to extend the example to my use case.

If I can't intuitively suss out their intentions from how they model their ideas using language features, it's either a shitty language or they're a shitty designer OR (rarely), there are actually novel concepts that I actually need to read about and educate myself on. I have no problem with the latter when I'm actually learning new concepts but that's pretty uncommon in my experience.

This feels kinda lazy and to some extent it is, but programming languages (or the better ones) are expressive. If they're just exposing an API for manipulating idk grocery store stock via some library interface, I shouldn't need to read English documentation cover to cover like a book to understand basic CRUD operations and relationships.

Now you might need to hop into sections of the documentation, and maybe even read a chapter or section top to bottom (once you've tried and failed to intuitively understand the library author's intentions), but right out the gate? Really shouldn't be necessary most of the time.

Also well written documentation should be easy to understand piecemeal like that.
 
Back
Top Bottom