HNHacker News
TopNewBestAskShowJobs

xiii1408

748 karma · joined November 2, 2014

submissionscomments
xiii1408··on Reple: “Replay-Based” REPLs for Compiled Languages
Yes, there are tools like rcrl (mentioned in the blog post) that dynamically link in new pieces of code [1]. The author of rcrl gave a nice talk at CppCon [2].

The trouble with tools like that is that they're pretty language specific, so it's my impression that it would require a fair bit of work to generalize to languages other than C++.

[1] https://github.com/onqtam/rcrl

[2] https://www.youtube.com/watch?v=UEuA0yuw_O0

xiii1408··on Storing C++ Objects in Distributed Memory
This post is really just about an abstraction for storing objects and doesn't explain how you'd make data structures that distribute objects across nodes using remote pointers.

Remote pointers end up being pretty nice for locality, since you can explicitly see what process a remote pointer is pointing to.

None of the backends that my remote pointer implementations depend on really offer fault tolerance, though. So you're right: if you're in a situation where you have nodes entering or leaving your cluster before your program ends, this model needs extending before it works for you. That's true for MPI-style programs, generally, though.

xiii1408··on Storing C++ Objects in Distributed Memory
Some cool people at VMWare wrote some software that lets you manage RDMA segments as files in the file system [1]. And you can mmap those RDMA-resident files if you wish.

[1] https://256fd102-a-62cb3a1a-s-sites.googlegroups.com/site/mk...

xiii1408··on Storing C++ Objects in Distributed Memory
Yep, you caught my typo. Notice the GodBolt version has serialize_().
xiii1408··on Storing C++ Objects in Distributed Memory
It's just CSS based on the LaTeX defaults, written by Andrew Belt as a style for Wikipedia [1,2].

[1] https://github.com/AndrewBelt/WiTeX

[2] https://andrewbelt.name

xiii1408··on Storing C++ Objects in Distributed Memory
Dynamic languages for sure - you just dynamically dispatch your method call based on the type of the object in the container.

But what C++ is doing (and static languages with metaprogramming in general) is specializing and statically inlining everything at compile time so the assembly just takes the fastest path every time; no runtime cost.

I'm unsure which static languages do and do not support partial specialization. My understanding is that the current iteration of Rust doesn't have partial specialization, but maybe it has other features that could do what this post is doing?

I'd be interested in hearing people's perspectives on the metaprogramming power of different statically typed languages - people have expressed interest in me building libraries like this in Rust and a few other languages.

xiii1408··on Storing C++ Objects in Distributed Memory
That's super cool. I'd love to see any of your papers/code.
xiii1408··on Running FreeBSD on OS X using xhyve, a port of bhyve
What's the overhead of running in xhyve? Is it like a Linux kernel container, or more like KVM, or what?
xiii1408··on Google personalizes search results even when you’re logged out, new study finds
I've observed this a lot when working on SEO for my webpage. I'll be like, "Cool, I'm the top result for my name!" And, yes, this will be true for people searching from Berkeley, where I live. But if I go to an IP address over in SF, I'm not even on the front page.
xiii1408··on BSD vs. Linux
Oh, wow, that's good to hear. Maybe they've improved a lot in the past two years.
xiii1408··on BSD vs. Linux
Hahahahaha yes that's exactly what Manjaro is.

And, sure, it's not Debian or CentOS, so you don't have as much attention focused on the packages. Their record of keeping malware out is pretty solid, though, as far as we know.

I think a lot of security has to do with simplicity: if you don't understand how your software is configured, you're likely to open up a security hole on your system.

Arch's "don't start doing stuff until the user tells you" posture does a good job of making sure the user is aware of what's running on her system. Contrast this to Debian, which will often start running random services as soon as you install a package (e.g. Apache).

xiii1408··on BSD vs. Linux
Linux also has more drivers for older hardware. Or just hardware.

I installed FreeBSD on a ThinkPad T400 back in 2016... I was royally unimpressed with all the shit I had to go through to get drivers working on what is probably the most supported laptop of all time for the open-source community.

I would shudder to think about setting up an encrypted BSD dual-boot with Mac OS on my MBP, like I do with Arch.

And I mean this not to degrade BSD; I did love the design. Just, like, I don't want to spend all my time installing drivers from source and writing custom scripts to control my backlight and CPU fan.

xiii1408··on BSD vs. Linux
You definitely should try Arch.

It has a similar "from scratch" policy, but all the official packages are pre-compiled. There's also the Arch User Repository, where you can find proprietary and unofficial packages, many of which will compile from source.

It also has by far the best documentation of any distro.

xiii1408··on Show HN: The Reader View of Wikipedia
Wikipedia has themes and also lets you add whatever custom CSS you want to your account.

My personal favorite is WiTeX, which makes Wikipedia look like a LaTeX document [1].

[1] https://github.com/AndrewBelt/WiTeX

xiii1408··on Fortran is still a thing
I disagree.

Why is Fortran still a thing? technical debt

Everyone I know in astrophysics or engineering who can uses something else--Python, C++, and Julia, are big winners.

The problem is that there are these huge monolithic codebases written in Fortran that are difficult to get out of using. People end up using Fortran because they need a hydrodynamics code, or a navier stokes solver, or a chemical kinetics code, but they can't justify building one from scratch--that's not how you get a Ph.D., and Ph.D. students and post docs are the people doing the brunt of this work.

There's also the added disincentive that even if you do re-implement a solver in a modern, maintainable way, then your results might disagree with previous published work--not necessarily because your results are wrong, but because the published work probably has bugs that no one has been able to discover or reason about because the code is so complex.

xiii1408··on Fortran is still a thing
There's a better solution, to your problem: pass an "index object" as the argument to operator[].

So `T& operator[](index_t)`, where `index_t` could just be a tuple.

  a[{1, 2}] = 12;
This has virtually the same syntax, will be compiled in the same way by any modern compiler, and lets you create special index types that have invariants (suppose you want i0 < i1).
xiii1408··on Tacit Meta Programming in C++
Neat introduction to template metaprogramming, SFINAE, and what metaprogramming libraries can do for you.
xiii1408··on Creating Expressive C++ Smart Pointers for Remote Memory
That's true--you can add the ability to seek, in which case the stream becomes like a file.

Whether or not that's desirable depends on what kind of programs you're writing. For programs like databases that traditionally store things using the filesystem, that's probably a very useful abstraction, and some people at VMware have actually implemented an "RDMA over the filesystem" abstraction, which is super cool: https://256fd102-a-62cb3a1a-s-sites.googlegroups.com/site/mk....

If you're looking for an abstraction with which to directly implement programs that use data structures, however, I still think pointers are much more valuable than files because files are not strongly typed, and it's easy to read junk due to type errors and lack of structure.

xiii1408··on Creating Expressive C++ Smart Pointers for Remote Memory
Almost! This is something I've looked into, and hopefully I'll have time to write a whole blog post about it in the future.

There are some fundamental syntax limitations due to the way that operator-> works (and that operator. does not exist).

The best thing I have is a `pointerto()` macro that gets you a remote pointer to a member of a remotely stored object. This uses C++'s `offsetof` macro and a whole bunch of template voodoo to make the types work.

  struct coord_t {
    float x;
    float y;
  };

  remote_ptr<coord_t> p = getRemoteCoord();
  remote_ptr<float> p_x = pointerto(x, p);

  float x = rget(p_x);
  rput(p_x, x+1);

