News for hackers. Stuff that matters.
Re:Faster Python with Guido van Rossum by indymike on Thursday October 07, 2021 @11:43AM (#28787800)
> This means performance will fall further and further behind compiled languages.

This is exactly as it should be: the nature of the interpreter is that it has to do a lot of the work a compiler does when it compiles whenever a new command is run (and in Python's case, that is before you cover the whole "everything is an object" part). Yes, some of it can be mitigated, but the expectation that an interpreter keep pace with compiled code is somewhat of a pipe dream. What I'd love is a language that can be compiled (and be highly optimized) and interpreted without changing it's behavior. The developer experience with an interpreter is fantastic, the performance of compiled code is... better.

Re:Faster Python with Guido van Rossum by colejohnson66 on Thursday October 07, 2021 @11:44AM (#28787821)
> What I'd love is a language that can be compiled (and be highly optimized) and interpreted without changing it's behavior. The developer experience with an interpreter is fantastic, the performance of compiled code is... better.

You mean something like a byte code like language with a JIT system? Like Java and C#? C# in particular now supports AOT compilation, but can still be run as “interpreted” CIL.

Re:Faster Python with Guido van Rossum by indymike on Thursday October 07, 2021 @12:30PM (#28788566)
Having a VM / JIT in the middle is a way to get there, but ultimately, different. At least in Java's case, my code targets an abstraction instead of hardware, so I don't get the full benefit of compilation. Performance is part of the story... access to the OS and hardware is another.
Re:Faster Python with Guido van Rossum by smallnamespace on Thursday October 07, 2021 @06:25PM (#28792883)
Even native compilers like clang will use LLVM, and LLVM IR can look a lot like JVM bytecode.

The VM abstraction is not a barrier to fully optimizing for your architecture, but rather how much time you can spend converting IR/bytecode into assembly, whether you do it at runtime, and whether runtime information lets you optimize even further.

Re:Faster Python with Guido van Rossum by ska on Thursday October 07, 2021 @12:00PM (#28788064)
> hat I'd love is a language that can be compiled (and be highly optimized) and interpreted without changing it's behavior.

This has been a great feature of many lisps for 4+ decades now. Not unique to them of course.

Re:Faster Python with Guido van Rossum by giovannibonetti on Thursday October 07, 2021 @11:53AM (#28787951)
> The developer experience with an interpreter is fantastic,

By the way, there are some (high-level) compiled languages with REPLs like Lisp, Haskell and Elixir.

Re:Faster Python with Guido van Rossum by igouy on Thursday October 07, 2021 @12:59PM (#28789076)
"GHC compiles Haskell code either directly to native code or using LLVM as a back-end."

Does elixirc compile to "native code" ?

Does the Haskell REPL use an interpreter not the GHC compiler?

http://downloads.haskell.org/~ghc/latest/docs/html/users_gui...