mathialo / bython

Python with braces. Because python is awesome, but whitespace is awful.
MIT License
2.1k stars 50 forks source link

Bootstrapping #18

Open oleorhagen opened 6 years ago

oleorhagen commented 6 years ago

Bython should be able to parse itself, and not rely on filthy regular python in doing so!

b1f6c1c4 commented 6 years ago

Definitely. Yet there is a critical bug ( #14 ) that MUST be fixed. After that, x.py SHOULD by semantically identical to bython -c (py2by x.py). Then we can initiate transpilation (and manual minor modification) from src/*.py to src/*.by.

mathialo commented 6 years ago

There are a couple of real advantages of relying on regular python for parsing, these include:

Bython was simply meant as a translator from curly braces to indentation, and I think it's best to keep it like that and use other software for the interpreting.

b1f6c1c4 commented 6 years ago

@mathialo Basically, bootstrapping here (in my opinion) means:

(here bython is a language just like C, while Bython is a bython-to-python compiler just like GCC)

  1. Bython transpiler itself (source code) should be written in bython, not python because bython is much better as a language;
  2. Whenever a new version of Bython is to be released, we impose an older version of Bython on the source code to obtain python binaries (yeah python IS human-readable, but not SO readable as bython 😏 );
  3. The binaries are published. Anyone who wants to use Bython can simply download the binaries, copy them to /usr/local/bin, run bython -c, ...
b1f6c1c4 commented 6 years ago
Concept In Bython v0.x In Bython v1.x In GCC
High-level language bython bython C
Compiler Bython Bython GCC
Low-level language python python machine code
Compiler source code is written in python bython C
Does compiler need compilation No Yes Yes
Compiler binary is in python python machine code
mathialo commented 6 years ago

Ah, I see, I misunderstood. Of course, I think that should be a goal. I also agree on your table above that we keep Bython 0.x written in Python for now, but it should be written in Bython and compiled to Python as of version 1.0 (whenever that may be).