wircho
wircho

Reputation: 155

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?

Upvotes: 2

Views: 364

Answers (2)

Bill Burdick
Bill Burdick

Reputation: 975

Wish I'd seen this earlier. If by "type unsafe", you mean "dynamically typed", then yes, I have been working on a dynamically typed, lazy, functional language with strong metaprogramming support since 2011, called "Leisure".

Here is an incomplete, interactive feature overview that only works in Chrome (so don't bother opening this page in Firefox, Opera, Safari, etc.): http://zot.github.io/Leisure/?load=doc/LeisureFeatures.org

The project page is here: https://github.com/zot/Leisure

Leisure compiles to JavaScript and runs both in Chrome and Node.js. I'm also working on a Leisure-based shell right now :).

I haven't really made an announcement about this yet because I'm not satisfied with the stack traces, yet -- lazy languages need special stack trace support.

If you're interested in dynamic, lazy, functional languages, please check it out and let me know what you think.

Upvotes: 1

Jonathan Cast
Jonathan Cast

Reputation: 4635

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:

Upvotes: 1

Related Questions