You can make operator-> work as well, for both methods and members, but unfortunately right now it has to involve pulling the whole object, storing it inside a proxy object, accessing the member of the local object, and then storing it back in remote memory in the proxy object's destructor. It's a cool piece of code (I'm open-sourcing this library as soon as I have a free weekend to clean it up and document it).

I hope that metaclasses or reflection in a future version of C++ will allow the syntax you wrote above, but right now this is the only way I've come up with.

xiii1408··on Creating Expressive C++ Smart Pointers for Remote Memory
For parallel programs, streams are problematic because they enforce a strict order to communication. (I assume you're talking about creating distributed istream/ostream classes.)

Also, stream communication is explicitly two-sided; if you want to pull in a value on an istream, there needs to be a corresponding process on the other side inserting something into an ostream. I've found pointers to be a much better abstraction for data structures, which often require irregular access that two-sided communication can't satisfy easily.

Streams also have the problem that, while the underlying interface (a socket, file, etc.) is untyped, the interface is typed. This leads to the unfortunate situation where you can attempt to pull an std::string in on an istream and get junk because you're using the wrong type.

This does depend a lot on the kinds of programs you're writing and what your assumptions are--in the HPC world, we don't generally care about fault tolerance, and we actually have hardware that gives us fast RDMA read/write. In a distributed systems setting where processes are communicating with messages and need to be fault tolerant and reach consensus using algorithms like Paxos or something, I could see abstractions like streams being really useful.

xiii1408··on Google Employees Protest Work on Censored Search Engine for China
Well, for one thing, it might suddenly become difficult to travel in China as a result of signing this letter. That would not be unprecedented.

As for Google, companies in general value employees who are flexible in the projects they're willing to work on. Without efforts to counteract bias, employees who decline projects due to ethical objections risk being seen as difficult.

xiii1408··on Google Employees Protest Work on Censored Search Engine for China
It's gotten even worse than airlines: they pressured 85C, the Taiwanese Bakery, into espousing a one China policy: https://www.hongkongfp.com/2018/08/16/taiwans-85c-bakery-caf....

It's remarkable to me that the "feelings of 1.3 billion people" are so fragile that they're unable to enjoy their coffee cake if the company that made it doesn't kowtow to Beijing.

xiii1408··on Google's censored Chinese search engine: a catalogue of ethical violations?
They'll almost certainly hand over user data to the central government. They're required to partner with a Chinese firm, and this is a fairly common practice among Chinese technology companies.
xiii1408··on Google's censored Chinese search engine: a catalogue of ethical violations?
No. It's not fair to justify building the machinery of a totalitarian state as simply "abiding by local laws and regulations." Not when the consequences involve clear violations of human rights.

You don't have to look far to see how bad things have gotten recently in China, from abductions of booksellers in Hong Kong to an activist being carted away literally during a phone interview with Voice of America.

When Western companies act like this is totally normal and even develop censorship technologies for regimes in countries with poor records for human rights, it lends false legitimacy to these unjust systems and even emboldens them to commit more serious violations of human rights.

xiii1408··on Why some PhDs are quitting academia for unconventional jobs
We make double stipend during the summer, to try to somewhat offset the financial incentive to take a summer internship. I'm including this in the base rate--without, it's probably closer to $32K.
xiii1408··on Why some PhDs are quitting academia for unconventional jobs
I live in a high cost of living area, and starting salaries are usually around $100-140K.

Students in my program usually end up paying 40-60% of the base salary toward rent.

xiii1408··on Why some PhDs are quitting academia for unconventional jobs
This has been my experience as a CS Ph.D. student at a top US university as well--the pay is way less than industry, but it's enough to have a decent quality of life.

In my department, students make about $40K/year as a base salary, which is not a lot, but enough to get by with. Add a summer internship to this, and your income is not too shabby--I made about $70K this year.

Now, of course, I realize this is half or less of what students would be making in industry. But it's enough that quality of life is pretty decent.

xiii1408··on Arch Linux AUR Repository Found to Contain Malware
The install hooks are chrooted inside the pacman install directory.

But, yeah, they run as root, so they can still do damage.

My point was that the danger zone is when you trust the package, rather than when you run the PKGBUILD itself with `makepkg`. Of course `makepkg -i` runs both `makepkg` and `pacman` as root.

xiii1408··on Arch Linux AUR Repository Found to Contain Malware
All the install hooks are run chrooted inside the pacman install directory.

But, yeah, they run as root, so they could still do something nasty at install time. Not when you `makepkg` the PKGBUILD, though.

xiii1408··on Arch Linux AUR Repository Found to Contain Malware
Yeah, Chromium, which is FOSS, not Google Chrome, and Google Noto Fonts, which are also FOSS.

Anything proprietary can't simply be copied over and mirrored for copyright reasons.

← PreviousPage 4 of 5Next →