News for hackers. Stuff that matters.

t0mek

Re:Wir müssen wissen – wir werden wissen on Monday November 02, 2026 @11:19AM (#50339108)
I think with the AI it's not only question about following the spec, but about the completness of the spec. Before the AI, if specification wasn't complete, then program would lack of a feature, won't start correctly or crash. Nowadays, agents will happily fill any missing specification parts with random stuff, often looking reasonable at the first glance. This random content can be different with every iteration of the LLM work.

To find the right position in this spectrum, I think we need to find a level of specification that we care about.

Re:Wir müssen wissen – wir werden wissen on Monday November 02, 2026 @10:06AM (#50337793)
> We must take the same attitude in computing: use abstractions, refactor, refine scope, invent and adopt higher-level languages, until we can hold the code in our head.

I want to believe this is true. But as an counterexample, do we need to hold machine code or assembly, generated from our C or Golang programs, in our heads? Or rather the Golang code is a high-level abstraction which is good enough?

If that's the case, does it mean we should go even further and treat design docs as the code suitable to hold in head and treat Golang program as a derivative? Or maybe design docs are also too low-level and the general vibe "create me an app, make no mistakes" is actually enough?

What's the right abstraction level? How to find it?

Re:Laptop Based on 6502 CPU on Monday October 19, 2026 @06:18AM (#50150569)
I assume you're talking about the Atari 2600 console (VCS), which uses a limited version of that CPU, called 6507. It has the addressing space reduced to 16 KB.

This machine indeed has 128 bytes of RAM, but the code and data live on the cartridges, which can include up to 64 KB of ROM (exposing 4 KB at a time, with bank switching). Also, graphics is created on the fly ("racing the beam") at TV display, so there's no need to spend precious RAM on the framebuffer.

In comparison to the later constructions based on the 6502, like NES or C64, it was certainly not an easy platform to develop games, but not as hard as your comment is suggesting.

I used the "FX" option and I think there's a bug. The center tiles on each side always stay in the same position.
I like the "challenges" part at the end, especially the varying difficulty levels:

* A quadratic formula program, which outputs the number of roots and the x-intercepts upon the user inputting the values of A, B, and C.

* A fighting game, with health, a store, different enemies, weapons, armor, etc, with graphics and animation.

Re:The Oxford Comma – Why and Why Not on Thursday March 26, 2026 @03:28PM (#47534604)
Only tangentially related (but hey, it's HN) - I'm so happy about the support/requirements for trailing commas in the modern language syntax:

    x = [
      123,
      456,
      789,
    ];
It makes editing such a list so much easier. Also, the commit diffs are cleaner (you don't need to add comma to the last element when appending a new one).
Re:Writing a Game Boy Emulator in OCaml on Friday July 04, 2025 @09:53AM (#44464587)
Not a tutorial per-se, but here are 2 slides describing how I've done it:

https://www.slideshare.net/slideshow/emulating-game-boy-in-j...

Essentially, there are 4 channels, each providing a number 0-15 on every tick. Emulator should mix them together (arithmetic average), scale up to 0-255 and feed to the sound buffer, adjusting the tick rate (4.19MHz) to the sound output rate (e.g.: 22 kHz) - taking every ~190 value (4.19MHz / 22 kHz) is a good start.

Now the 0..15 value that should be produced by each channel depends on its characteristics, but it's well documented:

https://gbdev.gg8.se/wiki/articles/Gameboy_sound_hardware

Channels 1 and 2 produce square waves, so a bunch of low (0) and high (15) values, with optional volume envelope (gradually going down from 15 to 0 on the "high" part of the square) and frequency sweep (alternating 0s and 15s slower or faster).

Channel 3 allows an arbitrary waveform, read from the memory.

Channel 4 is a random noise, generated by the LSFR.

See SoundModeX.java for the reference:

https://github.com/trekawek/coffee-gb/tree/master/src/main/j...

Re:Engineers Who Won't Commit on Monday April 14, 2025 @09:08AM (#43680879)
Famous example from the pop-culture is Burr vs Hamilton:

> If you stand for nothing, Burr, what'll you fall for?

The article doesn't mention the recent development in Amiga extension cards - PiStorm is an easy (and affordable) way to max out the specs of any Amiga, A600 included.
I've always seen A600 more like a budget version of A1200 rather than a new variant of A500: better graphics chip, IDE port, PCMCIA and new look-and-feel of the Workbench 2.04 (at the first sight hardly distinguishable from the Workbench 3.0) gave a taste of something new.
Re:Show HN: ESP32 RC Cars on Sunday February 02, 2025 @03:42PM (#42911602)
12 years ago, when we already had Arduino but no ESP32 yet, I built this thing:

https://newton-net-pl.translate.goog/2012/01/robot/?_x_tr_sl...

It was made of an old HTC Magic phone, acting as camera+wifi transmitter, connected to Arduino via its serial port and level shifter, to control the servo and a RGB LED. I had a lot of fan with that, even if the connection wasn't really to stable.

Thanks for sharing, maybe it's time to revive the project with the next generation of the microcontroller.

Re:A liar who always lies says "All my hats are green." on Monday December 09, 2024 @01:40PM (#42369058)
Yes, the liar have some hats. There are two ways how to conclude this:

1. If they don't have any hats, then any sentence about them would be truth.

2. The negation of the sentence, which must be truth, is "not all my hats are green". For this to be true, there must be some hats that are not green, so there must be some hats in general.

Re:Programming a computer for playing chess (1950) [pdf] on Tuesday October 29, 2024 @07:30AM (#41982785)
Programming a chess program was an important challenge for the "first generation of hackers" working on the mainframe machines like TX-0 and PDP-1 in '50 and '60, as described in "Hackers: Heroes of the Computer Revolution" by Steven Levy. I highly recommend this book, I think a lot of people here can recognize their own passion and interests in the stories described there.

Also, there's interesting implementation for the ZX-81, created over 20 years later and fitting in just 1024 bytes: https://users.ox.ac.uk/~uzdm0006/scans/1kchess/

Re:Show HN: Satoshi9000 analog BTC key generator (mechanical) on Thursday October 24, 2024 @09:49AM (#41935478)
I love the slow pace of the video, including a few minutes presentation of all available programs. And indeed, there are programs to test dice and coin bias:

* https://youtu.be/bJiOia5PoGE?si=IEhbNJk0C0-7_2Nj&t=229

* https://youtu.be/bJiOia5PoGE?si=3Se3lYFVAAkElx0w&t=245

Re:Euclid's Proof that √2 is Irrational on Wednesday August 21, 2024 @09:46PM (#41315930)
We can also assume that the p/q=√2 is already the simplest form of the fraction, since every fraction must have one, as in the first section of the article.

Then if we figure out that both p and q are even, it means that p/q can be simplified (by dividing p and q by 2), which contradicts the assumption about the simplest form - and we don't need to use the infinite descent.

Re:Python programming for Nintendo 8 bits on Wednesday July 03, 2024 @10:34AM (#40866308)
Similar, but in Haskell: https://github.com/DataKinds/sixty-five-oh-two

It's a DSL for writing 6502 assembly.

Re:How to Copy a File From a 30-year-old Laptop on Friday May 31, 2024 @12:28PM (#40537125)
A few years ago, I spent a fair share of time trying to copy files from and to a Macintosh Plus. I decided to use a 100 MB ZIP drive (actually two of them, SCSI for the Mac Plus and USB for a modern computer) and later a serial port connection with terminal software [1].

Now there's a much better and cheaper option: BlueSCSI [2]. It's a SCSI HDD emulator that allows to mount .img files stored on a SD card as HDD disks. It also supports CD and network card emulation.

Once the files are copied on a such a virtual drive, they can be extracted on a modern machine using via some kind of HFS explorer or an emulator.

[1] https://blog.rekawek.eu/2016/12/08/mac-plus#hard-drive

[2] https://bluescsi.com/

Re:Building a USB to Mac ADB keyboard adapter on Wednesday January 31, 2024 @07:21AM (#39202907)
And if you have even older Mac (128/512/Plus) and want to use an almost modern PS/2 keyboard with it, please check my https://github.com/trekawek/mac-plus-ps2
Same with Dell P3223QE.
Re:Celebrating the first NES Tetris game crash on Saturday December 23, 2023 @11:38AM (#38745487)
I remember having similar effects after long sessions of Lemmings. I saw the damn rodents when I was closing my eyes in bed, but it didn’t disturb my sleep (I guess they acted as sheeps to count).
Re:DOS on Dope: The last MVC web framework you'll ever need on Thursday December 21, 2023 @02:59PM (#38725986)
Trivia: this one was created by Adrian Zandberg, currently a Polish MP.
Re:"Useless Ruby sugar": Endless (one-line) methods on Friday December 01, 2023 @11:30AM (#38488604)
This is similar to Kotlin single-expression functions, which are actually pretty useful:

    fun double(x: Int) = x * 2
https://kotlinlang.org/docs/functions.html#single-expression...

However, in Kotlin there's no single-line constraint, so it's possible to define an expression function e.g. with a long chain of collection methods: `filter().map().findFirst()...`

The results are correct, but the explanation is wrong, e.g.:

    By using our Celsius to Fahrenheit conversion tool, you know that one Celsius is equivalent to 33.8
    1000 C = 1000 x 33.8 = 1832 F
Probably the explanation engine doesn't support the offset in the underlying linear formula.
Re:I wrote a GameBoy emulator for my hobby OS on Saturday May 20, 2023 @11:49AM (#36012908)
Hey,

  SBC:
    result = byte1 - byte2 - carry
    carry = result < 0
    return result & 0xff

  ADC:
    result = byte1 + byte2 + carry
    carry = result > 0xff
    return result & 0xff
Source - my implementation, passes tests. Look for SBC & ADC in https://github.com/trekawek/coffee-gb/blob/master/src/main/j...
Re:Random(Random(Random(Random()))) on Tuesday May 16, 2023 @03:42AM (#35958762)
Procedural generation was also used to generate levels in the Pitfall game for Atari 2600. A single level was represented with a byte (!) and bits were controlling the number of rolling logs, holes, etc. There were 255 levels there and LFSR was used to go from one level to another, so the actual level bytes wasn't even stored in the ROM.

For more details and screenshots see this great blog post: https://evoniuk.github.io/posts/pitfall.html

Re:So this guy is now S3. All of S3 on Friday May 05, 2023 @03:42AM (#35826390)
Archived version of the original Mastodon post: https://archive.is/fM06z
https://aqi.eco/

Open-source, crowd-sourced air quality page. I’m running it for 3 years now. Owners of private air quality detectors can use it to built micro-communities in their neighbourhoods. Eg. organization registered at https://mosina.aqi.eco installed dozens of sensors in their home town and is advocating for improving the air quality there.

Around 13k unique users and 40k sessions per month. Cost is about $35 for VMs and storage on DigitalOcean.

Re:Why the Windows Registry sucks technically (2010) on Friday July 29, 2022 @04:50PM (#32281610)
> although organizing it like a virtual FileSystem does have a certain appeal, and unfortunately I don't know of a database engine that supports such a layout

Apache Jackrabbit Oak [1] implements a tree-format data model called JCR [2]. It's used as database engine for the Adobe Experience Manager (enterprise-level CMS).

[1] https://jackrabbit.apache.org/oak/docs/ [2] https://en.wikipedia.org/wiki/Content_repository_API_for_Jav...

Older »