← Back to context

Comment by julienfr112

3 months ago

Most of the time, you want the type to be dynamic in a scripting langage, as you don't want to expose the types to the user. With this in mind, rhai and rune are pretty good. On the python front, there was also the pyoxidizer thing, put it seems dead.

Not necessarily!

These are the strong vs weak, static vs dynamic axes.

You probably want strong, but dynamic typing. eg., a function explicitly accepts only a string and won't accept or convert a float into a string implicitly or magically.

You're free to bind or rebind variables to anything at any time, but using them in the wrong way leads to type errors.

JavaScript has weak dynamic typing.

Python has strong dynamic typing (though since types aren't annotated in function definitions, you don't always see it until a type is used in the wrong way at the leaves of the AST / call tree).

Ruby has strong dynamic typing, but Rails uses method_missing and monkey patching to make it weaker though lots of implicit type coercions.

C and C++ have weak static typing. You frequently deal with unstructured memory and pointers, casting, and implicit coercions.

Java and Rust have strong static typing.

If the language has types at all, they're exposed to the user, even if the time of exposure is a runtime failure. I suspect you want inferred types, which can be had in statically-typed languages.