[NTG-context] Using ConTeXt-LMTX for modern Mathematically-Literate-Programming 2/2
Stephen Gaito
stephen at perceptisys.co.uk
Thu Dec 3 11:43:25 CET 2020
Hans,
If my only constraints were ease of programming and moderate
performance, I would completely agree that using mostly Lua plus
(possibly) some C code for some targeted stuff that is really slow in
Lua is the correct solution.... we are actually in agreement.
Unfortunately, I have the *non-functional* requirement to *prove* the
code's correctness.... this is the heart of what I have to write about.
There is no getting out of this requirement....
So, some day it would be very useful to be able to directly embed a
Lua wrapped ANSI-C shared library inside the new LuaMetaTex....
However, at the moment, as part of my parallelization attempts I can
interact with my ANSI-C code over a network.... so I will use this
approach for the near to medium time frames.
Regards,
Stephen Gaito
On Wed, 2 Dec 2020 14:17:54 +0100
Hans Hagen <j.hagen at xs4all.nl> wrote:
> On 12/2/2020 11:43 AM, Stephen Gaito wrote:
>
> > Again, to my knowledge, Lua v5.4 has only one implementation (though
> > this implementation *can* be compiled for a very wide range of
> > CPU's).
>
> Lua has not many demands ... it can even run on tiny cpu's. It's all
> rather plain C code. (And in luametatex we have no c++ ... all is
> just C.)
>
> > Finally, the computational complexity of my proof engine, will be
> > comparable to MetaFun/MetaPost... which I suspect you would not
> > consider implementing in pure Lua. Some things are faster in C.
>
> Hard to say ... I think that the parser / expansion machinery in mp
> is the bottleneck here (no fun to do that in lua). Redoing it in Lua
> also is asking for compatibility issues. (btw, extensions are done in
> lua anyway, as is the mp backend)
>
> > So yes I do need to implement it in ANSI-C wrapped in Lua (so that
> > it can be used from *inside* ConTeXt).
>
> I would have to see the 'kind of code involved' in order to comment
> on that.
>
> An option is to do most in lua and maybe some helpers for crititical
> code in C.
> Hans
>
>
> -----------------------------------------------------------------
> Hans Hagen | PRAGMA ADE
> Ridderstraat 27 | 8061 GH Hasselt | The Netherlands
> tel: 038 477 53 69 | www.pragma-ade.nl | www.pragma-pod.nl
> -----------------------------------------------------------------
More information about the ntg-context
mailing list