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 6 531 Feb-28-2024, 09:52 PM
Last Post: Pavel1982
  Different Ways to Import Modules RockBlok 2 537 Dec-11-2023, 04:29 PM
Last Post: deanhystad
  Cross 2 arrays dylan261999 4 1,027 Feb-09-2023, 01:06 PM
Last Post: thensun
  python move specific files from source to destination including duplicates mg24 3 1,103 Jan-21-2023, 04:21 AM
Last Post: deanhystad
  Python Snippets Source kucingkembar 0 639 Oct-18-2022, 12:50 AM
Last Post: kucingkembar
  multi-line CMD in one-line python kucingkembar 5 3,986 Jan-01-2022, 12:45 PM
Last Post: kucingkembar
  Long-term stable source to get news headlines with Python? sandufi 4 1,941 Dec-23-2021, 09:48 AM
Last Post: sandufi
  Navigating cpython source using python quazirfan 3 2,030 Aug-09-2021, 07:52 PM
Last Post: quazirfan
  2 ways to initialize a list with all zero quazirfan 2 1,814 Aug-06-2021, 03:27 PM
Last Post: deanhystad
  Sorting Elements via parameters pointing to those elements. rpalmer 3 2,603 Feb-10-2021, 04:53 PM
Last Post: rpalmer

Forum Jump:

User Panel Messages

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