Skip to content
Go back

Base64Encoding

Language Characteristic

CharacteristicTerraform (HCL2)PythonJavaScriptTypeScriptC++Rust
Primary ParadigmDeclarativeImperativeImperativeImperativeImperativeImperative
Evaluation ModelExpression-basedStatement-basedStatement-basedStatement-basedStatement-basedStatement-based
Static TypingPartial / GradualNoNoYes (erased)YesYes
Dynamic TypingYesYesYesNo (after compile)NoNo
Type SoundnessNoNoNoNoMostlyYes
Type InferenceLimitedYesYesYesLimitedStrong
Explicit Type AnnotationsOptionalOptionalN/AOptionalRequiredOften optional
Gradual TypingYesNoNoYesNoNo
Runtime Type ErrorsYesYesYesYes (if unchecked)UB / compile failNo
Compile-Time GuaranteesWeakNoneNoneMediumStrongVery strong
Union TypesNoNoNoYesNoYes (enums)
Structural TypingYesDuck typingDuck typingYesNoNo
Nominal TypingNoNoNoNoYesYes
Flow-Sensitive TypingNoNoNoYesNoYes
Pattern MatchingNoNoNoLimitedNoYes
GenericsNoYes (runtime)NoYesYesYes
Value MutabilityImmutableMutableMutableMutableMutableImmutable by default
State MutationNoYesYesYesYesYes
Memory ManagementRuntime managedGCGCGCManualOwnership system
Late BindingYesYesYesYesLimitedNo
Runtime Schema DependenceYesNoNoNoNoNo
Declarative SemanticsYesNoNoNoNoNo
Sound Refactoring SupportNoNoNoPartialYesYes
IDE Type RecoverabilityPoorPoorPoorGoodExcellentExcellent
Foreign Runtime DependenceYes (providers)NoNoNoNoNo
Execution Order Defined by LanguageNoYesYesYesYesYes
Compile TargetGraph + runtimeBytecodeBytecodeJSNativeNative

Definitions

Evaluation Model Whether programs are composed primarily of expressions (which evaluate to values) or statements (which perform actions). Expression-based models enable composition but complicate static reasoning.

Static Typing Types are checked before execution and do not change at runtime. Errors can be detected without running the program.

Dynamic Typing Types are associated with values at runtime rather than variables at compile time. Type errors are detected during execution.

Type Soundness A property where well-typed programs are guaranteed not to produce type errors at runtime. Unsound systems allow programs that type-check but still fail.

Type Inference The ability of the compiler or analyzer to deduce types automatically without explicit annotations. Strong inference reduces verbosity while preserving safety.

Explicit Type Annotations Programmer-supplied type declarations that constrain or document values. They may be required, optional, or unavailable depending on the language.

Gradual Typing A type system that allows mixing statically typed and dynamically typed code, with runtime checks at the boundaries. It trades completeness for flexibility.

Runtime Type Errors Errors caused by type mismatches during execution. Their presence indicates weak or absent static guarantees.

Compile-Time Guarantees Properties of the program that are proven before execution (e.g., type correctness, memory safety). Strong guarantees reduce runtime failures.

Union Types Types that explicitly allow a value to be one of several alternatives. They enable precise modeling of branching logic.

Structural Typing Type compatibility is based on shape (fields and operations), not declared identity. This enables flexible composition but weakens encapsulation.

Nominal Typing Type compatibility is based on explicit declarations and names. This enforces stronger abstraction boundaries.

Flow-Sensitive Typing The type system refines variable types based on control flow (e.g., after checks or pattern matches). This improves precision without annotations.

Pattern Matching A construct that destructures values and binds variables while enforcing exhaustiveness. It enables safe handling of complex data types.

Generics Parameterized types that allow code to operate over multiple types while preserving type safety. They enable abstraction without runtime cost.

Value Mutability Whether values can be modified after creation. Immutability simplifies reasoning and concurrency.

State Mutation The ability of a program to modify shared or persistent state. Mutation introduces ordering and aliasing concerns.

Memory Management How memory is allocated and reclaimed (manual, garbage-collected, or ownership-based). This strongly impacts safety and performance.

Late Binding Resolution of values, types, or behavior at runtime instead of compile time. Late binding increases flexibility but reduces predictability.

Runtime Schema Dependence Program correctness depends on external schemas or metadata available only at runtime. This prevents complete static verification.

Declarative Semantics Programs describe desired outcomes rather than execution steps. The runtime decides how to realize the result.

Sound Refactoring Support The ability to refactor code with confidence that behavior remains correct, enforced by the type system. Requires strong static guarantees.

IDE Type Recoverability How well tools can infer types and structure for navigation, refactoring, and error detection. Depends on language semantics, not just tooling.

Foreign Runtime Dependence Correctness depends on external systems or plugins beyond the language runtime. This limits static reasoning.

Execution Order Defined by Language Whether the language specifies a deterministic order of evaluation. Undefined order complicates reasoning and optimization.

Compile Target The form the program is translated into (machine code, bytecode, graph, or interpreted representation). This shapes performance and guarantees.


Share this post on:

Previous Post
Kubernetes
Next Post
Terraform Quick Notes