Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
ddevault
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
38 ms
·
391.
▲
by
ddevault
4y ago
Yep. I used it in a kernel to create a linked list of statically allocated data structures in a context where dynamic allocation was off the table. You can see the code here: https://git.sr.ht/~yerinalexey/carrot/t
392.
▲
by
ddevault
4y ago
https://en.wikipedia.org/wiki/Collision_attack#Hash_flooding Note that this is only a problem when an attacker can influence your hash table usage, and can be mitigated with hashing functions like siphash. This is not
393.
▲
by
ddevault
4y ago
Thanks for the email - yours is one of 46 emails in my Hare queue, which is why it has not been addressed yet. I agree with your comments and have filed a ticket to address them, however, and I will answer your email in time. Thanks for you
394.
▲
by
ddevault
4y ago
I like Go and I use it often. I also work on kernels. Go is not suitable for writing kernels.
395.
▲
by
ddevault
4y ago
It's not atrocious unless you need the performance. A linked list with a hundred items which is scanned every 90 seconds or something does not really demand attention for optimization, but it will be simpler, easier to write, easier to
396.
▲
by
ddevault
4y ago
The problem here is *void, which is not great. You lose type safety with this approach, and the allocation problems are still present. Rolling your own can be both more type safe and better suited to your problem area, and it's not par
397.
▲
by
ddevault
4y ago
I question the assertion that Hare's standard library is "anemic"; it includes a pretty decent set of batteries for many use-cases: https://docs.harelang.org Many Hare programs will not need to have dependencies a
398.
▲
by
ddevault
4y ago
Aye, we would have probably gone with a design similar to what you suggest... if we had generics, but we do not. Generics simply don't fit with the core values of the language. I still believe that there is room for languages without t
399.
▲
by
ddevault
4y ago
It does inherit some of the limitations of C, but in exchange, it also inherits much of the power. The trade-offs are similar to C, which is desirable in many cases. But, you may be working under different constraints, in which case you may
400.
▲
by
ddevault
4y ago
Checking the bucket entries based on their module identifier instead of (or in addition to) their key is a simple and obvious improvement to this code. https://todo.sr.ht/~sircmpwn/hare/679
401.
▲
by
ddevault
4y ago
Most application's bottlenecks are not their linked lists, and optimizing for anything other than your bottleneck is not the wisest use of your time. Performance is a budget, and I feel comfortable spending some of that budget on simpl
402.
▲
by
ddevault
4y ago
Thanks for writing this up, though I feel that it may be a bit premature since at this point hardly anyone has any real experience writing Hare code. Regardless, I understand that this is a contentious design decision of Hare, so I would be
403.
▲
by
ddevault
4y ago
Hare is not millions of lines of code; in fact, it is approximately the same size as clang tidy. 17,146 lines in the compiler, 59,271 lines in the standard library. These line counts are just wc -l, which is less favorable than e.g. sloccou
404.
▲
by
ddevault
4y ago
By vectored writes I mean the writev(2) syscall, which can write from multiple buffers in a single syscall (offsetting the performance loss from unbuffered I/O, in theory). io::handle is separate from io::stream because it needs to sto
405.
▲
by
ddevault
4y ago
Or ask your distro to package it, or contribute it to your distro yourself, or put it in ~/ somewhere and add it to your HAREPATH, or...
406.
▲
by
ddevault
4y ago
Good thing you have to type heaps of semi-colons and double-colons to use Hare!
407.
▲
by
ddevault
4y ago
It's hard to say, I'm not sure.
408.
▲
by
ddevault
4y ago
Thanks!
409.
▲
by
ddevault
4y ago
"io" cannot depend on "fmt", since "fmt" depends on "io" (technically, dependency cycles in Hare can be solved, but it's messy and strongly discouraged if avoidable). We did previously have a s
410.
▲
by
ddevault
4y ago
> So, the case is that the formatting string fits into memory, the data being formatted fits in memory but the output formatted text does not? It takes a minimum of twice as much memory to store the original data and its formatted stream
411.
▲
by
ddevault
4y ago
No, you don't do anything. Each distro packages it for you. It's not the vendor's responsibility to package their software themselves. I wrote about this in detail here: https://drewdevault.com/2021/09&#x
412.
▲
by
ddevault
4y ago
The same argument can be made of Hare, but the reality is that closing the portability gap between C and any other language is a monumental undertaking which will take decades to complete.
413.
▲
by
ddevault
4y ago
I revisit Zig often.
414.
▲
by
ddevault
4y ago
We're leaving package management in the capable hands of distribution packagers. https://harelang.org/distributions/
415.
▲
by
ddevault
4y ago
Yes, except for proprietary operating systems. However, as vast as the gulf is between Hare and Zig/Rust in terms of portability, far vaster is the gulf between both of those and C. It's disingenuous to compare any of these langua
416.
▲
by
ddevault
4y ago
Thanks!
417.
▲
by
ddevault
4y ago
Many of these names come from Unix, and we chose not to make an opinionated renaming of something that most C programmers are already familiar with. Regarding rt - read the docs, it's a low-level module which is not meant to be used by
418.
▲
by
ddevault
4y ago
No languages provide any such comparison that I'm aware of. Rust does not, Zig does not, C and C++ do not, JavaScript does not. Are all of these languages toys?
419.
▲
by
ddevault
4y ago
And neither does your experience dismiss mine. I have also seen years of vulnerabilities going unnoticed in pinned dependencies four orders transitively removed from anything the developer has ever heard of, of malware being published witho
420.
▲
by
ddevault
4y ago
Yes. As I reiterated many times in that thread, having your data stored in the heap does not introduce any immediate vulnerabilities, and this behavior is thoroughly documented in the standard library. It is possible for two people who both
More ›