Is an early version of the application with no unit tests and it eagerly calls `sh` command with string input ( see: https://github.com/egoist/maid/blob/master/lib/index.js )
I would be worried that some parse error or non-obvious typo in the Markdown format could result in `sh` accidentally running something destructive locally.
Still though, I like the idea and am now following the project, you should keep working on it!
You may want to consider running the Node tasks in a separate subprocess instead of using `require-from-string` module in parent process. You could also try using https://github.com/stackvana/microcule to add support for subprocess execution and multiple programming languages.
> I would be worried that some parse error or non-obvious typo in the Markdown format
well I couldn't help this too much since it uses markdown-it under the hood to parse the markdown, i think it's safe as long as you don't write destructive shell script yourself..
> You may want to consider running the Node tasks in a separate subprocess instead of using `require-from-string` module in parent process.
will give this a try. also PR welcome xD
I'll keep an eye on the Github Issues and may make a PR.
I cant agree on your point though. While there is a place for custom build tools, its incredibly rare. And if you're in a situation where you actually need to build a custom build tool for your project, you should consider fixing the reason why you'd need that. Builds shouldn't need such a complicated process..
A markdown which is also a build file with specific rules on headings and first block quotes? High astonishment.
Literate programming without text semantics? Medium astonishment.
Declarative dependency tracking build tool, such as CMake? Low astonishment.
[1] https://en.wikipedia.org/wiki/Principle_of_least_astonishmen...
This is wrong in the first place.
I suppose Sphinx(Python) or equivalent in other languages already do this, but the ease of use of Markdown is lucrative.
In my case Python - the language already recognizes lines starting with # as comments. Goes on to check out the rest of the stuff.
Features of org mode that I use:
* Full editor support for the language you're writing -- syntax highlighting, structural editing, etc
* On-line evaluation of code blocks, with the results appearing after said code block
* Threading of data through multiple code blocks -- I can perform an SQL query and transparently pass the result to gnuplot for visualization -- emacs takes care of translating the intermediate data between formats
* Full noweb-style tangling of source
and many more.
I would love to write our tasks / build config out in org-mode, but running that on someone elses machine w/o Emacs, CI, etc. seems not highly supported.
A common workflow for me when prototyping something, and then I let it grow into a fullblown program, with org goes something like this:
* Main
This program will print out "Hello, world!".
#+NAME: main
#+BEGIN_SRC c :tangle hello.c :noweb yes
<<includes>>
int main(void) {
<<main-body>>
}
#+END_SRC
* Includes
- stdio :: this is included to get =printf=
- others :: if I had other includes I'd explain why here
#+NAME: includes
#+BEGIN_SRC c
#include <stdio.h>
#+END_SRC
* Main body
Maybe an explanation of the algorithm
#+NAME: main-body
#+BEGIN_SRC c
printf("Hello, world!\n");
#+END_SRC
Literate programming doesn't care about the order, I can put that main at the bottom or in the middle. This allows me to introduce program concepts in a logical fashion that is different from what the compiler wants or needs. This allows me to, for instance, group all data structures and even share code across them where this would be less feasible in straight C. References like the `<<main-body>>` can be shared by multiple code blocks.Obviously, as programmers, we want to minimize repetition. But sometimes a language forces us to repeat ourselves. If it gives us a way to include common source blocks, that's awesome (like you can make a header file called common.h that every one of your source files includes). But that's feasible in every language. Nor are the macro systems ideal in every case where it is technically feasible.
As I write the code, usually in one pane of tmux, I'll tangle it. Then in a separate pane (usually on the right) I'll execute the code. Or I may have something that monitors the files for changes and builds it automatically and runs tests.
EDIT: This is also an effective technique for developing an understanding of a new code base. Bring all the code into one big source block in a new org file (or whatever you use). Tangle it and make sure it's the same as the original (this process gets repeated a lot, make it a script).
Grab segments of the code and extract them into new blocks (with a properly named reference). I usually do this with large chunks (whole class declarations, struct declarations, or function definitions).
Document what the code does and its relation to other segments. Repeatedly extract segments until they're down to reasonable chunks (a 500 line function? It's probably worth going down to 10-50 smaller blocks covering each logical section).
But the ability to integrate code from any language into a document, and spit that same code out for execution, makes it a near ideal environment for me. I miss some features from IDEs doing this, but honestly it's not that big of a deal for me. I end up having to commit more to memory. Or write up my own tutorial/example section for things that I keep forgetting. You can have code blocks that don'
I can see the advantage of having a runnable readme, and documentation with the code. I guess it's sorta like a Zeppelin notebook.
Huh .. at first I though this project was kinda ridiculous, but I do like the concept for including a maid file in a project and people can get started right away, with sections available for auto installing the packages and running the program on a local user account.
It uses a specific renderer. The renderer adheres to a spec that defines code blocks.
For reference, "maid" as someone who cleans up a place is not seen as derogatory nor demeaning to everyone, as there are swaths of trademarks [1] registered using that term, and innumerable mobile maid services available in the U.S. which use that term in their company name.
Or maybe that comment was just a troll job.
[1] http://tmsearch.uspto.gov/bin/showfield?f=toc&state=4807%3Aw...
I can almost never detect this kind of stuff because it doesn't affect me directly and I'm sure the dev meant no ill-will, but once pointed out, I can see how projects named like this would get under people's skin.
"made, the MArkDown Executor"? :D It's pretty easy to be more inclusive.
Both of their purpose is to essentially help do stuff for you.