From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTP id 5C1E331279 for ; Fri, 21 Jun 2019 08:14:15 -0400 (EDT) Received: from turing.freelists.org ([127.0.0.1]) by localhost (turing.freelists.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id leqPRVa8KMsO for ; Fri, 21 Jun 2019 08:14:15 -0400 (EDT) Received: from smtp54.i.mail.ru (smtp54.i.mail.ru [217.69.128.34]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by turing.freelists.org (Avenir Technologies Mail Multiplex) with ESMTPS id 1AC0031275 for ; Fri, 21 Jun 2019 08:14:14 -0400 (EDT) Date: Fri, 21 Jun 2019 15:14:12 +0300 From: Konstantin Osipov Subject: [tarantool-patches] Re: [RFC] box/lua/console: Add console.fmt module Message-ID: <20190621121412.GB5998@atlas> References: <20190620215405.9338-1-gorcunov@gmail.com> <20190621073241.GJ18958@atlas> <20190621081640.GB18551@uranus> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190621081640.GB18551@uranus> Sender: tarantool-patches-bounce@freelists.org Errors-to: tarantool-patches-bounce@freelists.org Reply-To: tarantool-patches@freelists.org List-Help: List-Unsubscribe: List-software: Ecartis version 1.0.0 List-Id: tarantool-patches List-Subscribe: List-Owner: List-post: List-Archive: To: Cyrill Gorcunov Cc: tarantool-patches@freelists.org, Alexander Turenko * Cyrill Gorcunov [19/06/21 11:20]: > Because I want to separate output engine from general > console code. To me console is like a transport peer, > which includes setting up a connection to remote machine, > run evaluator and etc, but output formatter is like a > separate engine so it should live in other module. Or > you meant something else? I don't care much about the internals here, but about the consistency of the console api: https://www.tarantool.io/en/doc/1.10/reference/reference_lua/console/ > > > > index 000000000..f860d76fb > > > --- /dev/null > > > +++ b/src/box/lua/console_fmt.lua > > > @@ -0,0 +1,295 @@ > > > +-- # vim: ts=4 sw=4 et > > > + > > > +local internal = require('console') > > > + > > > +local console_formats = { > > > + ["lua"] = nil, > > > + ["yaml"] = nil > > > +} > > > > Why didn't you use a git submodule with an established Lua > > formatter? > > I considered using vanilla "pretty print" or "serpent" but > > 1) they are too huge > 2) we need own extensions for decoding own subset of keywords > (for example box.NULL symbol) > > so we simply can't use unmodified third party engines thus > better to keep own much simpler (hopefully) engine. I don't see why we can't fork serpent. But OK, provided you don't want serpent, what can serpent do that we're going to miss in an own implementation? Could you write down a summary so that we can analyze this ahead of time? -- Konstantin Osipov, Moscow, Russia