3 ms·
I only read the front page, but I can't figure out what "statically typed" even means in the context of lisp. If it isn't doing manifest value typing it's hard
by bandrami 4y ago
I only read the front page, but I can't figure out what "statically typed" even means in the context of lisp. If it isn't doing manifest value typing it's hard for me to call whatever it is "lisp"; it's something else with a lot of parentheses. Does it just mean once a symbol has taken a value of one type it can't ever take a value of another? What would the point of that limitation be?
- CodeArtisan 4y agoAs its name implies, Statically typing does mean that the typing is resolved in the static environment (before execution). Dynamic typing is resolved in the dynamic environment (during execution). Both enabling all kind of techniques. You need dynamic typing to have eval which is the core of the lisp language therefor you can't have a "true" lisp without dynamic typing.
- pohl 4y agoLooks like Carp does also have eval. It’s nice that one gets to choose to pay the cost here. https://carp-lang.github.io/carp-docs/core/Dynamic.html https://carp-lang.github.io/carp-docs/core/Dynamic.html
- jeremyjh 4y agoAt the top of that page, it says it is used in the REPL and during compilation and not available in compiled code. The guide elaborates they are also available in macros. But I don't see a mechanism for runtime eval.
- crabbone 4y agoThere's no real definition for "static typing". It's an opaque marketing term that somehow made it into programming lexicon. Don't ask what "static typing" is, you are simply supposed to love it, because it's good.
- naasking 4y agoSomebody hasn't heard of the Curry–Howard correspondence!
- nathan_compton 4y agoExtremely weird take! While there are a variety of static type systems (enough that it might even form a kind of cluster concept) they all share a pretty recognizable character: a statically typed language has a phase _before_ execution which enforces certain invariants (beyond syntax) on the behavior of the code related to what operations can be performed on what objects. Unquestionably this involves some trade offs, but to suggest that its purely a marketing term is truly bizarre.
- Joker_vD 4y agoThere is even an established term for that, "phase distinction".
- zozbot234 4y agoStatic typing need not involve a phase distinction. It does not in dependently-typed languages, though you can always reintroduce one via some kind of program extraction.
- c-cube 4y agoMoreover, static typing means that every expression has a well defined type (checked or inferred statically, as the name suggests). Dynamic typing means that only values, ie the result of evaluating expressions, have types in any meaningful way. It's as far as a marketing gimmick as it comes, and there's literally a whole academic field in CS dedicated to it.
- djha-skin 4y agoWe did typed racket in school[1]. It helps me wrap my brain around the concept. In if then statements, both branches must return the same type, and the whole statement is typed to that type, for example. It is pretty limiting, but hey, lisp is the programming language you can use to make other programming languages. I do agree though; common lisp and its `declare` statements hit the sweet spot for me. 1: https://docs.racket-lang.org/ts-guide/ https://docs.racket-lang.org/ts-guide/
- bandrami 4y agoI get expression typing (which as you point out `declare` does very well). I just don't understand how you can either 1. Do static typing with manifest-typed values that can be assigned to arbitrary symbols, or 2. Do Lisp in any real sense without #1
- JonChesterfield 4y agoIt's through "gradual" typing. You check what you can as early as you wish and emit dynamic checks for the remainder. There was a claim a while ago that gradual typing is inherently slower than static or dynamic, but that sounds like an implementation bug to me, not anything fundamental.