reddit / emacs

Emacs WebRender front(window system)

declantsien · 2022-11-14 06:00
Why try this? [https://github.com/servo/webrender/wiki#why-try-this](https://github.com/servo/webrender/wiki#why-try-this) This [feature](https://www.reddit.com/r/emacsng/comments/nqjee1/comment/h0l3v02/?utm_source=share&utm_medium=web2x&context=3) is originated from the awesome guys from emacs-ng (kind-of hibernated now). I extracted the WebRender related work into a new repo and made some small changes. Now it can be built and run under macOS, which supposed to works on all main platforms. Well, Linux build seems more solid. On macOS, I realized some issues I'll just drop it here hoping some macOS Emacs guys wants to improve it. Haven't tested on Windows. * ~~the meta key not working on MacOS~~ * ~~Crash after switching to background~~ This configuration option I am using on macOS ./configure --with-wr --without-ns --with-gnutls=ifavailable CFLAGS="-Wno-implicit-function-declaration" * Code lives [https://git.sr.ht/\~declantsien/WREmacs](https://git.sr.ht/~declantsien/WREmacs) * For Guix user on Linux I have `emacs-next-wr` definition [here.](https://git.sr.ht/~declantsien/guix-channel/tree/master/item/declantsien/packages/emacs.scm#L35) * This is demo video on macOS. https://reddit.com/link/yuqi6s/video/3r2bsu1rwuz91/player
arthurno1 · 2022-11-14 08:57
This is interesting. It means you are rendering entire Emacs with webrender? Are there any benchmarks? How does it compare to built-in X11 renderer, for example? Any chance to get this as a standalone patch? Or a module?
Thaodan · 2022-11-14 09:09
It depends on using webrenderer something that is for example now also used in Gecko. I suspect that it can't be done in patch.
declantsien · 2022-11-14 12:50
>It means you are rendering entire Emacs with webrender? Yeah, thanks to [harryfei](https://github.com/emacs-ng/emacs-ng/commits?author=harryfei) >Are there any benchmarks? How does it compare to built-in X11 renderer, for example? No benchmarks yet. But I would just take the words from Servo [https://github.com/servo/servo/wiki/Research](https://github.com/servo/servo/wiki/Research) I am not familiar with Emacs X11 window system. I use pgtk Emacs on Wayland recently. I guess there wont be any significant visual feedback user can realize, at least on Linux. Since pgtk works perfectly on my device. But this port does added the cross-platform possibility. ​ >Any chance to get this as a standalone patch? Or a module? A standalone patch if you mean patches you can apply to Emacs upstream, the yes. Code here [https://git.sr.ht/\~declantsien/WREmacs](https://git.sr.ht/~declantsien/WREmacs) is rebased on to `52d9c51816d`. A module no. Its more like pgtk, X11 render...
1nc0ns1st3nt · 2022-11-14 15:03
Surely, there is more potential to this such as direct better web content rendering for sites (replacement for eww, still without javascript?). And web content rendering from elisp? Or emacs-webrenderer as a 2d/3d rendering platform? Am I getting too excited for this?
declantsien · 2022-11-15 00:08
>Surely, there is more potential to this such as direct better web content rendering for sites (replacement for eww, still without javascript?). And web content rendering from elisp? I doubt that we'll have direct web content rendering. The name of WebRender can be misleading somehow, we can't directly feed it with HTML and CSS data. ​ >Or emacs-webrenderer as a 2d/3d rendering platform? Webrender is using openGL. There are existing work out there regarding this. [https://github.com/Jimx-/emacs-gl](https://github.com/Jimx-/emacs-gl) . But I would prefer [WebGPU API](https://github.com/gfx-rs/wgpu) over opengl's if I want to do computer graphics. ​ >Am I getting too excited for this? Ha, think about the possibilities.
deagle50 · 2022-11-17 23:06
which `configure` script are you invoking? I see `configure.ac` but it errors.
m_sachs · 2022-11-18 12:05
Look at INSTALL.REPO. You need to run ./autogen.sh before ./configure
deagle50 · 2022-11-29 22:37
Not sure how I missed that, thanks. Getting this compilation error: error[E0512]: cannot transmute between types of different sizes, or dependently-sized types --> /Users/xxx/src/WREmacs/vendor/display-link/src/macos.rs:24:16 | 24 | let time = mem::transmute::<_, std::time::Instant>(in_out_timestamp.host_time); | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ | = note: source type: `u64` (64 bits) = note: target type: `Instant` (128 bits) For more information about this error, try `rustc --explain E0512`.