poll winners

Feb. 9th, 2026 08:47 pm
wychwood: chess queen against a runestone (Default)
[personal profile] wychwood posting in [community profile] girlmeetstrouble
Hi, all -

The winners are:
  • Mary Stewart - This Rough Magic ([personal profile] shewhostaples - first)
  • MM Kaye - Death in the Andamans (aka Night on the Island) ([personal profile] themis1 - second)
  • Madeleine Brent - Tregaron's Daughter ([personal profile] wychwood - third)
  • Charlotte Armstrong - The Chocolate Cobweb ([personal profile] coughingbear - fourth)


[personal profile] shewhostaples, [personal profile] themis1, and [personal profile] coughingbear - what book would you like to pick? And what order would you prefer? I know [personal profile] coughingbear said not the next one.

Question thread #148

Feb. 9th, 2026 08:59 pm
pauamma: Cartooney crab wearing hot pink and acid green facemask holding drink with straw (Default)
[personal profile] pauamma posting in [site community profile] dw_dev
It's time for another question thread!

The rules:

- You may ask any dev-related question you have in a comment. (It doesn't even need to be about Dreamwidth, although if it involves a language/library/framework/database Dreamwidth doesn't use, you will probably get answers pointing that out and suggesting a better place to ask.)
- You may also answer any question, using the guidelines given in To Answer, Or Not To Answer and in this comment thread.

good things

