Live data from Hacker News

Emacs-ng: Emacs with Deno runtime and TypeScript

github.com

21–30 of 154 posts

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#21
Not entirely sure I see the point.

I would like to see Emacs/Guile. Emacs need a more modern elisp (or in this case, Scheme) implementation. It's much easier to make it compatible with the mountain of existing (and useful!) elisp code if you are also in a form of Lisp. That's still not trivial.

It also needs a better front-end renderer, across platforms. I could understand if the "NG" part were to be just about that. But WebRender is an optional feature. Then again, it looks and runs perfectly fine for me on Linux, it's when I'm using on OSX that I see the warts. This is doubtless in no small part due to patches being refused because they are for proprietary platforms.

Async I/O is needed but I am not sure we need to bring Typescript and a full JS environment to get that.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#22
post #3

Compare the recursive Fibbonaci function against Scheme with Guile's JIT.

As far as I understand Guile-emacs is pretty much dead in the water, it hasn't seen any substantial development in quite a while. Your best bet for better emacs performance is the gccemacs branch, that integrates the libgccjit and builds off the existing emacs bytecode infrastructure and compiles it to native code. It is much much further along than guile-emacs and on track to be merged into emacs master at some point.

That would cover one major point of complaint with emacs performance, the other would be getting some form of real threading and parallelism into emacs so that long-running elisp doesn't block the UI thread, but that is a pretty huge task. With that said, I am sure that the community realizes this and is slowly working their way towards this.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#23
I’m not convinced emacs performance is that bad. It’s pretty highly optimised for typing at a normal rate though I agree the data structures aren’t great for more graphical things (lots of properties, random access inserts, even just long lines). But then the way to improve this is to improve the data structures rather than replacing emacs lisp.

Emacs performs better than many other applications at important objective measures, eg the time between pressing a key and the character showing up on screen. You might expect vim to be good at this but many terminal emulators are optimised for throughput rather than latency and are slower than gui emacs.

Certainly legacy is a problem but I worry that replacing eg font-lock with something with better performance properties (does this actually do that?) means throwing out the baby with the bath water as so many modes depend on these things.

Typically the reason that emacs becomes slow is due to an overload of features or bad asymptotics. Examples:

- global-auto-revert-mode plus lots of buffers plus some in a slow file system like nfs or maybe lots of open fired buffers

- some mode using a configured alist that works fine for small lists but really sucks for big ones (ie perf is linear in size of config, but often this comes hand in hand with trying to process big inputs so it can be worse.) I think this happened with spacemacs and which-key-mode for example

- flyspell + flycheck + build running in background + some autocompletion server. Even a powerful computer can be slowed down by this. Some of these are likely to slowly improve over time as they become more synchronous. Others are problems you’re likely to have with any editor (a nice emacs thing was that it was easy for me to add some advice to pin my build to not use all my cpu. It can be really hard to poke around in other plugin systems to do that sort of thing without a config option for it)

- just piling on the nodes with something like spacemacs and not paying attention to the performance of the whole. I think doom-emacs shows a lot of promise here.

I do think there are advantages that could be made by modernising emacs’ core and improving data structures (whatever happened to remacs?)

I feel like the fundamental design of emacs is good however and I like:

1. keymaps and the command loop

2. Buffer-local variables, advice, dynamic scoping

3. Documentation

4. Fundamentally text-based interface

Obviously you should disregard all of this though as I am very biased due to my emotional reaction to getting rid of emacs lisp which, frankly, you can pry from my cold dead hands.

————————————

Some other thoughts I had on emacs lisp as a good language for a text editor:

1 https://news.ycombinator.com/item?id=19343908

2 https://news.ycombinator.com/item?id=22881597

3 https://news.ycombinator.com/item?id=18605001

On the “fast” measurement that actually matters: https://news.ycombinator.com/item?id=23432292

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#24
post #6

I see a lot of parallels between Emacs' problems now and Vim's problems a few years ago: opaque maintenance/contributions, poor performance inherited from core design decisions made decades ago, the burden of backwards compatibility for legacy systems, etc. I think Emacs users and the community would benefit from a ground-up modern rewrite much like Neovim did for Vim, especially compared to this project which adds e…

Neovim is not a rewrite.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#25
post #6

I see a lot of parallels between Emacs' problems now and Vim's problems a few years ago: opaque maintenance/contributions, poor performance inherited from core design decisions made decades ago, the burden of backwards compatibility for legacy systems, etc. I think Emacs users and the community would benefit from a ground-up modern rewrite much like Neovim did for Vim, especially compared to this project which adds e…

The last time I had things randomly break under me due to elisp was a long long time ago. Such that, I really can't remember it.

