From nobody Thu Sep 5 16:13:24 2024 X-Original-To: freebsd-hackers@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4X04Dk1Jtfz5WKMj for ; Thu, 05 Sep 2024 16:14:14 +0000 (UTC) (envelope-from freebsd-hackers@phoe.frmug.org) Received: from frmug.org (enterprise.frmug.org [IPv6:2a01:e0d:1:3:58bf:fa61:0:1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 4X04Dh6bvHz4pdc for ; Thu, 5 Sep 2024 16:14:12 +0000 (UTC) (envelope-from freebsd-hackers@phoe.frmug.org) Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=frmug.org; spf=pass (mx1.freebsd.org: domain of freebsd-hackers@phoe.frmug.org designates 2a01:e0d:1:3:58bf:fa61:0:1 as permitted sender) smtp.mailfrom=freebsd-hackers@phoe.frmug.org Received: by frmug.org (Postfix, from userid 66) id BBA2C12B4B4; Thu, 5 Sep 2024 18:14:03 +0200 (CEST) Received: by memo2.memo.frmug.org (Postfix, from userid 1001) id 240FC17A09; Thu, 5 Sep 2024 18:13:24 +0200 (CEST) Date: Thu, 5 Sep 2024 18:13:24 +0200 From: Bertrand Petit To: freebsd-hackers@freebsd.org Subject: Re: Suitability of Lua as a userland-programming language? Message-ID: <20240905161324.GF1354@memo2.memo.frmug.org> References: <40836902-cb68-45e0-b4ec-623c21aa47ba@FreeBSD.org> <88AC3419-2BD0-4664-80E8-368360E143B4@freebsd.org> <20240905131543.GD1354@memo2.memo.frmug.org> List-Id: Technical discussions relating to FreeBSD List-Archive: https://lists.freebsd.org/archives/freebsd-hackers List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-hackers@FreeBSD.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.12.1 (2019-06-15) X-Spamd-Bar: -- X-Spamd-Result: default: False [-2.79 / 15.00]; SUBJECT_ENDS_QUESTION(1.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; NEURAL_HAM_SHORT(-0.99)[-0.991]; DMARC_POLICY_ALLOW(-0.50)[frmug.org,none]; R_SPF_ALLOW(-0.20)[+ip6:2a01:e0d:1:3:58bf:fa61:0:1]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; RCPT_COUNT_ONE(0.00)[1]; FROM_EQ_ENVFROM(0.00)[]; ASN(0.00)[asn:12322, ipnet:2a01:e00::/26, country:FR]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; RCVD_COUNT_TWO(0.00)[2]; R_DKIM_NA(0.00)[]; TO_DN_NONE(0.00)[]; MID_RHS_MATCH_FROMTLD(0.00)[]; MIME_TRACE(0.00)[0:+]; MLMMJ_DEST(0.00)[freebsd-hackers@freebsd.org]; ARC_NA(0.00)[] X-Rspamd-Queue-Id: 4X04Dh6bvHz4pdc On Thu, Sep 05, 2024 at 02:18:17PM +0000, Bridger Dyson-Smith wrote: > > Do you think incorporating a third-party Lua module would be acceptable? > E.g. https://github.com/lunarmodules/Penlight That looks promising, it is modelled after Python batteries, that is a good thing. When evaluating such libraries, after glancing at the range of tackled problems and the interfaces proposed to solve them, because it is a difficult problem, I always focus on date and time handling. It is not rosy, see [1]. Right now I can't pronounce myself for or against the bulk of the library, one must actually use it to forge an opinion, I can only say that the documentation is not par to my expectations--the output of a doxygen-like tool is never good enough IMHO. The only Lua code I have is running in kernel as a set of ZFS channel programs, an environment where one can't import libraries, this make testing Penlight difficult for me. Testing must await for a medium size project not requiring network access which I should write in Lua instead of Python. [1] https://github.com/lunarmodules/Penlight/issues/285 -- %!PS -- Bertrand Petit /D{def}def/E{exch}D/G{get}D/I{2 div}D/U{dup}D/L{roll}D/Y{setgray}D/N{newpath}D /O{N 0 0 moveto}D/P{pop}D/T{translate}D currentpagedevice/PageSize G U 0 G/w E D 1 G /h E D w I h I T 0 Y 1 setlinewidth 0 1 2 { P 120 rotate 2 4 w U mul h U mul add sqrt I 50 add {N 50 0 3 2 L 0 360 arc stroke}for}for/s{O true charpath pathbbox exch 4 -1 L E sub I 3 1 L sub I} D /l(bp)D 0.94 Y /Helvetica findfont 22 scalefont setfont l s P(x)s exch P T O l show showpage