Readit News logoReadit News
_rend commented on Odin: Moving Towards a New "core:OS"   odin-lang.org/news/moving... · Posted by u/ksec
_flux · a month ago
What language is this? I'd expect a language with a ? -type would not use an Optional type at all.

In languages such as OCaml, Haskell and Rust this of course works as you say.

_rend · a month ago
This is Swift, where Type? is syntax sugar for Optional<Type>. Swift's Optional is a standard sum type, with a lot of syntax sugar and compiler niceties to make common cases easier and nicer to work with.
_rend commented on The Best Line Length   blog.glyph.im/2025/08/the... · Posted by u/zdw
dvh · 6 months ago
0.618 * screen width
_rend · 6 months ago
I personally much prefer screen width / 1.618, but to each their own
_rend commented on Writing memory efficient C structs   tomscheers.github.io/2025... · Posted by u/aragonite
_rend · 7 months ago
For completeness, this description of alignment is misleading:

> Well, dear reader, this padding is added because the CPU needs memory to be aligned in sets of 4 bytes because it’s optimized in that fashion.

> ...

> Remember: since structs are aligned to 4 bytes, any padding is therefore unnecessary if the size of the struct is a multiple of 4 without the padding.

Individual data types have their own alignment (e.g., `bool`/`char` may be 1, `short` may be 2, `int` may be 4, `long` may be 8, etc.), and the alignment of a compound type (like a struct) defaults to the maximum alignment of its constituent types.

In this article, `struct Monster` has an alignment of 4 because `int` and `float` have an alignment of 4 for the author's configuration. Expanding one of the `int`s to a `long` could increase the alignment to 8 on some CPUs, and removing the `int` and `float` fields would decrease the alignment to 1 for most CPUs.

_rend commented on Hyperspace   hypercritical.co/2025/02/... · Posted by u/tobr
bsimpson · a year ago
Which means if you actually edited those files, you might fill up your HD much more quickly than you expected.

But if you have the same 500MB of node_modules in each of your dozen projects, this might actually durably save some space.

_rend · a year ago
> Which means if you actually edited those files, you might fill up your HD much more quickly than you expected.

I'm not sure if this is what you intended, but just to be sure: writing changes to a cloned file doesn't immediately duplicate the entire file again in order to write those changes — they're actually written out-of-line, and the identical blocks are only stored once. From [the docs](^1) posted in a sibling comment:

> Modifications to the data are written elsewhere, and both files continue to share the unmodified blocks. You can use this behavior, for example, to reduce storage space required for document revisions and copies. The figure below shows a file named “My file” and its copy “My file copy” that have two blocks in common and one block that varies between them. On file systems like HFS Plus, they’d each need three on-disk blocks, but on an Apple File System volume, the two common blocks are shared.

[^1]: https://developer.apple.com/documentation/foundation/file_sy...

_rend commented on Apple Smells Blood in the Water   petapixel.com/2024/11/14/... · Posted by u/atombender
DeathArrow · a year ago
Still Mac only?
_rend · a year ago
> Award-winning photo editing, graphic design and page layout software for Mac, Windows & iPad.

They've supported Windows and iPad for years, too.

_rend commented on Judge dismisses majority of GitHub Copilot copyright claims   developer-tech.com/news/j... · Posted by u/thunderbong
ativzzz · a year ago
> there was no license provided for the code or the repo

Interesting - I assume any code that's not licensed as "free to use for whatever purpose I want"

_rend · a year ago
Not at all: unless a license is provided, the code is fully protected under copyright and you have _no_ rights to copy it or use it in _any_ way you want (unless falling under "fair use" clauses for the jurisdiction you're in/the author is in).
_rend commented on Zellij: A terminal workspace with batteries included   zellij.dev/... · Posted by u/thunderbong
resonious · 2 years ago
I'm a Linux user so of course I think like this, but: why use the native terminal tabs? I use Kitty with window decorations turned off, and Zellij provides all the UI I need.
_rend · 2 years ago
You're right, good question. At least partially, habit and muscle memory. I'm used to the keybindings, and the behavior for navigating tabs/splits/panes (across macOS, Windows, and Linux).

But also, native splits/panes and tabs cover 90% of what I really want from a multiplexer, so it's easier for me personally to stick with familiar behavior than to integrate another tool into my workflow just to recreate it.

_rend commented on Zellij: A terminal workspace with batteries included   zellij.dev/... · Posted by u/thunderbong
_rend · 2 years ago
Zellij is pretty great, and I recommend others check it out. The UI is extremely slick, and getting a comfortable setup is nicer (to me) than tmux or screen.

Unfortunately, it's missing one key feature that keeps me from using it as a daily-driver: it doesn't appear to be possible to attach to an existing session by automatically creating a new tab or pane. iTerm2 has fantastic integration with tmux that allows it to directly create a new tmux tab for every native iTerm2 split or tab, and I was hoping to recreate that with Zellij, outside of iTerm2.

It _is_ possible to open a new tab with the `new-tab` action (or whatever it's called), but unfortunately, there's no way to do that "in the background": one of your open sessions always switches to that new tab when it opens. I don't know if this is a limitation of the session/tab system, but when I dug through the source, I couldn't for the life of me figure out why this was happening.

I did spend some time trying to contribute a flag to allow attaching to existing sessions with a new tab/pane, but the actual architecture in place back then made this very difficult to support without non-trivial refactoring (and at least at the time, Zellij wasn't accepting any major contributions that weren't directly aligned with the roadmap, which I respect: there's only enough time in the day to review random PRs).

I check back periodically; if this is made possible at some point, I'd love to switch to it.

_rend commented on Swift for C++ Practitioners, Part 1: Intro and Value Types   douggregor.net/posts/swif... · Posted by u/ksec
pourred · 2 years ago
I noticed the same thing. Either Swift performances are atrocious, or I'm missing something.

Just the other day I was trying to sort a large array of strings in Swift and it was painfully slow. A 3 lines Python script managed to sort the same dataset _at least_ 10x faster.

_rend · 2 years ago
I think it'd be curious to see the code, some example strings, and whether or not you compiled with optimizations enabled — if you're willing to share. There's no reason for this to have been the case.

u/_rend

KarmaCake day569February 11, 2020View Original