Python Forum
What are ways of pointing cross-compiled origin source line for python?
Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
What are ways of pointing cross-compiled origin source line for python?
#1
I'm considering using Python as compiler backend (target). The problem I see is that there is no standard way to "tell" interpreter about origin line (from other language it was compiled). For example, JavaScript uses Source Maps for debugging, but it's not that perfect. Ideally I'd compile down to bytecode (pyc), where arbitrary lines can be set, but as I see, Python bytecode, it's not as portable, is it? Is generating bytecode portable between e.g. Python 3.1 and Python 3.6? What are ways of pointing cross-compiled source lines for python?
Reply
#2
There are several questions here.
I'm having trouble understanding what exactly you are trying to do.
and why generate byte code, why not just interpret script which will run on any platform, and any version of python (that contains all objects used)
Reply
#3
(Feb-02-2019, 10:30 AM)Larz60+ Wrote: I'm having trouble understanding what exactly you are trying to do.

I take some language and cross-compile it to Python, but original line positions can't be prevailed in Python (e.g. for that JavaScript uses Source Maps). So basically I'm asking if there are any ways to do that, since .pyc bytecode is not reliable enough.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Algorithm for extracting comments from Python source code Pavel1982 7 3,014 Aug-28-2024, 02:50 AM
Last Post: timothyferriss
  Confused by the different ways of extracting data in DataFrame leea2024 1 715 Aug-17-2024, 01:34 PM
Last Post: deanhystad
  Executable file compiled by PyInstaller does not work on Windows 7 amusaber 1 1,938 Jul-11-2024, 02:59 PM
Last Post: DeaD_EyE
  Different Ways to Import Modules RockBlok 2 1,427 Dec-11-2023, 04:29 PM
Last Post: deanhystad
  Cross 2 arrays dylan261999 4 2,122 Feb-09-2023, 01:06 PM
Last Post: thensun
  python move specific files from source to destination including duplicates mg24 3 2,010 Jan-21-2023, 04:21 AM
Last Post: deanhystad
  Python Snippets Source kucingkembar 0 1,051 Oct-18-2022, 12:50 AM
Last Post: kucingkembar
  multi-line CMD in one-line python kucingkembar 5 6,327 Jan-01-2022, 12:45 PM
Last Post: kucingkembar
  Long-term stable source to get news headlines with Python? sandufi 4 3,218 Dec-23-2021, 09:48 AM
Last Post: sandufi
  Navigating cpython source using python quazirfan 3 2,888 Aug-09-2021, 07:52 PM
Last Post: quazirfan

Forum Jump:

User Panel Messages

Announcements
Announcement #1 8/1/2020
Announcement #2 8/2/2020
Announcement #3 8/6/2020