Hacker News new | ask | show | jobs
by virtualritz 24 days ago
Why do not call a 'record' a 'struct'?

Same with 'List' vs 'Vec'.

And why are List, String & co uppercase?

From what I gather these are built-in types the compiler knows?

'i32', not 'I32' but 'List' not 'list'? In Rust the case is clear cut: built-ins that the compiler 'knows' are lowercase, types expressed in Rust itself are PascalCase.

Roto seems to mix this?

Reads like Rust but then "differs subtley" where it (seemingly?) does not matter at all.

What is the rationale? I'm not complaining, Roto looks great. I'm considering swapping my Koto integration in my project out for this. :)

I'm just genuinely curious. From the outside the above smell like "just because" decisions.

1 comments

This is something we've been backpedaling a bit indeed. 0.11 changed some things to look a lot more like Rust. The reason for this being different in the first place is that were not trying to make Rust-but-simpler necessarily. Or target audience with Rotonda is also not Rust programmers. So we've been exploring different syntax options.

Regarding the List type, as we optimize that, it will probably become a different data structure from a Vec. Also in the Roto-Rust boundary, you cannot pass in a normal Vec. So different names male sense there.

Regarding the case, small primitive types are lowercase. String and List are heap allocated and therefore somewhat different. I'm open to changing that but there is some logic to it.

PascalCase == Heap allocated makes a lot of sense to me.

Even if one may argue that scripting languages usually abstract ideas like stack and heap away. :)