Dev Tools

Loading…

Forty tools for text a machine will read later

Every tool here works on text that something else is going to read: a string literal, a comment, a patch, a command line, a specification, a pattern. They run as WebAssembly in this browser tab, upload nothing, and β€” the rule that decides what all forty of them may say β€” run nothing. A shell command is explained and never executed. A container recipe is read and never built. A request is written out and never sent. That is the only honest position for something running on somebody else's machine, and it is also the limit: a linter that never built the image cannot tell you whether it builds, and says so on its own result.

Text as a literal comes first: a string escaped for eleven languages and read back unchanged, every language's escape sequence for a codepoint with all four forms read at once, characters with their numbers and blocks and bytes, a colour in the six notations code wants β€” including the one that puts the transparency first, which is the most-copied-wrong constant there is β€” byte sizes in both ladders because a kilobyte is two different numbers, and a list of lines as an array or a set with each item escaped for its own language.

Then what a source file is made of: a natural sort that puts ten after nine, a comment stripper that knows a marker inside a string is not a comment and that Rust nests a block comment where C does not, an indentation converter that advances to the next tab *stop* rather than by a fixed width so that aligned lines stay aligned, a line counter that reads the language from each file's name, and a stack trace unglued from the single log line it arrived as with your own frames told from the library's.

Then the repository: a patch read file by file, a git command for the thing you meant with the ones that throw work away named before you press return, ignore rules with a path tested against them by the rule that actually wins β€” the last β€” a licence chosen by four answers, badges drawn here rather than fetched from a service, a changelog grouped by the kind of change with the breaking ones alone at the top, and versions compared with the pre-release rule the right way round. Then requests and interfaces, then five things read rather than run β€” a pattern, a glob, an identifier, a list of names and a command line β€” then a Dockerfile, a compose file and a YAML file read for what is wrong with them. Last, markup turned into Markdown, into a component, or into an icon whose colour follows the text around it.

Text as a literal

String literals
Text as a literal in eleven languages, and back out again unchanged.

Escape sequences
A character in every language's escape form, and every form read back at once.

Character codes
Every character with its number, its block and its bytes β€” and codes back to text.

Colour constants
One colour in six notations, including the one that puts the alpha first.

Byte sizes
A count of bytes in both ladders at once, because a kilobyte is two things.

List to array
Lines as an array or a set in eleven languages, each item escaped for its own.

Inside a source file

Natural sort
A list sorted the way a person reads it, so that ten follows nine.

Remove comments
Comments taken out, and a marker inside a string left exactly where it was.

Tabs and spaces
Indentation converted to the next tab stop, so that aligned lines stay aligned.

Lines of code
Code, comment and blank lines counted per file, with the language read from the name.

Stack trace
A trace glued into one log line, unglued β€” with your own frames told from the library's.

The repository's own files

Read a patch
A unified diff as what changed, file by file, with the added and removed counted.

Git commands
The command for the thing you meant, with the ones that throw work away named.

Changelog
Commits grouped by the kind of change, with the breaking ones on their own at the top.

Semantic versions
Versions read, sorted and tested against a range β€” with the pre-release rule the right way round.

Ignore rules
Rules from templates, and a path tested against them by the rule that wins β€” the last one.

Choose a licence
Four answers and a licence, with the short ones in full and the long ones pointed at.

Readme badges
Badges drawn here as SVG rather than fetched from a service that may go away.

Requests and interfaces

curl to code
A command as the same request in six languages, with the token masked by default.

Build a request
Method, headers and body as a command, a request file or a table of its parts.

WHERE clause
Rules as a clause with the values kept outside it, which is the only safe way to write one.

Sample answer
A shape of fields as a JSON answer, repeatable from a seed and never mistaken for data.

Format a query
A query indented or minified, with its variables named and its braces counted.

Read a schema
Types and fields listed, and which type is named by which β€” the question a schema is opened for.

Read, not run

Explain a pattern
A pattern taken apart and said in words, or built from named pieces.

Test a glob
Which paths a pattern covers, with the syntax it does not read refused by name.

Read an identifier
Version, variant and the instant it was made β€” or the plain statement that it has none.

Identifier collisions
Titles as address-safe identifiers, with the ones that become the same named and numbered.

Explain a command
A command line taken apart and explained, never run β€” with the destructive parts named.

Read a Dockerfile
The faults that cost size or safety, including the secret that stays in a layer for ever.

Run to compose
A run command as the service that would do the same, with the ports and volumes kept.

Read a YAML file
The four things that break a YAML file, including the country code that reads as false.

Turned into something else

HTML to Markdown
A page as prose, with the tags it cannot convert named rather than swallowed.

HTML to JSX
Markup as a component, with the three things that are a syntax error if left alone.

Drawing to component
A drawing as an icon whose size is a parameter and whose colour follows the text around it.

Snippet as a picture
A snippet drawn as SVG source rather than an encoded picture, in three colours and no more.

Terminal colours
An escape sequence said in words, taken out, or written as something a source file can hold.

Terminal colour
A colour as the nearest of the two hundred and fifty-six, and as the full-colour sequence.

Questions

Which tools from the group are missing?
The ones that are really a build: a code formatter for each language, a compiler explainer, a dependency auditor. Each needs the language's own grammar or its package registry, which is a bigger thing than this whole application and, in the second case, a network request. What is here instead is the half of each job that is a document being read.
Why are the comment tools per language rather than general?
Because the two mistakes a general one makes are both silent and both destroy a file. A comment marker inside a string literal is not a comment β€” treat it as one and the rest of that line of code disappears. A quotation mark inside a comment does not open a string β€” treat it as one and everything to the next quotation mark in the file disappears. One state machine reads both, and it reads a row of a language table that says whether that language nests a block comment.
Is the snippet picture an image file?
No: it is SVG source, which is text. Nothing in this workspace ships or produces a binary asset. The text inside it is still text, so it stays sharp at any size and can be searched β€” and it uses three colours, comment, string and everything else, rather than pretending to be a syntax highlighter, which would need a grammar for every language.
Why does the identifier reader refuse to guess a date?
Because five of the eight versions of that identifier carry no time in them at all. Reading four bytes of randomness as a timestamp produces a plausible date in the nineteen-seventies that somebody will believe. Version one, six and seven carry a real instant and it is shown; the other five say plainly that there is none.