Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Is there a good guide somewhere, that explains all the different "types" of languages? When I read dynamic/static etc, I often have NFI what that means, something better than Wikipedia, perhaps.


There’s two main attributes of languages as far as typing goes:

Static vs dynamic: when a variable is declare does the compiler know and enforce the type? e.g. can I declare a variable as a string and then assign it an int to it? If you can then you have a dynamic language. If you can’t then you have a static language. Examples of static are Java, Rust, and C++. Examples of dynamic are Python, JavaScript, and Ruby.

The other attribute is weak vs strong typing. Weakly typed languages will coerce types where appropriate. for example if I try to compare “1” with 1 a runtime error occur for a strongly typed language, a weakly typed language will coerce “1” -> 1 and return “true”. Examples of strongly typed languages are Ruby and Java. Examples of weakly typed languages are JavaScript.

Mostly statically typed languages are strongly typed.

My definitions probably aren’t rigorous, but I think they’re good enough.


One way to get at this: making your own language will show you not only what each thing means, but also what the underlying mechanics are!

Crafting Interpreters is a great guide on this: http://www.craftinginterpreters.com


> One way to get at this: making your own language will show you not only what each thing means, but also what the underlying mechanics are!

True, but if everyone who asked any question about something had to implement those things to even understand the basics of them, we'd never get anything done :)


For what it's worth, most CS degrees do involve building a programming language.

You don't need a degree to be a developer (I don't have one) but I think it's a good indication that it is actually reasonable to think that every developer could implement a programming language. (And I mean developer as in someone who writes code professionally as their main job, not necessarily sysadmins or designers or whatnot).

To reiterate, I think many more people than think they can can develop their own language.


It's a big topic. Not only static/dynamic, but also things like structural vs nominal typing.

In this case, it comes down to whether the compiler tracks the "type" of every value when compiling (static typing) or whether types are stored somewhere in memory that is read from when your program is actually running.


> something better than Wikipedia, perhaps

You can probably ask a large language model like GPT-N to generate a summary.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: