Live data from Hacker News

The Rune Programming Language

github.com

171–180 of 203 posts

Re: The Rune Programming Language

#171
post #116

Earlier quoted context omitted.

Hard disagree on single characters for logic and exponentiation. ASCII has too few special characters and you'd want to use those elsewhere, without creating ambiguity. Elixir got it right.

ASCII has tones of unused chars we could grab for coding.

[deleted]

Re: The Rune Programming Language

#172
post #137

Earlier quoted context omitted.

It all gets more complicated when you want to pass more than one secret parameter, or the function already returns a Secret - now you need a monad. The key feature seems to be that the code does not need 'map' or anything, the secrecy flag is propagated regardless.

> now you need a Monad "need a Monad" sounds scary but in practice it looks like this impl Secret { pub fn map (&self, func: impl FnOnce(&T) -> U) -> Secret { Secret(func(&self.0)) } pub fn flat_map (&self, func: impl FnOnce(&T) -> Secret ) -> Secret { func(&self.0) } } If you need an escape hatch for something more complicated, you could provide an api to that impl Secret { pub unsafe fn reveal(&self) -> &T { &self.…

My point, which I didn’t express well there, was about the call side: How do you call

    func(param1: A, param2: B) -> C
with both parameters being secrets (secret1: Secret, secret2: Secret)? In Rust, it‘s

    flat_map(secret1, |param1|
      map(secret2, |param2|
        func(param1, param2)
      )
    )
or with do_notation at least a bit cleaner

    do! {
      param1 
whereas Rune manages it with

    func(secret1, secret2)

Re: The Rune Programming Language

#173
post #89

Why do they call it " Python-inspired " if it looks like C++? From https://github.com/google/rune/blob/main/benchmarks/mandelbr... for k = 0u32, k (8 * x + k) / width - 1.5; }

Not syntactically. It's slot-based, vaguely like Python, and has reference-counting GC, like Python. That's how I understand it.

So.. objective-c inspired? :P

Re: The Rune Programming Language

#174

> The only close competitor is C++, where the author uses the little-known MemoryPool class from the library. I was like I know C++ and I’ve never heard of MemoryPool. Turns out that MemoryPool doesn’t exist in . In the source code they’re talking about it’s an alias to std::pmr::monotonic_buffer_resource. https://benchmarksgame-team.pages.debian.net/benchmarksgame/...

Why would the struct-of-arrays layout be beneficial in a binary tree where every single node is visited, and the left + right arrays constitute all of the data in the tree? The previous example they gave was touching 75% less memory. In the binary tree it's the same amount of memory. Is the order it's touched better somehow?

Some memory-touching orders are better than others, because CPUs will prefetch nearby memory into CPU cache during memory accesses.

Re: The Rune Programming Language

#175
post #161

Earlier quoted context omitted.

I was just considering a nicer interface for computeHmac at a library level, but if you don't have that, you could still just implement checkHmac using your Secret class and call it with checkHmac(Secret(str), message, mac).

It's turtles all the way down. Without the secrets monad support in the language, at some point I have to be the one enforcing secrets in multiple places: if I implement checkHmac(secret(str),...) that calls computeHmac(str)->str then I must both "unbox" the secret(str) _and_ "box" the return value of computeHmac. I can do this, sure, and if I forget then I'll have a security bug. This is similar to the situation wit…

If you try to call computeHmac from checkHmac surely you'll get some sort of error or warning, wouldn't you? You have no guarantee computeHmac will your secret will be treated as a secret by computeHmac, if its signature is simply "str". Unboxing it is never safe.

Re: The Rune Programming Language

#176

x^2 means x squared, orphaning the XOR operator. Rune is for crypto, so math comes first. Isn't XOR used very heavily in crypto? (As is exponentiation of course)

OTP is simply pt XOR giant-key.

It would've been wiser to duplicate C's bit operators ( ~ ^ & | > ) than give the emperor some "new clothes."

Welcome to another "Not Invented Here" language dying to be special and full of surprises. It's a fail.

Re: The Rune Programming Language

#177
post #101

x^2 means x squared, orphaning the XOR operator. Rune is for crypto, so math comes first. Isn't XOR used very heavily in crypto? (As is exponentiation of course)

It looks like Rune still has a bitwise XOR operator: @ https://github.com/google/rune/blob/main/bootstrap/database/... That innovation does seem like a potential footgun.

Sheer insanity. Sensible languages use ** for exponentiation and ^ for xor.

Re: The Rune Programming Language

#178
post #52

This is because we didn't just kill Abel, we destroyed Abel, and this caused all of Abel's children to be recursively destroyed. TT

The Destruction of Abel, Jeremiah 27:14.

Sigh. There's enough religion in programming languages already. Can we not add or xor actual religion?

Re: The Rune Programming Language

#180
post #7

Written in C. Uses LLVM for execution. Parsers are Lex and Yacc.

So a weekend toy project.

Hand-coded parser-lexers are far more powerful because their diagnostics are useful and are much easier to maintain.

Lex/yacc / flex/bison products by contrast have awful diagnostics and become steaming piles of confusion that have to be rewritten.

Post reply on HN