I run a few groups, like @fediversenews@venera.social, mostly on Friendica. It’s okay, but Friendica resembles Facebook Groups more than Reddit. I also like the moderation options that Lemmy has.

Currently, I’m testing jerboa, which is an Android client for Lemmy. It’s in alpha, has a few hiccups, but it’s coming along nicely.

Personally, I hope the #RedditMigration spurs adoption of more Fediverse server software. And I hope Mastodon users continue to interact with Lemmy and Kbin.

All that said, as a mod of a Reddit community (r/Sizz) I somewhat regret giving Reddit all that content. They have nerve charging so much for API access!

Hopefully, we can build a better version of social media that focuses on protocols, not platforms.

You are viewing a single thread.
View all comments View context
0 points

Is there anything with no garbage collection that doesn’t work with pointers? If the compiler is handling all the memory allocation for you it might as well just collect garbage, so I figured they were kind of synonymous.

Since we’re now going into details, Rust is neat because they figured out a way to keep track of the memory safety of pointers at compile time. That’s hard to do, which is why it’s a new language and not the old standard.

permalink
report
parent
reply
1 point

I would argue that on the one hand you could say that the references to objects in garbage collected languages are also pointers.

On the other hand, you could argue that such references are not pointers, but then you might as well argue that references in rust are not pointers.

I just feel like “a language with pointers” is a weird way to describe a language and it isn’t really something that causes the language to become fast. Pointers are low level constructs that are used all the time, and whether or not they are abstracted away in the high level language doesn’t automatically make it slow or fast.

permalink
report
parent
reply
1 point
*

Hmm. Alright, what word would you use to differentiate C or Rust pointers/references from, say, Python? I haven’t actually made anything with Rust, but it sounds like you can store a reference in another structure like you can in C, but you can’t AFAIK in Python.

permalink
report
parent
reply
1 point

You can store references in another structure, but you probably don’t want to do this most of the time, since it’s a major headache to get ownership and lifetimes right. You shouldn’t think of references as pointers, but you should think of them as “borrows”: you are temporarily borrowing something from the owner, but you can only do so if the owner exists. So you need to statically guarantee that for as long as you borrow it, the owner must be alive, which gets tricky when you store that borrow somewhere in some data structure. In practice, references or borrows will be short-lived, and most operations on data will be done by the owner of that data.

Underneath, references are represented by pointers, but you shouldn’t think of them as pointers, but rather as something you have borrowed, so in that sense it’s different from C.

Also, Python does use references everywhere, it’s just implicit, and depends on the type. Try storing a list in a class: you’ve just stored a reference to another structure. Most things (e.g. lists, objects) are passed and stored by reference, some types like integers are copied. In Rust, you can choose whether you want to pass by reference, copy or move ownership. At this point we’re still at a high level of abstraction, we don’t think so much about whether this will be pointers at the low level.

But my main point is that whether you use pointers, references, or whether it’s implicit or explicit doesn’t make a language slow or fast, it just defines how programs are written. Rust is very fast because it’s compiled to machine code and doesn’t do garbage collection or have any other overhead from a “runtime”. Python is relatively slow because it’s interpreted. You could argue that more manual control over references/pointers can make a language faster, but it’s not the main contributing factor.

permalink
report
parent
reply

Technology

!technology@beehaw.org

Create post

A nice place to discuss rumors, happenings, innovations, and challenges in the technology sphere. We also welcome discussions on the intersections of technology and society. If it’s technological news or discussion of technology, it probably belongs here.

Remember the overriding ethos on Beehaw: Be(e) Nice. Each user you encounter here is a person, and should be treated with kindness (even if they’re wrong, or use a Linux distro you don’t like). Personal attacks will not be tolerated.

Subcommunities on Beehaw:


This community’s icon was made by Aaron Schneider, under the CC-BY-NC-SA 4.0 license.

Community stats

  • 2.8K

    Monthly active users

  • 3.4K

    Posts

  • 78K

    Comments