5 ポイント 投稿者 alstjr7375 2021-03-18 | 6件のコメント | WhatsAppで共有
  • EmacsにDenoランタイムを統合し、JavaScript/TypeScriptを使える

  • V8エンジンはElisp VMより最適化が進んでいる

  • Emacsで不足している非同期処理やマルチスレッドをJavaScriptで処理可能(Async/Await、Web Worker)。WebAssemblyもサポート

  • Elispをネイティブコードに変換するnative-compと、FirefoxのWebRenderをコンポジターとして利用することでGPUアクセラレーションが可能(実験的)

少し前にHacker Newsにも投稿されていました。

https://news.ycombinator.com/item?id=26453174

6件のコメント

 
ryuheechul 2021-03-18

Emacs は以前 SpaceMacs しか使ったことがないので詳しくはありませんが、メインページで下の部分を読んでみると興味深いですね。結局のところ、Deno を通じた性能向上と言語サポートの拡張によって、エコシステムを活性化させるのが核心のようです。

Performance#

v8's world-class JIT offers the potential for massive performance gains. For a simple benchmark (fibonacci), using the following implementations:

(defun fibonacci(n)

(if (<= n 1)

  n

(+ (fibonacci (- n 1)) (fibonacci (- n 2)))))

const fib = (n) => {

if (n <= 1) {

    return n;

}

return fib(n - 1) + fib(n - 2);

};

emacs-ng's JS implementation clocks in over 50 times faster than emacs 28 without native-comp for calculating fib(40). With native-comp at level 3, JS clocks in over 15 times faster. This, along with Async I/O from Deno, WebWorkers, and WebAsm, gives you the tools to make Emacs a smoother and faster experience without having to install additional tools to launch as background processes or worry about shared library versions - full performance with EVERYTHING in the scripting layer.

 
alstjr7375 2021-03-18

実際、拡張性そのものは悪くありません。

Lisp特有のマクロ

動的モジュール対応によるネイティブ言語バインディング(tree-sitterのようなプロジェクトが代表的です)

libvterm と Xwidget の対応により、ネイティブなターミナルエミュレータやブラウザを内部的に使えたりもしますし..

https://github.com/canatella/xwwp

問題は I/O やスレッドです。

I/O が非同期に実装されていないので、大きなファイルではフリーズが発生し、スレッドを作っても並行性はサポートしていても並列ではないため、負荷が大きくなると必ず問題が起きるんですよね。😢😢😢

でもこのプロジェクトは

https://github.com/DavidDeSimone/ng-async-files

のように、ファイルの非同期処理対応をしようとする努力が見えるので、関心を持っています。

NPM の膨大なエコシステムにも乗っかれますし。

 
alstjr7375 2021-03-18

https://emacs-ng.github.io/emacs-ng/main-features/

厳密に追加されるレイヤーなので、アップストリームのパッチをきれいに適用できます。

代表的な例として、私が昨日 Emacs ミラーの native-comp ブランチのマージを試してみたのですが、

1200コミットを超えているのに、conflict が発生したのは 4〜5 ファイルだけでした。

https://github.com/emacs-mirror/emacs/tree/feature/native-comp

https://github.com/emacs-ng/emacs-ng/pull/185

 
alstjr7375 2021-03-20

なんだかんだでチームに参加することになりましたね(笑)

 
xguru 2021-03-20

わあ、素敵ですね。頑張ってください!!

 
alstjr7375 2021-03-20

ありがとうございます!!