• 0 Posts
  • 1.29K Comments
Joined 3 年前
cake
Cake day: 2023年6月21日

help-circle

  • What do you find hard about it?

    For me, what made it take so long to learn and really understand was that it’s different from most modern programming languages. It’s not C, C++, or based on my own experiences, C#, JS, Java, etc. Approaching the language as someone who’s really into C# made it difficult to throw away that experience to learn something completely new, whether because I now had to wrap my head around lifetimes or because I can’t have one type inherit the fields and methods of another.

    Eventually, if you keep sticking to it (and have interest to do so), you’ll learn how the language was designed to be used, and why it was designed that way.

    Reading source code is your friend, by the way. If you want to learn the language, you should spend at least as much time reading code others have written as you also spend writing code. This can be as simple as “go to definition” on some imported function from a library you’re using. Try to understand how that code works, and eventually you’ll even begin to form opinions on what works well vs. what doesn’t. Heck, you might find yourself opening PRs against something like Tauri in no time.


  • From the author’s own website, they left AWS to join their current company as VP of Software (whatever that title means but seems obvious that it’s software related). My immediate assumption would not be that this person is clueless about software development. Maybe they are, but assuming that from the start is just engaging in bad faith.

    Refusing to engage with someone is not gatekeeping.

    You show up to a party and talk to a group talking about using LLMs to make software to try to make friends. They look at you. You are a developer, but you don’t specifically work in financial services so they just ignore you. In fact, they say out loud at the party “hey you don’t know jack shit about anything because you don’t work in financial services”. The whole discussion they’re having has nothing to do with financial services.

    You don’t consider that gatekeeping?


  • Also, I think their point was not that AGI will never happen, it’s more that it doesn’t matter whether it happens or not, because AI/AGI will not solve our problems

    This exactly. AGI can never solve people problems because those problems are inherent to people. Social problems, for example, don’t magically disappear because you have a magic box that does everything.

    I think we are further from AGI than people think. I doubt I will live to see it.

    I would go far enough as to say that most people alive, if not all, definitely won’t see AGI in their lifetime. That’s of course besides the point, but still…









  • There is one other thing not mentioned that LLMs are bad at: being accountable. When your customers come complaining at 2:30 in the morning that the payments are failing, your manager isn’t going to the LLM to ask what the fuck broke and why the fuck he’s awake after 3 hours of sleep. He’s going to you to do that. And when you’re able to tell him that your downstream service is having an outage because AWS shit the bed again, he’s going to trust your word. Will he choose to replace you with a LLM? Maybe, but he’ll never be able to put out those fires without you.


  • maybe some experienced people can correct me

    Well first thing, I’d recommend saving the gist with a .rs extension so we get syntax highlighting :)

    You should convert your loop to iterate over input.chars() instead. Your current loop will have issues if someone writes, for example, “naïveté” due to some of those letters being multiple bytes long in UTF-8 (which is the encoding str and String use). What you can do is:

    let mut input = input.chars().peekable();
    while let Some(ch) = input.next() {
        // ...
    }
    

    This also lets you input.peek() in the body to look at the next character without taking it from the iterator. input.peek().is_some() tells you if there’s more data (and is_none tells if you’re at the end of the input).

    Even in C, I’d have made the big if-chain use if-else to avoid evaluating conditions that are known to be false. However, here I’d convert it to a big match statement:

    match ch {
        ' ' => {}
        ';' => {
            // ...
        }
        _ if ch.is_numeric() => {
            // ...
        }
        // ...
    }
    

    As an optional (and more advanced) thing, you can return slices into the input instead of copies of those slices:

    fn tokenize(input: &str) -> Vec<(TokenType, &str)>
    

    If you want to do this, you should do .char_indices() instead of .chars() so you know where to slice the input string at.

    Otherwise, you can use std::mem::take(&mut current_token) to replace current_token with an empty string and take (without cloning) the existing value out of that variable:

    use std::mem::take;
    
    tokens.push((blah, take(&mut current_token)));
    


  • Am I missing something here? It’s an open source Postgres extension with a permissive license. Azure has had hosted Postgres databases for years, as have all the other major cloud providers. I’d be concerned if they were ecosystem locking the extension, but that doesn’t appear to be the case.

    The motivation for this extension, hilariously, is likely to run AI. With how long requests can take due to inference, durable execution is useful to avoid losing data mid-request and needing to restart the whole thing. This seems useful outside of that though, for other kinds of long-running requests.



  • From the policy in the PR:

    The policy’s guidelines are roughly as follows:

    It’s fine to use LLMs to answer questions, analyze, distill, refine, check, suggest, review. But not to create.

    LLMs work best when used as a tool to write better, not faster.

    We carve out a space for “experimentation” to inform future revisions to this policy.

    So… No, it isn’t.

    Note that there are times when using a LLM to create code is allowed. Reading the doc explains the nuance.


  • While not legal advice:

    In general, you can copy and create your own works for personal use as long as you keep them to yourself. Copyright is usually enforced on distribution, so if you don’t distribute, nobody cares.

    Free licenses (MIT, GPL variants, Apache, BSD, and so on) allow you to copy and create your own works and distribute the work freely. Free licenses allow you to distribute your work if you share the source code, and some (MIT, Apache, etc) allow you to distribute the work even without sharing your source code as long as you provide the source code for whatever was licensed (like a library you’re using that’s MIT licensed).

    The licenses all have different restrictions, so it’s good to research a license before you use something licensed that way. For example, AGPL, GPL, and LGPL are all different, and some licenses may require you to rename and rebrand something if you create a fork of it.


  • I’m worried about this creating a bunch of confusion in the future, but hopefully at some point they mark the old ranges as deprecated.

    Ranges directly being iterators confused me so much at first because no other standard iterable types really work that way, then combined with them being !Copy they just felt wrong. The new ranges look so much easier to use and understand.