Skip to content

Conversation

Namenot
Copy link

@Namenot Namenot commented Mar 12, 2025

I have changed / (re)implemented the following features:

  1. silenced certain print statements regarding:

    • the successful writing to file
    • the successful compilation of files
    • the execution of a program.
      This was done to improve output readability. The output still exists, but is now part of the jupyter notebooks logs instead.
  2. Created a folder structure for source files and binaries to declutter the notebooks root folder

    • .o files get put into the same temporary directory as the wrapper
    • source files get put into a build/src/ folder
    • executables get put into the build/ folder
    • dependecies are now searched for in both the notebooks root folder aswell as the temporary directory
      When I started using this kernel i noticed, that my rootfolder cluttered very quickly. This change seeks to eliminate the cultter while still letting the user keep their source files and executables. I've elected to keep the object files as temporary files as they're not required to run the executables. If you'd prefer them to not be temporary I can also put them in a subdirectory as well.
  3. reimplemented the detect main function to remove duplicate compilations

    • the reimplementation only uses the compilers preprocessor & regex to find main implementations
    • This might not be as rigorous as the previous implementation but has the benefit of not needing to compile everything twice
    • If preferred I can also redo this, keep the compilation but also keep the object file, if main is not found. This would at least skip the duplicate compilations for not executable binaries.
      This change seeks to improve a bit on performance (tho im not entirely sure whether I've succeded in that Goal) as it eliminates the need to compile everything twice. Another solution would be to only compile up until the assembly step, this would forgo the complete compilation, and would produce a (re)usable assembly file that can be checked for the main: lable.

I'm not the most seasoned python programmer so if you'd like me to change anything or have some suggestions please let me know! :)

Namenot added 2 commits March 12, 2025 17:55
The Changes to this are:
1. silenced certain print statements regarding:
    - the successful writing to file
    - the successful compilation of files 
    - the execution of a program. 
2. Created a folder structure for source files and binaries to declutter the notebooks root folder
    -  .o files get put into the same temporary directory as the wrapper
    - source files get into a build/src/ folder
    - executables get put into the build/ folder
    - dependecies are now searched for in both the notebooks root folder aswell as the temporary directory
 3. reimplemented the detect main function to remove duplicate compilations 
    - the reimplementation only uses the compilers preprocessor & regex to find main implementations
    - This might not be as rigorous as the previous implementation but has the benefit of not needing to compile everything twice
    - If preferred I can also redo this, keep the compilation but also keep the object file, if main is not found. This would at least skip the duplicate compilations for not executable binaries. 
    - Another solution would be to only go to the assembly step, this  would forgo the complete compilation, and would produce a usable assembly file that can be checked for the main: lable.
drastically improved the detect main function
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant