Live data from Hacker News

The Rune Programming Language

github.com

191–200 of 203 posts

Re: The Rune Programming Language

#191
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.

PHP is Flex/Bison.

The main point of the discussed project is to alter data structure to be more CPU cache friendly and thus try to be faster than C++. The paradigm.

Re: The Rune Programming Language

#192

Earlier quoted context omitted.

That doesn't justify them choosing an already chosen name now, does it?

Rune (the existing language) is a fairly small hobby project that only got started in 2020. The developer of this new Rune probably just didn't know about it. There is nothing nefarious here. There is no cabal. These things happen all the time . I've had it happen to two of my own small/obscure projects. It happens.

Goggle's Rune is even a smaller hobby project.

Re: The Rune Programming Language

#193

Earlier quoted context omitted.

You can't provide an API that gives the security features they want in c. The core feature here is a generic secret type. In c that's a void*, defeating the purpose of the typed, safe, API.

Yes you can? // lib.h struct SecureString { uint8_t *content; size_t len; } bool secure_str_eq(l *SecureString, r *SecureString) { // some constant-time algorithm } SecureString *new_secur_string() { struct SecureString *s = malloc(sizeof(struct SecureString)); // initialize s return s; } And then in go, for instance, you would do something like this: // #include "lib.h" import "C" type SecureString struct { ptr *C.s…

Ok, now how do you provide a SecureUserCreatedStructuredData type?

Re: The Rune Programming Language

#195
post #125

Earlier quoted context omitted.

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...

The subject has been discussed to death here on HN and in other places. If you're unfamiliar, this talk by Hoare (the inventor of implicit nullability) is as good a place to start as any:

https://www.infoq.com/presentations/Null-References-The-Bill...

Re: The Rune Programming Language

#197

> 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?

For anyone interested, Rune's SOA is done entirely by DataDraw. The API for creating relations is passed almost verbatim to datadraw, which will generate a bunch of C code for interacting with the DD library. So Rune didn't really write any of this, it just bundled DD with a language runtime, and used a more permissive license despite DataDraw being LGPL... ! It was taking too long to set up Rune on an Ubuntu VM, so I just replicated Rune's version of the Benchmarks Game binary-tree benchmark using DataDraw directly.

DataDraw runs the depth=21 case (single threaded, -O3) in about 4.6 seconds on my M1. It has the built-in advantage of reusing the table allocations as the database is global and implicit, the indexes being u32 sized. The existing C++g++#7/MemoryPool and Rust#5/bumpalo versions (both array-of-structs) are discarding their allocations on every iteration. Running Rust#5/bumpalo with RAYON_NUM_THREADS=1 runs in about 2.7 seconds. So in addition to the implementation being someone else's and possibly misused LGPL, the claims re the binary tree benchmark are not really made out.

Nevertheless you can very closely approximate in Rust what DataDraw does, without macros or anything else, by creating a single global struct of `slab::Slab`s, inserting a dummy first element, converting the usize keys to NonZeroU32 and using this as your SOA. If you do that, then you get roughly the same perf except that DataDraw isn't doing bounds checks. So the Rust version can do it in about 5.5 seconds vs 4.6. Obviously this can't be parallelised as you're passing a single &mut SOA around or using a thread-local.

I also compared the perf for a `slotmap::SlotMap`. It was about 7 seconds, but it solves the ABA problem with the generational indices, so that may be worth it.

Finally I compared the perf for a global Slab, i.e. global AOS style, to avoid clouding the AOS results with bumpalo's insane performance. It ran quicker than the global SOA style, in 4.6 seconds, because the overhead of managing two arrays, their separate allocations and their bounds checks was too much for the memory access pattern to do anything, if there indeed was any advantage to it.

Re: The Rune Programming Language

#198
post #193

Earlier quoted context omitted.

Yes you can? // lib.h struct SecureString { uint8_t *content; size_t len; } bool secure_str_eq(l *SecureString, r *SecureString) { // some constant-time algorithm } SecureString *new_secur_string() { struct SecureString *s = malloc(sizeof(struct SecureString)); // initialize s return s; } And then in go, for instance, you would do something like this: // #include "lib.h" import "C" type SecureString struct { ptr *C.s…

Ok, now how do you provide a SecureUserCreatedStructuredData type?

Serialize SecureUserCreatedStructuredData into an array of SecureString (or SecureInt, etc).

Re: The Rune Programming Language

#199
post #54

Earlier quoted context omitted.

I think the point behind "constant time" here is that the comparison always takes the same amount of time, and not based on how many characters in the two strings are equal, to prevent a timing attack. "Constant time" isn't very accurate here because given a choice of hashing algorithm, the hash is a fixed-length string and therefore even a trivial string comparison technically "runs in constant time", at least if we…

Yes, but my point is that there are only a few use cases for this, mostly in cryptography, and to ensure something is genuinely constant time you have to write in assembly. The routines needed are small enough and compilers hard enough to trust that you just bypass them in practice, so it's an odd choice for something to build into a language syntax.

My assumption is that it's not just the syntax, but that their compiler does the right thing. Though someone said it's based on LLVM, so who knows how much control they get.

Re: The Rune Programming Language

#200
post #132

Earlier quoted context omitted.

Unfortunately Rob Pike, Ken Thompson, and Robert Griesemer are not competent engineers by this standard. I’m sure they’ll be sad to hear it.

The competence is assumed. The disappointment comes from people who are competent not doing the due diligence that some think should be par for the course when naming a project.

You seem to be a lot more saddened than I am that a nice two letter name wasn't successfully squatted for all eternity by a no longer maintained ultra obscure niche language that no one has ever heard of let alone used.

Now perl stealing prolog's file extension on the other hand...

Post reply on HN