Hacker Newsnew | past | comments | ask | show | jobs | submit | more gavinray's commentslogin

"Patient-Specific In Vivo Gene Editing to Treat a Rare Genetic Disease"

https://www.nejm.org/doi/full/10.1056/NEJMoa2504747



Thanks! We've put this link in the header of the thread.


The "htop" utility has a "Tree View" if you press F5 that is pretty handy for this, too.


You are not the target audience if "how" was not apparent to you


I am the target audience and I still had no idea what the site was promoting from just the landing page.


Someone else said it's not actually interactive. So which is it?


The "how" is very obvious, but not the "why". I'd assume this much would be very apparent from the OPs complaint, but apparently not I guess...


I became target audience after I had a cup of coffee...


I mean, I've done engineering work for the last 15 years on most layers of the stack. Seeing an ssh command into a fancy url does not tell me anything about what that is going to accomplish. But yeah, you must be right.


Outdated, modern solution is baked in now

https://en.cppreference.com/w/c/preprocessor/embed


That's good to know, but I've noticed it was added in C++26 and seems to be supported in GCC 15 and Clang 19, but not MSVC.

I think in a few (3-4?) years it will be safe to use, but in any case not now.

Still, good to know that it exists.


I would assume that this is easy enough to implement that it will likely appear in a minor update to the upcoming Visual Studio version. MS kept updating the compiler since VS 2022, too.


I certainly hope so, but we'll see. To give an example, std::chrono::current_zone (C++20) still doesn't work on Android even to this day.

So as long as #embed isn't supported by all the 3 major compilers, I am sticking with my current embedding setup. I guess that's what I was thinking of.


It will be at least a decade before I can rely on that in systems software that needs to be portable.


There are good reasons to stick to C89.


let me know when my embedded target's compiler is C23 compliant (i mean, i whish. we may be getting C11 or even C17 some times next year but i'm not holding my breath)


What are you targetting? for instance all ESP32 now support GCC15 which has support for #embed. AVR also has GCC 15 toolchains for months, as well as ARM which also allows you to target STM32 and Nordic nRF stuff.


What current embedded target in $this_year doesn't have a C11 compiler? I'll send you $5 if you can name one.


easy: microchip.


https://www.microchip.com/en-us/tools-resources/develop/micr...

GCC 15, so C23 is the default language.

And C11 was fully supported since GCC 4.9 which released in 2014.


cake[0] might interest you. Basically transpiles C into C89.

[0]: https://github.com/thradams/cake


The thing that always irks me about c++ is this sort of thing:

> Explanation 1) Searches for the resource identified by h-char-sequence in implementation-defined manner.

Okay, so now I have to make assumptions that the implementation is reasonable, and won't go and "search" by asking an LLM or accidentally revealing my credit card details to a third party, right?

And even if the implementation _is_ reasonable the only way I know what "search" means in this context is by looking at an example, and the example says "it's basically a filename".

So now I think to myself: if I want to remain portable, I'll just write a python script to do a damn substitution to embed my file, which is guaranteed to work under _any_ implementation and I don't have to worry about it as soon as I have my source file.

Does anyone else feel this way or is it just me?


You're not the only one who feels that way, but IMHO it's not a valid complaint.

The C++ standard says implementation defined because the weeds get very thick very quickly:

- Are paths formed with forward slash or backslash?

- Case sensitive?

- NT style drive letter or Posix style mounts?

- For relative paths, what is it relative to? When there are multiple matches, what is the algorithm to determine priority?

- What about symlinks and hard links?

- Are http and ftp URIs supported (e.g. an online IDE like godbolt). If so, which versions of those protocols? TLS 1.3+ only? Are you going to accept SHA-1?

- Should the file read be transactional?

People already complain that the C++ standard is overly complicated. So instead of adding even more complexity by redefining the OS semantics of your build platform in a language spec, they use "implementation defined" as a shorthand for "your compiler will call fopen" plus some implementation wiggle room like command line options for specifying search paths and the strategy for long paths on Windows

What if #embed steals my credit card data is a pointless strawman. If a malicious compiler dev wanted to steal your credit card data, they'd just inject the malicious code; not act like a genie, searching the C++ spec with a fine comb for a place where they could execute malicious code while still *technically* being standards conformant. You know that, I know that, we all know that. So why are we wasting words discussing it?


The real reason why this stuff in underspecified in the spec is that some mainframe operating systems don't have file systems in the common modern sense, but support C++. Those vendors push back a lot against narroed definitions as far as I know.


