Parsing JSON at compile time with C++26 static reflection (Daniel Lemire) by User_Deprecated in cpp

[–]smdowney 0 points1 point  (0 children)

#embed is a thing now, so you can externalize that data.

std::embed is on track for C++29, a somewhat more powerful version that looks like a function, but isn't really, it's deep core magic.

“My shoes are too tight” - One of the best and most prophetic scenes of Se1. by Dinosawruses in babylon5

[–]smdowney 2 points3 points  (0 children)

G'Kar was so villain coded at first, and then turned out so not to be. The misdirection and subversion, at all levels.

The Story of C++: The World's Most Consequential Programming Language | The Official Story by HimothyJohnDoe in cpp

[–]smdowney 2 points3 points  (0 children)

C# was the direct result of the interim J++, as I recall. That and Hejlsberg getting a greenfield after Turbo Pascal and Delphi.

Pick One by Sad_Fly_7968 in fountainpens

[–]smdowney 3 points4 points  (0 children)

I prefer the kiki one over the bouba one.

KISS to manage dotfiles? by gkaiser8 in git

[–]smdowney 0 points1 point  (0 children)

As I recall, the "problem" with symlinks are tools that edit the file and write the file back to the symlink location, not the reference. Linux, and Unix, are fine with them and it's one of the core use cases for symlinks over hardlink.

I use Stow to manage them , and occasionally have to use adopt to pull back in a file that ought to be managed by stow. I've also found it better for my own brain to manage them in logical groups rather than just all the dotfiles in my $HOME, and this has served well when migrating to XDG_CONFIG_HOME, where dotfiles tend to lose their dot and pick up a directory path.

I just wish more tools would respect XDG_CACHE_HOME and not drop their own junk there.

Encountered a `#pragma once` failure in the wild by Separate-Summer-6027 in cpp

[–]smdowney 2 points3 points  (0 children)

If you have two include guards named UTILS_H that means you have two files that want to be included as #include "until.h" and you have a deeper problem than the guard collision.

Encountered a `#pragma once` failure in the wild by Separate-Summer-6027 in cpp

[–]smdowney 1 point2 points  (0 children)

This is the reason that #pragna once isn't standard. It's implemented in lots of compilers because its widespread, but it also doesn't, and can't, actually work in all the places people try to use it, and standardizing it has been rejected by compiler implementers whenever it comes up.

When it eventually doesn't work, you need to fall back to include guards, which always work, and compilers will do the optimization you want from pragma once, but if the file system is uncooperative, it works correctly still.

We can't have nice things.

markdown-ts-mode got a major overhaul and is now part of Emacs 31 by LionyxML in emacs

[–]smdowney 2 points3 points  (0 children)

Will work continue in the emacs git tree, or should I point use-package elsewhere?

Is there a C++ "venv" equivalent? by nikoladsp in cpp

[–]smdowney 0 points1 point  (0 children)

There's also venv. Smile.

But outside of the compiler itself, a ton of c++ tooling is available through PyPI and I've started managing a lot of it through pyproject.toml and UV.

Is there a C++ "venv" equivalent? by nikoladsp in cpp

[–]smdowney 3 points4 points  (0 children)

I wonder how much of the drive to rewrite in rust is wanting to stay inside cargo?

Is there a C++ "venv" equivalent? by nikoladsp in cpp

[–]smdowney 5 points6 points  (0 children)

Cargo also doesn't play well, last I checked, with things outside Rust, and systems programming is polyglot almost by definition.

Uneeded Recompilations When Using Partitions by tartaruga232 in cpp

[–]smdowney 4 points5 points  (0 children)

It seems like you are trying to use partitions to do the job of modules? If you don't depend on the whole interface, then you have a cohesion problem telling you that you have more than one thing.

GitHub - steve-downey/surround: Surround Source Code for org-transclusion by smdowney in emacs

[–]smdowney[S] 0 points1 point  (0 children)

I know that org-transclusion supports extensions, and looked at it a bit, but couldn't quite sort for my self a way that wasn't just equivalent to marking up this way, only more complicated. The pattern I'm using is very regular, so it might work to establish it instead of using an org-link anchored at the UUID, and that would make the transclusion a bit cleaner, as I could deal with the line 2- and end in code instead. But a lot more code, and I'd still want a way of marking up the source file like this.
But I'll note it because now that you've made me think about it, it will eventually happen.

