4 ms·
> a well-structured way to define and enforce APIs I don't see the issue here? What do you think is stopping you from doing this in, for example, Common Lisp?
by Reelin 6y ago
> a well-structured way to define and enforce APIs
I don't see the issue here? What do you think is stopping you from doing this in, for example, Common Lisp?
> and oh wow, typing facilities
Common Lisp isn't typed, but there's no reason a Lisp dialect can't be. In fact, Typed Racket is just such a language.
- ywei3410 6y agoHell, to go even further you can implement your own type system on top of Racket's macro system; or better yet, use a macro DSL specifically created for type systems to implement your type system. [1] [1] https://docs.racket-lang.org/turnstile/ https://docs.racket-lang.org/turnstile/
- Jtsummers 6y agoCommon Lisp is typed. It is not (consistently, see SBCL for a counterexample) statically typed. If you try to do: (+ "hello" 3) You will get an error in CL, and with SBCL an expression like that wouldn't even compile.
- Reelin 6y agoYes, I'm aware (see my nearby comment for more detail). I very much enjoy writing Common Lisp, but use SBCL almost exclusively specifically because of the amount of (static) type checking it does. Even then, there are significant limitations that often leave me frustrated in comparison.
- flavio81 6y ago>Common Lisp isn't typed It is heavily typed. Very strongly typed for the most part (except numbers). So typed that it won't accept a "character vector" in the place of a string. But type checking is mostly at runtime, not at compile-time. The good part is that you can edit your program at runtime and restart it at the exact point the error happened, very easily.
- Reelin 6y agoIn context, particularly given the reference I made to Typed Racket, it should be abundantly clear that I'm referring to the lack of static typing there. That being said, I think you'll find truly untyped languages hard to come by. Other than assembly, Forth (similar to assembly in many ways), and esolangs such as Befunge (also quite similar to assembly), languages that see widespread use always check types eventually. Checking types eventually is table stakes. Checking types at compile time, before what you wrote has a chance to explode on you in an unpredictable manner when that one branch for an edge case finally gets taken after a few days of uptime, that's the truly desirable feature that not all languages manage to provide.