functional-programmingweakly-typed

Is there a weakly typed / type unsafe lazy+functional programming language?


I would like to know whether there exists a lazy+functional language with JavaScript style types. Most lazy+functional languages I've seen are very type safe.

One could argue that a type can be defined in some languages that encloses all JavaScript types. Has anyone done something like this already?


Solution

  • I don't think a "type unsafe" language can be (purely) functional, because part of being purely functional is that expressions have a semantic value that is independent of the machine representation. ("Type unsafe" is usually used to mean a language where any type can be cast to any other type by identifying values with the same machine representation --- think Assembly or C).

    JavaScript, though, is very type safe --- just dynamically typed. There's no reason you couldn't have a purely functional language with a single static type, like JavaScript; what you probably want to actually be searching for is "purely functional Lisp". Here are some results: