140 points · by todsacerdoti · 1y ago · 66 comments
I made an attempt to fix that for eli: https://github.com/codr7/eli#type-checking
Shen uses a dependently typed Sequent-Calculus based Type System (SCTS). It uses type rules vs. type classes, and type checking is optional, you can turn it on or off. Haskell's type inference makes things a bit simpler, and is a battle-tested static type system with excellent type inference which lends itself better for functional programming and large-scale software engineering (for the moment). Shen's TC is more expressive, but requires more effort.
Aditya Siram has some old but goody YT videos on Shen.
The problem is it's a walled garden, with its own quirky syntax; nothing that happens inside of loop is applicable outside, and the other way around.
Then you got all the life-improving goodies (in-{sequence,string,file,stream}, index-of-*, previous, etc...) that really add up to something.
Trivial example of breakage:
(iter (for i from 1 to 10)
(print (count i some-sequence)))Or is the documentation wrong?
Still better than the loop abomination, IMO.