Including files also opens up some potential security issues that the standards committee just didn't want to prescribe solutions to. Compiler explorer hides easter eggs around the virtual filesystem, for example:

https://godbolt.org/z/KcqTM5bTr


#include also searches for the file you give it in an "implementation-defined manner", so if you have this complaint about #embed, you ought to also consider #include equally problematic


> So now I think to myself: if I want to remain portable, I'll just write a python script

How can you know that your Python implementation won't send your credit card details to an LLM when it runs your script? It does not follow an ISO standard that says it can't do that. You're not making assumptions about it's behavior, are you?


This doesn't sound like the kind of portability anyone is really worried about. I get that the docs on the linked site are written in standards-ese and are complicated by macro replacement, but I don't think the outcome of sending your credit card details away is gonna be an outcome. If it was, an uncharitable implementation with access to your card details would be free to do that any time you gave it input invoking undefined behaviour (which is of course not uncommon, especially in incorrect code).


which makes me consider an interesting distinction, undefined behavior refers to the behavior of the compiler output, does the C standard "allow" compilers to do compile-time code executions with undefined behavior? is the runtime behavior of the compiler even in scope for the standard in general?


If you want to remain portable, write your code in the intersection of the big 3 - GCC, Clang and MSVC - and you’ll be good enough. Other implementations will either be weird enough that many things you’d expect to work won’t or are forced to copy what those 3 do anyway.


This is what I have been doing for years. Works well for me.

Sometimes it is annoying but realistically it is a good strategy.


...what? What are you talking about? In what world would a compiler implement a preprocessor directive to ever use an llm, the internet, or your credit card details (from where would it get those)??? There are always implementation defined things in every language, for example, ub behavior. Do you get worried that someone will steal your bitcoin every time you use after free? Of course not! Even in Python when you OOM -- at least in CPython -- you crash with undefined behavior.


Sorry for being so aggressive. I suppose I'm just very confused at where you're coming from.


this take is basically equivalent to "don't write software unless you write the stack from scratch."


  > Eh, DB branching is mostly only necessary for testing - locally
For local DB's, when I break them, I stop the Docker image and wipe the volume mounts, then restart + apply the "migrations" folder (minus whatever new broken migration caused the issue).


You can use "psql" to dump subsets of data from tables and then later import them.

Something like:

  psql <db_url> -c "\copy (SELECT * FROM event_data ORDER BY created_at DESC LIMIT 100) TO 'event-data-sample.csv' WITH CSV HEADER"
https://www.postgresql.org/docs/current/sql-copy.html

It'd be really nice if pg_dump had a "data sample"/"data subset" option but unfortunately nothing like that is built in that I know of.


pg_dump has a few annoyances when it comes to doing stuff like this — tricky to select exactly the data/columns you want, and also the dumped format is not always stable. My migration tool pgmigrate has an experimental `pgmigrate dump` subcommand for doing things like this, might be useful to you or OP maybe even just as a reference. The docs are incomplete since this feature is still experimental, file an issue if you have any questions or trouble

https://github.com/peterldowns/pgmigrate


Indeed, but is there a way to do it as a "point in time", eg do a "virtual checkpoint" at a timestamp, and do all the copy operations from that timestamp, so they are coherent?


I'm fairly sure I can speed the JVM implementations up a significant amount by MMAP'ing the file into memory and ensuring it's aligned.


I'm not too familiar with the JVM so perhaps I'm missing something here: how would that help? The file is tiny, just a few bytes, so I'd expect the main slowdown to come from system call overhead. With non-mmap file I/O you've got the open/read/close trio, and only one read(2) should be needed, so that's three expensive trips into kernel space. With mmap, you've got open/stat/mmap/munmap/close.

Memory-mapped I/O can be great in some circumstances, but a one-time read of a small file is one of the canonical examples for when it isn't worth the hassle and setup/teardown overhead.


Hmmmm

  llvm::Value* JitDirectiveNode::CodeGen(Compiler& compiler) {
    // TODO: Implement the @jit shell-to-native translation engine.
    // 1. Read the content of the shell script at FilePath.
    // 2. Parse the shell script into a sequence of POSIX-equivalent commands.
    // 3. Translate these commands into LLVM IR, similar to ProcessCallNode.
    // 4. Inline the generated IR into the current function.
    // This is a major and complex part of the compiler.
    return nullptr;
  }


Alright, I chuckled.


I just read a story about a 13-year-old awarded a Ph. D at a prestigious university.

Human intelligence/aptitude has such extreme distributions it's almost unthinkable.


Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: