Hacker News
C programmers commit fresh crimes against readability
Refreeze5224
|next
[-]
C does seem to sit at the perfect intersection of language age and low-level access to allow this kind of competition, whereas something like Go seems far less suited for it. Javascript is routinely obfuscated pretty well for human readers. I'm not familiar enough with Rust to say, but I bet with what little I know of its syntax you could create some pretty ugly stuff?
retrac
|root
|parent
|next
[-]
Standard ML, Haskell, and Lisp, among other languages are pretty serious about invalid states. One should never be able to break the virtual machine and put it into an unknown state, unless intentionally mucking around with unsafe {} or its equivalent. Rust is often described as being at least partly in the ML family because of its approach to types and safety, which is very ML-ish.
Dependent typing like in Rocq goes even further, and makes it impossible to express invalid algorithms. Expressing practical programs in formal terms like that is rather hard though. It largely goes over my head, for sure.
AlotOfReading
|root
|parent
|next
|previous
[-]
Zig could probably support a similar contest as it grows up.
bunderbunder
|root
|parent
|next
|previous
[-]
Of the two^H^Hhree, I think that the first is what contributes most to the aesthetic appeal of obfuscated C. The only other languages I’ve used that are as good for making code that looks impenetrable are Forth and JavaScript, both of which share that feature.
(Probably any lisp, too, but for some reason I’ve never actually tried. I can say, though, that the most confusing codebase I ever inherited was written in Clojure.)
So yes, I’m inclined to agree that Rust can be a good language for writing deliberately ugly code, and Go not so much. But for a different, perhaps more trivial reason.
anthk
|next
|previous
[-]
On 32k roms for the GB emulator:
https://github.com/tbsp/Adjustris
Old build:
https://pdroms.de/?__df=24010f101611170c163a13544b55553a4d22...
Someone ping back the IOCCC creator, please.
russfink
|next
|previous
[-]
retrac
|root
|parent
|next
[-]
four operands: A B D N
D = A - B. If zero or negative then jump to N else PC++.
Various configurations of this give one instruction for: move, subtract, branch equal, jump, inc, dec and most key: branch and link return address. Two instruction sequences synthesize: add, push, pop. And self-modifying code two instruction sequences for: load, store, call, return from call.
With a bunch of macros you get a reasonable instruction set.
Self-modifying code is terrible from an implementer's perspective once you want to go pipelined and have caches involved. And the instruction set lacks any way to rotate right or operate bitwise. So that involves an expensive loop over the width of the word. Otherwise quite practical.
The AI slop Lisp interpreter weighed in at about 40 kilowords.
https://github.com/retrac0/ulqasm/blob/main/demos/13_protoli...
RicoElectrico
|previous
[-]
Lol, no. That's a Numitron (although they were 7 segment)
tasty_freeze
|root
|parent
|next
[-]
master-lincoln
|root
|parent
|next
[-]
lightedman
|root
|parent
[-]
adrian_b
|root
|parent
[-]
A filament could be needed with a higher pressure gas, to emit electrons that would ionize the gas, to facilitate the initiation of a discharge. A filament might also be needed sometimes when the gas is a metal vapor, like mercury vapor or sodium vapor, in order to heat and vaporize the metal, though that is more commonly done by adding some noble gas, like neon, to cause a preliminary discharge that heats the metal until enough vapor is present, which allows the initiation of the main discharge.
RicoElectrico
|root
|parent
|previous
[-]
adrian_b
|root
|parent
[-]
The only wrong parts were that the cathodes are not filaments and the cathodes themselves do not glow.
The Nixie tubes are filled with neon at low pressure and the electric discharges through them produce the so-called negative light, i.e. where the luminescent gas is confined around the cathode. Therefore the negative light takes the shape of the cathode. The cathodes are not glowing, but they are surrounded by glowing neon gas.
In my opinion, negative light, which comes from an apparently empty space, looks somehow more beautiful than solid light emitters, like an incandescent filament or a fluorescent lamp (like VFD, i.e. vacuum fluorescent displays; display tubes with incandescent filaments or with fluorescent segments were alternatives to Nixie tubes, until all of them were replaced by cheaper LEDs and LCDs).
The neon tubes that were used in advertising for making letters or other shapes, use positive light instead of negative light, i.e. where the luminescent gas occupies most of the glass tube, away from the electrodes, so giving various shapes to the glass tube provides various shapes of the visible light, regardless of the shapes of the electrodes (unlike for negative light, where the shape of the cathode matters, while the shape of the glass tube is irrelevant).