9 Matching Annotations
- Jan 2022
-
gils-blog.tayar.org gils-blog.tayar.org
-
This was because dynamic typing doesn’t give the safety net that static typing does. So you write more tests. Which is a good thing.
Tests are a good thing, but not all devs are even aware of the loss of safety net and so there's no guarantee that using a dynamic language results in more tests.
Using tests and static-types together would mean that there's whole categories of bugs that get eliminated while also getting more coverage for less lines of test-code.
-
- Mar 2021
-
github.com github.com
- Feb 2021
-
-
I'm not a fan of listing exceptions functions can throw, especially here in Python, where it's easier to ask forgiveness than permission.
-
- Apr 2020
-
en.wikipedia.org en.wikipedia.org
-
This type relation is sometimes written S <: T
-
subtyping allows a function to be written to take an object of a certain type T, but also work correctly, if passed an object that belongs to a type S that is a subtype of T (according to the Liskov substitution principle)
-
chose the term ad hoc polymorphism to refer to polymorphic functions that can be applied to arguments of different types, but that behave differently depending on the type of the argument to which they are applied (also known as function overloading or operator overloading)
-
- Oct 2018
-
-
In computer science and logic, a dependent type is a type whose definition depends on a value. A "pair of integers" is a type. A "pair of integers where the second is greater than the first" is a dependent type because of the dependence on the value.
this is not the most impressive defitnition but it does the job ;) it's more like "relational types" where type definitions include relations between potential values
-
On the flip side, it can go further than mere types, including emulating dependent types and programming-by-contract.
spec though it's used at runtime (not compile time)
- hence: not a replacement for types as such BUT
- enables dependent types
- programming by contract
Tags
Annotators
URL
-
- Nov 2015
-
felix-lang.org felix-lang.org
-
almost all languages are dynamic and involve dynamic typing, even languages like Ocaml and Haskell. Every time your code interprets data and makes choices based on that, you have dynamic typing. The simple fact is that there's no hard and fast distinction between type information and data: constraints on data, such as the format of a stream of text, are type constraints which are beyond the static type system to check, so the checks are done dynamically at run time by your code, and that's dynamic typing!
An interesting perspective, which is a bit like the dual of the Lisp mantra: "code is data".
-