GoSuB Browser Progress, pt2
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:
About jaytaph
Codemuser extraordinaire
Joined: | March 24, 2023 |
Following: | 2 |
Followers: | 2 |
Posts: | 52 |
Comments: | 3 |
Upvotes: | 4 |
Previous musings
- (2) December 2024
- (1) November 2024
- (1) October 2024
- (1) September 2024
- (1) July 2024
- (2) February 2024
- (3) January 2024
- (3) December 2023
- (4) November 2023
- (5) October 2023
- (10) September 2023
- (8) August 2023
- (1) June 2023
- (1) May 2023
- (4) April 2023
- (5) March 2023