HackerTrans
TopNewTrendsCommentsPastAskShowJobs

averagedev

no profile record

Submissions

The Plight of the Prompt Engineers

elton.dev
2 points·by averagedev·3 lata temu·0 comments

[untitled]

1 points·by averagedev·4 lata temu·0 comments

Creating a memory allocator for fun

elton.dev
7 points·by averagedev·4 lata temu·3 comments

comments

averagedev
·3 lata temu·discuss
For me, the reason is simply that I like having a blog. Truth be told, I have no readers. I only post once in a blue moon, or whenever inspiration strikes, so that's to be expected.

A good blog can surely lead to all of what you're mentioning, but personally I wouldn't get into blogging with high expectations of any such benefit.

https://elton.dev
averagedev
·4 lata temu·discuss
Obligatory xkcd: https://xkcd.com/927/
averagedev
·4 lata temu·discuss
I've found Go to be much simpler than Rust, especially syntax wise. However, in Rust you can use the ? operator which propagates errors. In Go you have to check err != nil.
averagedev
·4 lata temu·discuss
Ok, the last one is pretty funny question. I tried it, and I got a different result:

Q: when is an appropriate time to cast your loved ones entirely in wax?

A: When you are ready to make a commitment to them.

That said, I like the product, and I think it has a lot of potential.
averagedev
·4 lata temu·discuss
I've been reading Command-Line Rust[1], and I think it's nice. Each chapter has a challenge where you build a common command-line tool, like echo, cat, head, wc, etc.

Just like you, I do prefer the "learn while you build" approach. My personal experience has been that the book is a nice addition to reference-style books, such as the one you mentioned.

1: https://www.oreilly.com/library/view/command-line-rust/97810...
averagedev
·4 lata temu·discuss
My experience was similar. I tried Factorio once, and gave up because it was very tedious, and too much work to consider it fun. I would have liked to enjoy it, but it's not for everyone.
averagedev
·4 lata temu·discuss
Great resource, thanks for sharing. As someone who wants to "re-learn" some college level math, this is invaluable.
averagedev
·4 lata temu·discuss
Interesting. I don't code in C for a living, and I wasn't familiar with strict aliasing -- thanks for sharing your thoughts.

> Can't do that either I'm afraid for much the same reason, need to memcpy over the memory and trust the compiler to elide said copy

Would this apply even to mmap-ed memory? Especially for the bit you're quoting, I guess it can be fixed with a union (or even by using the same struct for both purposes). But since the TAlloc_malloc function returns a pointer to void *, to a location in memory that hasn't been used for any other purposes, perhaps this isn't a violation?

On another note, I was playing around a bit with strict aliasing rules, and oddly enough, the compiler that ships with Monterey (ARM mac) shows no warnings even for code that violates the rules blatantly. Same code threw a warning with GCC (I used an online compiler).

The memory allocator I wrote doesn't throw any warnings using GCC either, but I guess that doesn't mean much.
averagedev
·4 lata temu·discuss
Hi HN! Just a disclaimer that this is my own post. I thought you might find it interesting.