65 karma · joined Apr 11, 2023 (3y ago) · 58 submissions
comment 8mo ago · link · parent
Zig has a better support for sqlite/JSON serialization (everything is strongly typed and validated) than Node.js, so that was a plus as well.
Zig minuses are well known: lack of syntax sugar for closures/lambdas/vtable, which makes it hard to isolate layers of code for independent development.
We use Arcs (atomic reference counting) with resource scopes (bumper allocators) extensively, so memory safety is not a concern despite aggressively multithreading logic. The default allocator automatically detects memory leaks, use-after-free, etc so we are planning to continue running it in DebugSafe indefinitely. We tried switching to ReleaseFast and gained about 25%, which is not that much faster to lose memory safety guarantees.
comment 9mo ago · link · parent
1. You'll have to expose a port externally. God only knows who will attempt to take over it.
2. You'll have spammers advertising addresses of known businesses in attempt to get everyone to spam (initiate connections with) them.
3. Sooner or later people start distributing content not related to Zig, which will attract acute attention from law enforcement agencies.
Consider these to be my predictions.
7.
Supreme Court Considers Legality of Trump's Tariffs(c-span.org ↗)
5 points · by MrResearcher · 1y ago · 1 comment
comment 1y ago · link · parent
Can you connect e.g. from Windows to Linux and vice versa? Or from Android to Linux? I believe, KDEConnect was specifically designed to address this (https://kdeconnect.kde.org/), have you had a chance to give it a try?
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
In other words, he doesn't do it out of malice. These are the rules of the game.
comment 1y ago · link · parent
14.
Cars are so expensive that buyers need seven-year loans(bloomberg.com ↗)
34 points · by MrResearcher · 1y ago · 52 comments
comment 1y ago · link · parent
mov si, GREETINGS_STRING
print_loop:
lodsb ; Load next byte into AL, advance SI
cmp al, 0 ; Check for null terminator
je done
mov ah, 0Eh ; BIOS teletype output
mov bh, 0 ; Page number = 0
mov bl, 07h ; Light gray on black in text mode
int 10h ; Print character in AL
jmp print_loop
done:
...
GREETINGS_STRING db "Hello, BIOS world!", 0
And linux doesn't rely on BIOS for output I/O, it provides TTY subsystem and then programs use devices like /dev/tty for I/O. Run $ lspci in your console: which of those devices should the kernel use for output? The kernel wouldn't know that and BIOS is no longer of any help.comment 1y ago · link · parent
And, the moment you start flushing correctly: if(flush(...)) { abort(); }, it becomes infallible from the program's point of view, and can be safely invoked in destructors.
File closure operations, on the other hand, do have legitimate reasons to fail. In one of my previous adventures, we were asking the operator to put the archival tape back, and then re-issuing the close() syscall, with the driver checking that the tape is inserted and passing the control to the mechanical arm for further positioning of the tape, all of that in the drivers running in the kernel space. The program actually had to retry close() syscalls, and kept asking the operator to handle the tape (there were multiple scenarios for the operator how to proceed).
comment 1y ago · link · parent
Here's an excerpt from the close(2) syscall description:
RETURN VALUE close() returns zero on success. On error, -1 is returned, and errno is set to indicate the error.
ERRORS EBADF fd isn't a valid open file descriptor.
EINTR The close() call was interrupted by a signal; see signal(7).
EIO An I/O error occurred.
ENOSPC
EDQUOT On NFS, these errors are not normally reported against the first write which exceeds the available storage space, but instead against a subsequent
write(2), fsync(2), or close().
See NOTES for a discussion of why close() should not be retried after an error.
It obviously can fail due to a multitude of reasons.comment 1y ago · link · parent
comment 1y ago · link · parent
Even for a simple web site.
comment 1y ago · link · parent
However, if you teach people how they can obtain DRM-free material, store it, and consume it in that format, that and only that can make the difference.
Amazon is effectively a monopoly at this point. Many books are available exclusively through them. I doubt that the US court system would look into this segment of market any time soon. They still can't decide what to do with Google, and that took them how many years? I doubt we will be able to resolve this problem in our lifetime.
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 1y ago · link · parent
comment 2y ago · link · parent
We will because that is the only sustainable mode of operation in the long term. Every proprietary stack goes through ups and downs, and is eventually displaced. You must be open to persevere.
It's just a matter of time.
comment 2y ago · link · parent
And if you downloaded and installed the authentic Debian 12 image from debian.org, you don't get it either. Must be a Ubuntu thingy.
30.
Complete set of steps for Debian installation with an Nvidia card, October 2024(forums.debian.net ↗)
1 points · by MrResearcher · 2y ago · discuss