hi there,
*-TeX v0.1.0 has just been tagged and released.
No new feature to speak off, except star-tex dropped its C++ sources and
is now a pure-(Go+C) package.
We can now focus on migrating all C code to Go, in a piece-wise manner
(function by function.)
In parallel, we should probably develop a complete web2go program that
- takes the official "tex.web" file,
- parses it,
- retains all documentation informations,
- preserves strings, constant literals,
- dumps the (Pascal) AST as Go code.
Prior art related to this: [1].
that should be fun.
-s
[1]: http://mruckert.userweb.mwn.de/hint/web2w.pdf
On Wed, Feb 24, 2021 at 10:22 PM Sebastien Binet <s@sbinet.org> wrote:
> In parallel, we should probably develop a complete web2go program that>> - takes the official "tex.web" file,> - parses it,> - retains all documentation informations,> - preserves strings, constant literals,> - dumps the (Pascal) AST as Go code.>> Prior art related to this: [1].>> that should be fun.
I can, and would love to, _try to_ contribute with the Pascal -> AST
-> Go part. IOW, is someone able to do the tex.web -> Pascal? I know
very little about that part, but I think it was solved by Knuth
himself in [1], although I cannot find any distro package of it nor
it's source to compile from.
Does anyone have some pointers?
Thanks in advance.
-j
----
[1]: https://linux.die.net/man/1/tangle
Jan,
On Wed Feb 24, 2021 at 23:12 CET, Jan Mercl wrote:
> On Wed, Feb 24, 2021 at 10:22 PM Sebastien Binet <s@sbinet.org> wrote:>> > In parallel, we should probably develop a complete web2go program that> >> > - takes the official "tex.web" file,> > - parses it,> > - retains all documentation informations,> > - preserves strings, constant literals,> > - dumps the (Pascal) AST as Go code.> >> > Prior art related to this: [1].> >> > that should be fun.>> I can, and would love to, _try to_ contribute with the Pascal -> AST> -> Go part. IOW, is someone able to do the tex.web -> Pascal? I know> very little about that part, but I think it was solved by Knuth> himself in [1], although I cannot find any distro package of it nor> it's source to compile from.>> Does anyone have some pointers?
originally, during the transition to UNIX, the TeX toolchain migrated to
Web2c, that does what I planned for Go, but with C as a target.
(then people such as LuaTeX or XeTeX and others, tried to get rid of the
WEB step as it's a bit cumbersome to edit).
The sources of Web2c are there:
- https://github.com/TeX-Live/texlive-source/tree/trunk/texk/web2c/web2c
- https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tangle.web
- https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tangle.ch
- https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tangle-sh.in
I was refering to web2w in the announcement email because it tries to
generate somewhat nice(r) code (compared to, say Web2c), as explained in
the TUG intro:
- https://www.tug.org/TUGboat/tb38-3/tb120ruckert.pdf> [1]: https://linux.die.net/man/1/tangle
my distro (ArchLinux) does provide it:
$> yay -Ql texlive-bin |grep tangle
texlive-bin /usr/bin/ctangle
texlive-bin /usr/bin/otangle
texlive-bin /usr/bin/tangle
texlive-bin /usr/share/man/man1/ctangle.1.gz
texlive-bin /usr/share/man/man1/otangle.1.gz
texlive-bin /usr/share/man/man1/tangle.1.gz
here's the recipe:
- https://github.com/archlinux/svntogit-packages/blob/packages/texlive-bin/trunk/PKGBUILD
hth,
-s
On Wed, Feb 24, 2021 at 11:48 PM Sebastien Binet <s@sbinet.org> wrote:
> originally, during the transition to UNIX, the TeX toolchain migrated to> Web2c, that does what I planned for Go, but with C as a target.> (then people such as LuaTeX or XeTeX and others, tried to get rid of the> WEB step as it's a bit cumbersome to edit).>> The sources of Web2c are there:> - https://github.com/TeX-Live/texlive-source/tree/trunk/texk/web2c/web2c> - https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tangle.web> - https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tangle.ch> - https://github.com/TeX-Live/texlive-source/blob/trunk/texk/web2c/tangle-sh.in>>> I was refering to web2w in the announcement email because it tries to> generate somewhat nice(r) code (compared to, say Web2c), as explained in> the TUG intro:> - https://www.tug.org/TUGboat/tb38-3/tb120ruckert.pdf>> my distro (ArchLinux) does provide it:>> $> yay -Ql texlive-bin |grep tangle> texlive-bin /usr/bin/ctangle> texlive-bin /usr/bin/otangle> texlive-bin /usr/bin/tangle> texlive-bin /usr/share/man/man1/ctangle.1.gz> texlive-bin /usr/share/man/man1/otangle.1.gz> texlive-bin /usr/share/man/man1/tangle.1.gz>> here's the recipe:> - https://github.com/archlinux/svntogit-packages/blob/packages/texlive-bin/trunk/PKGBUILD>> hth,> -s
Thank you Sebastien.
jnml@e5-1650:~/src/modernc.org/tk/tmp/tex$ ll
total 1008
-rw-r--r-- 1 jnml jnml 1031999 Feb 25 10:48 tex.web
jnml@e5-1650:~/src/modernc.org/tk/tmp/tex$ tangle tex.web
This is TANGLE, Version 4.5 (TeX Live 2019/dev/Debian)
*1*17*25*38*54*72*99*110*115*133*162*173*199*203*207*211*220*256*268*289*297*300*321*332*366*402*464*487*511*539*583*592*644*680*699*719*768*813*862*891*900*919*942*967*980*1029*1055*1136*1208*1299*1330*1338*1340*1379*1380
Writing the output
file.....500.....1000.....1500.....2000.....2500.....3000.....3500.....4000.....4500.....5000.....5500.....6000.
Done.
1045 strings written to string pool file.
(No errors were found.)
jnml@e5-1650:~/tmp/tex$ ll
total 1388
-rw-r--r-- 1 jnml jnml 356839 Feb 25 10:48 tex.p
-rw-r--r-- 1 jnml jnml 25916 Feb 25 10:48 tex.pool
-rw-r--r-- 1 jnml jnml 1031999 Feb 25 10:48 tex.web
jnml@e5-1650:~/tmp/tex$
PS: I don't recall subscribing to ~sbinet/star-tex@lists.sr.ht ? I
checked the sr.ht site and I don't even know how to do that. This is
not a complain, just checking if I'm already that senile or not ;-)
On Thu Feb 25, 2021 at 10:55 CET, Jan Mercl wrote:
[...]
> Thank you Sebastien.>> jnml@e5-1650:~/src/modernc.org/tk/tmp/tex$ ll> total 1008> -rw-r--r-- 1 jnml jnml 1031999 Feb 25 10:48 tex.web> jnml@e5-1650:~/src/modernc.org/tk/tmp/tex$ tangle tex.web> This is TANGLE, Version 4.5 (TeX Live 2019/dev/Debian)> *1*17*25*38*54*72*99*110*115*133*162*173*199*203*207*211*220*256*268*289*297*300*321*332*366*402*464*487*511*539*583*592*644*680*699*719*768*813*862*891*900*919*942*967*980*1029*1055*1136*1208*1299*1330*1338*1340*1379*1380> Writing the output> file.....500.....1000.....1500.....2000.....2500.....3000.....3500.....4000.....4500.....5000.....5500.....6000.> Done.> 1045 strings written to string pool file.> (No errors were found.)> jnml@e5-1650:~/tmp/tex$ ll> total 1388> -rw-r--r-- 1 jnml jnml 356839 Feb 25 10:48 tex.p> -rw-r--r-- 1 jnml jnml 25916 Feb 25 10:48 tex.pool> -rw-r--r-- 1 jnml jnml 1031999 Feb 25 10:48 tex.web> jnml@e5-1650:~/tmp/tex$
IIRC the content of tex.p is an interesting exercize in code obfuscation :)
and eventhough my first "real" programming language was Turbo Pascal at
the university, some 23 years ago (oh my...), I couldn't really decipher it
by eye (well, tex.web is in a Pascal dialect), and didn't find the gofmt
equivalent of Pascal.
> PS: I don't recall subscribing to ~sbinet/star-tex@lists.sr.ht ? I> checked the sr.ht site and I don't even know how to do that. This is> not a complain, just checking if I'm already that senile or not ;-)
to subscribe to it, you'd have to go there:
- https://lists.sr.ht/~sbinet/star-tex
(blue button on the left.)
or:
- ~sbinet/star-tex+subscribe@lists.sr.ht
(you're not subscribed (nor senile), I've just BCC'ed you the first time
around as I thought you might have been interested in learning star-tex
was dropping its C++ ties.)
-s
nice!
I'll try to send a PR to fix this problem I get on my box, though:
go test -v
=== RUN TestScanner
all_test.go:85: This is TANGLE, Version 4.5 (TeX Live 2020/Arch Linux)
*1*17*25*38*54*72*99*110*115*133*162*173*199*203*207*211*220*256*268*289*297*300*321*332*366*402*464*487*511*539*583*592*644*680*699*719*768*813*862*891*900*919*942*967*980*1029*1055*1136*1208*1299*1330*1338*1340*1379*1380
Writing the output file.....500.....1000.....1500.....2000.....2500.....3000.....3500.....4000.....4500.....5000.....5500.....6000.
Done.
1045 strings written to string pool file.
(No errors were found.)
rename tex.p /tmp/web2go-test-2439105947/tex.p: invalid cross-device link
--- FAIL: TestScanner (0.09s)
=== RUN TestParser
all_test.go:120: This is TANGLE, Version 4.5 (TeX Live 2020/Arch Linux)
*1*17*25*38*54*72*99*110*115*133*162*173*199*203*207*211*220*256*268*289*297*300*321*332*366*402*464*487*511*539*583*592*644*680*699*719*768*813*862*891*900*919*942*967*980*1029*1055*1136*1208*1299*1330*1338*1340*1379*1380
Writing the output file.....500.....1000.....1500.....2000.....2500.....3000.....3500.....4000.....4500.....5000.....5500.....6000.
Done.
1045 strings written to string pool file.
(No errors were found.)
rename tex.p /tmp/web2go-test-2439105947/tex.p: invalid cross-device link
--- FAIL: TestParser (0.09s)
FAIL
exit status 1
‐‐‐‐‐‐‐ Original Message ‐‐‐‐‐‐‐
On Saturday, February 27th, 2021 at 9:02 PM, Jan Mercl <0xjnml@gmail.com> wrote:
> @d24877c3>> jnml@3900x:~/src/modernc.org/web2go$ go test -v>> === RUN TestScanner>> all_test.go:111: toks: 123190>> --- PASS: TestScanner (0.09s)>> === RUN TestParser>> --- PASS: TestParser (0.12s)>> PASS>> ok modernc.org/web2go 0.219s>> jnml@3900x:~/src/modernc.org/web2go$