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
Can you even realistically make a pure HTML / CSS website anymore?
Those tools haven't really lost any power, if you could before, you still can now. Whether you need JS depends on whether you need client-side scripting (which can be, to limited extents, handled by CSS, but don't get too niggerlicious with it, at a certain point a little bit of JS is fine, as a treat).
 
I know you probably know this but I'll start from the beginning anyways: A sample of 44 kHz is basically sampling about every 22 µs. The microphone's diaphragm (which physically exists and has mass) can't actually switch directions that fast, it is likely to be in a correlated/similar position if the sampling intervals are too short. So the microphone diaphragm position at t=0 is highly predictive of its position at t=1 (22µs later). If Sample A predicts Sample B with 90% accuracy, then Sample B provides zero new entropy. It's redundant. Look at these samples as "echos" of the earlier ones. The von Neumann whitener can't help here. It can fix bias, but it cannot fix correlation.

[...]

We basically want to listen to the mechanical movement of the diaphragm. While the force of air molecules hitting the mic is random and fast (white noise), the displacement of the diaphragm is "colored" (Red or Brownian noise). The diaphragm acts as a mechanical integrator. It takes time for it's mass to accelerate and move, so especially in this mic the physical enthropy bandwidth is far lower than 20 kHz anyways.
This reasoning appears suspect to me. How do you square this with the reality that these transducers routinely record signals well into the ultrasonics?
Yeah, this mic diaphragm argument doesn't quite sit right with me, at least from an acoustics perspective. I think the trap being fallen into here is thinking about this problem strictly in the time domain.

The lower frequencies indeed have a much more noticeable effect on the shape of the resulting wave, but this in no way makes any of the higher frequency values more deterministic. If it did, this would sorta completely break LTI system theory, Fourier analysis, and the uncertainty principle.

Also, like, how would speaker diaphragms be able to produce such high pitched tones with reasonable accuracy if a shitty little mic diaphragm (probably way smaller) can't?

We basically want to listen to the mechanical movement of the diaphragm. While the force of air molecules hitting the mic is random and fast (white noise), the displacement of the diaphragm is "colored" (Red or Brownian noise). The diaphragm acts as a mechanical integrator. It takes time for it's mass to accelerate and move, so especially in this mic the physical enthropy bandwidth is far lower than 20 kHz anyways.
How "fast" would you say the membrane/diaphragm is moving in these gifs?

Drum_vibration_mode01.gif Drum_vibration_mode12.gif Drum_vibration_mode23.gif

Are they different? All the same?
What frequency outputs do you think each would produce vs the others?

While the force of air molecules hitting the mic is random and fast (white noise)
:thinking:

Imagine it like taking 1000 pictures of a driving car with a high-fps camera. You get 1000 frames of the car, but the car is in the same spot in all of them. You haven't captured 1000 random locations, you captured one location a thousand times.
This isn't really a workable analogy when you keep thinking about the data in the frame as a car instead of a discrete set of points (pixels) with values that vary over time.

In a perfect environment, the high frequency range we discard might actually contain valuable entropy but the case of my mini PC is no perfect environment. That range is most likely full of predictable and "rhythmic" EMI/RFI garbage, so coil whine etc.. We don't want that noise, especially since it's very likely to alias into stable patterns. Von Neumann can't help us here either.
The argument about RF noise being potentially deterministic is fairly sound imo (no pun intended).
 
Last edited:
How "fast" would you say the membrane/diaphragm is moving in these gifs?

Drum_vibration_mode01.gifDrum_vibration_mode12.gifDrum_vibration_mode23.gif

Are they different? All the same?
What frequency outputs do you think each would produce vs the others?
They all move at the same frequency, but with different symmetries. So I guess they would all just be sine waves at different magnitudes? Or I guess if you model the way to the receiver, with slightly different phases as well?

Though, I have no real knowledge in that field.
 
They all move at the same frequency, but with different symmetries. So I guess they would all just be sine waves at different magnitudes? Or I guess if you model the way to the receiver, with slightly different phases as well?

Though, I have no real knowledge in that field.
If it helps at all, the vibrating circular membrane is the 2D version of a vibrating string.

You're correct they move at the same base frequency (the fundamental frequency, or "fundamental" for short), but the smaller inner waves you see in the 3rd gif themselves can be thought of as oscillating at a higher frequency than the slow up-down of the fundamental. Imagine the membranes in the 1st and 3rd gifs are pushing against a column of water. You would expect the 3rd to jiggle the water around in a much more complex and turbulent way than the 1st. That's the idea.
c1.webp c2.webp
Forgive the shittily drawn lines:
1767811361251.webp 1767811368628.webp
See how you can trace sines of different frequencies on various parts of the membrane throughout its fundamental cycle? This is how upper harmonics appear. Now consider I have only traced a few of the shitload of sine waves you could trace on these images. All of those frequencies you can trace over time "appear" in the corresponding sound wave when analyzed spectrally, including the fundamental. imo this is the most beautiful part of it all conceptually.

So it's not that the full membrane/diaphragm is moving at a uniform speed, but rather various parts of it moving at vastly different rates. Cool, right?
 
If it helps at all, the vibrating circular membrane is the 2D version of a vibrating string.

You're correct they move at the same base frequency (the fundamental frequency, or "fundamental" for short), but the smaller inner waves you see in the 3rd gif themselves can be thought of as oscillating at a higher frequency than the slow up-down of the fundamental. Imagine the membranes in the 1st and 3rd gifs are pushing against a column of water. You would expect the 3rd to jiggle the water around in a much more complex and turbulent way than the 1st. That's the idea.
View attachment 8387267View attachment 8387268
Forgive the shittily drawn lines:
View attachment 8387300View attachment 8387304
See how you can trace sines of different frequencies on various parts of the membrane throughout its fundamental cycle? This is how upper harmonics appear. Now consider I have only traced a few of the shitload of sine waves you could trace on these images. All of those frequencies you can trace over time "appear" in the corresponding sound wave when analyzed spectrally, including the fundamental. imo this is the most beautiful part of it all conceptually.

So it's not that the full membrane/diaphragm is moving at a uniform speed, but rather various parts of it moving at vastly different rates. Cool, right?
Ah, I went wrong with looking at it through the time domain only then. Which is exactly the trap you called out. Though, tbh, I still don't quite get how those higher frequency waves on the spacial domain turn into different frequencies in the time one.
 
Ah, I went wrong with looking at it through the time domain only then. Which is exactly the trap you called out. Though, tbh, I still don't quite get how those higher frequency waves on the spacial domain turn into different frequencies in the time one.
The key with the time domain is how the wave changes shape over a period of time.

Phase_shifter_using_IQ_modulator.gif Phase-modulation.gif

Any change in the wave's shape over time can be modeled in terms of periodic functions. The same type of periodic functions that make your typical phase-amplitude wave. Your brain, in a way, does the same sort of "tracing" that I did above in that it's able to recover those inner waves using a biomechanical version of a fourier transform. Without going too in the weeds, another important detail is the vectors in the phasor diagram; like how adding 2 vectors gives you a new single vector, adding 2 waves gives you a new single wave. Each phase vector, or "phasor" (not phaser), represents a single sine wave as one is taught in pre-calc with points on unit circles.
In this way, time truly serves as an additional axis through which perceivable frequencies can be introduced. If this doesn't immediately make sense, don't worry about it. It's abstract as fuck and takes a while to really click.
 
