runtools / run Goto Github PK
View Code? Open in Web Editor NEW⚡The resource runtime
Home Page: https://run.tools
License: MIT License
⚡The resource runtime
Home Page: https://run.tools
License: MIT License
This is fork 2 of 2 from #2.
Quoting @mvila. The goal is to create...
a "resource runtime" allowing to implement resource methods in Bash.
For example:
{
"@runtime": "bash",
"@implementation": "./main.sh",
"compress": {
"@type": "method",
"@input": {
"source": {
"@type": "string",
"@position": 0
},
"destination": {
"@type": "string",
"@position": 1
}
}
},
"uncompress": {
}
}
Then, the implementation would be a bash script:
#!/bin/bash
compress ()
{
gzip -c $1 > $2
}
uncompress ()
{
# ...
}
A runtime for resources implemented in Bash is complicated,
and I am not sure that Bash can handle the whole resource specs.
I like the idea of machine readable interoperability, but for legacy reasons I think there should be a bash runtime so that, for instance, a 'bzip' resource could be created to wrap the bzip command line. If you feel like a challenge, try building a 'javac' or 'gcc' resource.
This is a repost of resdir/resdir#1, as I believe this is probably the more correct place.
Hiya, just gave run a go, ran (no pun intended) into an issue on Linux:
❯ run @registry
{ Error: EXDEV: cross-device link not permitted, rename '/tmp/8d44d3f1dc023f4de9ac635acc6eeb55' -> '/home/markus/.run/resdir-registry/resource-cache/resdir/registry-client/versions/0.1.27'
at Error (native)
at fs.renameSync (fs.js:811:18)
at /Users/mvila/Projects/resdir/public/packages/resource-fetcher/src/index.js:222:7
at next (native)
at step (/usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:221)
at _next (/usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:409)
at /usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:477
at /usr/local/lib/node_modules/run-cli/node_modules/@resdir/resource-fetcher/dist/node/cjs/index.js:36:97
at ResourceFetcher._saveCachedResourceVersion (/Users/mvila/Projects/resdir/public/packages/resource-fetcher/src/index.js:213:89)
at /Users/mvila/Projects/resdir/public/packages/resource-fetcher/src/index.js:90:23
errno: -18,
code: 'EXDEV',
syscall: 'rename',
path: '/tmp/8d44d3f1dc023f4de9ac635acc6eeb55',
dest: '/home/markus/.run/resdir-registry/resource-cache/resdir/registry-client/versions/0.1.27',
contextStack:
[ Resource {
'$defaultAutoBoxing': false,
'$defaultAutoUnboxing': false,
'_$bases': [],
'_$children': [],
'_$currentDirectory': '/home/markus',
'_$isInitializing': false,
'_$listeners': {},
'_$hasBeenInitialized': true } ] }
I don't really know much node, so maybe this is a known issue and my partition setup is at fault. But figured it can't hurt to log it...
This is fork 1 of 2 from #2. The goal is to provide a resource so that bash commands can be used to implement methods, such as this implementation for a compress
method powered by gzip
, implemented by calling out through the command line.
{
"compress": {
"@type": "method",
"@input": {
"source": {
"@type": "string",
"@position": 0
},
"destination": {
"@type": "string",
"@position": 1
}
},
"@run": "(@import shell/bash) run 'gzip -c ${source} > ${destination}'"
},
"uncompress": {
}
}
Plan of attack is that I will create a resource named robertfischer/bash
for @mvila to be review, and we will move that into script/bash
once it looks good.
I do most of my development in Haskell, which is a nontrivial environment to manage. I'm excited about the possibility of using Run resources to manage them, since the dominant alternative (the Nix package manager) gives me a sad.
There are two pieces that I think we would need for this: first, a resource for supporting stack builds; and second, a runtime resource that would execute a Haskell *.hs
file (via stack runghc
).
Two questions.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.