prologic

twtxt.net

Problems are Solved by Method\" 🇦🇺👨‍💻👨‍🦯🏹♔ 🏓⚯ 👨‍👩‍👧‍👧🛥 -- James Mills (operator of twtxt.net / creator of Yarn.social 🧶)

In-reply-to » AoC Day #1 solution (mu): https://gist.mills.io/prologic/d3c22bcbc22949939b715a850fe63131

I actually can’t progress to day two till I get home 🤣 – I haven’t pushed the code for the mu compiler yet 🤦‍♂️ So no-one can check my work even if they were so kind 🤣

⤋ Read More
In-reply-to » Thinking about doing Advent of Code in my own tiny language mu this year.

The most interesting part about mu is that the language is actually self-hosted and written in itself. There is a stage zero compound written and go on a stage one compiler written in mu

⤋ Read More

Thinking about doing Advent of Code in my own tiny language mu this year.

mu is:

  • Dynamically typed
  • Lexically scoped with closures
  • Has a Go-like curly-brace syntax
  • Built around lists, maps, and first-class functions

Key syntax:

  • Functions use fn and braces:
fn add(a, b) {
    return a + b
}
  • Variables use := for declaration and = for assignment:
x := 10
x = x + 1
  • Control flow includes if / else and while:
if x > 5 {
    println("big")
} else {
    println("small")
}
while x < 10 {
    x = x + 1
}
  • Lists and maps:
nums := [1, 2, 3]
nums[1] = 42
ages := {"alice": 30, "bob": 25}
ages["bob"] = ages["bob"] + 1

Supported types:

  • int
  • bool
  • string
  • list
  • map
  • fn
  • nil

mu feels like a tiny little Go-ish, Python-ish language — curious to see how far I can get with it for Advent of Code this year. 🎄

⤋ Read More
In-reply-to » I have to say. A well designed Hypermedia Driven Web Application such as yarnd‘ using HTMX is just as good, i'd not better, than one written in React.

Even on piss poor in-flight Wi-Fi it works pretty well 👌

⤋ Read More