Hello World!
Hello and Welcome to My Blog!
I felt like I should probably have a place to post all my various ramblings, musing, and other thoughts. Now here we are! didn’t want to deal with limitations in various cms suites and just have arbitrary html js as I please, so just using a site generator tool. Also have enough sense to know that I don’t want to manage a mess of html files, hence doing most of the stuff in makdown with a couple places for embedding interesting widgets. Personally prefer latex for markup, maybe one day I can get that setup, but today is not that day.
In order to get my masochism out of me, am writing this on an android tablet from Indiana while ssh’d into a linux box in California. turns out vs code forwards just fine over an ssh tunnel. In retrospect I could probably set up git locally on my tablet now that most of the infa is set up, but I aleady got this and probably should actually spend time posting stuff instead of tweaking infa (or well prodding gemini to do it).
JavaScript Demo
What tech blog isn’t complete without some code demos‽ Have two modes I want to do:
- I want the static site to be static so it loads quick.
- I want to be able to poke and prod with the code interactively on the site
I’ve modified the generator to have a pre processing pass that takes the code blocks, evaluates the code locally, and inserts the output into a separate section. It is somewhat overkill, but does serve as a sort of integration test that my code actually evaluates to what is posted.
For JS, statically I use Node and then dynamically I basically just need to use eval()
console.log("Hello from Victor's Quest!");
const x = 10;
const y = 5;
console.log("Result:", x + y);Hello from Victor's Quest! Result: 15
Python Demo
For Python, am using a library called quarto to take care of the static evaluation and then it also provides a python runtime in wasm.
print("Hello from Python!")
squares = [x**2 for x in range(1, 6)]
print(f"Squares: {squares}")Hello from Python! Squares: [1, 4, 9, 16, 25]
Prolog Demo
Wanted to try and see if i can hook i. a less frequently used language. I found the Tau Prolog runtime in wasm. For the static teneration, I actually just call Tau from Node so I can set consistent result with the web view.
% Facts
fruit(apple).
fruit(banana).
fruit(cherry).?- fruit(X).
X = apple X = banana X = cherry
Go Demo
Wanted to try a compiled language so here we have Go. Stattic contentt is generated by running things locally. For dynamic interaction, am actually using the go playground api.
package main
import (
"fmt"
"time"
)
func main() {
fmt.Println("Hello from Go!")
fmt.Printf("Current time: %s\n", time.Now().Format(time.Kitchen))
}Hello from Go! Current time: 5:02AM