ecma | 6 years ago | on: More Productive Git
ecma's comments
ecma | 7 years ago | on: Approaching the kernel year-2038 end game
ecma | 7 years ago | on: A fun optimization trick from rsync
ecma | 8 years ago | on: Researchers have developed a water-based battery to store solar and wind energy
ecma | 8 years ago | on: FCC Issues Warning in Wake of Swarm's Unauthorized Launch
This is a discussion of another offence against a different document and assumes the first offence against FCC regulations is valid. Be careful not to conflate the two, one causes the other.
ecma | 8 years ago | on: Google Pay app for Android
ecma | 8 years ago | on: How to properly use macros in C
#2 is referred to as an unsafe macro because of the multiple evaluation of its arguments. In some cases this is fine but it may need to be documented that the macro is unsafe for future users. It is also entirely possible to convert these macros into safe ones if you're willing/able to use GNU C extensions like typeof. The SEI CERT secure C wiki has a good reference for this at [0].
#3 presumes you want to compose functions but I'd suggest that by doing so you are writing bad C. Because of the lack of any type of side-band error reporting (exceptions etc) you must presume that your functions will always return a sane/non-error value. That's not a good assumption even for your own code and definitely not for the C library or any other libs. In addition, this is just another unsafe macro which could be made safe as above.
#4 doesn't explain the solution to the problem it poses which is annoying because it's the most important one IMO. There are a number of ways to make a multi-line macro safe for use in an unbraced expression body. My preferred way is to define the macro with a always false-post check while loop. e.g.
#define MY_NAME_JEF(x) do{ \
const char jef[] = "jef"; \
printf("my name %s, not %s\n", jef, x); \
}while(0)
Note the lack of a trailing semi-colon. This is because we expect the macro to be terminated with its own semi-colon. Stupid example but it gets the point across I suppose.Check out the secure C wiki, it's full of gems which can help you avoid issues with macros, and much more.
[0] https://wiki.sei.cmu.edu/confluence/display/c/PRE31-C.+Avoid...
ecma | 8 years ago | on: A Little Story About the `yes` Unix Command
ecma | 8 years ago | on: The Joy of Sexagesimal Floating-Point Arithmetic
ecma | 8 years ago | on: (n+1)sec – a protocol for distributed multiparty chat encryption
ecma | 8 years ago | on: We need to document macOS
ecma | 8 years ago | on: Highlighting prime numbers with CSS
CSS4, let's do it.
ecma | 8 years ago | on: Highlighting prime numbers with CSS
It'd be pretty cool if CSS could define new rules based on counters and calculated properties. Then you might be able to bootstrap from something small like "2 is prime" and discover the rest of the primes up to n. Is this sort of wizardry possible?
ecma | 8 years ago | on: The NOVA filesystem
I actually wrote a comment in response to loeg elsewhere in the thread and lost it by refreshing (and then lost interest, hah!) on the subject of conversion. I think there are some interesting problems around introducing a new FS and having to build "migrations" into it from the start. Migration feels like an expensive (in time/effort) word and I'd be concerned about issues coming up when you need to rewrite chunks of your NOVA FS because the per-CPU region has to become larger and everything else needs to shift along. It wouldn't need to be a full rewrite since only some data would need to be moved but it still seems clunky.
As mentioned in another comment, it seems like the solution being put forward is to oversubscribed the per-CPU data region for 256 CPUs but I wonder how long until that turns out to be a bad assumption. Who knows, maybe it doesn't matter. Maybe it's just out of scope for NOVA. One FS doesn't need to rule the world after all!
ecma | 8 years ago | on: The NOVA filesystem
What type of usage am I missing where losing/having to do an offline rebuild of your data would be acceptable during a hardware upgrade? NOVA seems to be aiming to address the recognised issue by overprovisioning (which I disagree with but such is life). I don't really understand your argument.
ecma | 8 years ago | on: The NOVA filesystem
due to the per-CPU inode table
structure, it is impossible to
move a NOVA filesystem from one
system to another if the two
machines do not have the same
number of CPUs.
seems like a dealbreaker. What use is a FS if it isn't portable? At least it sounds like they're very aware of this issue.I'd be very interested to see what they end up doing to make this behave better prior to upstream consideration. I wonder if a linked list journal of inode table changes (with space drawn from per-CPU freelists) would be safe/fast enough. That could be periodically coalesced and remapped to the NOVA device's non-CPU aware inode table.
ecma | 8 years ago | on: Snowman: native code to C/C++ decompiler
The radeco project is a train wreck. The current state of radeco-lib (unless it's been remediated in the last month) is disappointing and the only reason it compiles is because the last SoC student appears to have commented out the bindings that radeco is meant to use to get radeco-lib to do anything. I actually spent an evening attempting to undo that absurd series of commits but after getting a lot of the commented out back in place, not being a Rust programmer, hit roadblocks I did not understand regarding types and traits.
Unsolicited advice incoming. Please keep a close eye on your RSoC students this year. Their goals to achieve anything which they can present do not necessarily grok with the ongoing health of your project. I'd also love it if you would drop Rust and work with a more accessible language, at least while you work toward an initial version which spits out something resembling C code. Ultimately it's your project so do whatever you want but IMHO making everyone understand an inherently complex project in a language which is not straightforward is not the best option. Or at least add some documentation and make your lib and program build together...
ecma | 8 years ago | on: Redesigning GitLab's navigation
ecma | 8 years ago | on: A formal kernel memory-ordering model
ecma | 8 years ago | on: Show HN: Warp – Secure and simple terminal sharing
Git guidance should almost always start with a brief introduction to the concepts you believe the audience doesn't know or fully understand. To begin with reset and not properly explain the index will just end up being confusing, especially with brief references to hard, soft and mixed resets later on!