[-] cx40@programming.dev 1 points 7 months ago* (last edited 7 months ago)

I'm not saying that there's a problem with doing things one way or another. Rather, I'm asking whether there's a problem with doing things differently that then led to this design decision to be made with Rust. I want to better understand how this language came to be.

[-] cx40@programming.dev 1 points 7 months ago

The term “meta-programming” had me lost since I’m only familiar with that in reference to C++ templates (and Rust’s generics are more like templates).

Yes, like C++ template and macros. The kind of code that generates new code before being run.

So to answer your question as to why there are macros, it’s because you need to generate code based on the input. A function call can’t do that.

You can design a language where you don't need to generate code to accomplish this. My question isn't why this is necessary in Rust. My question is why Rust was designed such that this was necessary.

Someone mentioned elsewhere that this allows for compile-time type safety. I'm still trying to wrap my head around how that works.

[-] cx40@programming.dev 3 points 7 months ago

I can see that. I'm coming in from the other extreme that is Python, where even the meta-programming is done in plain Python.

[-] cx40@programming.dev 1 points 7 months ago* (last edited 7 months ago)

C++ was my first programming language. I remember the nightmare of dealing with dependencies and avoiding boost because it felt wrong to need a third part library for basic features. The toolchain for Rust is very nice (not just compared to C++, but all other languages I've worked with) and has so far been a huge joy to work with. The language itself too. I'm just curious about why the language likes to expose more of its features through meta-programming rather than directly in the language itself. Things like println! and format! being macros instead of functions, or needing a bunch of #[derive(Debug,Default,Eq,PartialEq)] everywhere for things that other language provide through regular code.

[-] cx40@programming.dev 1 points 1 year ago

Thanks, that's a good start.

The bigger question for me is whether there's more to it than privacy and blurring out faces.

[-] cx40@programming.dev 2 points 1 year ago

That's also to make programming easier. Different programmers have different needs.

[-] cx40@programming.dev 1 points 1 year ago

But the main benefits of static typing is in making the programming part easier. What do you gain from translating dynamically typed languages into a statically typed language?

[-] cx40@programming.dev 1 points 1 year ago

Tabs get in the way and force you to actually address them instead of ignoring them. In theory.

[-] cx40@programming.dev 1 points 1 year ago

Do you know if there's a similar extension that allows you to export/import the tabs in some text format rather than saving to bookmarks? I'm currently using Tab Season Manager, but it takes way too many steps to accomplish this.

[-] cx40@programming.dev 1 points 1 year ago

They did give us OpenAI gym (now Gymnasium) and PPO. It's sad that they completely pivoted away from this line of work though.

[-] cx40@programming.dev 1 points 1 year ago

We've seen similar effects in the context of reinforcement learning (see the "primacy bias" works of Evgenii Nikishin). It makes sense that it would also apply to LLMs, and any other ML model.

[-] cx40@programming.dev 1 points 1 year ago

Early 30s now. I've been on this path since I was 18, so I guess I'd be happy to hear that I stuck with it. I'd probably also be disappointed to hear that I'm actually kind of bad at it.

view more: ‹ prev next ›

cx40

0 post score
0 comment score
joined 2 years ago