News for hackers. Stuff that matters.
Re:Vapour: A typed superset of the R programming language by russellbeattie on Thursday September 19, 2024 @03:23PM (#41595384)
This isn't specifically about Vapour, just about what's become the common way to specify types.

I know this is totally bike shedding, semantics, vi vs Emacs, BigEndian vs LittleEndian and it's too late now to affect anything, but to me using a colon after the variable is just wrong!

let x : int = 1

func add(x: int, y: int): int { return x + y }

I see that and it looks like int = 1 and the function's return type is totally lost.

This seems completely backwards to me. Maybe I'm just used to the way C did it, but the variable modifiers should come first.

let int x = 1

func int add(int x, int y) { return x + y }

Why we reversed it and added in the colon just doesn't make much sense to me.

Re:Vapour: A typed superset of the R programming language by lrasinen on Friday September 20, 2024 @07:28AM (#41600909)
": type" has a long heritage, going back to (at least) Pascal in 1970.
Re:Vapour: A typed superset of the R programming language by russellbeattie on Friday September 20, 2024 @04:30PM (#41605300)
I didn't know that! Still doesn't make much sense to me.