Skip to content

Instantly share code, notes, and snippets.

View intentionally unscalable.md

Intentionally Unscalable

Deniz Akşimşek, 2021-11-22

_hyperscript is intentionally unscalable. We make decisions that would be obviously inadvisable to anyone looking to make scalable software, and dismiss features like reactivity that seem to have proven themselves in this regard. To understand why, I examine and critique the concept of "scalable".

@dz4k
dz4k / discord_bot._hs
Last active Aug 24, 2021
Discord bot in _hyperscript
View discord_bot._hs
require discord.js as Discord
init immediately
make a Discord.Client from {
intents: [Discord.Intents.FLAGS.GUILDS, Discord.Intents.FLAGS.GUILD_MESSAGES]
}
set module discord to it
login(process.env.TOKEN) to discord
end
@dz4k
dz4k / shadow-dom._hs
Created Jun 13, 2021
Hyperscript DOM Isolation
View shadow-dom._hs
behavior DomIsolation
init
attachShadow({ mode: "open" }) on me
put my children into it
end
end
@dz4k
dz4k / Draggable._hs
Last active Apr 9, 2022
Draggable window in _hyperscript
View Draggable._hs
-- Usage: _="install Draggable(dragHandle: .titlebar in me)"
behavior Draggable(dragHandle)
init
if no dragHandle set the dragHandle to me
end
on pointerdown(clientX, clientY) from dragHandle
halt the event
trigger draggable:start -- hooks, e.g. for adding a drop shadow while dragging
measure my x, y
@dz4k
dz4k / taml.ebnf
Last active Sep 30, 2020
TAML EBNF
View taml.ebnf
(*
# Tokens
* newline: one or more CR or CRLF
* tab: one or more tab characters not following a newline
* string: one or more characters none of which are tabs or newlines
The following tokens relate to indentation tracking: