News for hackers. Stuff that matters.
Re:Yes, Python is Slow, and I Don’t Care by scarface74 on Friday September 08, 2017 @02:27PM (#15202777)
Clojure is trying to do that with Clojure.spec and specifications being checked at runtime can get you closer to things you could have automatically proved correct only with languages with dependent types, nothing against statically typed languages but I feel that your sweeping generalizations hurt the point you are trying to make.

"Checking at runtime* is exactly the problem. Why would checking at runtime be more reliable than compile time?

Re:Yes, Python is Slow, and I Don’t Care by flavio81 on Friday September 08, 2017 @02:51PM (#15202958)
>"Checking at runtime is exactly the problem. Why would checking at runtime be more reliable than compile time?*

If you use metaprogramming (i.e. Lisp macros, Scheme/Racket macros, Clojure macros), then the only way to have truly reliable checks is at run time.

In fact, for debugging and testing, it's much better to have a runtime able to do many things (such as live patching of the code).

Contrary to a language like C or C++, where the compiler produces machine language from the source and then goes out of the picture, in most of the Lisp family languages your program runs along with the runtime; this runtime also contains the compiler itself and is usually big on features; it will not just catch the type errors, it will show you exactly all kind of important information about any, error and will allow you to correct the error if you like, without having to recompile and start again.

Re:Yes, Python is Slow, and I Don’t Care by scarface74 on Friday September 08, 2017 @10:05PM (#15205197)
Contrary to a language like C or C++, where the compiler produces machine language from the source and then goes out of the picture,

I use C#. When you create a Linq expression, you get type safety and it "compiles to" an expression tree that is converted to its runnable form at runtime -- in my case a Sql statement, a MongoQuery, or C# code. It really comes in handy. Theoretically I could change my backing Store from Mongo/C# driver to Sql Server/EF without changing any of the queries. I do this all of the time when unit testing, I substitute an in memory list for a database table and still get complete type safety.

Re:Yes, Python is Slow, and I Don’t Care by kazinator on Friday September 08, 2017 @03:10PM (#15203126)
> If you use metaprogramming (i.e. Lisp macros, Scheme/Racket macros, Clojure macros), then the only way to have truly reliable checks is at run time.

That is a misconception. The macros output a target language and that can be checked. Plus macros can do their own checking before that. A macro expander can perform some static checks. In TXR Lisp, warnings about unbound functions and variables come from the macro-expanding code walk.

Re:Yes, Python is Slow, and I Don’t Care by abhirag on Friday September 08, 2017 @03:27PM (#15203260)
In addition to the points flavio81 made, checking at runtime because unless the language is dependently typed i.e. has types as first class citizens(for example Idris) a lot of the information about your code you want to prove to be correct is not available at compile time(for example, you have an integer but is it a non-negative integer, a list but is it sorted). It is not about being reliable, it is about being possible.
Re:Yes, Python is Slow, and I Don’t Care by kazinator on Friday September 08, 2017 @03:09PM (#15203113)
A run-time check will work even if the compiler has a bug which mistranslated the code or neglected to do a check.