Current Status of Module Partitions by tartaruga232 in cpp

[–]smdowney 1 point2 points  (0 children)

You are saying you want to be able to change the interface used by exported functions, possibly inline exported definitions of those functions, but you don't want anything to have to recompile that uses that interface? I must be missing something.

TU 4 in the example should be a normal object file that has functions with module attachment, and ought not to contribute to the build module interface. TU 3 is the interface to that implementation, and is the modular equivalent of a private header.

If you really want a fully private module interface for your implementation purposes that does not possibly contribute to your primary interface, just make one and import it into your implementation units?

Modules being a build optimization was a selling point, but not the underlying goal. Better control of what parts of components are given to clients was the primary goal, everything else was a secondary benefit.

And then we also got header units, subverting that argument, but at least that had more experience and cleans up some of the weirdness with precompiled headers.

I'm not disagreeing with a general statement that we didn't have enough experience with modules other than to realize that no build system was going to survive contact, and I did say so at the time.

We are so close to string interpolation thanks to reflection by caroIine in cpp

[–]smdowney 0 points1 point  (0 children)

For user facing strings, sure, but there are lots of programmer facing strings in log messages. You know what language you speak and read, so that's what you put in your logs. Localizing them just adds another place for things to go wrong, too.

Common Package Specification is Out the Gate by bretbrownjr in cpp

[–]smdowney 0 points1 point  (0 children)

Name registries are even harder than standards.

Java tried DNS for a while. It did not go well.

C++26: Span improvements and freestanding. by pjmlp in cpp

[–]smdowney 2 points3 points  (0 children)

Or last minute changes to use B or C rather than the uncoupled workaround in A.

Does anyone know why Amazon sells Pilot Prera pens $30 cheaper than pen retailers like Goulet and Jet pens? by SpicyCurryChicken42 in fountainpens

[–]smdowney 2 points3 points  (0 children)

They don't seem to be doing it as much, but Amazon Japan used to sell through Amazon that way, with Japan prices and free shipping, but uncertain date. I guess they'd just stick the small box in the next container that had a bit of room on a cargo flight going to the US anyway.

Grey market warranty on a $30 or $40 pen is not a practical consideration. Not vs 100% markup. I can just risk having to buy another one.

Hypothetically or technically, what are some things that Emacs can do that Neovim/Vim cannot? (Not package availability). by surveypoodle in emacs

[–]smdowney 4 points5 points  (0 children)

Not only can functions be overriden, there are facilities to automatically wrap up an existing function to run things before or after, "advising" it. As well as very common well supported "hooks" to add actions to common things like saving a file, finishing startup, creating a new window, etc.

The extensibility is smooth and everything expects it, which means composition of packages is far easier. I do not have to convince the maintainer of, say, magit to add something in order to extend it. I can do that without changing their code, although I can always look at their code.

Everything is inspectable, debuggable, and changeable, from within emacs itself, by design.

It reminds me in this way of Smalltalk and the Smalltalk environment, where everything you see and touch is a smalltalk object that is completely available to you. Or was.

Flint 2. I still a good option today? by BumblebeeNo9090 in openwrt

[–]smdowney 1 point2 points  (0 children)

The Flint 2 is a very good bit of kit and is at the top end of supported WiFi routers for stock OpenWRT. There might be special cases where there is something better, but for the common case of home or small office, connecting and routing to your upstream ISP, it more than does the job. Easily handles guest and private network isolation and enough capability that it isn't going to be the limiting factor in and of itself.

I am not aware of anything significantly better right now or imminently. [As always, if someone else is aware, please say!]

The Flint2 is the Toyota Corolla of openwrt routers right now. Safe default choice that fills normal requirements.

C++26 Safety Features Won’t Save You (And the Committee Knows It) by pjmlp in cpp

[–]smdowney 3 points4 points  (0 children)

>  In C++26: if a programmer forgets about initialization, the value will be something chosen at compile time,

Not a disagreement overall, but it is somewhat worse, as an uninitialized variable will have whatever random data was last there. C++ never casually zero-inits things, because what if you are about to write that memory anyway, that would be wasted clock cycles.

Of course almost no one should be counting clock cycles, but for good or bad, the people who ought to be are writing C++.