From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: michael schuldt Newsgroups: gmane.emacs.devel Subject: Re: Emacs <-> Lua bridge Date: Sun, 18 Apr 2021 13:16:15 -0700 Message-ID: References: Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="0000000000004ae14205c044e336" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="19941"; mail-complaints-to="usenet@ciao.gmane.io" Cc: Emacs developers To: Eduardo Ochs Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Sun Apr 18 22:17:39 2021 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 1lYDrP-00053p-Jn for ged-emacs-devel@m.gmane-mx.org; Sun, 18 Apr 2021 22:17:39 +0200 Original-Received: from localhost ([::1]:52606 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lYDrO-0000kJ-NQ for ged-emacs-devel@m.gmane-mx.org; Sun, 18 Apr 2021 16:17:38 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:49480) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lYDqK-0008Ki-1I for emacs-devel@gnu.org; Sun, 18 Apr 2021 16:16:32 -0400 Original-Received: from mail-lf1-x134.google.com ([2a00:1450:4864:20::134]:38884) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lYDqH-0006xg-TQ for emacs-devel@gnu.org; Sun, 18 Apr 2021 16:16:31 -0400 Original-Received: by mail-lf1-x134.google.com with SMTP id j18so52770744lfg.5 for ; Sun, 18 Apr 2021 13:16:28 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SCuUUzuaDlZnmAyILnzVdNKMMt1ZrJWeNHykksBN05c=; b=tHdWoTIIsgXTuZtnbleh4owXxbW8kSUrvvpPC/603vvnnCOGJVBz/AMaub2iArp3JT Ewlp/j8oiAeaUj3dLtbVOPjoKQCYnvlqoOyshW5l0Ikr6KfQy5TtbJuV63xsUMD6m7ch qHwhYnPC58m6gjgJnN+lrkKffBMKh/OenHW38h0xbR6+UmJZqsoXn+97VMQh5w4fvPVn C1W2I7mM9IKMasAIYK+l+QPhQAUhB81I4iHZyur+r2YGgC3ixABSBKwIXFgqt8+o6vuo FA/RKaPF/pfSPdTSIFu6uLJyPGz95O1f6hcLfOY+PNh83v8mtEqE6P/zBHIpcyU+EqEB PN7A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=SCuUUzuaDlZnmAyILnzVdNKMMt1ZrJWeNHykksBN05c=; b=YQ2cg3RyNU8xYQ7/Phmvf7YCGMeOXCxROMdfZx0J0vvjR/Cl1s6YwmpMET+KqOggkg t4FUtzRfOadPmLJh3ITrWyU6xMoAO8RWzEMzC7cLBtoSzBiGIA/nbtufWePXcDBdnn/h GZ6wSxCZqpsfdCTXLQ+mfIAaCVZCnwLddqikViLOwgrlT+v3B5RMlMmMeN03UYo98sO/ YgXzB/gAUHb595+DAkXJl1FiU7FBc6ciKYlxQ3FX73aISkC3bxgWvCO85agZhVCkh/E1 v06itrIiTw6Wyf/XP8ZS074PyNyPDFrHJYb0HTGLZkhw/kUoM3P9mn5u8w9X9ZriB3PJ Pwig== X-Gm-Message-State: AOAM532m4b+5HuHwpzzyIzXf7tATCY3Vg3aeWH9mVLJX94K8IZH7iIre TubQMbDLjLS01Lw0gEEIBm8fmJkm6hT2H7c5ETc= X-Google-Smtp-Source: ABdhPJxCTQvwEPQu54jZKMPpFFnKHTJMYdPIZrZNrJIgyT0r9rKEOgk9YW1FddZxB9EgzNWHwUhUbbMjmYcVcurRHQg= X-Received: by 2002:a19:4f5e:: with SMTP id a30mr6157717lfk.400.1618776987196; Sun, 18 Apr 2021 13:16:27 -0700 (PDT) In-Reply-To: Received-SPF: pass client-ip=2a00:1450:4864:20::134; envelope-from=mbschuldt@gmail.com; helo=mail-lf1-x134.google.com X-Spam_score_int: -20 X-Spam_score: -2.1 X-Spam_bar: -- X-Spam_report: (-2.1 / 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_FROM=0.001, HTML_MESSAGE=0.001, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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:268146 Archived-At: --0000000000004ae14205c044e336 Content-Type: text/plain; charset="UTF-8" Awesome! Several years ago I compiled the Lua interpreter into Emacs and added functions for accessing each from the other. It was just fun experimental software and is not supported or actively developed and still has unresolved issues, but might be of interest to you. This was before modules got added to Emacs. You can check out the code here: https://github.com/mschuldt/luamacs On Sat, Apr 17, 2021 at 9:46 PM Eduardo Ochs wrote: > Ooops, I forgot the link to the version with my comments > and instructions to compile on Debian! Here it is: > http://angg.twu.net/emacs-lua/emlua.cpp.html > http://angg.twu.net/emacs-lua/emlua.cpp > > Cheers =/, > Eduardo > > On Sun, 18 Apr 2021 at 01:32, Eduardo Ochs wrote: > > > > Hi list, > > > > about a month ago I asked on the Lua mailing list if anyone there had > > tried to create an Emacs module that would load Lua and then start a > > Lua interpreter and let Emacs call it... > > > > I received this answer, > > > > http://lua-users.org/lists/lua-l/2021-03/msg00084.html > > > > and today I finally had time to compile that code on Debian and test > > it. It looks prototype-ishy, but it is surprisingly functional - if we > > run something that returns several values, like the second sexp here, > > > > (emlua-dostring "a = 22") > > (emlua-dostring "return a+33, '44', {}") > > > > it retuns a vector like this, > > > > ["55" "44" "table: 0x55f5e0a15a10"] > > > > with tostring-ed versions of all its return values, and if we run > > something that yields an error it returns a string with Lua's error > > message. > > > > I haven't played much with it yet. > > Happy hacking =), > > > > Eduardo Ochs > > http://angg.twu.net/#eev > > http://angg.twu.net/emacsconf2020.html > > --0000000000004ae14205c044e336 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Awesome!

Several years ago I= compiled the Lua interpreter into Emacs and added functions for accessing = each from the other.
It was just fun experimental software and is= not supported or actively developed and still has unresolved issues,
=
but might be of interest to you. This was before modules got added to = Emacs.
You can check out the code here: https://github.com/mschuldt/luamacs

On Sat, Apr 17, 2021 at 9:46 PM Eduardo Ochs <eduardoochs@gmail.com> wrote:
Ooops, I forgot the link to the= version with my comments
and instructions to compile on Debian! Here it is:
=C2=A0 http://angg.twu.net/emacs-lua/emlua.cpp.html<= br> =C2=A0 http://angg.twu.net/emacs-lua/emlua.cpp

Cheers =3D/,
=C2=A0 Eduardo

On Sun, 18 Apr 2021 at 01:32, Eduardo Ochs <eduardoochs@gmail.com> wrote:
>
> Hi list,
>
> about a month ago I asked on the Lua mailing list if anyone there had<= br> > tried to create an Emacs module that would load Lua and then start a > Lua interpreter and let Emacs call it...
>
> I received this answer,
>
>=C2=A0 =C2=A0http://lua-users.org/lists/lu= a-l/2021-03/msg00084.html
>
> and today I finally had time to compile that code on Debian and test > it. It looks prototype-ishy, but it is surprisingly functional - if we=
> run something that returns several values, like the second sexp here,<= br> >
>=C2=A0 =C2=A0(emlua-dostring "a =3D 22")
>=C2=A0 =C2=A0(emlua-dostring "return a+33, '44', {}")=
>
> it retuns a vector like this,
>
>=C2=A0 =C2=A0["55" "44" "table: 0x55f5e0a15a10= "]
>
> with tostring-ed versions of all its return values, and if we run
> something that yields an error it returns a string with Lua's erro= r
> message.
>
> I haven't played much with it yet.
> Happy hacking =3D),
>
>=C2=A0 =C2=A0Eduardo Ochs
>=C2=A0 =C2=A0http://angg.twu.net/#eev
>=C2=A0 =C2=A0http://angg.twu.net/emacsconf2020.html
--0000000000004ae14205c044e336--