unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Emanuel Berg <incal@dataswamp.org>
To: help-gnu-emacs@gnu.org
Subject: Re: stats say SBCL is 78 875 % faster than natively compiled Elisp
Date: Thu, 16 Feb 2023 07:04:51 +0100	[thread overview]
Message-ID: <878rgyjgcc.fsf@dataswamp.org> (raw)
In-Reply-To: Y+yC7hDSRLMLJzOV@protected.localdomain

Jean Louis wrote:

>> ;; commands: [results]
>> ;;   $ emacs -Q -batch -l fib.el                    [8.660 s]
>> ;;   $ emacs -Q -batch -l fib.elc                   [3.386 s]
>> ;;   $ emacs -Q -batch -l fib-54a44480-bad305eb.eln [3.159 s]
>> ;;   $ sbcl -l fib.cl                               [0.004 s]
>
> Whatever those stats say

They say CL (with SBCL) is fast; and that natively compiled
Elisp is a good step from byte-compiled Elisp, and a huge leap
from not compiling it at all! However, compared to CL/SBCL our
beloved Elisp/Emacs is still just a turtle on steroids ...

> SBCL does not have tabulated-list-mode and integrated editor
> in the programming environment

Oh, we have Emacs for that! Check this out, including
instructions how to install a bunch of stuff ...

It's SLIME ... as you know well! You are just goofing
around. That's okay.

But while I got it to work, the level of integration is still
below what we have with Elisp. So I thought, with the native
compile step, we could maybe ... but no. Need speed? Use CL.
Simple as that!

