Better HN
topnewbestaskshowjobs
Log inSign up

codebje

1,356 karma · joined Jun 19, 2017 (9y ago) · 591 submissions

Submissions

comment 4y ago · link · parent

If we're arguing here that it's a great form of professional development, why would it be a joke to get better at your job, on your job?

comment 4y ago · link · parent

I bought a smart TV that works just fine with the smarts never enabled. I think it's a Sony, I bought it after one of these threads a few years ago when someone else said that model could simply be told to be dumb.

Based on current comments if I were to buy today it'd be a Spectre. The more consumers who refuse to buy a TV with mandatory advertising, the sooner it will stop being profitable.

comment 4y ago · link · parent

How much does construction affect the efficiency?

comment 4y ago · link · parent

Having persisted with user authentication X509 for years, I can in fact tell you the UX got _worse_ over time. We wound up sometimes making key pairs and certificates for end users and emailing them because browser enrollment is so shonky.

comment 4y ago · link · parent

Time zone rules change relatively frequently - future dates may be better stored in the appropriate time zone, optionally along with the UTC offset at the time of recording, so you don't report incorrect information when the rules do change on you.

Past dates should always be in UTC, for the same reason - timezone rule changes are sometimes even retroactive.

comment 4y ago · link · parent

Squillions of them. Microchip, Silicon Labs, Infineon, and Maxim all produce such µCs, like the Silicon Labs EFM8BB - up to 50MHz, a small handful of kb of program space, a smaller on-die RAM, off you go. Or pick a more specialised IC like the Cypress FX2LP family of USB controllers - they embed an 8051 core so you can apply firmware using cheap, widely available tools.

comment 4y ago · link · parent

BitTorrent made itself less relevant by relying on end to end networking and symmetrical links, neither of which panned out.

comment 4y ago · link · parent

It's easy to stop calling a now-unused function when some behaviour is no longer needed.

The system is made more simple if you remove the function, though.

This is more so if only part of the behaviour of a function is no longer desired - the function becomes easier to understand when it's trimmed down, but it's harder to make that change.

comment 4y ago · link · parent

3. An excellent design that lets you play without getting in the way

comment 4y ago · link · parent

The TI-84 Plus CE, at least, uses the same CPU as my board (plus or minus revisions) - but it clocks it _much_ lower, at 15MHz. The eZ80 uses around 30mA at that speed; it also has a sleep mode using under 3µA that I would expect a battery powered device to make heavy use of.

The Z84C00 at 6Mhz will also "only" use around 30mA, down to 10µA in standby. At 15MHz the Z84C00 uses something more like 80mA, though, so the "turbo" mode in that calculator line probably chews through batteries.

I expect TI still uses the eZ80 CPU for the same reason other companies still use Z80-based processors - backwards compatibility. The Z80's got a very long life in industrial control systems, where you want to avoid rewriting the code if you reasonably can.

The eZ80 is about as modernised as you can take the Z80 core, but as you say a lot of the Z80 design is due to the constraints of the era. It was also designed to be code compatible with the Intel 8080, and probably would have just quietly fizzled on launch if it didn't have that.

comment 4y ago · link · parent

The eZ80 is a better Z80, but it's still a Z80. It's worse in pretty much every way to a modern MPU.

The STM32 line is my preference for performant parts - there's an STM32L0 on the board doing USB to serial. I could likely emulate the eZ80 on that faster than the real thing runs, but I couldn't build an 8-bit bus computer with it.

comment 4y ago · link · parent

The board runs at 3v3, the CPU consumes around 140mA, with SD and Ethernet off its just memories and LEDs adding to that, so typically not much higher than 150mA sustained.

It's likely a bit less than that over USB Vbus but it's just running a linear regulator down to 3v3 so mostly the difference just becomes heat.

comment 4y ago · link · parent

You can buy brand new 20MHz Z80s, but with the multiple clock cycles per instruction they'll still be slower overall than a 20MHz AVR.

The later chips in the 8-bit family are much more power efficient; I built an eZ80 board whose total power budget is 500mA including SD card and Ethernet module. It runs at 50MHz, but performance isn't really the reason we muck around with 8-bit CPUs, right? :)

comment 4y ago · link · parent

Turbo Pascal used to support building your program as multiple executables with a shared data space, so you could chain from one part of your application to another.

comment 4y ago · link · parent

