groff
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Pygments-based syntax highlighting preprocessor


From: Robin Haberkorn
Subject: Re: Pygments-based syntax highlighting preprocessor
Date: Thu, 1 Aug 2024 02:30:19 +0200

Hello Bento!

On Wed, 31 Jul 2024 15:19:53 -0300
Bento Borges Schirmer <bbschirmer@inf.ufsm.br> wrote:

> I peeked around your repository. I noticed the hyperlinks to CSNOBOL4
> are broken. what about SNOBOL4? is it cool? I understand it acts as a
> filter?

I updated the links. It seems to live here nowadays:
http://www.regressive.org/snobol4/csnobol4/

SNOBOL4 is a scripting language. A very old one. But it's still
interesting and worthwhile to learn because of its unique built-in
backtracking-based pattern matching language. Its descendant - Icon - is
also worth checking out.
On the downside, SNOBOL4 will torture you with its exclusive reliance on
Gotos for control flow. A rarity nowadays, but this language is
entirely "unstructured"!

> and is this BNF built into SNOBOL4?

No. I built a EBNF parser in SNOBOL4 that spits out GNU Pic code. That
was back when I wrote my bachelor thesis.
SNOBOL4 is good at prototyping small DSLs and compilers.

> is it worth learning? or do you think other
> languages/libraries/DSLs better solve the problems it was designed
> for?

If you have a fetish for old and obscure languages like I, it's
certainly worthwhile to learn. ;-)

> how do you even learn it, like is there some
> tutorial, manual or exercises about it?

There is lots of material on SNOBOL4 on the aforementioned website:
http://www.regressive.org/snobol4/
The most important book is probably the "Green Book":
http://www.math.bas.bg/bantchev/place/snobol/gpp-2ed.pdf

> is it standardized, or are
> there dozens of mutually exclusive dialects?

Pretty much standardized. There are only two dialects left, that you
could possibly run on a modern PC. That's CSNOBOL4 and SPITBOL.

> is it compiled or interpreted?

CSNOBOL4 is interpreted. But SPITBOL is actually a compiler - the first
and oldest compiler for a loosely typed high-level scripting language
AFAIK. (Mind you, this was before JIT-compilation...)

> can I call it inside a C program as a subroutine?

Not that I know.

> can it call C functions?

http://www.regressive.org/snobol4/csnobol4/curr/doc/snobol4ffi.3.html

> 
> Also, please do share tricks, difficulties you faced, methodologies
> and habits when writing your thesis in ms groff! I'm to follow similar
> path some time.

Mhh, better ask something more concrete.
Use `pdfmom --roff` even with `-ms` (`-mspdf`) and gropdf (pdfmom does
that by default).
Other than that, be prepared to write quite a few custom macros.
Be sure to check out Pic and Grap - it's so much fun to play around
with. Both my bachelor and master thesis contained only code-generated
graphics (not counting screenshots).

Best regards,
Robin



reply via email to

[Prev in Thread] Current Thread [Next in Thread]