Inspired by this Lobsters thread, and some of the great comments within it, I would like to ask if anybody is doing some hobby programming this weekend?

  • shape_warrior_t@programming.dev
    link
    fedilink
    English
    arrow-up
    3
    ·
    edit-2
    1 day ago

    Just finished “version 0” for a very simple programming language yesterday, and I’m looking to work on “version 1” this weekend. Rust is truly fun to program in… although writing all the tests was not a very fun experience. But doing the work for that meant I was guaranteed to have a reasonably good grasp of the semantics by the time I finished.

    Since it’s Rust, there’s no garbage collector – heck, for this particular language, there’s not even any memory allocation after startup. Instead you get a giant global array of “memory” to work with. The only data type is the 32-bit integer (and thus, using UTF-32 for strings is actually the """correct""" choice for this language). I’m using a vaguely Lisp-like syntax that revolves around {[a tree] formed from (brackets and whitespace)}… which was probably slightly easier to parse than more traditional syntax, but Rust’s current lack of pattern matching “through” Vec (for example, letting you extract e from {a b [c (d e)] f} in one step) didn’t always make it feel that way.

    Nest up: adding while loops, exponentiation and bitwise operators, and most interestingly, string and character literals. (The char literals would just evaluate to their character codes, and string literals would only be usable in a specific write-to-memory construct.) And also expanding the standard library. I’d say “version 1” would really be the more properly “complete” version of the language. I also want to do a functional programming variation (ditching the global memory in favour of reference counted cons cells), and also the whole language is kind of just a stripped down version of another much bigger language half-formed in my head, but that’s all probably for… not this weekend, at any rate.