Giter Site home page Giter Site logo

Bootstrapping about bython HOT 5 OPEN

oleorhagen avatar oleorhagen commented on June 3, 2024 3
Bootstrapping

from bython.

Comments (5)

b1f6c1c4 avatar b1f6c1c4 commented on June 3, 2024 2
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

from bython.

mathialo avatar mathialo commented on June 3, 2024 1

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

  • All modules for Python automatically work for bython as well (I'm doing a lot of scientific computing, so having the scipy-stack available is necessary). No inbetween translators is necessary.
  • All language features of Python is available as soon as Python is updated. There's a reason that e.g. PyPy is still on 3.5 and not on 3.6, it's because they have to rewrite everyting, and that's a huge amount of work. You want fancy substitution of variables in strings as introduced in 3.6? You got it, no need to update Bython.
  • Now, it's up to the users what parser they want to use. Want to combine Bython with Cython? No problem. What about PyPy? Not an issue. Simply compile with the -c flag and run with your interpreter of choice.

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.

from bython.

b1f6c1c4 avatar b1f6c1c4 commented on June 3, 2024

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.

from bython.

b1f6c1c4 avatar b1f6c1c4 commented on June 3, 2024

@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, ...

from bython.

mathialo avatar mathialo commented on June 3, 2024

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).

from bython.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.