Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 5 Sep 2024 14:18:17 +0000
From:      Bridger Dyson-Smith <bdysonsmith@gmail.com>
To:        Bertrand Petit <freebsd-hackers@phoe.frmug.org>
Cc:        David Chisnall <theraven@freebsd.org>, freebsd-hackers@freebsd.org
Subject:   Re: Suitability of Lua as a userland-programming language?
Message-ID:  <CAD-FYmTXrtvDEG9-2xNrTf2YBLQ81Qr_DoTVF5Wdvh6cnen6xg@mail.gmail.com>
In-Reply-To: <20240905131543.GD1354@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>

next in thread | previous in thread | raw e-mail | index | archive | help
--000000000000fd4b8f06215ff6e7
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

Hi Bertrand

On Thu, Sep 5, 2024 at 1:19=E2=80=AFPM Bertrand Petit <
freebsd-hackers@phoe.frmug.org> wrote:

> On Thu, Sep 05, 2024 at 08:25:26AM +0100, David Chisnall wrote:
> >
> > It took me about an hour to go from never having written any Lua to
> > writing some Lua code that actually worked (and that we still use).
>
>         I made the same observation here, I must add that having a
> funcional programming background helps greatly. The conciseness of the
> reference manual is lovely even if I think it is badly organised.
>
>         I regret the "any variable name is assumed to be global unless
> explicitly declared as a local" concept which preclude users from
> writing large programs easily. 1-indexed strings is... peculiar by
> modern times. I see the language libraries as very limited and
> unsuitable for system programming---I was frustrated to not find map
> nor reduce. If Lua is to be integrated into base for public
> consumption we should beforehand write an extensive library of tool
> functions that would include at least strings and tables
> manipulations, functional abstractions, a sanctioned object system and
> a complete set of system interfaces. By extensive I mean
> Python-scale. That is a large project, do we have sufficient
> ressources to conduct it from design to documentation?
>
>
Do you think incorporating a third-party Lua module would be acceptable?
E.g. https://github.com/lunarmodules/Penlight

I see map, reduce, string manipulation, and more.

--=20
> %!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 mu=
l
> 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
>
> Best,
Bridger

--000000000000fd4b8f06215ff6e7
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr"><div dir=3D"ltr">Hi Bertrand <br></div><br><div class=3D"g=
mail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On Thu, Sep 5, 2024 at 1:=
19=E2=80=AFPM Bertrand Petit &lt;<a href=3D"mailto:freebsd-hackers@phoe.frm=
ug.org">freebsd-hackers@phoe.frmug.org</a>&gt; wrote:<br></div><blockquote =
class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px sol=
id rgb(204,204,204);padding-left:1ex">On Thu, Sep 05, 2024 at 08:25:26AM +0=
100, David Chisnall wrote:<br>
&gt;<br>
&gt; It took me about an hour to go from never having written any Lua to<br=
>
&gt; writing some Lua code that actually worked (and that we still use).<br=
>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 I made the same observation here, I must add th=
at having a<br>
funcional programming background helps greatly. The conciseness of the<br>
reference manual is lovely even if I think it is badly organised.<br>
<br>
=C2=A0 =C2=A0 =C2=A0 =C2=A0 I regret the &quot;any variable name is assumed=
 to be global unless<br>
explicitly declared as a local&quot; concept which preclude users from<br>
writing large programs easily. 1-indexed strings is... peculiar by<br>
modern times. I see the language libraries as very limited and<br>
unsuitable for system programming---I was frustrated to not find map<br>
nor reduce. If Lua is to be integrated into base for public<br>
consumption we should beforehand write an extensive library of tool<br>
functions that would include at least strings and tables<br>
manipulations, functional abstractions, a sanctioned object system and<br>
a complete set of system interfaces. By extensive I mean<br>
Python-scale. That is a large project, do we have sufficient<br>
ressources to conduct it from design to documentation?<br>
<br></blockquote><div><br></div><div>Do you think incorporating a third-par=
ty Lua module would be acceptable? E.g. <a href=3D"https://github.com/lunar=
modules/Penlight">https://github.com/lunarmodules/Penlight</a><br><br></div=
><div>I see map, reduce, string manipulation, and more.<br></div><div><br><=
/div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;bo=
rder-left:1px solid rgb(204,204,204);padding-left:1ex">
-- <br>
%!PS -- Bertrand Petit<br>
/D{def}def/E{exch}D/G{get}D/I{2 div}D/U{dup}D/L{roll}D/Y{setgray}D/N{newpat=
h}D<br>
/O{N 0 0 moveto}D/P{pop}D/T{translate}D currentpagedevice/PageSize G U 0 G/=
w E<br>
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<br>
mul add sqrt I 50 add {N 50 0 3 2 L 0 360 arc stroke}for}for/s{O true charp=
ath<br>
pathbbox exch 4 -1 L E sub I 3 1 L sub I} D /l(bp)D 0.94 Y /Helvetica findf=
ont<br>
22 scalefont setfont l s P(x)s exch P T O l show showpage<br>
<br></blockquote><div>Best,</div><div>Bridger <br></div></div></div>

--000000000000fd4b8f06215ff6e7--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?CAD-FYmTXrtvDEG9-2xNrTf2YBLQ81Qr_DoTVF5Wdvh6cnen6xg>