Readit News logoReadit News
adrusi commented on I am not yet ready to switch to Zig from Rust   medium.com/@penberg/why-i... · Posted by u/avinassh
knighthack · a year ago
How is it a "better C" as compared to Go? Genuinely asking.
adrusi · a year ago
Go has a heavy runtime, including both a garbage collector and a userland scheduler. Those features both make it inappropriate for some applications where you would use c, and also make calling (and especially being called from) foreign code problematic. You effectively cant implement a library in go and then call it from another language, not without considerable ffi overhead at the very least.
adrusi commented on MKBHD, Fisker, and "the worst car ever reviewed"   twitter.com/MorningBrew/s... · Posted by u/redbell
mongol · a year ago
He called it "the worst car I've ever reviewed"

How many cars have he reviewed? I thought he mostly reviewed smartphones.

adrusi · a year ago
42 videos on his car review channel plus 13 videos on his main channel (a few might be crossposted) plus a couple tesla reviews from several years earlier than the others.

So 50+.

adrusi commented on WebAssembly Playground   observablehq.com/@chaosal... · Posted by u/ifree
thrdbndndn · 2 years ago
To incorporate something currently is only available in "native" program form is what I am thinking; like ffmpeg example above.
adrusi · 2 years ago
it's maybe negligible compared to the code-size bloat of web applications, but delivering large libraries over the network with only limited caching is less than ideal
adrusi commented on Augmenting the Markdown Language for Great Python Graphical Interfaces   taipy.io/posts/augmenting... · Posted by u/nevodavid
eviks · 2 years ago
/ intuition is pretty simple: slanted mark for slanted text

What's that wild intuition of underscores???

Also, why would you ever read it as a regex in a human /text/ markup language?

adrusi · 2 years ago
At least in English, typographic conventions have historically equated underlining with italics, and the reason the underscore key is present on your keyboard is because it was used on typewriters to format text that would have been italicized in printed text.

Surrounding text with underscores to indicate italicization is intuitive to anyone who is familiar with that convention.

Personally, I find surrounding text with forward slashes exactly wrong for italicization, because I mentally apply a skew-transform to the text to make the slashes into vertical lines, which leaves the text itself slanted in the wrong direction. Backslashes would make more sense, and also avoid looking like regular expressions. But literally no one uses that convention and we do not need a new one.

adrusi commented on C23: A Slightly Better C   lemire.me/blog/2024/01/21... · Posted by u/mfiguiere
dzonga · 2 years ago
quick qn ? for the tinkerers -- is there a language these days that nicely interfaces with c i.e able to use all c libraries through ffi. without loss of performance or extra fu.

the language being small enough that all basics can be grasped in a day.

the language being complete that it will remain the same in 10 years.

while at the same time being memory safe.

btw I don't think golang applies given the bad ffi story in go.

--- edit btw:: yeah this implies the use of a GC. though it must not have massive pauses or stop the world GC.

adrusi · 2 years ago
while at the same time being memory safe.

memory safety doesn't mean just one thing, but probably it requires either a lot of rust-like features, a tracing garbage collector, or automatic reference counting.

the language being small enough that all basics can be grasped in a day

that disqualifies taking the rust-like path.

able to use all c libraries through ffi. without loss of performance or extra fu.

that disqualifies most (all?) advanced tracing gc strategies

it must not have massive pauses or stop the world GC.

that disqualifies simpler tracing gc strategies

depending on what precisely you're looking for, it's possible it might be a pipe dream. but it's also possible you'll find what you want in one of D, Nim or Swift. Swift is probably the closest to what you want on technical merit, but obviously extremely tied to Apple. D and Nim strap you with their particular flavor of tracing gc, which may or may not be suited to your needs.

adrusi commented on Flying kites deliver container-sized power generation   spectrum.ieee.org/micro-w... · Posted by u/geox
londons_explore · 2 years ago
Odd shapes and constantly starting/stopping the plougher/seeder/harvester mean you get less ROI on your equipment. Farming is super tight margins - if your machines waste 20% of the time starting and stopping every time they pass over a road, your farms profits are wiped out.

This is true whether the machines are robot driven or not, and it's the reason most commercial farms have huuuuuge fields rather than lots of small ones.

adrusi · 2 years ago
The cost of the land to the grower is lower on account of the presence of the turbines.
adrusi commented on NewPipe – Lightweight YouTube experience for Android   newpipe.net/... · Posted by u/vyrotek
micw · 2 years ago
Honestly, I do not understand why one should use this. I have recently seen some high quality YT videos, each of a length of 30-60 minutes. In those videos where some sponsors mentioned which took only one or two minutes. Seems perfectly OK for me to support the creators. I guess if many people block sponsor content, this kind of vids will die.
adrusi · 2 years ago
I do not understand why one should use this

