GoSuB Browser Progress, pt2

Last updated at 2023-08-13 17:22:44 (1 year ago)

I've spend some time fighting against Rust. It's not clear who won though. The biggest problem I'm currently facing is the fact that I have to discover how the architecture of the parser/tokenizer should look like, AND how to actually implement this in Rust.

Most of the issues is due to my lack of knowledge of the whole borrowing/moving/lifetime stuff from Rust. Unlike Golang, where you can create a string inside a function, and happily return it, this doesn't fly with Rust. That string is local for that function only, so when returning it, it can cause memory issues. So in a way I have to look at Rust like a more lowlevel C alternative, and less like a highlevel language where all memory management is abstracted away for me.

I also have added some initial unit-tests to test some of the functionality which seems to work nice. I need to get used to the fact that unit-tests are part of the same file, and that you can have multiple implementations of the same struct in different files.

Also: Rust: don't worry about reference counts and memory allocations and stuff.
Me: oh, lets try to create a linkedlist. Rust: ah.. for this you need to implement your own reference count system.. Me: :tableflip:

rust gosub

About jaytaph

Codemuser extraordinaire

avatar Loves building crazy and insane stuff. Happiest when left alone. All I wanted was a Pepsi, just a Pepsi.
Joined:March 24, 2023
Following:2
Followers:2
Posts:50
Comments:3
Upvotes:4
RSS feed