From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: ludo@gnu.org (Ludovic =?utf-8?Q?Court=C3=A8s?=) Newsgroups: gmane.lisp.guile.user Subject: Re: Guile bugs Date: Sun, 10 Sep 2017 15:11:32 +0200 Message-ID: <87y3pm7l6j.fsf@gnu.org> References: <87lgtajpkc.fsf@web.de> <87h8y7ruuz.fsf_-_@gnu.org> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Trace: blaine.gmane.org 1505049122 19616 195.159.176.226 (10 Sep 2017 13:12:02 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 10 Sep 2017 13:12:02 +0000 (UTC) User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.2 (gnu/linux) Cc: Guile User To: Linas Vepstas Original-X-From: guile-user-bounces+guile-user=m.gmane.org@gnu.org Sun Sep 10 15:11:58 2017 Return-path: Envelope-to: guile-user@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1dr21f-0004XX-Da for guile-user@m.gmane.org; Sun, 10 Sep 2017 15:11:51 +0200 Original-Received: from localhost ([::1]:53030 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr21m-0003Yl-Ja for guile-user@m.gmane.org; Sun, 10 Sep 2017 09:11:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:58330) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr21P-0003X8-J5 for guile-user@gnu.org; Sun, 10 Sep 2017 09:11:36 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1dr21O-0004Ls-Jk for guile-user@gnu.org; Sun, 10 Sep 2017 09:11:35 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:60560) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1dr21O-0004Lo-Fb; Sun, 10 Sep 2017 09:11:34 -0400 Original-Received: from [2a01:e0a:1d:7270:6a6c:dc17:fc02:cfda] (port=35316 helo=ribbon) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1dr21N-0002hA-Rx; Sun, 10 Sep 2017 09:11:34 -0400 X-URL: http://www.fdn.fr/~lcourtes/ X-Revolutionary-Date: 24 Fructidor an 225 de la =?utf-8?Q?R=C3=A9volution?= X-PGP-Key-ID: 0x090B11993D9AEBB5 X-PGP-Key: http://www.fdn.fr/~lcourtes/ludovic.asc X-PGP-Fingerprint: 3CE4 6455 8A84 FDC6 9DB4 0CFB 090B 1199 3D9A EBB5 X-OS: x86_64-unknown-linux-gnu In-Reply-To: (Linas Vepstas's message of "Sat, 9 Sep 2017 15:30:21 -0500") X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:4830:134:3::e X-BeenThere: guile-user@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: General Guile related discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: guile-user-bounces+guile-user=m.gmane.org@gnu.org Original-Sender: "guile-user" Xref: news.gmane.org gmane.lisp.guile.user:14106 Archived-At: Hi, Linas Vepstas skribis: > 1) There is a need to pass messages between subsystems running on differe= nt > machines. > > 2) Solutions include ROS, ZeroMQ, google protocol buffers... whatever. A= ll > require lots of work, a learning curve, complexity, etc. > > 3) Wait! I know! I will just send around ascii (utf8) strings that are > guile programs! Just use the guile repl server, connect to it, and send > some guile string! No muss, no fuss, no coding, no learning curve, simple > easy ... You can use netcat to drive things! echo (display "hello > world\n") | nc 1.2.3.4 37146 Then you=E2=80=99re sending sexps, not strings, and you=E2=80=99re reading = them with =E2=80=98read=E2=80=99 from a port, as opposed to loading whole strings in = memory. Also, the REPL server is not necessarily the right thing here. You conceptually want a REPL, but not Guile=E2=80=99s full-blown REPL, which ca= n be hard to deal with (you need to parse the prompts, determine if you=E2=80=99= re in a recursive REPL, whether an exception occurred, etc.) In the Shepherd, I implemented a very simple REPL that is just enough to communicate evaluation results to the client, and to distinguish return values from exceptions. This does not use Guile=E2=80=99s REPL server, only =E2=80=98read=E2=80=99, =E2=80=98eval=E2=80=99, =E2=80=98write=E2=80=99. HTH, Ludo=E2=80=99.