advent of code

yo! advent of code this year is starting in about 2.5 hours

from their about page:

Advent of Code is an Advent calendar of small programming puzzles for a variety of skill sets and skill levels that can be solved in any programming language you like. […] You don’t need a computer science background to participate - just a little programming knowledge and some problem solving skills will get you pretty far. Nor do you need a fancy computer; every problem has a solution that completes in at most 15 seconds on ten-year-old hardware.

i don’t have much to add, it’s a pretty cool programming event. i kinda wish a gamedev equivalent existed, with small prototypes to complete on a theme every day

if you want to get more into programming or want to learn a new language it’s pretty great imo

i’m personally gonna do it in C++20, i’m very experienced with C and C++ tends to irritate me, i want to get comfortable with this language because i believe it’ll help me write games and tools even faster.
if Zig was done i would have gone Zig but yeah it’s not even close to 1.0, maybe in four years

anybody else doing it this year?

I was decently sick at the start of the month, and a little preoccupied with other projects right now anyways - but every time i see advent of code i do get the urge to like, prove myself ahaha. then i think for a second about how i’ve never checked out anyone else’s answers (and who ever would mine) so i end up passing. it’s definitely one of those more intrinsically motivated challenges, and i shy away from doing much that can’t be dropped into a project. i think maybe it would be better to do it with a specific group, like setup a chat channel and talk around everyone’s different approaches each day

aoc is 100% motivation based! i dropped after day 12 this year 'cause all my contacts did, so i didn’t had much of a reason to keep going

i did all days in C++20 and Rust (all parts done twice). i’m happy to know a bit more Rust after this, i still ain’t in love with the language but i feel comfortable enough to use it whenever necessary now

partly thanks to this experience, i went into designing a programming language and writing a compiler for it right after day 12 (it’s here for the curious). peak adhd moment lol. i’m just done with the parsing phase today and putting work into type coercion for the next couple of days, so i’ve pretty positive feelings with aoc for igniting the flame

i mean gosh, the number of things you’ve been doing this month is kinda astounding ahaha. even 12 (24) is impressive as is.

would be nice to hear your thoughts on rust so far… and of course if you’re interested in trying it for games let me know hehe

uh wow!? is this something you’ve done before? i’ve done a couple of language-ish parsing things before (namely yarnspinner), and i’ve had my eye on reading crafting interpreters before but never made the jump. cool to see union types, those have been really great in rust - know much about how easy they are to implement? also… any chance of dropping semicolons??? ;)
edit: just realized the o7 thing and thats a cute extension lol

sorry if my structure’s a bit messy, it’s 4am here and i’m stupid lmao

tl;dr: overall, i like rust, but i find its abstractions overwhelming at times, and i understand the hype

as a game programmer (and to some extent, system programmer) with a moderate amount of experience, i feel like rust is getting in my way most of the time, most importantly when i wanted to create custom data structures or optimize memory layout. i know it’s still possible to write linked lists and shit in a somewhat complicated way, but i’m not at that level yet and i don’t know when (and if) i’ll get to it. i know it’s by design, but it still frustrate me

the error handling system is alright, but far from my favorite. i like Zig’s approach way more, and even C’s (it’s dangerous yeah but ignoring shit can be a design choice sometimes). it is leagues better than any kind of exception system

the overly encapsulated types exposed by the std feel overwhelming too imo, i felt like i was writing pythonesque code 90% of the time and it worked without me fully understanding what’s happening under the hood. in short: too much forced abstraction. the reason why i like C/C++ is than i can build any form of abstraction on top of these language ; yeah they are huge footguns but i got the experience to handle them now and it’s hard to give up on these powers

oh, build times and resource usage are insanely high. compiling rust programs on my old computers always take ages, and on my most recent ones it’s still crazy long (comparatively to C and well written C++). not having stable specs or good alternative implementations is a bit scary but i know it’s getting better

some positive notes i couldn’t fit in: the syntax is a delight (very modern), the borrow checker is amazing and i like unwrap()ing all my errors and not giving a damn

i might need more time with the language, after all i have, what, 50/100 hours with the language (over three years time, including reading the book twice)

i’m very open to working more with it to discover more intricacies, it’s an interesting language. i’ll gladly try your engine any time

yeah, but nothing as complicated! this is the real deal

i love programming languages and compilers. i wrote multiple forth’s (very fun exercise, i love forth), and at least (if i remember correctly) one lisp. i also designed at least a couple virtual computers with custom instruction sets and assemblers. and this june, i wrote golem, a semi-joke C-like language with some legit cool features that is my first “real” compiler, with AST and shit. among many other small programs, i wrote a bad terminal chess game in it

i also absorb a lot of information about programming languages, i often find myself reading nerd_emoji blog posts or watching talks about low level programming and language syntax

if you want to get started, i recommend looking into making a FORTH, then a LISP, then a C-like, it’s a great progression curve: forth pretty much only has a lexing phase and code generation ; lisp requires light parsing and AST generation on top of that ; C-likes are getting more complicated but using the same principles

none of these books helped me more than actually doing it and reading other people code! there’s a lot of small languages around the web

if you can do structs, you can probably do unions. due to the fact o7 is planned to compile to C, unions are not gonna be a big issue, but even if that wasn’t the case they aren’t too complicated if you plan your type system well. type system is the hardest part of the project so far, that’s why golem doesn’t have types

i plan on making the unambiguous optional (such as the ones right before }s), but otherwise it doesn’t really fit the design of the language sadly. it would have been a good idea if i didn’t go for the “everything is an expression approach”

ty eheh

i agree with most of your points, yeah! though i will say from experience a lot of the irks with ‘getting in the way’ iron themselves out more overtime - after running into the roadblocks for a month things clicked a bit and i tend to design around avoiding them now. one thing i’ll say about object relationships, esp. for a game context is to learn to love generational arenas pulz_arena - Rust || . arenas are really good even outside of rust, super cool structure imo. the initial test versions of vibbit i put together were rough but by the time i decided to commit to it and rewrite, the process has had almost no borrow checker frustration. and thisversion is unwrap() ing with enough abandon to put xmas to shame and its great lol.

the build times, the into_iter_mut_refcell() type conversions, etc are a pretty tough pill to swallow i think for the gamedev world. but the tooling, cargo, rust-analyzer, and really simple cross-platform building setups is really what’s kept me around with it, before any of the language features honestly.

yeah the type system does seem like the biggest hurdle to wrap my head around. but important because i don’t really think i’d get much use out of making a dynamic language (at least compared to whats out there already)