Feb. 9th, 2026 02:49 pm
watersword: Keira Knightley applying lipstick and looking in a mirror, with the words "a work in progress" nearby (Keira Knightley: lipstick)
[personal profile] watersword
  1. I have wonderful friends who validate me when I'm having a hard time.
  2. Farmer's market pesto in the freezer in the middle of winter.
  3. My team won a prestigious award at work and I got to read the nomination and it says really lovely things about the work we do.
  4. I already had the book Humankind: a hopeful history out from the library and after encountering Too Many Informations about the Epstein files, I started reading it and it is exactly what I need right now (although I would very much like to know what e.g. Maimonides' thoughts are on Bregman's argument, as well as wisdom traditions from India and China; maybe we'll get there).
  5. The public library is giving out free seeds which means it WILL be spring someday.
ffutures: (Default)
[personal profile] ffutures
This is a bundle of two-player RPGs for Valentine's day, the fourth such offer from Bundle of Holding. They come from a variety of authors and publishers, genres range from Georgian romance to far future exploration and horror

 https://bundleofholding.com/presents/ForTwo4

  

This isn't really my preferred style of play - I prefer a larger pool of players - but if you like a more intimate approach to gaming the bundle is pretty cheap and may be worth a look. My personal favourite from these is probably Retired: The Ordinary Life of a Former Supervillain, which looks like it could be a lot of fun, and might be expanded to a larger group of characters, but several others look entertaining.

I was listening to an audiodrama

Feb. 9th, 2026 10:47 am
conuly: (Default)
[personal profile] conuly
(Mission Rejected, if you're curious)

and they took the time at the start of the most recent episode to talk about a charity in Minnesota that will bring food safely to people. I don't have the name of the charity, it's not on their website right now.

But what really struck me is that they spent a few minutes on this and never once mentioned or even alluded to why some people might need food to be delivered safely.

I'm not sure what I think about that, but I'm sure I don't like it much.

******************************


Read more... )
forestofglory: Cup of tea on a pile of books (books)
[personal profile] forestofglory
The graphic novel pile is still going strong! (I did start watching a mini drama but I’m going to wait until I finish it to include it in one of these round ups)

In other media related news I have figured out that I can read comics from Hoopla on a tablet and that’s been nicer on my hands than reading at my normal computer set up. I’ve also gotten a new timer and have been doing better at taking hand breaks so I’ve been watch more Crush of Music

Lumberjanes, Vol. 1-2 by N.D. Stevenson et al.—There’s a Lumberjanes/Gotham academy crossover that I want to check out, but it's been ages since I read any Lumberjanes so I thought I’d re-read them. Another series about girls who are friends with each other! Friendship is so great! This is definitely an advantage of reading a lot of YA and MG things, though it still would like more female friendships in media for adults. Anyway, these comics are very fun! I have requested several more volumes form the library

The Space Cat: A Graphic Novel written by Nnedi Okorafor, art by Tana Ford— I was very excited when I learned that Nnedi Okorafor had written a graphic novel about a cat! It turns out this is based on her real life cat. It is extremely cute and very charming! The art was perfect for the story.

Teen Titans: Raven, Teen Titans: Beast Boy, Teen Titans: Beast Boy Loves Raven, Teen Titans: Robin, and Teen Titans: Robin Teen Titans: Starfire written by Kami Garcia, art by Gabriel Picolo—These are like YA graphic novels adaptations of the Teen Titans – that is this own version and not as far as I can tell part of larger continuity, but clearly based on the earlier versions. I’m not super familiar with most of these characters or the earlier version of the Teen Titans but I liked these as their own thing.

I did break my no YA with dead moms rule, as the first book opens with Raven’s mom dying in a car crash. The characters are fun, and I liked seeing their friends and family. The romances do feel really fast and underdeveloped though. But seeing the team form is a lot of fun! The art is good too!

There’s supposed to be one more of these published later this year so I’m going to have to keep an eye out for it so I can read the ending!

Taproot by Keezy Young—A lovely graphic novel about a gardener who can see ghosts. I loved all the lush plants! I would have liked just a little bit more detail about how the magic worked though. The whole book was really sweet.(CW: several of the ghosts are kids)

The Changeling King by Ethan M. Aldridge—Sequel to Estranged, I liked how this dealt with the consequences of the events of the first book. And the art remains excellent!

The Return of the King— Watched with R and the Kid. This one felt the darkest of the three, also the one with the most changes from the book. We took more breaks this time so I felt less over-stimulated by the end, which was good.
[syndicated profile] smbc_comics_feed

Posted by Zach Weinersmith



Click here to go see the bonus panel!

Hovertext:
Bet you none of these newfangled Ai art generators will do you an upskirt Pope.


Today's News:
oursin: C19th engraving of a hedgehog's skeleton (skeletal hedgehog)
[personal profile] oursin

Too busy trying to extend their lifespans to, you know, actually Have A Life?

The troubling rise of longevity fixation syndrome: ‘I was crushed by the pressure I put on myself’

One is actually surprised that this guy does in fact go for an evening out in a restaurant with his husband, even if he does exhaustively research it first and pre-order (and then melt down when it comes to him RONG):

He painstakingly monitored what he ate (sometimes only organic, sometimes raw or unprocessed; calories painstakingly counted), his exercise regime (twice a day, seven days a week), and tracked every bodily function from his heart rate to his blood pressure, body fat and sleep “schedule”. He even monitored his glucose levels repeatedly throughout the day. “I was living by those numbers,” he says.

One wonders if there is any place for Ye Conjugalz with hubby or is that losing Precious Bodily Fluids and all the other ills once ascribed to sexual indulgence.

And, indeed, tempted to say, it just feels like living for ever....

With a side of, austere regimes have been followed by religious devotees for centuries but that was for life everlasting in the next, not this, right?

But, honestly, surely it is possible to lead a healthy life which is not actually purgatorial - see also this Why has food become another joyless way to self-optimise?. Thinking back to the delicious healthy nosh at Grayshott of beloved nostalgic memories - along with the lovely treatments etc.

Okay, there are some dietary things I do because I do not particularly have to think about them, but that is because I made certain decisions back when, and e.g. I have my nice tasty home-made muesli of a morning with its healthy oats and linseed and nuts and it is an established pattern but it is a pleasure to eat.

Is it just me?

Feb. 9th, 2026 10:47 am
conuly: (Default)
[personal profile] conuly
Or is something up with the create entry page?
[syndicated profile] salo_linkspam_feed

Posted by Salo linkspam

The report authors warned that “default AI browser settings prioritize user experience over security,” pointing to several risky scenarios. These include:

    Indirect prompt injection via rogue agents
    Erroneous agent actions due to “inaccurate reasoning”
    Loss and abuse of credentials, if a browser is tricked into visiting to a phishing site
    Employees dodging cybersecurity training by telling their AI browser to complete sessions on their behalf
    Agents making expensive but incorrect corporate purchases, e.g., booking the wrong flights
    Loss of sensitive corporate data to the cloud, where it is processed by AI services

Permalink

(no subject)

Feb. 9th, 2026 09:12 am
seekingferret: Two warning signs one above the other. 1) Falling Rocks. 2) Falling Rocs. (Default)
[personal profile] seekingferret
Cathedrals of Science by Patrick Coffey

I picked it up because Wikipedia says Gilbert Lewis was nominated for a Nobel Prize 41 times and never won and I was like, there's gotta be a story there. I couldn't find a bio of Lewis, but I did find this, which is a group bio of Lewis and a cohort of physical chemists who revolutionized chemistry in the early 20th century. Lewis is joined in the main cast by Arrhenius and Nernst and Langmuir and Seaborg, all names I'd heard before but didn't really know.

Lewis had some Massachusetts blue blood, but he grew up in Nebraska before returning to attend Harvard and finishing his studies in Europe. And it seems clear that he was always a bit of a social oddball, even once he established himself as the king of chemistry at Berkeley.

The book has some serious parts when it covers the intersection of chemistry and the world wars, and Lewis's strange and tragic death, but mostly it's about how amazingly petty chemists are. I loved reading about how they kept stealing credit from each other for discoveries and doing backroom deals to keep each other from winning Nobel prizes.

To be clear, because I still don't understand how Nobel Prizes are awarded, it's not that Lewis was nominated in 41 years and never won. He received nominations from 41 people over a span of something like 25 years, for multiple discoveries and theoretical advancements in the field. He also devoted those 25 years, and the 20 before, to publically trashing the science of several of the people who decided who would win the prize, or had influence on the decides. Coffey digs up amazing documentary evidence of the coordinated campaign against Lewis, but also makes you think maybe you don't blame them for it.

Anyway, a long running theme in this journal is the way science doesn't move in a sphere of pure ideas but is instead a function of imperfect personalities in collision, and this was a brilliant illumination of that theme.

And if you just think Chemistry: The Soap Opera sounds fun, this is the book for you.

six thoughts on generating c

Feb. 9th, 2026 01:47 pm
[syndicated profile] wingolog_feed

Posted by Andy Wingo

So I work in compilers, which means that I write programs that translate programs to programs. Sometimes you will want to target a language at a higher level than just, like, assembler, and oftentimes C is that language. Generating C is less fraught than writing C by hand, as the generator can often avoid the undefined-behavior pitfalls that one has to be so careful about when writing C by hand. Still, I have found some patterns that help me get good results.

Today’s note is a quick summary of things that work for me. I won’t be so vain as to call them “best practices”, but they are my practices, and you can have them too if you like.

static inline functions enable data abstraction

When I learned C, in the early days of GStreamer (oh bless its heart it still has the same web page!), we used lots of preprocessor macros. Mostly we got the message over time that many macro uses should have been inline functions; macros are for token-pasting and generating names, not for data access or other implementation.

But what I did not appreciate until much later was that always-inline functions remove any possible performance penalty for data abstractions. For example, in Wastrel, I can describe a bounded range of WebAssembly memory via a memory struct, and an access to that memory in another struct:

struct memory { uintptr_t base; uint64_t size; };
struct access { uint32_t addr; uint32_t len; };

And then if I want a writable pointer to that memory, I can do so:

#define static_inline \
  static inline __attribute__((always_inline))

static_inline void* write_ptr(struct memory m, struct access a) {
  BOUNDS_CHECK(m, a);
  char *base = __builtin_assume_aligned((char *) m.base_addr, 4096);
  return (void *) (base + a.addr);
}

(Wastrel usually omits any code for BOUNDS_CHECK, and just relies on memory being mapped into a PROT_NONE region of an appropriate size. We use a macro there because if the bounds check fails and kills the process, it’s nice to be able to use __FILE__ and __LINE__.)

Regardless of whether explicit bounds checks are enabled, the static_inline attribute ensures that the abstraction cost is entirely burned away; and in the case where bounds checks are elided, we don’t need the size of the memory or the len of the access, so they won’t be allocated at all.

If write_ptr wasn’t static_inline, I would be a little worried that somewhere one of these struct values would get passed through memory. This is mostly a concern with functions that return structs by value; whereas in e.g. AArch64, returning a struct memory would use the same registers that a call to void (*)(struct memory) would use for the argument, the SYS-V x64 ABI only allocates two general-purpose registers to be used for return values. I would mostly prefer to not think about this flavor of bottleneck, and that is what static inline functions do for me.

avoid implicit integer conversions

C has an odd set of default integer conversions, for example promoting uint8_t to signed int, and also has weird boundary conditions for signed integers. When generating C, we should probably sidestep these rules and instead be explicit: define static inline u8_to_u32, s16_to_s32, etc conversion functions, and turn on -Wconversion.

Using static inline cast functions also allows the generated code to assert that operands are of a particular type. Ideally, you end up in a situation where all casts are in your helper functions, and no cast is in generated code.

wrap raw pointers and integers with intent

Whippet is a garbage collector written in C. A garbage collector cuts across all data abstractions: objects are sometimes viewed as absolute addresses, or ranges in a paged space, or offsets from the beginning of an aligned region, and so on. If you represent all of these concepts with size_t or uintptr_t or whatever, you’re going to have a bad time. So Whippet has struct gc_ref, struct gc_edge, and the like: single-member structs whose purpose it is to avoid confusion by partitioning sets of applicable operations. A gc_edge_address call will never apply to a struct gc_ref, and so on for other types and operations.

This is a great pattern for hand-written code, but it’s particularly powerful for compilers: you will often end up compiling a term of a known type or kind and you would like to avoid mistakes in the residualized C.

For example, when compiling WebAssembly, consider struct.set‘s operational semantics: the textual rendering states, “Assert: Due to validation, val is some ref.struct structaddr.” Wouldn’t it be nice if this assertion could translate to C? Well in this case it can: with single-inheritance subtyping (as WebAssembly has), you can make a forest of pointer subtypes:

