Concatenated block format

From wiki
Revision as of 00:13, 3 December 2021 by Colby Russell (talk | contribs) (→‎Delimiters: mention g-blocks)

Triple scripts use the concatenated t-block file format. It's one of the most portable application file formats in the world. Refer to the existing info about the triple script file format.

As the linked page indicates, you should NOT use the triple script file format for anything that is not actually a triple script. Programs are only triple scripts if they conform to all three of the triple script invariants. To experiment with similar concepts for files that are not valid triple scripts, it's not necessary to use the triple slash delimiter, so please do not abuse it for other purposes. (You could use double-slash delimited blocks instead, as one example.)


The scriptwrap trick is what allows triple scripts to run in various legacy runtimes, including Web browsers and JS engines. The triple script dialect was carefully designed so the triple slash script delimiters that appear in compilation form indicating the beginning and end of a given module are not just valid tokens for the triple script compiler, but for valid sequences according to the ECMA-262 grammar and for a Web browser expecting markup according to the HTML5 standard.

The file format permits, as an alternative to t-blocks, delimiters that look like //? <script> and //? </script> to denote a g-blocks. Files comprising a sequence of g-blocks are not meant to have strong guarantees about the contents the way that t-blocks do. The trplkt publish command may be used to convert a valid program into a triple script for wide distribution. Programs that are *not* valid triple scripts (because they fail to abide by the three invariants) may repurpose the triple script tooling to produce files comprising a sequence of g-blocks instead, so as not to confuse recipients.

Cookies help us deliver our services. By using our services, you agree to our use of cookies.