Absurdle is static - once you get a word in four it's beaten forever. The spirit of Wordle means it's better to always re-use your successful guesses, but Absurdle has no target word. It's a game of filtering the word list down to only one candidate as fast as you can.

comment 4y ago · link · parent

A dependent type is a function from a value to a type - where a value is a runtime value, not a compile time constant.

Can you do 'MyType<n> foo(int n) {...}' ?

comment 4y ago · link · parent

If package A depends on package C at version 1.0 but package B depends on C at version 1.1, what version of C will be pulled in?

Dependency management is not as simple as only upgrading one direct dependency at a time after careful review.

The NPM ecosystem is particularly difficult to work with as it has deep and broad transitive dependency trees, many small packages, and a very high rate of change.

You either freeze everything and hope you don't have an unpatched vulnerability somewhere or update everything and hope you don't introduce a vulnerability somewhere.

comment 4y ago · link · parent

Doesn't that make Twitter the central authority providing the trust framework required for it to work?

comment 4y ago · link · parent

I do love a good pedantic correction, thank you :-)

comment 4y ago · link · parent

Because 'coding' is just slang for 'programming'.

comment 5y ago · link · parent

Are those results useless?

The question posed early in the blog was whether Duff's Device is still relevant in 2021. The fact that the compiler can completely elide the loop without it but cannot with it is a pretty good indicator that it's likely to cause more harm than good.

It might prevent inlining of a function call in the loop body, which would make a loop much, much slower to execute. It will make the loop body larger (even without inlining) and likely cause an increase in cache misses. It will be unpredictable based on build: an unrelated change somewhere else might misalign it with a cache line. Different CPUs might have different cache behaviours and perform differently.

The right view on this sort of thing hasn't changed for decades: don't optimize prematurely. Trust your compiler, check it with profiling, look first for algorithmic improvements because you can gain FAR more converting an O(n^2) algorithm to an O(nlogn) than you can by unrolling a loop. Duff's Device is obsolete in all but a vanishingly tiny number of edge cases.

comment 5y ago · link · parent

#41 - if you write a system that can accommodate all 40 previous examples, you can still integrate it with the popular brand customer management system your company wants to use.

comment 5y ago · link · parent

Perhaps we could alter government policy then?

comment 5y ago · link · parent

It sounds exactly like a DikuMUD zone, where each place has an exit to another place in four cardinal directions plus up or down, but those exits do not need to be symmetrical. Loops, warps, multiple exits into the same place. The graph is not necessarily even connected as portals and triggers can teleport you into otherwise unreachable places.

comment 5y ago · link · parent

It wouldn't (likely) be the main way you program a device so much as an interpreter available on the device for interaction.

I last used it on an ARM micro. Building and deploying a new image to flash is substantially slower than using a lisp console over USB serial, and requires me to wire up the programming headers instead of just using the USB line providing power and other services.

comment 5y ago · link · parent

I used uLisp in a project. I had no available non-volatile storage so I handled persistence by writing my code on the laptop and sending it serially to the micro.

When some functions proved to be stable and useful I ported them in as uLisp builtins with a C implementation.

I used it as a debug driver in an STM32 for an eZ80 CPU - the STM32 provided USB to TTY and a third serial channel for debug control.

It was a nice addition but I do wish it was designed in a way that made these modifications easier.

comment 5y ago · link · parent

ZSDOS provides replacements for two of the three parts of a CP/M system: BDOS and CPR. The existing BIOS should work perfectly with these replacements, and the BIOS is the only part that is machine specific.

IOW it should run just fine, unless the simulator is written to hook into CP/M itself. I have my own z80 based system emulator where the BIOS is basically breakpoints into host code, and I didn't need to change anything to switch from DR's OS to ZSDOS.

comment 5y ago · link · parent

The assumption would be the limit you actively test for.

comment 5y ago · link · parent

Wouldn't a partial order be possible using logical clocks? Vector clocks probably don't satisfy "practical" but a hybrid logical clock is practical if you can assume clock synchronisation is within some modest delta.

comment 5y ago · link · parent

I don't know of a competition, but there is an 8-bit retro discord server: https://disboard.org/server/643973143358341151

Various projects get shown off, plenty of boards built around retro (and quasi-retro) CPUs, some more audacious stuff like rebuilding the Apollo Guidance Computer.

The ultimate homebrew derby is those brave enough to make their designs available for sale, I suppose.

1
131415
20