Skip to content

Instantly share code, notes, and snippets.

import {words as _words} from "popular-english-words";
let words = _words.getAll();
//let words = _words.getMostPopular(100000);
let set = new Set(words);
function findSmallestRoot(word, path=null) {
if (!path) {
path = [word];
}
let app = getContext("app");
let {
tabs,
selectedTab,
} = app;
function select({detail: tab}) {
app.selectTab(tab);
}
@gushogg-blake
gushogg-blake / entrypoints.md
Last active May 20, 2022 16:19
A proposal for // ENTRYPOINT comments to indicate where a project connects to the outside world

Entrypoints

This is a proposal to adopt the use of // ENTRYPOINT comments next to a program's top-level entrypoints, such as the main function, event handlers, and network listeners.

The idea is to allow new contributors and curious readers to quickly gain an overview of the project's main functions in a way that's easy to understand, and for the entrypoints to act as sensible starting points (and helpful mental anchor points) for further exploration.

The presence of ENTRYPOINT comments should allow the reader to quickly begin to answer questions like what does this program do? (provided the main function is sufficiently readable); what happens when I press a key?; and how does this program respond to network requests?.

Tooling

let Parser = require("tree-sitter");
let HTML = require("tree-sitter-html");
let parser = new Parser();
parser.setLanguage(HTML);
let code = dedent(`
<!doctype html>
<html>
#include <stdio.h>
int main() {
int arr[] = { 3, 4, 2, 1, 5, 6 };
int winter_high[6] = { NULL };
int overall_high[6] = { NULL };
int j,k;
<!doctype html>
<html>
<head>
<style>
.yellow.svelte-77u8jk{background:yellow}
</style>
</head>
<body>