new language alignment chart: semantic static types, mechanical static types, dynamic types vs. designed for strong types, weak types, accidentally strongly typed

Rust is semantic/designed, C is mechanical/weak, Python is dynamic/designed, and Lua is dynamic/accidental

By semantic and mechanical, I mean, are the types there primarily to let humans communicate to the compiler about the structure of the program and its constraints, or to let the compiler know how much space to allocate on the stack?

@tindall ]stares at the ceiling] i love this but also im too tired to figure out how to place euphoria

i'll figure it out later...

@tindall i would argue semantic for sure, but idk where it lies on strength

it's both strongly typed, when you choose it to be.... and loosely typed, when you don't want it to be strongly typed?

'flexile' i guess,

@tindall (side note i really love how you define the equivalent of typed structs by just handling nested arrays)

@tindall my favorite type system to compare in systems like these is VB.NET, since it kind of has a sliding scale based on project/file settings

with Strict Off/Infer On it's kinda like C or javascript, but when flipped around it more resembles a kind of semantic/designed system (but not 100% since it still needs to interact with the old VB-style base lib as well as .NET as a whole - i forget which setting makes everything Objects if you're not careful)

@tindall what happens if a language basically only has one type? Stuff like shell scripting, I guess you could say it's mechanical/weak?

@refi64 yeah! Although bash does have numerical types, they just can't be stored

@tindall oh that's true, guessing you're referring to stuff like numeric comparisons ("there is more than one type but you can't really use it directly" is the most cursed yet fittingly shell-script thing ever tbh)

@tindall Can you explain what you mean about the designed part? Especially how C is designed for weak types?

Sign in to participate in the conversation

cybrespace: the social hub of the information superhighway jack in to the mastodon fediverse today and surf the dataflow through our cybrepunk, slightly glitchy web portal support us on patreon or liberapay!