From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Ihor Radchenko Newsgroups: gmane.emacs.devel Subject: Re: Ideal performance of ELisp Date: Sat, 13 Aug 2022 19:58:00 +0800 Message-ID: <87o7wo5p9z.fsf@localhost> References: <83mtceupbx.fsf@gnu.org> <83lerxvfnu.fsf@gnu.org> <838rnxvdcq.fsf@gnu.org> <83r11ptksn.fsf@gnu.org> <83a68dti6w.fsf@gnu.org> <874jykzvx9.fsf@yahoo.com> <83fsi4sttn.fsf@gnu.org> <838rnws5c7.fsf@gnu.org> <838rntocb8.fsf@gnu.org> <875yiw92p2.fsf@localhost> <87pmh47fis.fsf@posteo.net> Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="3413"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Stefan Monnier , Eli Zaretskii , Lynn Winebarger , luangruo@yahoo.com, acm@muc.de, emacs-devel@gnu.org, casouri@gmail.com To: Philip Kaludercic Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sat Aug 13 13:58:26 2022 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1oMpmb-0000dj-Ld for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Aug 2022 13:58:25 +0200 Original-Received: from localhost ([::1]:54296 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oMpma-0002ir-Hp for ged-emacs-devel@m.gmane-mx.org; Sat, 13 Aug 2022 07:58:24 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49236) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oMplI-00019p-B4 for emacs-devel@gnu.org; Sat, 13 Aug 2022 07:57:04 -0400 Original-Received: from mail-pj1-x102a.google.com ([2607:f8b0:4864:20::102a]:45889) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oMplG-0006b4-GH; Sat, 13 Aug 2022 07:57:04 -0400 Original-Received: by mail-pj1-x102a.google.com with SMTP id p14-20020a17090a74ce00b001f4d04492faso3021559pjl.4; Sat, 13 Aug 2022 04:57:01 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:from:to:cc; bh=TFHZqFkxgtPRcUOcl8eLHLnKLpxdDrMfG0N6LzyNk1s=; b=CX3GE8BszWFwTV9p+32VeouNXhjITJ3oYVyEb71C9vJ91h8hVVFAG38oqVPVJVplUE bS39yjvDMBgpTsE1IvTdgE+erILnfv77fAS3hKM61jhZLOyiaDD8y9ruRqhzBFM1YHPD EB23L0shxnpResDcV+zSVFUWQ8hcAbp5wxEfP+stymPGmKrEBWSa2vLzZeqmwVpTamS8 85o4FGN76r8pbzC232eF/IRrXjYov7cd6Acr2RKxpnQ9bRJ9WPXRgEt9eLilhyureHKV 0dstcdtQK4cUQVw56b1FGXCmKFgxsE8EnA2RbbfhSKm862suxZZA0ZyxjwYjw7AyQ9ct wyVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=mime-version:message-id:date:references:in-reply-to:subject:cc:to :from:x-gm-message-state:from:to:cc; bh=TFHZqFkxgtPRcUOcl8eLHLnKLpxdDrMfG0N6LzyNk1s=; b=d1+i2zfeuM6QVv3zj3oQj6xaKEBV5LSQDEIMpuDmYf6XCcdoG9hWDyrXoXjonw1F/N WWBs6kLpyvFqtesh0/xYzdD24uygXa81mzRF78/VEC6rT2ZhZAPLYiRZafFna0znfG6I /rXORlPnPg1P3CDuCxQAFzbsBWFniH75dBuNbgF5kG3U5Ltb8DdbBFSy6Xnhynd/+jbs U1hJuC4dDP6AFqwf96EyvP3MkNdySrPh0bNwmOsLMDIUXVM0Afm3IlZ9zomPUA1ga5je EdhuIazj1TcIh3rOjkNrIEsqJ6hJoxww4hutSyHEBuqb/9BN/LA+Mz6HQp4Jiv0GCoEG mRbw== X-Gm-Message-State: ACgBeo0EGOAvxiYSUeJwBI2ZjN/EM81JWzcC6qnPk4JoZBUyA2EC1Mwg KC4+y5U9J7D/vi/s7AXQB6k= X-Google-Smtp-Source: AA6agR6DPpYdpMgnOksDctEtM7Xk6wx/ipcLBuzT0mCq89L+oIpwnvhX/vfKz247tYM22ntU1Z2fvg== X-Received: by 2002:a17:902:e552:b0:16d:2a83:e751 with SMTP id n18-20020a170902e55200b0016d2a83e751mr7880228plf.39.1660391820551; Sat, 13 Aug 2022 04:57:00 -0700 (PDT) Original-Received: from localhost ([2409:8a70:2bf:80b0:8ec6:81ff:fe70:339d]) by smtp.gmail.com with ESMTPSA id 202-20020a6214d3000000b00518285976cdsm3373643pfu.9.2022.08.13.04.56.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 13 Aug 2022 04:56:58 -0700 (PDT) In-Reply-To: <87pmh47fis.fsf@posteo.net> Received-SPF: pass client-ip=2607:f8b0:4864:20::102a; envelope-from=yantar92@gmail.com; helo=mail-pj1-x102a.google.com X-Spam_score_int: -18 X-Spam_score: -1.9 X-Spam_bar: - X-Spam_report: (-1.9 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:293407 Archived-At: Philip Kaludercic writes: >> Could it be possible to embed C snippets into lisp functions directly? >> Similar to assembler snippets in C. > > Inline assembler is usually just pasted verbatim by the C compiler into > the assembled output, but Lisp if Lisp is interpreted, the best thing I > can imagine would be the automatic the automatic generation and loading > of dynamic modules, which considering the call overhead involved would > rarely be worthwhile for just a "snippet". I had something like macro in mind. Say, we got something like: (c-code "lines" "of" "C code") would expand to # utilising JIT-compiler we already use for native-comp. Normally, this would happen at compile time, and we do not need to care about JIT overheads. Otherwise, JIT-compilation can be used as we already do. Of course, this is just an idea. But it could be an extremely useful feature when we want to beat certain performance bottlenecks and do not want to change Emacs core every time we need such optimization. Dynamic modules are not good idea, AFAIU. The communication between modules and the Elisp machine is very limited. -- Ihor Radchenko, Org mode contributor, Learn more about Org mode at https://orgmode.org/. Support Org development at https://liberapay.com/org-mode, or support my work at https://liberapay.com/yantar92