Live data from Hacker News

The Rune Programming Language

github.com

121–130 of 203 posts

Re: The Rune Programming Language

#121
post #12

Can someone explain the timing security vulnerability mentioned in the article, I'm not sure I understand.

This is sort of classic problem. First, you need to assume the attacker is capable of measuring checkMac's runtime reliably. Second, you also need to assume the attacker is able to control the message and the mac, but not the secret. How the attacker got there is not really relevant, the point is figuring out whether or not the system is possible to crack by having the attacker full knowledge of everything, but the secret.

In most languages, a similar implementation of checkMac would not pass the test, because they will usually implement some sort of short-circuiting. Which essentially means that checkMac will take longer to execute the closer you get to the true mac of that message.

Let's say computeMac(secret, "a") == "a21a". The attacker could pass in message="a" mac="0000" at first. Let's say that takes 1 unit of time, because "0000" == "a21a" only has to look at the first character. So the attacker knows that 0 is wrong. They then try "1000", then "2000", up until they get to "a000". Then, the algorithm takes 2 units of time, the first one is comparing '0' == 'a' and the second one is '0' == '2'. Now the attacker knows the first character of the mac. They keep going like this until they find out the entire mac of the message. In a nutshell, the time the function takes to execute leaks informartion that an attacker could use.

In this language, when you do use the secret(string) type, it will always compare all the characters of the string, even after it knows it will be false anwyay, just to make sure no information is leaked.

Re: The Rune Programming Language

#122
post #90

Earlier quoted context omitted.

Let's be real for a minute. A couple of hobbyists have named their pet project "rune". Should the name be then forsaken for all eternity?

Let's be real for a minute. What you're actually saying is these hobbyists don't really matter and they don't even deserve to name their projects. Only Real Projects created by Real Programmers at Real Big Tech corporations get the cool names. This is the kind of disrespect that pushed people to create trademark laws.

The actual issue here is you acting like a name collision is a huge problem. It isn't, it's an everyday occurrence on Github alone. We just add a bit more info, like the account name in the case of Github or the year of release for movies/series/games etc.

Re: The Rune Programming Language

#123
post #9

There already exists Rune programming language and that one was earlier: https://rune-rs.github.io/ They should be more careful picking the name.

Whoever gets the stronger adopters gets the name.

A programming language is such a common personal project, it’s inevitable to not see this happen. It also doesn’t help that 95% of these languages aren’t known.

Re: The Rune Programming Language

#124
post #91

Earlier quoted context omitted.

Define the computeHmac method to return a secret(string) type? Then define the equals operator for "secret" to behave in the needed way.

But now you've forced computeHmac to only work only secrets, when there is no such need. You've coupled an implementation of an abstract algorithm with the particular case that _you_ want to use it this one time with sensitive secrets. The advantages of monads include exactly the opposite decoupling: the hmac algorithm implementation is true to its bare specification, and it is the context that changes some of its be…

You could overload computeHmac's return value so that it would return either a string or a secret, then you could use it directly with checkHmac, if you wanted, or as a string in other applications.

Re: The Rune Programming Language

#125

Implicit nullability of all values, a very dubious design decision in a new language.

Given that they mention SQL more than other things, and stress SoA and memory intensive applications, I think this makes more sense than it would otherwise

Go on...

Re: The Rune Programming Language

#126
post #9

There already exists Rune programming language and that one was earlier: https://rune-rs.github.io/ They should be more careful picking the name.

Who is the rightful owner of a name or similarly, a piece of land, or an idea, patent? The first settler? The first settler that held it for at least a year, 10 or 100? The most powerful entity claiming it? In the modern western mind there is the notion that whoever grabs it first rightfully owns it. Which is a simple rule, but encourages squatting and holding but not using. The squatter can then hold ransom against…

When you say “Modern western mind”, who exactly are you referring to ?

Re: The Rune Programming Language

#127
~I love when I see programming languages who's first advertised features are implementable in 8 lines of rust~

Edit: ^ the above had the wrong tone. Thanks to dang for pointing it out. What I meant to express was that it's possible to accomplish a similar safety/ergonomics at the library level in rust in not too many SLOC. My personal preference is towards Rust's approach because the type system gives really powerful composable primitives which makes it possible to have the compiler check a wide range of invariants, instead of just the ones that are common/special enough to go into the language itself

(Example edited after comments from mumblemumble)

    // The struct is public, but the contents are private, meaning you can't directly access the secret once it's inside the struct
    pub struct Secret(T);

    impl Secret {
        // The only public way to access the secret, returns a new secret
        pub fn map(&self, func: impl FnOnce(&T) -> U) -> Secret {
            Secret(func(&self.0))
        }
    }
    
    impl> PartialEq for Secret {
        // == does the correct thing (and only works for types that would make sense (`AsRef`)
        fn eq(&self, other: &&[u8]) -> bool {
            constant_time_eq(self.0.as_ref(), other)
        }
    }

    /* Some other file */

    use secret::Secret;
    
    // Translated from the example
    fn check_mac>(mac_secret: Secret, message: &[u8], mac: &[u8]) -> bool {
        // This returns a new Secret
        let computed_mac = mac_secret.map(|secret| hmac_sha_256(secret.as_ref(), message));

        // This uses the `constant_time_eq` impl from above
        computed_mac == mac
    }

Edit: It looks like you can implment SOA as a macro too https://github.com/lumol-org/soa-derive

Edit: mumblemumble helpfully points out I demonstrated this poorly, so I tried to better demostrate what I was going for in this comment https://news.ycombinator.com/item?id=33764037

Re: The Rune Programming Language

#128

Earlier quoted context omitted.

Let's be real for a minute. What you're actually saying is these hobbyists don't really matter and they don't even deserve to name their projects. Only Real Projects created by Real Programmers at Real Big Tech corporations get the cool names. This is the kind of disrespect that pushed people to create trademark laws.

The actual issue here is you acting like a name collision is a huge problem. It isn't, it's an everyday occurrence on Github alone. We just add a bit more info, like the account name in the case of Github or the year of release for movies/series/games etc.

If a name really isn’t such a big deal, then it shouldn’t be a big deal to change it to something else that wasn’t already taken. If there’s resistance to that idea, then maybe names are a big deal after all.

For a language dev, the name of the language is all you really own about it. These days, developers expect their languages and tools to be free, and of course open source and permissively licensed. The name and logo of the language is really the only IP most PL devs actually fully control, and costs actual money and time to maintain (registering and defending trademarks, domains, etc.)

To just step on names like Google has repeatedly done shows a crass disregard for what independent language devs go through.

Re: The Rune Programming Language

#129

~I love when I see programming languages who's first advertised features are implementable in 8 lines of rust~ Edit: ^ the above had the wrong tone. Thanks to dang for pointing it out. What I meant to express was that it's possible to accomplish a similar safety/ergonomics at the library level in rust in not too many SLOC. My personal preference is towards Rust's approach because the type system gives really powerful…

[deleted]

Re: The Rune Programming Language

#130
Instead of this:

  do {
    c = getNextChar()
  } while c != ‘\0’ {
    processChar(c)
  }
I'd prefer:

  loop {
    c = getNextChar()
    break if c == ‘\0’
    processChar(c)
  }
The eyesight rationale for curly braces (screen readers) is something I had never considered. But it would be nice if they were optional. I've been writing Python for 14 years and have never had a problem with mis-indenting.

Edit: I had to correct my post because Tabs were used in the original, so alignment was all wrong.

Post reply on HN