And as a user of emacs, the stability has been quite nice. The speed has mostly only hurt around things I'd expect to hurt. (Long long long lines, for example.)

I can see the allure of language servers. But, to me they are basically a modern cscope. With json being the transport. Not bad, but hardly magical or unforseen. (Granted, getting the pockets of microsoft has been nice.)

What sort of spontaneous breaks are you referencing?

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#26

The Emacs community, like the Lisp community with which it overlaps, is very conservative, in the sense that it doesn't throw things away quickly or make huge changes lightly. For that reason, I'd be very surprised if this took off — even though it sounds like it would be mostly backwards-compatible. I think Emacs types would shy away from building JavaScript into their editor, having V8 be the engine, adding more la…

Well, basically this is someone trying to implement VSCode in Emacs ...

Ain't gonna get far once the main developer loses interest in the project. Emacs users use Emacs because they want Lisp and don't care about web rendering and javascript runtimes ... Oh yeah and Rust is thrown in too for good measure.

Good 90% of Emacs code is in the extensions which are in Lisp and nobody is going to rewrite them to Javascript even if the code was running 50x faster.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#27
post #8

>it's an ecosystem of powerful tools and approaches that Emacs just doesn't have currently. Guile-Emacs should.

Yeah, let me know when that gets released in a form that's usable as a daily driver. I'll install it on my production-ready Hurd system, right alongside the first version of GIMP that doesn't send professional designers into fits of rage.

Even then, there is no other ecosystem that has quite the volume of powerful tools and approaches that HTML/CSS/JS have.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#28
post #26

The Emacs community, like the Lisp community with which it overlaps, is very conservative, in the sense that it doesn't throw things away quickly or make huge changes lightly. For that reason, I'd be very surprised if this took off — even though it sounds like it would be mostly backwards-compatible. I think Emacs types would shy away from building JavaScript into their editor, having V8 be the engine, adding more la…

Well, basically this is someone trying to implement VSCode in Emacs ... Ain't gonna get far once the main developer loses interest in the project. Emacs users use Emacs because they want Lisp and don't care about web rendering and javascript runtimes ... Oh yeah and Rust is thrown in too for good measure. Good 90% of Emacs code is in the extensions which are in Lisp and nobody is going to rewrite them to Javascript e…

Rust isn't "thrown in", it's what Deno is built with.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#29
I agree that using a JS runtime makes more sense that Emacs's weird e-lisp runtime, with all of its dynamic-scope weirdness.

But dynamic scope, and e-lisp, isn't the only thing weird about Emacs. Emacs also calls "files" "buffers", and calls "windows" "frames" and "frames" "windows". It has weird keyboard shortcuts. Every third command also copies to the clipboard as a side-effect, which means you constantly obliterate the contents of the clipboard while getting ready to paste what you thought was there. Oh, but to address this problem, it makes the clipboard into a ring of clipboards, so that when you replace the clipboard with something else, you can still access the other clipboards in a ring by hitting the paste command multiple times in a row. Oh, but if you press another key in between, you get lost in clipboard madness.

Emacs also has an "undo", but no "redo" command. Except that when you "undo", it actually pushes the "undo" itself onto the list of "things to undo", so that you can undo that undo, in order to redo. But people also need to undo multiple undos before getting interrupted with a redo, so Emacs only undoes the undos if you press some other key after undoing a few dos in a row. But hey, this means it doesn't need a "redo" command.

So, I agree that the elisp runtime is a weird thing about Emacs, and something that is rational to change. But the thing is... if you're going to change that... why not everything else about Emacs?

I mean, at some point Emacs looks a lot like Bitcoin Core, or Wikipedia -- a beautiful historical community with weird consensus rules that flowered into a very exotic, strange, and usually-functional artifact. Although sometimes it doesn't work as well as the newer technologies.

Re: Emacs-ng: Emacs with Deno runtime and TypeScript

#30
post #6

I see a lot of parallels between Emacs' problems now and Vim's problems a few years ago: opaque maintenance/contributions, poor performance inherited from core design decisions made decades ago, the burden of backwards compatibility for legacy systems, etc. I think Emacs users and the community would benefit from a ground-up modern rewrite much like Neovim did for Vim, especially compared to this project which adds e…

Neovim is not a rewrite.

No, but it tackles the same aforementioned issues:

> opaque maintenance/contributions, poor performance inherited from core design decisions made decades ago, the burden of backwards compatibility for legacy systems, etc.

The main goal of NeoVim is to ditch the backwards compatibility and simplify the codebase. Sure, it isn't a from-scratch rewrite, but it's a very deep fork.

Post reply on HN