Y
HN Search
Hacker News Search
new
|
comments
|
top
|
jobs
accelbred
searching PlanetScale…
1.
▲
2.
▲
3.
▲
4.
▲
5.
▲
6.
▲
14 ms
·
91.
▲
by
accelbred
2y ago
On the other hand, at Amazon, people I know like Chime. Sad its going away.
92.
▲
by
accelbred
2y ago
Not being able to easily write a program without Unicode being pulled in for Rust code was a reason I'd chosen C over Rust before. When targeting binary sizes measured in kilobytes, pulling in full unicode handling is not an option. Es
93.
▲
by
accelbred
2y ago
All the dark mode extensions I've used also would work for making pages light mode. For me, I have trouble focusing when reading light mode content, but dark mode is perfectly fine (light backgrounds seem not still, as if there is move
94.
▲
by
accelbred
2y ago
I really like MessagePack as a serialization format but it does leave a lot underspecified, such as how to handle decoding/encoding integers. While the encoding has signed and unsigned types, the data model does not. Its not straightfo
95.
▲
by
accelbred
2y ago
Thats what Zig does. It compiles down to the same stuff as C. It does not have a runtime.
96.
▲
by
accelbred
2y ago
Worse yet, at least in Seattle, are right arrow lights that go green at the same time as the walk light. You get a green light to go and pedestrians start crossing at the same time. Having a green light and a walking sign on should be mut
97.
▲
by
accelbred
2y ago
I avoid the Rust stdlib. The stdlib uses panics and dynamic memory allocation, neither of which are great for embedded usecases or writing software adhering to safety-critical coding practices. no_std is common for embedded targets, and IIR
98.
▲
by
accelbred
2y ago
Does Zig fit your bill?
99.
▲
by
accelbred
2y ago
Note that using this will likely violate strict aliasing due to using the void pointer returned as one type, freeing it, and then getting that same chunk again and using it as another type. You'll probably want to compile with -fno-str
100.
▲
by
accelbred
2y ago
__attribute__((cleanup)) cleans up on scope exit, unlike go.
101.
▲
by
accelbred
2y ago
This defer (using attribute cleanup) as well as Zig's are run when going out of scope. Go's runs at function exit.
102.
▲
by
accelbred
2y ago
Nice, if this is reliable across gcc versions and optimization levels, I might consider it for future stuff. Though making it such that treesitter and other tools dont barf on it would still need investigation.
103.
▲
by
accelbred
2y ago
The macro from the article uses nested functions which on gcc are implemented with tramolines that need executable stack. https://thephd.dev/lambdas-nested-functions-block-expression...
104.
▲
by
accelbred
2y ago
Destructors are hidden control flow, and can be non-obvious for structs from other files. I find they make code significantly harder to follow than in plain C. Defer does not have the problem, as all the logic in your function is explicitly
105.
▲
by
accelbred
2y ago
The main problem I have with fuse is inotify not working. If inotify just worked for fuse, I'd just use it. Ideally I could just run the software in a mount namespace with a fuse fs, but I need inotify. I mainly was trying to use ublk
106.
▲
by
accelbred
2y ago
Since when can you use a MAC as an unprivileged user on an arbitrary distro?
107.
▲
by
accelbred
2y ago
Unfortunately, this requires an executable stack, and only works on gcc, though an alternate implementation can work on clang. After a few attempts at defer, I ended up using a cleanup macro that just takes a function and a value to pass to
108.
▲
by
accelbred
2y ago
Out of current ones, at a quick glance: connect, openat, openat2, renameat, mkdirat, and bind. More importantly, I'd like to block any opcode I haven't whitelisted, even when my software runs on future kernels with more opcodes av
109.
▲
by
accelbred
2y ago
I'd like to use io_uring, but as long as it bypasses seccomp it should be disabled whenever seccomp is in use. As such, I use epoll, and find it annoying when kernel APIs like ublk require io_uring. The places I'd want to use ublk
110.
▲
by
accelbred
2y ago
I write pure embedded C at work. I used to pretty much only write Rust prior to going into the embedded field. Rust gives you memory safety, but has costs. It is a complex language (like C++ but not to same extent) with a lot of non-local c
111.
▲
by
accelbred
2y ago
This is false; with formal analysis tools like CBMC, you can prove the memory safety properties of your C code. You can even statically prove lack of integer overflows and that asserts are unreachable. I'll agree this is uncommon in ge
112.
▲
by
accelbred
2y ago
Hyperfine is a really useful tool. Weirdest thing I've used it for is comparing io throughput on various disks.
113.
▲
by
accelbred
2y ago
Nice! I was planning to try this at some point to bootstrap my environment, so nice to know its possible.
114.
▲
by
accelbred
2y ago
I work for the team that maintains coreMQTT ( https://github.com/FreeRTOS/coreMQTT ) Its a C89 MQTT library intended for embedded devices.
115.
▲
by
accelbred
2y ago
MMUless embedded with FreeRTOS. For example, at one point, we did not want connecting over TCP to block our command handler, so created a task that waited for a notification, and connected on that task, and went back to waiting for another
116.
▲
by
accelbred
2y ago
I have the opposite experience, working in embedded (C, not Rust...). Building a synchronous API on top of an async one is hell, and making a blocking API asynchronous is easy. If you want blocking code to run asynchronously, just run it on
117.
▲
by
accelbred
2y ago
Not only prototypes but typedefs with function pointers as well.
118.
▲
by
accelbred
2y ago
I end up using a .S asm file with .incbin directives to embed files. #embed would be much nicer
119.
▲
by
accelbred
2y ago
C++ can seamlessly include C89 headers. The C library headers for libraries I write often include C11/C99 stuff that is invalid in C++. Even when they are in C89, they are often incorrect to include without the include being in an `ext
120.
▲
by
accelbred
2y ago
Are strings used for timestamps? Those are usually why I'm sending 64-bit ints over IPC.
More ›