Last edited:
dude old school programmers are so goated. the things my professors tell me they did when they were in school would have my classmates pissing and shitting themselves, causing mass drop-outs. i'm told back then the computer science degree didn't exist, and most started out as mathematicians or engineers.
Anecdotal but I've read someone else say that the best programmer he ever knew was a Middle English scholar
Another problem is a sort of Kaczynskian oversocialization: for corporate code monkeys, conformity is key, Dive into any Java codebase and pleasure your eyes with all the common design patterns. There is no room for clever, simple and beautiful solutions.
The necessity for boilerplate pajeetery diminished in Java 8 and since then but, other things being equal, I'm more interested in other JVM languages
Since I learned about smalltalk lisp somehow didn't feel as revolutionary anymore. I've been dabbling with Cuis here and there (dabbling because I'm not sure what to with it in the end) and I sometimes have that dream of building the most minimal of minimal linux machines that just directly boots into a smalltalk image. Never quite understood all the talk of dead languages that live on elsewhere. The languages are right there, you're allowed to use them.
Smalltalk is bad at playing nice with the Unix world. Maybe its way of doing things is better in some respects but the Unix philosophy won and getting things done with Smalltalk tends to involve some kind of concessions made to Unix or other operating systems that base things on files instead of images, partially defeating the purpose of using Smalltalk to begin with. Look here for example (§5.1):
It's also possible to edit Smalltalk code with an external editor and load it in (at least in Pharo) but that defeats even more of the purpose. My experience is that the Pharo editor widget is merely "OK" in comparison with either of Vim / Neovim or Emacs. What makes Pharo shine is other programming tools but using an external editor will give you a painful, fragmented experience.
I dislike Paul Graham
What for?
You'll see many people ricing their emacs by adding 2482384822 packages, mostly to completely change how default emacs works but that really isn't necessary and I wouldn't recommend doing it before you actually understand bog standard emacs workflows, which in all honesty, are different from what you are probably used to, but not bad at all.
I don't use any Emacs distribution but learned only fairly basic stuff before making my own init.el replete with invocations of use-package
As a heterodox data point, Common Lisp writes just fine under neovim, but make sure to have a rainbow brackets plugin of some sort. I use https://github.com/HiPhish/rainbow-delimiters.nvim They really help you visually ascertain where you are in the paren nesting hierarchy. But if you want more of an "IDE" style experience, yeah, EMACS.
Neovim + Lazyvim will give you more of an IDE experience in general but Emacs is widely considered superior for Common Lisp (and, from what I've heard, Clojure as well)
For Emacs the equivalent package is rainbow-delimiters however out of the box the colors are quite dim as such i have the following set:
There are a number of good color themes in doom-themes, which does not require the installation of Doom Emacs. I use doom-outrun-electric and it is even better than cyberdream.nvim.
i got filtered by emacs not syntax highlighting numbers by default in c mode
I didn't know about that and I saw you got a bespoke solution here but there is also an Emacs package that does it for you, highlight-numbers
i would never want to grade for a class that taught java just because i'm so tired of hearing students bitch about java. it's always python or rust fanboys crying about java and how complicated it is. it's a prerequisite for a reason, just shut up and learn.
The alternative (if not Python) is usually C++ and C++ is substantially more complex than Java, including at the level of the absolute beginner
Can you even realistically make a pure HTML / CSS website anymore?
For most interpretations of "realistically", no. If you want to avoid a framework in front-end JavaScript I would consider at least using jQuery.
 
Last edited:
I literally am doing a website that actually works as pure html/css on the frontend. Though, I am using f# in the backend + use a bit of htmx on the frontend to enhance it
Right, and that sounds neat, but when I considered "realistically" I was thinking about things like different skill levels, prospects for employability etc.
 
Can you even realistically make a pure HTML / CSS website anymore?
technically you can make raw html sites without js but it's uncommon.
the classic web stack (html + css + js) is still dominant and i don't see it changing much.
I do this wherever possible. imo most uses of JS are unnecessary and an active cancer on the web—and that's not even factoring in all those gay JS frameworks. If I don't need JS, I avoid it out of a very strong disdain for modern web dev.

A majority of dynamic request-based stuff can be handled by modern template-based web servers behind some reverse proxy, and CSS pseudo-classes like :hover can help with creating dynamic collapsing menus and stuff.

Right, and that sounds neat, but when I considered "realistically" I was thinking about things like different skill levels, prospects for employability etc.
As I'm sure you can imagine, doing things in a nuanced and technically sound way like this is generally not compatible with commercial software development. If you wanna get hired, go learn Angular or React or whatever tf the new fad is.
 
Last edited:
what is the HTML sphere looking like?
Assuming we're talking about web-dev in general; enterprise is split between Angular and React, grogs are starting to use things like HTMX, autists (and gamedevs) are using C/C++/Rust wasm apps. Backends are split between PHP, Java, Go, and Rust afaik. Databases are either captured cloud shit or postgres, I think the market share of mongo is way down from 2016.
 
Hello programming thread.

I've decided to try and work my way through SICP this year. I tried a few years back, and got to around the part where they construct the Church numerals using cons cells. Or something like that, my memory is a little fuzzy on the specifics. I don't remember why I set it aside, I think work picked up or something. I'm not sure if I'll get through the whole thing, since I've heard the last chapter or two are less enlightening and relevant, but I enjoy Lisp a little more every time I come back to it. Looking forward to blogposting about it here.
 
enterprise is split between Angular and React
Hows JQuery? I've only ever used vanilla JS, and even that only minimally, but I'll need to make a bit more interactive site (think a "text editor" with two text panes, a "FS tree" that you can drag and drop edit, and some other show/hideable panels that can be handled through basic html), the tree editor is the most complicated part (frontend wise, I'm fine on backend, just a retard with interactivity), and I saw that there is a JQuery plugin that can handle it. I'm pretty tight on time so I think I may bite the framework bullet and try it. I'd still need to mod the package a bit, as I need to add stuff like (partially) locking the structure and what not, but it still looks like an overall time saver.
 
One of my websites has Javascript to handle the search. No server back-end for it as it's all done browser side while pulling the index incrementally from the server using Pagefind.

The other one has no JS. But it does have an animated GIF to let you know it's under construction.
 
Backends are split between PHP, Java, Go, and Rust afaik.
JavaScript, Python and C# deserve mention here as well
Databases are either captured cloud shit or postgres, I think the market share of mongo is way down from 2016.
I remember following "MEAN stack" tutorial material which introduced Mongoose as a means of making MongoDB more like SQL. All of that added complexity could have easily been avoided by just using SQL in the first place. I'm not saying NoSQL is useless but much of its (erstwhile?) popularity seems to have been driven by pure Silicon Valley trendfaggotry.
Hows JQuery?
jQuery isn't a framework, for better or for worse, but a bag of tricks that made writing JS a lot easier in the mid-2000s with features such as ensuring that front-end code was far more portable between different browsers. More recent JavaScript standards have absorbed much of what jQuery offered to devs, making it more redundant now. It still has certain advantages today like the prewritten plugin you mentioned. If I do any front-end stuff in the future, I will be using a framework instead of jQuery, because for front-end I want to minimize the amount of effort I put in and just get things done. I still remember jQuery being pretty nifty for what it was worth years ago.
 
Last edited:
YouTube surprisingly recommended me some simple videos that were useful and taught me shit I wanted to learn programming wise:

Simple Video Explaining Memory I/O and how code interacts with hardware:


In this video he makes Blinky(LED blinking every 1000ms) using various levels of abstraction. The first part is really funny because he builds a Rue Goldberg machine involving a virtual server in Africa, Cloud Computing and AI which perfectly demonstrates why software fucking sucks on 2025.

Video explaining the theory on how to crack random number generators

This video isn't like the others but it's some guy demonstrating live why OOP sucks. I haven't gotten experienced enough to take a side on OOP but even listening to what he was saying while I was driving sounds exactly why everytime I try to understand OOP it just seems to make everything super complicated for no reason.
 
This video isn't like the others but it's some guy demonstrating live why OOP sucks. I haven't gotten experienced enough to take a side on OOP but even listening to what he was saying while I was driving sounds exactly why everytime I try to understand OOP it just seems to make everything super complicated for no reason.
https://youtube.com/watch?v=C90H3ZueZMM
1767945249221.png

The title on the embed got me
 
Back
Top Bottom