;;; -*- lexical-binding: t -*-
;;
;; this file:
;;   https://dataswamp.org/~incal/emacs-init/ide/slime-incal.el
;;
;; install quicklisp and cl-sdl2:
;;   $ sudo apt-get --install-suggests install \*sbcl\* libsdl2-\*
;;   $ mkdir -p ~/common-lisp
;;   $ cd ~/common-lisp
;;   $ wget 'https://beta.quicklisp.org/quicklisp.lisp'
;;
;;   $ sbcl --load quicklisp.lisp
;;   * (quicklisp-quickstart:install)
;;   * (ql:add-to-init-file)
;;   * (quit)
;;
;;   CL-USER> (load "~/quicklisp/setup.lisp")
;;   CL-USER> (ql:quickload "quicklisp-slime-helper")
;;   CL-USER> (ql:update-dist "quicklisp")
;;   CL-USER> (ql:update-client)
;;
;;   CL-USER> (ql:quickload "sdl2")
;;   CL-USER> (ql:quickload :sdl2/examples)
;;   CL-USER> (sdl2-examples:basic-test)
;;
;;   $ sbcl # boot faster, redo this on update to SLIME or SBCL
;;   * (load "~/quicklisp/dists/quicklisp/software/slime-v2.26.1/swank-loader.lisp")
;;   * (swank-loader:dump-image "sbcl.core-with-swank")
;;   * (quit)
;;   then set `slime-lisp-implementations' as below

(require 'slime)
(require 'slime-autoloads)
(require 'slime-banner)
(require 'slime-repl)
(require 'super)

(load (expand-file-name "~/quicklisp/slime-helper.el"))

(setq inferior-lisp-program "/bin/sbcl")

(setq slime-lisp-implementations
      '((sbcl ("sbcl" "--core" "/home/incal/common-lisp/sbcl.core-with-swank")
              :init (lambda (port-file _)
                      (format "(swank:start-server %S)\n" port-file) ))))

(setq slime-startup-animation      nil)
(setq slime-words-of-encouragement nil)

;; sldb

(defun sldb-mode-hook-f ()
  (disable-super-global-keys sldb-mode-map) )
(add-hook 'sldb-mode-hook #'sldb-mode-hook-f)

;; slime

(defun slime-mode-set-keys ()
  (let ((the-map slime-mode-indirect-map))
    (disable-super-global-keys the-map)
    (define-key the-map "\C-hf" #'slime-describe-function)
    (define-key the-map "\M-9"  #'slime-eval-last-expression)
    (define-key the-map "\M-n"  #'slime-eval-buffer) ))

(defun slime-mode-hook-f ()
  (abbrev-mode)
  (slime-mode-set-keys) )
(add-hook 'slime-mode-hook #'slime-mode-hook-f)

;; slime repl

(defun slime-repl-mode-set-keys ()
  (let ((the-map slime-repl-mode-map))
    (disable-super-global-keys the-map)
    (define-key the-map "\C-\M-n" #'slime-repl-next-input)
    (define-key the-map "\C-\M-p" #'slime-repl-previous-input) ))

(defun slime-repl-mode-hook-f ()
  (slime-repl-mode-set-keys) )
(add-hook 'slime-repl-mode-hook #'slime-repl-mode-hook-f)

;; (find-file "~/common-lisp/general-base/gb.lisp")
;; (find-file "~/quicklisp/dists/quicklisp/software/cl-sdl2-20201220-git/examples/basic.lisp")

-- 
underground experts united
https://dataswamp.org/~incal




  reply	other threads:[~2023-02-16  6:04 UTC|newest]

Thread overview: 41+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-14  7:56 stats say SBCL is 78 875 % faster than natively compiled Elisp Emanuel Berg
2023-02-15  5:04 ` Chen Zhaoyang
2023-02-15 11:37   ` Emanuel Berg
2023-02-15  6:59 ` Jean Louis
2023-02-16  6:04   ` Emanuel Berg [this message]
2023-02-17 17:38     ` Jean Louis
2023-02-18 19:54       ` Emanuel Berg
2023-02-18 20:15         ` Emanuel Berg
2023-02-18 20:39           ` Eli Zaretskii
2023-02-18 20:47             ` Emanuel Berg
2023-02-19  6:35               ` Eli Zaretskii
2023-02-21  7:04                 ` Native compilation by default?: Was [Re: " Madhu
2023-02-21 12:37                   ` Eli Zaretskii
2023-02-21 16:35                     ` Emanuel Berg
2023-02-21 19:57                       ` Emanuel Berg
2023-02-21 22:21                       ` Native compilation by default? (was: Re: stats say SBCL is 78 875 % faster than natively compiled Elisp) Emanuel Berg
2023-02-21 23:54                         ` Emanuel Berg
     [not found]                           ` <87h6vetquk.fsf@dataswamp.org>
2023-02-22  1:47                             ` Emanuel Berg
2023-02-23 10:46                         ` Emanuel Berg
2023-02-23 20:18                           ` Jean Louis
2023-02-26  1:05                             ` Emanuel Berg
2023-02-22 12:32                       ` Native compilation by default?: Was [Re: stats say SBCL is 78 875 % faster than natively compiled Elisp Eli Zaretskii
2023-02-26  3:08                     ` Madhu
2023-02-26  4:32                       ` Stefan Monnier via Users list for the GNU Emacs text editor
2023-02-26  5:15                         ` Emanuel Berg
2023-02-26  6:27                         ` Eli Zaretskii
2023-02-26  7:10                         ` Emanuel Berg
2023-02-26 16:14                         ` FW: [External] : " Drew Adams
2023-02-26 16:31                           ` Eli Zaretskii
2023-02-26 17:12                             ` Drew Adams
2023-02-26 17:31                               ` Eli Zaretskii
2023-02-26 18:29                                 ` Drew Adams
2023-02-26 19:04                                   ` Eli Zaretskii
2023-02-26 20:05                                     ` Emanuel Berg
2023-02-27  8:42                         ` Madhu
2023-03-03 14:55                           ` Stefan Monnier via Users list for the GNU Emacs text editor
2023-02-26  6:25                       ` Eli Zaretskii
2023-02-26 16:10                         ` [External] : " Drew Adams
2023-02-19  5:58         ` Jean Louis
2023-02-15 12:36 ` full native compile (was: Re: stats say SBCL is 78 875 % faster than natively compiled Elisp) Emanuel Berg
2023-02-15 14:05   ` Eli Zaretskii

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=878rgyjgcc.fsf@dataswamp.org \
    --to=incal@dataswamp.org \
    --cc=help-gnu-emacs@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).