News for hackers. Stuff that matters.
Re:Turbo Pascal Compiler in JavaScript by kevin_thibedeau on Saturday February 20, 2021 @07:51PM (#26209726)
> or the life of me I can't phantom why none writes a compiler for it. Would be a huge advantage

Pick your poison:

PyPy https://www.pypy.org

Cython https://cython.org

Nuitka https://nuitka.net

Re:Turbo Pascal Compiler in JavaScript by unnouinceput on Sunday February 21, 2021 @03:07AM (#26211745)
I have a problem. For some reason a good mathematician wrote the solution to it in Python. Works great. Now I want to use that solution, which is very complex, tens on thousands of lines in Python, in another language because I also need speed and Python is solving that solution in too much time.

What choices do I have? One would be to rewrite the solution myself using provided Python code as base. Second would be to get the Python code compiled in a .dll(Win)/.so(Lin) and use it.

Can above poisons do that for me? Answer: NO. I tried all 3 already, they do. not. work.

Otherwise I can definitely call Powerpoint2Exe an interpreted language too since it can generate a standalone executable.

Re:Turbo Pascal Compiler in JavaScript by ptx on Sunday February 21, 2021 @03:39AM (#26211890)
Statically compiling general Python code to a high-performance standalone executable is currently not possible.

But to solve the problem you describe, you can:

1) embed CPython in your app to run the Python code (i.e. link with the libpython DLL), and then

2) modify the most performance-critical parts of the Python code so that they can be compiled with Cython or mypyc (or write them in C using the Python C API).

Re:Turbo Pascal Compiler in JavaScript by pjmlp on Sunday February 21, 2021 @06:03AM (#26212533)
All workarounds for something not needed to do had the OP started with a language with proper AOT support.