News for hackers. Stuff that matters.
Re:Systems ideas that sound good but almost never work by d0mine on Wednesday January 01, 2025 @12:57AM (#42564241)
Here's a few DSL (for programmers) examples that might make sense (the context is embedding DSLs into Python literal strings): https://news.ycombinator.com/item?id=41214365

For example, bash, SQL DSLs may be immediately useful by protecting against shell,sql injection: shutil.run(sh"command {arg}") may translate to subprocess.run(["command", os.fspath(arg)])

No shell--no shell injection. The assumption is that it enables sh"a | b > {c}" syntax (otherwise just call subprocess.run directly). Implementing it in pure Python by hand would be more verbose, less readable, more error-prone).

Re:Systems ideas that sound good but almost never work by travisjungroth on Wednesday January 01, 2025 @02:52AM (#42564602)
Yes, there are definitely counterexamples. It’s not black and white at all.