[NTG-context] LuaTeX 1.0.3 announcement
Luigi has shown me a simple and useful application of ffi: In the case of lua(jit)tex in W32TeX, which are used in context, standard C libraries are linked statically. Thus it is necessary to load a necessary DLL for standard C functions, like the following meaningless example: \starttext $$ j0(1.765)= \startluacode ffi=require("ffi") ffi.cdef[[ double _j0(double x); ]] -- In the case of lua(jit)tex in W32TeX, C libraries are linked -- statically. Thus it is necessary to load a necessary DLL. local msvcrt=ffi.load("msvcrt") tex.print(msvcrt._j0(1.765)) \stopluacode $$ \stoptext It is expected that Windows APIs in the following libs can be used without loading DLL: WSOCK32.dll USER32.dll ADVAPI32.dll SHELL32.dll GDI32.dll KERNEL32.dll WS2_32.dll Best, Akira ___ 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] LuaTeX 1.0.3 announcement
On Sat, 18 Feb 2017 14:59:14 +0100 luigi scarso wrote: > On Sat, Feb 18, 2017 at 2:27 PM, Henri Menke > wrote: > > On 02/18/2017 09:42 AM, luigi scarso wrote: > >> On Sat, Feb 18, 2017 at 9:11 AM, Henri Menke > >> wrote: > >>> On 02/17/2017 08:57 PM, luigi scarso wrote: > >>> How can I use the FFI? There is nothing in the latest docs. > >>> Thanks for all the efforts! > >> luatex ffi is beyond the "experimental state", and aims to be > >> compatible with luatexjit ffi. > > > > So it has the same interface? There seems to be no documentation > > about it in the most recent manual from luatex.org > yes, "aims to be compatible" means same interface and functionality, > but there is still lot of work to do, > apart the dynamic loading of the library and the C parser. > But it's usable for testing. > Luigi has shown me a simple and useful application of ffi: \startluacode ffi=require("ffi") ffi.cdef[[ double j0(double x); double j1(double x); double jn(double x); -- ... ]] \stopluacode These libm functions can then be used in lua as: ffi.C.j0(x) for example. In my case, I pass them to MetaPost as: \startMPdefinitions vardef jzero primary x = scantokens(lua("mp.quoted(ffi.C.j0(" & decimal x & "))")) enddef ; \stopMPdefinitions This experimental code appears to work quite well. Thank you Luigi and Hans! Alan ___ 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] LuaTeX 1.0.3 announcement
On 2/18/2017 2:27 PM, Henri Menke wrote: On 02/18/2017 09:42 AM, luigi scarso wrote: On Sat, Feb 18, 2017 at 9:11 AM, Henri Menke wrote: On 02/17/2017 08:57 PM, luigi scarso wrote: How can I use the FFI? There is nothing in the latest docs. Thanks for all the efforts! luatex ffi is beyond the "experimental state", and aims to be compatible with luatexjit ffi. So it has the same interface? There seems to be no documentation about it in the most recent manual from luatex.org btw, context will never depend on libraries for functioning but it has support for ffi built in and there might be some additional helpers for glueing to libraries but libraries themselves will always be considered a liability i.e. if someone uses them in a workflow (which is fine) support for specific libraries will not be provided (unless context ships with some module that uses them which probably will happen but even then those libraries are considered black boxes so failures are outside the dev team responsibilities) 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] LuaTeX 1.0.3 announcement
On Sat, Feb 18, 2017 at 2:27 PM, Henri Menke wrote: > On 02/18/2017 09:42 AM, luigi scarso wrote: >> On Sat, Feb 18, 2017 at 9:11 AM, Henri Menke wrote: >>> On 02/17/2017 08:57 PM, luigi scarso wrote: >>> How can I use the FFI? There is nothing in the latest docs. Thanks for >>> all the efforts! >> luatex ffi is beyond the "experimental state", and aims to be >> compatible with luatexjit ffi. > > So it has the same interface? There seems to be no documentation about it in > the most recent manual from luatex.org yes, "aims to be compatible" means same interface and functionality, but there is still lot of work to do, apart the dynamic loading of the library and the C parser. But it's usable for testing. -- luigi ___ 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] LuaTeX 1.0.3 announcement
On 2/18/2017 2:27 PM, Henri Menke wrote: On 02/18/2017 09:42 AM, luigi scarso wrote: On Sat, Feb 18, 2017 at 9:11 AM, Henri Menke wrote: On 02/17/2017 08:57 PM, luigi scarso wrote: How can I use the FFI? There is nothing in the latest docs. Thanks for all the efforts! luatex ffi is beyond the "experimental state", and aims to be compatible with luatexjit ffi. So it has the same interface? There seems to be no documentation about it in the most recent manual from luatex.org indeed as there is enough on the web ... duplicating that makes no sense For luajit ffi see http://luajit.org/ext_ffi.html The main difference with standard luajit is that by default jit.off() in luajittex. ___ 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 ___ -- - 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] LuaTeX 1.0.3 announcement
On 02/18/2017 09:42 AM, luigi scarso wrote: > On Sat, Feb 18, 2017 at 9:11 AM, Henri Menke wrote: >> On 02/17/2017 08:57 PM, luigi scarso wrote: >> How can I use the FFI? There is nothing in the latest docs. Thanks for all >> the efforts! > luatex ffi is beyond the "experimental state", and aims to be > compatible with luatexjit ffi. So it has the same interface? There seems to be no documentation about it in the most recent manual from luatex.org > For luajit ffi see > http://luajit.org/ext_ffi.html > > The main difference with standard luajit is that by default jit.off() > in luajittex. > ___ 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] LuaTeX 1.0.3 announcement
On Sat, Feb 18, 2017 at 9:11 AM, Henri Menke wrote: > On 02/17/2017 08:57 PM, luigi scarso wrote: > How can I use the FFI? There is nothing in the latest docs. Thanks for all > the efforts! luatex ffi is beyond the "experimental state", and aims to be compatible with luatexjit ffi. For luajit ffi see http://luajit.org/ext_ffi.html The main difference with standard luajit is that by default jit.off() in luajittex. -- luigi ___ 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] LuaTeX 1.0.3 announcement
On 02/17/2017 08:57 PM, luigi scarso wrote: > == > LuaTeX Release 1.0.3 was released 2017021514 > == > > This is a minor upgrade and probably this version will go on texlive. > There are a couple > of fixes and additions. > - We added a few a few more helpers in the pdf namespace (like > set|get]gentounicode, > [set|get]omitcidset and set|get]decimaldigits. Some helpers were > moved from the tex > to the pdf namespace. > > - We added a build_page_insert callback for inserts so that one can > for instance adapt > spacing on demand. > > - On the agenda has been some more control over word start and end in > hyphenation and > this is now possible via hyphenationbounds. We also updated the > manual with some more > details. > > - An old tracker item with respect to control over spacing around math > was revived and > has resulted in mathsurroundmode (one can wonder how useful this is). > > - We improved the resolution detection in included jpeg images. > > > - An ffi library has been added to luatex so that it is more in sync > with luajittex. This > permits easy and flexible loading of libraries. Our policy is to > make luatex as lean > as possible with no dependencies and this is a step towards that. > Eventually we hope > to support all relevant platforms. How can I use the FFI? There is nothing in the latest docs. Thanks for all the efforts! > - The glue and skip register accessors have been improved as a step in > freeing the user > from glue spec management. > > - We added a few more getters and setters for nodes in order to get a > more consistent > set. > > - Irrelevant fields have been removed from the status table and an > engine identifier > has been added. > > - Of course there are numerous fixes and improvements but none of > these have consequences > for the interfaces. > > - The manual has been updated but will be improved over time. > > > > > Have fun, > Hans, Luigi, Taco > ___ > 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 > ___ > ___ 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] LuaTeX 1.0.3 announcement
== LuaTeX Release 1.0.3 was released 2017021514 == This is a minor upgrade and probably this version will go on texlive. There are a couple of fixes and additions. - We added a few a few more helpers in the pdf namespace (like set|get]gentounicode, [set|get]omitcidset and set|get]decimaldigits. Some helpers were moved from the tex to the pdf namespace. - We added a build_page_insert callback for inserts so that one can for instance adapt spacing on demand. - On the agenda has been some more control over word start and end in hyphenation and this is now possible via hyphenationbounds. We also updated the manual with some more details. - An old tracker item with respect to control over spacing around math was revived and has resulted in mathsurroundmode (one can wonder how useful this is). - We improved the resolution detection in included jpeg images. - An ffi library has been added to luatex so that it is more in sync with luajittex. This permits easy and flexible loading of libraries. Our policy is to make luatex as lean as possible with no dependencies and this is a step towards that. Eventually we hope to support all relevant platforms. - The glue and skip register accessors have been improved as a step in freeing the user from glue spec management. - We added a few more getters and setters for nodes in order to get a more consistent set. - Irrelevant fields have been removed from the status table and an engine identifier has been added. - Of course there are numerous fixes and improvements but none of these have consequences for the interfaces. - The manual has been updated but will be improved over time. Have fun, Hans, Luigi, Taco ___ 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 ___