I don't care to sit through sponsor reads, nothing more to it than that. When I'm viewing on a client that doesn't support sponsorblock, I'll manually seek to the end of the segment. Supporting the creator is great; I pay for YouTube Premium, though thanks to uBlock Origin I wouldn't see the add if even if I stopped paying. To a couple creators, I send a regular donation. If I could spend another $10/mo to make up for any revenue my sponsorblock usage loses other creators, I'd do that, but I'm less enthusiastic about regularly listening to sales pitches for the same products over and over again.

Also: I'm not sure how common it is for YouTube sponsorship contracts to have payment contingent on the view count for the section of the video with the sponsored segment, and I'm not sure if the way sponsorblock skips such segments is visible to YouTube's analytics. With at least some of the most prolific sponsors of creators I watch (Audible, Brilliant, etc) the payout is based on how many viewers sign up for a trial through the affiliate link. And YouTube has no incentive to make it easy for creators to share their detailed analytics with third-party sponsors, since independent sponsorships cut YouTube out of the deal. YouTube would prefer creators replace their independent sponsor reads with mid-roll ads.

adrusi commented on Bringing garbage collected programming languages efficiently to WebAssembly   v8.dev/blog/wasm-gc-porti... · Posted by u/kiyanwang
ngrilly · 2 years ago
I'm a bit skeptical about this. This is significantly increasing WebAssembly's complexity.

Garbage collectors are a leaky abstraction: Some support interior pointers, others don't. Some support parallel tasks sharing memory, others don't. Some require compaction, making C FFI more difficult, others don't. Some require a deep integration with whatever mechanism is used for green processes/threads and growable stacks, others don't. Etc.

When looking at languages like Erlang, JavaScript, Python, or Go, the choices made at the language level are partly reflected in their garbage collectors.

That idea of a universal/generic VM supporting many languages has been tried many times, with limited success, for example with the JVM, CLR, or Parrot. What makes this different?

adrusi · 2 years ago
That idea of a universal/generic VM supporting many languages has been tried many times, with limited success

What wasm is doing is something different than previous efforts. The gc facilities aren't provided for the sake of interop with other languages, or for the sake of sharing development resources across language runtime implementations. Wasm is providing gc facilities so that managed-memory runtime languages can target wasm environments without suffering on account of limitations imposed by the restrictive memory model, and secondarily to reduce bundle sizes.

Wasm can potentially support more tunable gc parameters to better suit the guest language's idiosyncrasies than can other general purpose language runtimes. And unlike the runtimes we're comparing it against, language implementers don't have to option of making something bespoke.

adrusi commented on Unix Structured Concurrency   matklad.github.io/2023/10... · Posted by u/ingve
gwright · 2 years ago
I'm a little rusty here, but I think you are talking about the fact that the exit status of the child process has to remain available until the parent process can reap it. Until that happens the child process is in the zombie state. You indicated that the creating thread needed to exit, but that seemed a bit too specific to me, I think that any thread can reap the exit status of a child process.

Related to this is the double-fork pattern to avoid zombie processes (and a couple other issues) when initiating a daemon process.

adrusi · 2 years ago
The surprising behavior was that the child process received the configured signal not when the process that created it exited, but rather when the specific thread that called fork(2) exited.

The parent process was an event loop based python program whose main function was to manage the creation and deletion of these child processes, and the simplest way to spawn child processes without blocking the event loop is to call fork(2) on a thread pool. My thread pool was triaging the number of worker threads based on demand, so occasionally it would decide a worker was no longer needed, and all the child processes that happened to have been created on that thread would get SIGKILL'd — something you rarely want when using a thread pool!

I didn't want the child processes to die unless the parent process's business logic decided they were no longer needed, or if the parent was itself killed (this latter reason being the motivation for setting PDEATHSIG).

Once I understood why my processes were dying, the solution was simple: make sure the worker threads never exit.

adrusi commented on Unix Structured Concurrency   matklad.github.io/2023/10... · Posted by u/ingve
josephcsible · 2 years ago
If you're on Linux, you can use PR_SET_PDEATHSIG to accomplish exactly this goal.
adrusi · 2 years ago
I had a hell of a time a few months ago debugging why my child processes were dying, before learning that PDEATHSIG=9 (don't ask) kills child processes when the thread that created them in the parent process exits.

My debugging was not aided by the fact that disabling the code where I set PDEATHSIG had no effect, since someone else's code was invisibly setting it regardless.

u/adrusi

KarmaCake day3700May 11, 2011
About
[ my public key: https://keybase.io/adrusi; my proof: https://keybase.io/adrusi/sigs/AsJK2Q8-9_okvvc1HoWmt6KTGnL_SpJ34Ld6-QdP_EE ]
View Original