Readit News logoReadit News
celrod commented on Helix Editor 25.07   helix-editor.com/news/rel... · Posted by u/matrixhelix
mananaysiempre · 2 months ago
In that case, Kakoune[1] (Helix’s main inspiration) is probably more your jam. You get an RPC interface and are free to script it from anything you want (shell to Rust is about the range I’ve encountered). It does mean that you don’t get the batteries you get with Helix (e.g. LSP support) and need to bring your own (e.g. kakoune-lsp[2]).

[1] https://kakoune.org/

[2] https://github.com/kakoune-lsp/kakoune-lsp

celrod · 2 months ago
Is including batteries the main reason helix seems to have started taking off, while kakoune hasn't?

I use kakoune, because I like the client/server architecture for managing multiple windows, which helix can't do. The less configuring I do the better, but I've hardly done any in the past year. It's nice to have the option.

I do use kakoune-lsp and kak-tree-sitter.

celrod commented on Why does C++ think my class is copy-constructible when it can't be?   devblogs.microsoft.com/ol... · Posted by u/ibobev
kazinator · 3 months ago
This whole article is a very verbose way to reach the conclusion that std::is_copy_constructible_v is a poorly chosen name, not reflecting the actual truth that the construct provides.

If it were called std::has_copy_constructor, there would be no need to write even the title of this article, let alone the body.

Also, maybe this should require a diagnostic due to it being statically obvious that it is calling a deleted constructor:

  Derived(Derived const& d) : Base<T>(d) {}
... and if we use regular non-template classes, it does!

Clang:

  #include <type_traits>

  struct Base
  {
    // Default-constructible
    Base() = default;

    // Not copy-constructible
    Base(Base const &) = delete;
  };

  struct Derived : Base
  {
    Derived() = default;
    Derived(Derived const& d) : Base(d) { }
  };

Clang:

  copy-constructor.cc:15:33: error: call to deleted constructor of 'Base'
     15 |     Derived(Derived const& d) : Base(d) { }
        |                                 ^    ~
  copy-constructor.cc:9:5: note: 'Base' has been explicitly marked deleted here
      9 |     Base(Base const &) = delete;
        |     ^
  1 error generated.
If the program requires a diagnostic which allows it to be rejected entirely, it then doesn't matter what is_copy_constructible returned.

The only reason we don't get a diagnostic is that the language plays it loose with templates, in many cases deferring type checks until instantiation.

It is possible to argue that is_copy_constructible isn't necessarily badly named, but rather foiled by templates.

celrod · 3 months ago
I agree.

The problem with eager diagnostics and templates is that the program could define a `Base<int>` specialization that has a working copy constructor later. [0]

I think if you define an explicit instantiation definition, it should type check at that point and error. [1] I find myself sometimes defining explicit instantiations to make clangd useful (can also help avoid repeated instantiations if you use explicit declarations in other TUs).

[0] https://en.cppreference.com/w/cpp/language/template_speciali...

[1] https://en.cppreference.com/w/cpp/language/class_template.ht...

celrod commented on Suckless.org: software that sucks less   suckless.org/... · Posted by u/flykespice
guenthert · 6 months ago
> There's no rationale given

True and it would indeed be desirable that it were. Here I go out on a limb and assume it's because someone got bitten by attempting to use the loop index outside the loop (common for search operations) while declaring the index within and outside the loop. A bug (gcc and clang can warn about using -Wshadow, but which sadly isn't part of -Wall) which might easily occur when multiple people edit the code over a longer time-span.

celrod · 6 months ago
I use Wshadow personally. I highly recommend it. I think code that violates it (even if correct) is harder to understand.

Deleted Comment

celrod commented on Linux: We need tiling desktop environments   linuxblog.io/linux-tiling... · Posted by u/ashitlerferad
rom1v · a year ago
I think tiling is great for terminals, but not for the whole desktop (I don't want my web browser or video player to be resized because I open a new program).

So I use a "normal" floating environment (xfce, but could be another one), and I use Terminator in full screen enabled on a specific shortcut, so that I have tiled terminals.

celrod · a year ago
> I don't want my web browser or video player to be resized because I open a new program

I've been using niri (a tiling WM) recently. This is their very first design principle: https://github.com/YaLTeR/niri/wiki/Design-Principles Maybe other PaperWM-inspired WMs are similar. niri is the first I've used.

If your windows within a workspace are wider than your screen, you can scroll through them. You also have different workspaces like normal. I'll normally have 1 workspace with a bunch of terminals, and another for browsers and other apps (often another terminal I want to use at the same time as browsing, e.g. if I'm looking things up online).

celrod commented on Papersway – a scrollable window management for Sway/i3wm   spwhitton.name/tech/code/... · Posted by u/smartmic
Zetaphor · a year ago
I've become a really big fan of this model of window management after using Karousel on KDE for the last 3 months. This is especially useful if you're using a widescreen monitor.

I never understood the appeal of tiling as 99% of the time I am focused on a single window at a time and I want it to take the full height of my display, so scrolling with the focused window centered is my ideal workflow.

I only wish I had the ability to quickly toggle the side-by-side mode that is default with these for the occasional time I need to have a code editor next to my browser.

If anyone knows if any of these supports that toggle, while also supporting the other key features I use in karousel (being able to shrink/expand the focused window with a hotkey), then I'd be willing to leave KDE to get that perfect workflow.

celrod · a year ago
Do you not often quickly look between files? If so, odds are you're using tiles within tmux, vim, emacs, vscode, or something.

I use kakoune, which has a client/server architecture. Each kak instance I open within a project connects to the same server, so it is natural for me to use my WM (niri) to tile my terminals, instead of having something like tmux or the editor do the tiling for me. I don't want to bother with more than one layer of WM, where separate layers don't mix.

celrod commented on ICPP – Run C++ anywhere like a script   github.com/vpand/icpp... · Posted by u/davikr
mananaysiempre · a year ago
> This `operator[]` method isn't even templated (although the container type is)

That might be it. If that operator isn’t actually ever emitted out of line, then GDB will (naturally) have nothing to call. If it helps, with the following program

  template<typename T>
  struct Foo {
      int operator[](long i) { return i * 3; }
  };
  
  Foo<bool> bar;
  template int Foo<bool>::operator[](long); // [*]
  
  int main(void) {
      Foo<int> foo;
      __asm__("int3");
      return foo[19];
  }
compiled at -g -O0 I can both `p foo[19]` and `p bar[19]`, but if I comment out the explicit instantiation marked [*], the latter no longer works. At -g -O2, the former does not work because `foo` no longer actually exists, but the latter does, provided the instantiation is left in.

celrod · a year ago
Can confirm, this works for me in my actual examples, thanks!
celrod commented on ICPP – Run C++ anywhere like a script   github.com/vpand/icpp... · Posted by u/davikr
mananaysiempre · a year ago
It does though? Just compiled a small program that creates a vector, and GDB is perfectly happy accessing it using this syntax. It will even print std::string’s correctly if you cast them to const char* by hand. (Linux x86-64, GDB 14.2.)
celrod · a year ago
I've defined a few pretty printers, but `operator[]` doesn't work for my user-defined types. Knowing it works for vectors, I'll try and experiment to see if there's something that'll make it work.

  (gdb) p unrolls_[0]
  Could not find operator[].
  (gdb) p unrolls_[(long)0]
  Could not find operator[].
  (gdb) p unrolls_.data_.mem[0]
  $2 = {
`unrolls_[i]` works within C++. This `operator[]` method isn't even templated (although the container type is); the index is hard-coded to be of type `ptrdiff_t`, which is `long` on my platform.

I'm on Linux, gdb 15.1.

celrod commented on ICPP – Run C++ anywhere like a script   github.com/vpand/icpp... · Posted by u/davikr
celrod · a year ago
How feasible would it be for something like gdb to be able to use a C++ interpreter (whether icpp, or even a souped up `constexpr` interpreter from the compiler) to help with "optimized out" functions?

gdb also doesn't handle overloaded functions well, e.g. `x[i]`.

celrod commented on AMD Ryzen 5 9600X and Ryzen 7 9700X Offer Excellent Linux Performance   phoronix.com/review/ryzen... · Posted by u/pella
kvemkon · a year ago
Or other ASUS mainboards. For now ASUS seems to be the only desktop mainboard manufacturer that officially mentions in the docs support of "ECC and Non-ECC, Un-buffered Memory".
celrod · a year ago
Yes, I see now that while not advertised on seller's websites, Asus's product pages do indeed say that.

u/celrod

KarmaCake day1092February 4, 2018
About
SIMD and performance enthusiast. https://github.com/JuliaSIMD https://spmd.org/
View Original