|
|
|
|
|
by dmux
1648 days ago
|
|
I've been having a wonderful time spinning up small projects using Tcl, Wapp, and Sqlite. Tcl's quoting rules makes it really easy to embed HTML (or anything else, really) inline within a procedure. Simple example: # available at /style.css
proc wapp-page-style.css {} {
wapp-mimetype text/css
wapp-cache-control max-age=3600
wapp-trim {
body {
background: aliceblue;
}
}
}
# available at /hello
proc wapp-page-hello {} {
wapp-trim {
<html>
<head>
<link href="%url(style.css)" rel="stylesheet">
</head>
<body>
<h1>Hello HN!</h1>
</body>
</html>
}
}
|
|
I enjoyed the little bit of exposure that I had to Tcl/Tk through EXPECT, I used to write a lot of embedded test scaffolding using it back in the 00s. I've also been interested in checking out Little Language [0].
Wapp looks like a great place to start with Tcl.
[0]: https://www.little-lang.org/