8 ms·
Taf - A plan for a statically-typed Lisp
- batgaijin 14y agoI think strongly static typing can be added to CL, if I understand this paper correctly: ftp://ftp.cs.utexas.edu/pub/boyer/diss/akers.pdf
- samth 14y agoHow will this compare to Typed Racket and Typed Clojure? In particular, Typed Clojure works with Clojure's multi-methods, I believe. Also, you should have a look at Andrew Wright's work on Soft Scheme, which also used row polymorphism to statically analyze and check Scheme programs.
- chimeracoder 14y agoTyped Racket[1] has the advantage of being completely inter-operable with dynamically typed Racket - I can (and have) imported dynamically typed modules and used them in (statically) typed modules, as well as imported (statically) typed modules and used them in dynamically typed ones. You can even turn off the static type checking while keeping the type annotations. Not to mention that the type system is incredibly powerful and expressive. It's literally the best of both worlds. [1] http://docs.racket-lang.org/ts-guide/ http://docs.racket-lang.org/ts-guide/
- mahmud 14y agoTyped Racket's static-dynamic is due to its module system: modules allow for seperate compilation, and the type-checker accepts accepts fully typed modules, not mix-code fragments. However, Siek's Gradual Typing does handle mix-type expressions at finer-grain.
- samth 14y agoYou can use the `with-type` form to embed typed expressions in larger untyped modules in Racket. Also, submodules let you accomplish more of this as well, without needing to put your modules in separate files.
- BruceM 14y agoThere's also OpenDylan (http://opendylan.org/ http://opendylan.org/) and we're even considering adding an s-expression syntax back as an alternative...
- shaunxcode 14y agodoes it currently - or are there plans to - compile to js?
- BruceM 14y agoWe'd love to do that. We just lack the manpower. There are a couple of possible approaches ... one is a compiler backend similar to our C backend. Another is to try out emscripten. If you're interested in helping out, would love to chat. We're on #dylan on freenode.
- ambrosebs 14y agoTyped Clojure multimethod support is work in progress, but closing in.
- jjtheblunt 14y agoCommon Lisp has optional type annotations; doing so should only help the compiler (or the interpreter if you're running that way). Paragraph 4 of http://en.wikipedia.org/wiki/Common_Lisp http://en.wikipedia.org/wiki/Common_Lisp for a vague citation.
- rayiner 14y agoCommon Lisp's optional type annotations aren't complete. That is to say there is no level of annotation you can provide that guarantees you won't get type errors at runtime.
- akurilin 14y agoIs there a philosophical reason why Lisp is generally dynamically typed, or is it mostly an artifact of history? Would anything of value of Lisp be lost beyond the typical trade-offs you see mentioned in every static vs dynamic debate, such as up-front ease of development?
- chimeracoder 14y agoYou can test it out yourself: http://docs.racket-lang.org/ts-guide/ http://docs.racket-lang.org/ts-guide/ Typed Racket lets you easily migrate portions (or the entirety) of a dynamically typed codebase into an equivalent statically-typed version. You get the best of both - easy prototyping with dynamic typing, robustness and scalability of static typing, and then the flexibility of applying those choices to parts of your codebase while keeping everything completely interoperable.
- akurilin 14y agoNeat, thanks for the link!
- rayiner 14y agoLisp both predates static type systems, and has a philosophical bent towards "late binding" to the maximum extent possible. In terms of what you'd lose--eval() for one. It's only been relatively recently that decent type inference has been integrated with interactive execution (GHCi), but I think it's possible (though GHCi is still more limited and cumbersome than full batch GHC).
- groovy2shoes 14y agoNeat! Is anyone aware of any accessible introductions to the concept of row polymorphism?
- evincarofautumn 14y agohttp://lambda-the-ultimate.org/node/4666 http://lambda-the-ultimate.org/node/4666
- groovy2shoes 14y agoThanks! I read the MLPolyR paper when it was posted on LtU, but I found it a bit hard to digest, and the link to your article is also purple so I guess I read it at some point :)
- turnersr 14y agoHow will this compare to Shen ( http://www.shenlanguage.org/ http://www.shenlanguage.org/ )? In my experience it has a more expressive type system than Taf.
- justin_vanw 14y agoLets take a language that is already marginalized, and remove one of it's best loved features! That'll get 'em excited.
- DanWaterworth 14y ago> Taf is not properly tail recursive. I don't understand why tail recursion isn't a bigger deal to people.
- pjmlp 14y agoMaybe because many still avoid recursion like hell?
- deleted 14y ago[deleted]
- pootch 14y agoLISP, and every form of it, especially Clojure, is a scam.
- dschiptsov 14y agoThe one of the biggest ideas behind a classic Lisp is now called Exploratory Programming - a natural way of evolving your program very quickly. When a programmer is forced to think about a type before he already decided what it could be is a limiting factor. All scripting languages are based on this idea. And, of course, having lists of elements of just the same type and different sets of functions for different types of, say, lists is an ugly thing. The current mass-hysteria about necessity of static typing is due some sort of Bandwagon effect. I think it is much better to learn the elegant approach of authors of Scheme and other Lisps to hide necessary hardware types inside a runtime and to allow programmers and themselves to think in terms of a problem domain. So, statically typed Lisp is something like four-wheel bicycle. It is very "safe" and "stable" but for some reasons no one wants it.
- pwpwp 14y ago"And, of course, having lists of elements of just the same type and different sets of functions for different types of, say, lists is an ugly thing." Both of these are not the case with row polymorphism.
- sbt 14y agoI agree that it's important to retain the dynamism of LISP, but if types could be made optional, it could be useful. In my view, the expressive power of LISP is the same thing that hinders it for use in teams (unless the team is small and super qualified) and consequently what has prevented its widespread adoption. I think this is a wonderful initiative. I originally tried to do this a few years ago, but gave up after having considered the implementation too involved (I was using LLVM at the time and was effectively writing a compiler). I still think an optionally typed LISP compiler would be a great idea if somebody is willing to do it. EDIT: grammar.
- yvdriess 14y agoCL has optional types and quite an interesting type system. Check out Qi if you want a Lisp designed to have a rich type system.
- deleted 14y ago[deleted]