typedef struct anyref { uintptr_t value; } anyref;
typedef struct eqref { anyref p; } eqref;
typedef struct i31ref { eqref p; } i31ref;
typedef struct arrayref { eqref p; } arrayref;
typedef struct structref { eqref p; } structref;

So for a (type $type_0 (struct (mut f64))), I might generate:

typedef struct type_0ref { structref p; } type_0ref;

Then if I generate a field setter for $type_0, I make it take a type_0ref:

static inline void
type_0_set_field_0(type_0ref obj, double val) {
  ...
}

In this way the types carry through from source to target language. There is a similar type forest for the actual object representations:

typedef struct wasm_any { uintptr_t type_tag; } wasm_any;
typedef struct wasm_struct { wasm_any p; } wasm_struct;
typedef struct type_0 { wasm_struct p; double field_0; } type_0;
...

And we generate little cast routines to go back and forth between type_0ref and type_0* as needed. There is no overhead because all routines are static inline, and we get pointer subtyping for free: if a struct.set $type_0 0 instruction is passed a subtype of $type_0, the compiler can generate an upcast that type-checks.

fear not memcpy

In WebAssembly, accesses to linear memory are not necessarily aligned, so we can’t just cast an address to (say) int32_t* and dereference. Instead we memcpy(&i32, addr, sizeof(int32_t)), and trust the compiler to just emit an unaligned load if it can (and it can). No need for more words here!

for ABI and tail calls, perform manual register allocation

So, GCC finally has __attribute__((musttail)): praise be. However, when compiling WebAssembly, it could be that you end up compiling a function with, like 30 arguments, or 30 return values; I don’t trust a C compiler to reliably shuffle between different stack argument needs at tail calls to or from such a function. It could even refuse to compile a file if it can’t meet its musttail obligations; not a good characteristic for a target language.

Really you would like it if all function parameters were allocated to registers. You can ensure this is the case if, say, you only pass the first n values in registers, and then pass the rest in global variables. You don’t need to pass them on a stack, because you can make the callee load them back to locals as part of the prologue.

What’s fun about this is that it also neatly enables multiple return values when compiling to C: simply go through the set of function types used in your program, allocate enough global variables of the right types to store all return values, and make a function epilogue store any “excess” return values—those beyond the first return value, if any—in global variables, and have callers reload those values right after calls.

what’s not to like

Generating C is a local optimum: you get the industrial-strength instruction selection and register allocation of GCC or Clang, you don’t have to implement many peephole-style optimizations, and you get to link to to possibly-inlinable C runtime routines. It’s hard to improve over this design point in a marginal way.

There are drawbacks, of course. As a Schemer, my largest source of annoyance is that I don’t have control of the stack: I don’t know how much stack a given function will need, nor can I extend the stack of my program in any reasonable way. I can’t iterate the stack to precisely enumerate embedded pointers (but perhaps that’s fine). I certainly can’t slice a stack to capture a delimited continuation.

The other major irritation is about side tables: one would like to be able to implement so-called zero-cost exceptions, but without support from the compiler and toolchain, it’s impossible.

And finally, source-level debugging is gnarly. You would like to be able to embed DWARF information corresponding to the code you residualize; I don’t know how to do that when generating C.

(Why not Rust, you ask? Of course you are asking that. For what it is worth, I have found that lifetimes are a frontend issue; if I had a source language with explicit lifetimes, I would consider producing Rust, as I could machine-check that the output has the same guarantees as the input. Likewise if I were using a Rust standard library. But if you are compiling from a language without fancy lifetimes, I don’t know what you would get from Rust: fewer implicit conversions, yes, but less mature tail call support, longer compile times... it’s a wash, I think.)

Oh well. Nothing is perfect, and it’s best to go into things with your eyes wide open. If you got down to here, I hope these notes help you in your generations. For me, once my generated C type-checked, it worked: very little debugging has been necessary. Hacking is not always like this, but I’ll take it when it comes. Until next time, happy hacking!

Just one thing: 9 February 2026

Feb. 9th, 2026 07:09 am
[personal profile] jazzyjj posting in [community profile] awesomeers
It's challenge time!

Comment with Just One Thing you've accomplished in the last 24 hours or so. It doesn't have to be a hard thing, or even a thing that you think is particularly awesome. Just a thing that you did.

Feel free to share more than one thing if you're feeling particularly accomplished!

Extra credit: find someone in the comments and give them props for what they achieved!

Nothing is too big, too small, too strange or too cryptic. And in case you'd rather do this in private, anonymous comments are screened. I will only unscreen if you ask me to.

Go!

Profile

diziet: (Default)
Ian Jackson

February 2026

S M T W T F S
1234567
891011121314
15161718192021
22232425262728

Most Popular Tags

Style Credit

Expand Cut Tags

No cut tags