A ReactJS webapp to convert source code into pseudocode using SMT( Statistical Machine Translation)
Use Code Kindle
What is SMT?
·
Live
.
Report Bug
·
Request Feature
An aid to learning which helps to visualize source code into pseudocode using SMT
You can use it live here: Code Kindle
- The converter page contains two editors, one for writing the source code that you want to convert and the other one which will display the pseudocode after the conversion.
- You can also upload the file to be converted by firstly choosing the language from the dropdown menu and then browsing the file and uploading it.
- The file that you chose will also be displayed in the text editor.
- Now, just click on the convert button, it will run the docker container based compiler in the background.
backend
folder contains the code for the Django based API to upload the files into the projects directory.code_converter
folder contains the frontend code deployed on DFINITY.cpp-pseudogen
folder contains the translator code for cpp/c languages.frontend
folder contains the UI of the entire webapp.python-scripts
folder contains the translator for python source code.
To get a local copy up and running follow these simple steps.
This is an example of how to list things you need to use the software and how to install them.
- npm
npm install npm@latest -g
- Clone the repo
git clone https://github.com/Open-Sourced-Olaf/Code-Kindle.git
- Install NPM packages
npm install
- Run Locally
npm run start
- Add support to more languages
- Convert one language code into other like cpp code to php and so on.
- Improving the algorithm of the translator to include complex cases like multiple functional calls inside the main.
- See the open issues for a list of proposed features (and known issues).
- To translate the cpp/c codes,move to the cpp-pseudogen folder upload a file named "prog.cpp" and then compile the main.cpp using the command
g++ main.cpp -o main
after that execute./main
, it will display the output in the terminal as well as create a output.text file. - To translate the python code, move to the python-scripts folder, upload a file named hello.py, then compile the generatePseudo.py file using the
python3 generatePseudo.py
, it will produce hello-pseudo file in the working directory. - to run the frontend code, move to the frontend directory and run
npm i
followed bynpm start
. - to deploy and run the code on DFINITY, run
dfx start --background
to start the server in the background, then rundfx deploy
, it will produce a code_converter_assets canister id, copy that. - then open dfx.json and find the ip address, now the url of the web app will be http://127.0.0.1:8000/?canisterId=[canister-id].
- to deploy, run
dfx ping ic
,dfx deploy --network=ic
. - the deployed url will be https://[ your canisterId here ].ic0.app/
- Fork and clone the repository.
- create a branch
- make changes in that branch
- add and commit your changes
- then push the changes into your branch
- now you can create a PR using that branch in our repository.
- 🎉 you have successfully contributed to this project.
- https://sdk.dfinity.org/docs/developers-guide/tutorials/custom-frontend.html
- https://mlh-fellowship.gitbook.io/fellow-handbook/sponsor-resources/dfinity
- Other links can be found in the WIKI page of this repository.
Important decisions regarding the project are taken by the following maintainer.
Anjali | Deepak | Prashi | Bushra | Yvon Manzi |
---|---|---|---|---|
@anjalisoni3655 | @DebugAgrawal | @prashi23 | @codingbug671 | @yvonmanzi |