One thing to also consider: generally speaking you likely had no chance in convincing him or saving him. It’s awful to feel powerless. I recently had a somewhat similar situation with a friend. I knew he was struggling. I was going to reach out to him the day he was found dead. It was under somewhat strange circumstances so it took a couple of months to get the report back on what the authorities thought happened, which turned out to be a spontaneous health issue and not any deliberate act. But when a healthy man in his 20s is found dead you rarely think “brain aneurysm” so I and other people in his life struggled to make sense of what happened.
One of the more helpful things I was told was that there is nothing you can do if someone is determined to end their life. No intervention, no amount of reaching out, nothing. And that is a powerless place to be but it also means that you not calling the police the night your acquaintance died is likely not the deciding factor in this case.
Find a way to forgive yourself. Talk about your experience. To friends, to strangers, to a therapist. EMDR is great, from what I hear but even talk therapy is a really good place to start processing. I hope you find a way out of this, one internet stranger to another.
General AI on non-objective ("best" is undefined here and for what usecase/priorities?) broadly covered topics like this instance is mostly just a regression to the mean with bias bleed in from other knowledge graphs (eg, trying to use correct grammar/tense (linguistics) in place of endianness(compsci)). As we traverse further into the depths of the dead internet theory, and more AI slop pollutes the internet (and in turn/tandem, poorly curated synthetic datasets), there is some inevitable Ouroboros style reinforcement here too.
So a simple filter in the sense of "omit anything too similar to X" would just omit the mean result within your given deviation. It's effectively asking, "What are some truly insane ways to use PostgreSQL", which is an interesting thought experiment, though if it actually produces useful results then you've basically just written a unit-test (Domain test?) for when AI slop evolves into full on AI jumping the shark.
If you're doing it based on cross-linking (source-citing), you're basically doing Page-Rank for AI.
If you time gate familiarity to posts only up to the NLP/General AI explosion in 2022 or so, well that might still be useful today, but for how long?
If you were to write a "Smart" filter, you're basically just writing the "PostgreSQL Best Practices" article yourself, but writing it for machines instead of humans. And I don't know what to make of that, but frankly I was lead to believe that if nothing else, the robopocalypse would be more interesting than this.
You are asking a question that doesn’t make sense. It seems like to you it does, and to others it sounds like “what does the color blue taste like?” People do stuff for fun. It doesn’t have to be useful. Or it can be useful to them because it isn’t the existing thing. xv6 is great, this is different. It makes different choices and studying the differences can be a good thing. Comparing two different pieces of software written in the same language is sometimes exactly what you want.
The logic of “something similar already exists so don’t bother” is reductive. I am sure 99% of hobbyist software is useless to anyone but the person who wrote it. It still helps people learn and become professionals.
Remember a few weeks ago there was a post here by a high school student detailing building a laptop from scratch. Was that wasted effort because you can just buy a laptop? Was Linux wasted effort? Why does this project offend you so much that you keep commenting on it in such a negative way?
> Comparing two different pieces of software written in the same language is sometimes exactly what you want.
And here we are at my question, which obviously makes sense. So what's the difference to xv6? Why did the author consider it important to implement yet another unix-like system in C? What is the core benefit of this specific kernel? The website doesn't provide an answer.
> that you keep commenting on it in such a negative way?
That is a false accusation. I have not said anything negative about this project.
I think it's a cool project even though I have no interest in downloading and running it, but it's a technological curiosity that might yield some insight of other things.
If you're so hell-bent on knowing what differentiates Fiwix from xv6 why don't you download the projects and compare them? You shouldn't be asking others to do your work for you, or to justify their choices and actions to you.
> You shouldn't be asking others to do your work for you, or to justify their choices and actions to you.
Are you serious? This is HN, so it's reasonable to assume that there are people here (obviously not you) who know the project and can answer questions about it quickly. After all, the project author has even set up a dedicated website and is asking for support for his project. It should be in his and the other project contributors' interest to communicate the advantages of the project to people on their own initiative. I don't consider it my job to analyze the source code to find out for myself. I'm very interested in lean operating systems, especially for embedded SMP systems, but my time is limited.
> Why did the author consider it important to implement yet another unix-like system in C? What is the core benefit of this specific kernel? The website doesn't provide an answer.
The website does answer your questions:
> It is designed and developed mainly as a hobby OS
A hobby is something that someone does for their personal enjoyment; it isn't any more complicated than that.
> It is designed and developed mainly as a hobby OS
That doesn't answer my questions at all; e.g. Linux also started out as a hobby, and yet Linus had a clear position on why he considered his system to be better than e.g. Minix, and why he made certain design decisions. Hobby does not in any way preclude rational, goal-oriented motivation.
> Hobby does not in any way preclude rational, goal-oriented motivation.
And it doesn't imply one, either. Most hobbies are just hobbies, that began as hobbies, and continue to stay hobbies.
Replace programming with any other hobby here -- It would be ridiculous to say, in response to someone showing a hat they they've knit: "Why did you consider it important to knit yet another hat? What is the core benefit of this specific knit hat?"
> It would be ridiculous to say, in response to someone showing a hat they they've knit: "Why did you consider it important to knit yet another hat? What is the core benefit of this specific knit hat?"
Not at all. Knitting has a clearly defined purpose: to make a particular garment with a particular shape and pattern so that you can wear it, give it as a gift or sell it (coincidentally, I have detailed first-hand insider knowledge on this topic). But I don't think we need to continue this discussion because it doesn't bring me any closer to the answers to my questions, and apparently you don't have the answers either.
No, hobbies are done for the enjoyment of the activity itself. That's what the word means. The answer to your questions is likely "there is no advantage" and "because the author thought it was fun"
You are asking questions about things that were never asserted in the first place. "Why did the author consider it important to implement yet another unix-like system in C?" Nobody ever said it was!
If you left it at the initial question this might have been an entirely different thread.
"There are already so many Unix like operating systems of all sizes written in C... If I were to go to such an effort, I would try another language...It is meanwhile more than clear that it can be done in C...so it would actually be more interesting to explore the suitability of other languages for such a task."
Based on your earlier remarks why not say knitters should use different material or needles to make it more interesting? Why do the same pattern over again when so many knitters have probably knit the very same pattern already.
Because the statements above miss the point of what hobby means to most people.
>> and apparently you can't answer the questions either
No one is required to. Not anyone on HN or the hobbyist in question.
That was the original intent. It’s like a half way to a parliamentary system where the legislature elects a PM except here it is a separate one time use assembly.
There was a post from someone a long time ago who has an email address and name similar to Make Cuban but not quite. He got quite a few cold call emails meant for Cuban. A lot of them were quite sad (people asking for money for medical procedures and such).
I recently rediscovered Ratpoison WM and the origin of its name (tl;dr it is meant to prevent the need for using a mouse). I think the main issue for me really is that navigating the web is sometimes faster with a pointer. I already use vim and the shell for everything else, but navigating Google Maps or Wikipedia or Stack Overflow is just easier when you can point and scroll.
I think it's a nice first step in running web browsers from the keyboard. Well, beyond built-in functionality.
You push 'f' to get link hints, if there's few they'll be things like 'a', 'c', 'j', 'l', if many it'll build up algorithmically, most I've seen is triples, like 'ade'. You push those keys and it opens the linked page. 'H' to go backwards, 'd' and 'u' to scroll down and up, 'yf' and then a link hint to copy a link URL, 'x' to close a page and 'X' to open the last closed, and so on.
Some people want more, like vim motions in input fields and so on, so they opt for more complex tools.
This example isn’t showing silent data corruption due to out of bounds array access. It is showing that LLVM and others do not correctly apply optimizations to the original code. The program is correct and does what it’s supposed to in the original example.
You mean, accessing an array member past the declared array bounds and overwriting another variable that happens to be allocated right next to it is what the programmer should have consciously planned to do here?
IMHO, a planned aliasing would look like a union. The declaration we see does not even guarantee that q follows p in the address space, or maybe even that p and q are adjacent.
(I know that int[0] sort of means "no bounds", and I think it should be an error for a stack-allocated variable which ought to have definite bounds.)
I have some questions. First, do pointers that do not come from specifying a statically sized array also have provenance? That is if I say `char* c; size_t n = get_user_input(); c = malloc(n);` does c have provenance? If after the above I created an array like so `char str[n]` and then assigned such that it pointed to the same region of memory that malloc() returned, then would the provenance of both pointer be equal?
Also, in Rust why are pointer to integer casts allowed at all if they lose provenance?
Also, why exactly is one past end of bounds a valid pointer you can calculate?
Also, it seems like you cannot just create a random pointer to an unallocated address, not just that you can’t write to it. Is that correct?
Lastly, is provenance just a fancy way of saying metadata? Is there a reason something like “pointer metadata” or “object metadata” wasn’t used?
>That is if I say `char* c; size_t n = get_user_input(); c = malloc(n);` does c have provenance?
Yes.
>If after the above I created an array like so `char str[n]` and then assigned such that it pointed to the same region of memory that malloc() returned, then would the provenance of both pointer be equal?
Yes.
>Also, in Rust why are pointer to integer casts allowed at all if they lose provenance?
It would be a breaking change to remove the ability to cast. Instead Rust added API to extract the provenance when casting from ptr to int and then add provenance back when casting from int to ptr.
>Also, why exactly is one past end of bounds a valid pointer you can calculate?
It's useful to allow it to make `if (ptr < end)` with exclusive `end` possible. The alternative of only allowing `if (ptr <= end)` with inclusive `end` is not as trivial if it needs to handle empty ranges (the exclusive version can just use `end = start` to denote an empty range).
>Lastly, is provenance just a fancy way of saying metadata?
Pointer metadata in Rust at least refers to a different thing, namely the second half of fat pointers. For slice pointers the fat pointer contains data ptr and length, so the length is the metadata. For trait object pointers the fat pointer contains data ptr and vtable ptr, so the vtable ptr is the metadata.
> It's useful to allow it to make `if (ptr < end)` with exclusive `end` possible. The alternative of only allowing `if (ptr <= end)` with inclusive `end` is not as trivial if it needs to handle empty ranges (the exclusive version can just use `end = start` to denote an empty range).
As an aside: I find it fascinating that half-open ranges turn out to be - universally as far as I can tell - the right choice for ranges in software. As well as being able to store an empty range, they also allow you to calculate the length of the range by trivially subtracting end - start.
For the growable array and slice types (C++ std::vector and std::span) at a low level we should actually store ptr and length not start and end, it makes a tiny but measurable performance difference.
This is one of the tiny perf leaks from C++ ABI conservation. IIRC All three popular std::vector implementations got this wrong decades ago and are now ABI frozen so too bad. The design of std::span is correct though for whatever that's worth.
Storing the length instead of the address past the last element does not change anything in the answer to the question posed by the previous poster.
The length of an array is the index of an element beyond the limit of the array, which would be invalid in an indexed expression for accessing an array element.
Exactly like when using pointers the address beyond the last element of the array is useful, when using indices the length, i.e. the index beyond the last element of the array, is useful.
Moreover, regardless how the arrays are handled in a high-level programming language, on CPU architectures that provide SIB (scaled index + base) addressing modes instead of auto-incremented/auto-decremented addressing modes, e.g. on x86-64, there are frequently encountered cases when the optimal implementation of a loop in machine instructions requires a base register initialized to the address of the element beyond the array limit, together with an index register that contains negative indices, which is incremented at each iteration until it becomes non-negative, in order to access the array in increasing order.
(Positive indices that are decremented until becoming negative, together with a base register containing the address of the first array element, are used when the arrays must be accessed in decreasing order.)
In optimal implementations on x86-64 and similar ISAs it does not matter much which value between length and address past the array you choose to store in an array descriptor. When the loop is initialized in machine instructions you may need frequently the third value that is not stored, but that is pretty much irrelevant, because an extra addition or subtraction is usually done in zero time on modern CPUs (i.e. concurrently with the other instructions that would have been executed anyway, even when the extra addition/subtraction would not have been necessary).
Because arrays are more frequently accessed in increasing order, even when that is not necessary, for the purpose of just accessing the array it would be optimal to store in the array descriptor the length together with the address of the element beyond the array. However this would be worse in conjunction with legacy APIs that would expect the address of the first element, which would require an extra subtraction, and also when accessing just an array element, not the whole array, when an extra subtraction would also be needed.
In any case, on x86-64 storing both addresses instead of the first address with the length does not have any measurable performance difference in correct implementations, because the number of machine instructions needed for implementing a loop is the same in the most frequent cases. If there are performance differences, it is likely that the machine code generation is bad.
> > If after the above I created an array like so `char str[n]` and then assigned such that it pointed to the same region of memory that malloc() returned, then would the provenance of both pointer be equal?
> Yes.
Uh, no. This is flatly untrue. You cannot "assign an array such that it points to a region of memory". Arrays are not pointers, they do not point to anything.
I assumed they meant `char (*str)[5]`, ie a pointer to an array, because they wanted to reinterpret the malloc result as an array of the malloc'd length.
> If after the above I created an array like so `char str[n]` and then assigned such that it pointed to the same region of memory that malloc() returned, then would the provenance of both pointer be equal?
I don't think you can perform such assignment.
> Also, in Rust why are pointer to integer casts allowed at all if they lose provenance?
Sometimes you want the numeric address to perform some arithmetic/bitwise operation on it (e.g. for tagged pointers)
> Also, why exactly is one past end of bounds a valid pointer you can calculate?
Because it's increadibly useful for iterating. It is also used for representing an empty tail slice. It's something inherited from C/C++ and likely won't go away.
> Also, it seems like you cannot just create a random pointer to an unallocated address, not just that you can’t write to it. Is that correct?
You can create such pointer, it just won't be valid.
> Lastly, is provenance just a fancy way of saying metadata? Is there a reason something like “pointer metadata” or “object metadata” wasn’t used?
It's not metadata that exists at runtime. It only exist at compile time to allow certain common optimizations.
Any desktop computer + Intel dual GB NIC + opnsense and you have an amazingly powerful router. Add in a Raspberry Pi running the Omada controller software and some Omada access points and you have an inexpensive and very robust WiFi network. Don’t forget to turn on auto updates for opnsense.
I moved away from the x86 box to Mikrotik after a late night spent debugging NIC issues in BSD/Debian (Proxmox VM)
They have inexpensive devices (Hex wired router will handle up to about 1 Gbps), and they receive software updates for longer than any hw manufacturer I can think of.
The main gateway router in my household has become something that needs to work reliably, not something I can (or want to) tinker with all that much. The MT devices are infinitely flexible, but rock solid and cheap.
I recently switched to opnsense on bare metal on an N105 with dual 2.5g NIC, after having been quite happy for many years running a bunch of Asus routers on Merlin.
My main goals were to improve throughput and security. Opnsense seems to work well OOTB, but being a dilettante in these matters I must admit to having a nagging anxiety that I may have misconfigured something important.
Any recommendations for a reliable way to check that?
Do you have a particularly complex setup or a typical home LAN with Wi-Fi? If the latter, chances are you did not do anything bad as the defaults are sane and safe. Look over Firewall -> Rules to make sure you aren’t opening any ports that shouldn’t be. Put your phone on a cell network and try to log into your box using your public IPv4 and IPv6 address. Try to run nmap against the same from a remote server (you can get a cheap or free one from Vultr for example). If you have IPv6, try to for example access ssh running on a computer inside your network from the outside, or even just nmap that address.
One of the more helpful things I was told was that there is nothing you can do if someone is determined to end their life. No intervention, no amount of reaching out, nothing. And that is a powerless place to be but it also means that you not calling the police the night your acquaintance died is likely not the deciding factor in this case.
Find a way to forgive yourself. Talk about your experience. To friends, to strangers, to a therapist. EMDR is great, from what I hear but even talk therapy is a really good place to start processing. I hope you find a way out of this, one internet stranger to another.
reply