Readit News logoReadit News
msully4321 commented on C stdlib isn't threadsafe and even safe Rust didn't save us   edgedb.com/blog/c-stdlib-... · Posted by u/msully4321
mad0 · 7 months ago
Sounds like you are arguing with a bot? em-dashes are a giveaway (nobody sane uses these "—")
msully4321 · 7 months ago
I go through periods of loving em dashes--but I always just write them as two dashes! (And LaTeX at least does the right thing.)
msully4321 commented on C stdlib isn't threadsafe and even safe Rust didn't save us   edgedb.com/blog/c-stdlib-... · Posted by u/msully4321
nwellnhof · 7 months ago
> Our nightly CI machines run on Amazon AWS, which has the advantage of giving us a real, uncontainerized root user.

> We don’t have the necessary files outside of the container, and our containers are quite minimal and don’t allow us to easily install gdb.

Have people lost the ability to build and debug their code locally, without clouds and containers?

msully4321 · 7 months ago
> Have people lost the ability to build and debug their code locally, without clouds and containers?

No, of course not, but it didn't crash on our machines!

msully4321 commented on C stdlib isn't threadsafe and even safe Rust didn't save us   edgedb.com/blog/c-stdlib-... · Posted by u/msully4321
hauntsaninja · 7 months ago
We had so many of these issues that we ended up LD_PRELOAD-ing patch getenv / setenv / putenv
msully4321 · 7 months ago
With a fixed implementation that leaks environments (like the one that just landed in glibc)?
msully4321 commented on C stdlib isn't threadsafe and even safe Rust didn't save us   edgedb.com/blog/c-stdlib-... · Posted by u/msully4321
plorkyeran · 7 months ago
The problem is that applications sometimes need to set environment variables which will be read by libraries in the same process. This is safe to do during startup, but at no later times.

Ideally all libraries which use environment variables should have APIs allowing you to override the env variables without calling setenv(), but that isn't always the case.

msully4321 · 7 months ago
Yeah, the cows have certainly gotten out already.
msully4321 commented on C stdlib isn't threadsafe and even safe Rust didn't save us   edgedb.com/blog/c-stdlib-... · Posted by u/msully4321
Thaxll · 7 months ago
Why requiring unsafe when the std implementation could take care of the synchronisation?
msully4321 · 7 months ago
Because it can still race with C code using the standard library. getenv calls are common in C libraries; the call to getenv in this post was inside of strerror.
msully4321 commented on C stdlib isn't threadsafe and even safe Rust didn't save us   edgedb.com/blog/c-stdlib-... · Posted by u/msully4321
01HNNWZ0MV43FF · 7 months ago
Env vars are good if you treat them as read-only within the process
msully4321 · 7 months ago
Yeah, setenv should probably just not exist, and environment variables should be only set when spawning new processes.
msully4321 commented on Show HN: EdgeDB 1.0   edgedb.com/blog/edgedb-1-... · Posted by u/colinmcd
c4m · 4 years ago
I'm wondering about the physical level—or at least how the EdgeDB conceptual level is translated to the Postgres conceptual level. The docs, and the comment you linked to, have helped me get pretty clear about the EdgeDB conceptual level.
msully4321 · 4 years ago
I talked a bit about this in my release day talk (https://www.youtube.com/watch?v=WRZ3o-NsU_4&t=8151s), but:

* Every edgedb type has a postgres table

* "single" properties and links are stored as columns in that table (links as the uuid of the target)

* "multi" properties/links are stored as a link table

So it's basically just translated to a relational database in normal form

msully4321 commented on Show HN: EdgeDB 1.0   edgedb.com/blog/edgedb-1-... · Posted by u/colinmcd
torartc · 4 years ago
Dumb question, how do you exit the shell? I feel like I've scoured the docs and can't find it.
msully4321 · 4 years ago
What colin said, or (in every terminal emulator I've used), ctrl-d to send end of file, which will close it.
msully4321 commented on EdgeDB: EdgeQL   website-atgsmhega-edgedb.... · Posted by u/todsacerdoti
historyloop · 4 years ago
How do I join tables 1:1 without creating a subfield, i.e.:

table1: id, name

table2: table1_id, level

Desired result:

{id, name, level}

msully4321 · 4 years ago
The most direct implementation of what you want would be:

  SELECT (Table1.id, Table1.name, Table2.level, Table2.table1_id)
  FILTER Table1.id = Table2.table1_id;
(This has a somewhat annoying extra output of table1_id, which could be projected away if necessary.)

If you want to use edgeql's shapes but still keep the essential join flavor, then something like:

  SELECT (Table1 { id, name }, Table2 { level })
  FILTER Table1.id = Table2.table1_id;
To make it a little more concrete, you can try this on the tutorial database (https://www.edgedb.com/tutorial)

  SELECT (Photo {uri}, User {name, email})
  FILTER Photo.author.id = User.id;
The tutorial database uses links, and so instead of having an author_id we have author.id, but having an author_id property would work just fine---except that then you'd have to do all the joins manually.

u/msully4321

KarmaCake day149July 14, 2021View Original