Re: [NTG-context] Any initial thoughts on luau?

2021-11-05 Thread Hans Hagen via ntg-context

On 11/5/2021 6:23 PM, Ramkumar KB via ntg-context wrote:

Hello,

Yesterday, Roblox announced - Luau - https://luau-lang.org/why 
 - mainly adding linting and type-checking 
features.


Being compatible with Lua 5.1 is probably a bummer but nonetheless would 
be interesting to hear about this from this community.
for sure i need more than an email to give a real answer (and some can 
be read between the lines of the history documents / articles that we 
ship); that said:


the main reasons for choosing lua for luatex has been that it is 
relatively small, has no dependencies, doesn't need tons of libraries to 
make it useful, is made for embeded usage, evolves in a proper academic 
setting, has long-term dedicated (nice) developers, is not part of some 
religious programming language war/competition, reminds me (in a 
positive way of pascal and modula), is pretty fast, ... so, no regrest 
and no need for something else


now, the link you point at mentions 'typing', 'multipass bytecode 
generation', 'possible jit'


to start with typing: i suppose that a more explicit integer / float 
separation can give better performance, although on modern cpu's one can 
wonder (personally i don't see the current mix of integer / float as a 
benefit over all numbers being floats  - which had some charm due to the 
consistency - but who an i to complain; at least we now have bitwise 
operators (for a specific application like roblox it makes sense but 
using a dedicated / patched / extended lua machinery in luatex doesn't); 
there are articles by the lua authors about typing but these are behind 
publisher firewalls


multipass compiling costs time and would actually not be that 
benificial: in luatex we rely a lot on instant and frequent compilation 
(\directlua, \latelua) which is real fast; i bet that there are some 
optimizations possible in the vm but at the cost of more granularity and 
therefore it could bring limitations too (unless one goes wider memory 
wise) .. i think many lua applications actually assume fast realtime 
compilation; we simply don't stay long enough in a run to have an 
advantage (apart maybe from embedded bytecode for which an optional 
bytecode optimizer could make sense and i actually have been thinking 
about that)


jitting also costs time and for a single pass process like tex there is 
no gain (we established that long ago alreadY); the only reason why 
luajittex is faster than luatex for a tex run is that the vm is faster 
due to some limitations (that one can actually hit but in context we got 
around it) ... jitting also is cpu dependent and therefore more fragile 
futurw wise (more and more complex code too)


i'd read about the roblox vm project some time ago and was curious how 
it would work with the latest lua but then, but for good reason they 
stick to 5.1; if you look at the lua vm code i guess that some gain can 
come from less type-checking (maybe the  prefix in 5.4 is some 
indication that there are thoughts about this but currently that has no 
significant gain)


if better performance is an objective: there are probably spots in the 
current code that are candidates and one can see from updates that 
occasionally optimizations happen (keep in mind that lua has to run on a 
wide range of hardware: small embedded to fast single core)


so, I'm pretty okay with lua as it is now (but any influx from spin off 
languages / engines can be interesting, but i think the authors are 
aware of all that) ... and ... who knows what (side effects) pallene 
will bring


(also about performance: i know pretty well how to write fast lua code 
but no one ever comes around asking so that means everyone is satisfied)


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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Any initial thoughts on luau?

2021-11-05 Thread Ramkumar KB via ntg-context
Hello,

Yesterday, Roblox announced - Luau - https://luau-lang.org/why - mainly
adding linting and type-checking features.

Being compatible with Lua 5.1 is probably a bummer but nonetheless would be
interesting to hear about this from this community.

Thank you.

best regards,
Ramkumar
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] Strange result with the new upload

2021-11-05 Thread Hans Hagen via ntg-context

On 11/5/2021 5:45 PM, Alain Delmotte via ntg-context wrote:

Hi,

If I take the last piece of code from Hans' message 28/10/2021 11:24, 
and run it with the new upload I get clean paragraphs with the red ans 
the blue colour, but for the paragraphs with the green colour, the text 
in colour ("keyword") is overwritten by the normal text in black.


I don't remember that before.
the localboxes interface changed a bit ... see the new lowlevel manual 
for details (i added 'middle' boxes so that we can do better margin 
trickery and there are predefined handlers for l/r margin text and nline 
numbers now


(local boxes are still kind of work in progress, the old (luatex) 
interfaces were not that usefui / interesting anyway, and we can do more 
now)


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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] Strange result with the new upload

2021-11-05 Thread Alain Delmotte via ntg-context

  
  
Hi,
If I take the last piece of code from
Hans' message 28/10/2021 11:24, and run it with the new upload I
get clean paragraphs with the red ans the blue colour, but for
the paragraphs with the green colour, the text in colour
("keyword") is overwritten by the normal text in black.
I don't remember that before.
Alain
Here is the code:
%I need to ponder this usage:


\definelocalboxes

  [linetextA]

  [command=\LeftTextA,

  location=lefttext,

  style=\bs,

  color=darkblue]


\protected\def\LeftTextA#1{\llap{#1}\quad}


\definelocalboxes

  [linetextB]

  [command=\LeftTextB,

  location=left,

  style=\bs,

  color=darkgreen]


\protected\def\LeftTextB{\llap{\unhbox\localboxcontentbox}\quad}


\starttext


\dorecurse{10}{some
  text #1 }
\leftparbox
  {\red \bf keyword}HERE\leftparbox{}
\dorecurse{10}{some
  text #1 }
\blank


{\dorecurse{10}{some
  text #1 }
\leftparbox
  {\red \bf keyword}test
\dorecurse{10}{some
  text #1 }}
\blank


{\dorecurse{10}{some
  text #1 }
\localbox[linetextA]{keyword}HERE
\dorecurse{10}{some
  text #1 }}


{\dorecurse{10}{some
  text #1 }
\localbox[linetextB]{keyword}HERE
\dorecurse{10}{some
  text #1 }}


{\dorecurse{10}{some
  text #1 }
\localbox[linetextB]{keyword
  1}HERE1
\dorecurse{10}{some
  text #1 }
\localbox[linetextB]{keyword
  2}HERE2
\dorecurse{10}{some
  text #1 }}


\stoptext

  

  

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] can typesetbuffer use the same engine?

2021-11-05 Thread Rik Kabel via ntg-context


On 11/5/2021 11:18, Hans Hagen via ntg-context wrote:

On 11/5/2021 3:19 PM, Rik Kabel via ntg-context wrote:

Hello brain trust,

How can \typesetbuffer be instructed to use the same engine as the 
document which contains it?


With the following example:


\startbuffer[Buffer]
   \startTEXpage \contextmark \stopTEXpage
\stopbuffer
\starttext
   \contextmark\
   \typesetbuffer[Buffer]
\stoptext

I get "MKIV LMTX" when it is processed with context --luatex. I want 
the buffer to be processed as MkIV.

Does patching line 691 in buff-ini.lua

    template = (jit and "--jit --engine=luajittex" or 
"--engine=luatex") .. " --purgeall %?path: --path=%path% ?% %filename%",


work okay? Run "context --make" after patching.

Hans

Yes, that seems to do it. context --make and context --make --luatex 
were needed, I think.


--
Rik

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] new upload

2021-11-05 Thread Hans Hagen via ntg-context

Hi,

The latest lmtx upload has this:

\starttext

\dorecurse{10} {
\dorecurse{20}{test #1 }
\dorecurse{10}{\insertlinebefore{BEFORE 1/#1}}
\dorecurse{20}{test #1 }
\blank
}

\page

\dorecurse{10} {
\dorecurse{20}{test #1 }
\insertlinebefore{BEFORE 1a}
\insertlinebefore{BEFORE 1b}
\insertlineafter {AFTER  1}
\dorecurse{20}{test #1 \hbox{\hbox{\hbox{\footnote{!}
\dorecurse{20}{test #1 }
\insertlinebefore{BEFORE 2}
\insertlineafter {AFTER  2}
\dorecurse{20}{test #1 }
\blank
}

\page

\dorecurse{20}{before #1 }
\insertblankbefore[big]%
\insertlinebefore{\bf patch starts here}%
\insertblankbefore[2*big]%
\dorecurse{20}{between #1 }
\insertblankafter[2*big]%
\insertlineafter{\bf and ends here}%
\insertblankafter[big]%
\dorecurse{20}{after #1 }

\stoptext

so, some experimental injection mechanism (using some upgraded low level 
\vadjust related trickery).


(now back to the math font mess with Mikael ... so if math lovers have 
test cases ... it's about time to deal with persistent issues as I don't 
see/expect math fonts being made more consistent than they are now so we 
can add tweaks to the goodie files as we go)


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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


Re: [NTG-context] can typesetbuffer use the same engine?

2021-11-05 Thread Hans Hagen via ntg-context

On 11/5/2021 3:19 PM, Rik Kabel via ntg-context wrote:

Hello brain trust,

How can \typesetbuffer be instructed to use the same engine as the 
document which contains it?


With the following example:


\startbuffer[Buffer]
   \startTEXpage \contextmark \stopTEXpage
\stopbuffer
\starttext
   \contextmark\
   \typesetbuffer[Buffer]
\stoptext

I get "MKIV LMTX" when it is processed with context --luatex. I want the 
buffer to be processed as MkIV.

Does patching line 691 in buff-ini.lua

template = (jit and "--jit --engine=luajittex" or 
"--engine=luatex") .. " --purgeall %?path: --path=%path% ?% %filename%",


work okay? Run "context --make" after patching.

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
-
___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___


[NTG-context] can typesetbuffer use the same engine?

2021-11-05 Thread Rik Kabel via ntg-context

Hello brain trust,

How can \typesetbuffer be instructed to use the same engine as the 
document which contains it?


With the following example:


\startbuffer[Buffer]
  \startTEXpage \contextmark \stopTEXpage
\stopbuffer
\starttext
  \contextmark\
  \typesetbuffer[Buffer]
\stoptext

I get "MKIV LMTX" when it is processed with context --luatex. I want the 
buffer to be processed as MkIV.


--
Rik

___
If your question is of interest to others as well, please add an entry to the 
Wiki!

maillist : ntg-context@ntg.nl / http://www.ntg.nl/mailman/listinfo/ntg-context
webpage  : http://www.pragma-ade.nl / http://context.aanhet.net
archive  : https://bitbucket.org/phg/context-mirror/commits/
wiki : http://contextgarden.net
___