NLESC-JCER / cpp2wasm

Guide to make C++ available as a web application
https://nlesc-jcer.github.io/cpp2wasm/
Apache License 2.0
22 stars 6 forks source link

Repo directory structure #67

Closed jspaaks closed 4 years ago

jspaaks commented 4 years ago

Couple of observations on the directory structure of ad7ca360c3a519b2f5f3722aed438ef877b49d51.

  1. Apparently, it's customary to have a lit for literary programming, not a src like we have now.
  2. I would like to have a [src|lit]/cpp with the C++ code snippets in it
  3. I'd like to move the dependencies deps/lohmann to cpp as well.
  4. Probably the above means that /bin also needs to be moved to lower in the tree
  5. I'd like to put cypress under tests, so a reader knows what it is conceptually even if they don't know the name cypress
  6. Not sure what to do with apache2 and cgi-bin (also we have 2 cgi-bins)
sverhoeven commented 4 years ago
  1. Can you give some links, I only see lit/ used in https://entangled.github.io/tutorial.html, but all the examples at https://entangled.github.io/examples/ use src/ or no subdir.
  2. algorithm, cli and cgi are OK for me, what about the bindings? Alternativly have cpp/src with the Cpp chapter as cpp/README.md so each language has a main dir
  3. OK for me, we are only using it in the CGI chapter so we could even move it to a cgi specific folder
  4. agree
  5. As we are using the defaults we would need a config file (.cypress.json) to change all the cypress folders. So then readers will have questions about that.
  6. Correct /cgi-bin is no longer used and should be removed. We could rename /apache to /cpp/cgi to correspond with the chapter name. And have cgi-newtonraphson.cpp in /cpp/cgi/src .
jspaaks commented 4 years ago

@1. I based this off of entangled's claim; the only supporting example I could find was https://github.com/zyedidia/Literate. I find src more recognizable, so let's keep that.

jspaaks commented 4 years ago

@ 2, 3, 4, 6 I was able to do the main parts of the guide with the following layout, which I think is more readable:

.
├── cgi
│   ├── apache2
│   ├── cgi-newtonraphson.cpp
│   └── deps
├── cli
│   ├── algebra.hpp
│   ├── cli-newtonraphson.cpp
│   ├── newtonraphson.exe
│   └── newtonraphson.hpp
├── flask
│   ├── newtonraphsonpy.cpython-36m-x86_64-linux-gnu.so -> ../swagger/newtonraphsonpy.cpython-36m-x86_64-linux-gnu.so
│   └── webapp.py
├── react
│   ├── app.js
│   ├── example-app.html
│   ├── newtonraphsonwasm.js -> ../webassembly/newtonraphsonwasm.js
│   ├── newtonraphsonwasm.wasm -> ../webassembly/newtonraphsonwasm.wasm
│   └── worker.js
├── openapi
│   ├── api.py
│   ├── newtonraphsonpy.cpython-36m-x86_64-linux-gnu.so
│   ├── openapi.yaml
│   ├── py-newtonraphson.cpp
│   └── webservice.py
└── webassembly
    ├── example.html
    ├── newtonraphsonwasm.js
    ├── newtonraphsonwasm.wasm
    └── wasm-newtonraphson.cpp

There are a couple of places where we will have duplication, we can either make copies or have softlinks like I did in the tree above.

sverhoeven commented 4 years ago

I like it, some notes

jspaaks commented 4 years ago
sverhoeven commented 4 years ago
jspaaks commented 4 years ago

Working on this as part of #66 and PR #71.

jspaaks commented 4 years ago

BTW do we want one Makefile or per-method Makefiles?

sverhoeven commented 4 years ago

Many projects use a Makefile in each dir, don't think it will help us much. I like to keep a single Makefile.

jspaaks commented 4 years ago

OK

sverhoeven commented 4 years ago

Lets make separate Makefiles and Markdown will do later.

sverhoeven commented 4 years ago

@jspaaks this issue can be closed now, right?