Return type overloading for dynamic languages?

This page summarizes the projects mentioned and recommended in the original post on /r/ProgrammingLanguages

Our great sponsors
  • InfluxDB - Power Real-Time Data Analytics at Scale
  • WorkOS - The modern identity platform for B2B SaaS
  • SaaSHub - Software Alternatives and Reviews
  • julia

    The Julia Programming Language

  • As a mainstream dynamic language, Julia has a fair exploration of this idea, see https://github.com/JuliaLang/julia/issues/19206 . It might have been a syntactic sugar if not conflicting with the "type assertion" syntax. Anyhow, having the desired return type as one extra input arg, which is conventional in Julia, is a pretty pragmatic choice. You do not do type inference in your dynamic PL, so the end programmers have to be explicit in some way, right?

  • practical-haskell-book

  • Well, my worry is that people will come along and say "This language doesn't have return type overloading, it's verbose and it sucks". Take an example of readMaybe. Ignoring the monomorphism restriction, all the type signatures in there are optional (inferrable) and can be removed - the result looks just like a dynamic program because there aren't any types. So from this example it seems Haskell is more expressive than a dynamic language. Admittedly, this example only works because of Haskell's defaulting rules that choose Integer - so maybe it is a story of a nice-looking syntax held together with rubber bands and glue.

  • InfluxDB

    Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.

    InfluxDB logo
NOTE: The number of mentions on this list indicates mentions on common posts plus user suggested alternatives. Hence, a higher number means a more popular project.

Suggest a related project

Related posts