Comments (3)
The way it works in Ruby is through a trick (-run
=> require "un"
) then ARGV is made available for the script to interpret. I'm afraid that would be very slow and inefficient in Crystal since it'd have to (re)compile an executable on each and every call.
find-llvm-config
doesn't just build on top of a few commands (command
, cat
, dirname
and printf
) it also involves control-flow, variables, environment variables, ..., in other words: a programming language of sort.
It could be interesting to have a nanoshell
shard that would be compiled once and install itself as bin/nsh
to expose some portable commands, but... that still wouldn't be portable, unless it also implements an interpreter.
from crystal.
Oh, I didn't know about un.rb
. Looks interesting, like a mini busybox with a few selected commands.
I do not see how this would be useful for the Crystal compiler, though. With a small scope such as un.rb
it would be by far insufficient for implementing relatively straightforward scripts such as find-llvm-config
. And with more extensions to make it sufficient for more complex use cases, it'll end up being a complete shell and core utils implementation. That's most certainly out of scope for this project.
I could see some usefulnes for this as an internal tool for stdlib specs to replace a couple of platform-specific test helpers (such as
crystal/spec/std/process_spec.cr
Line 8 in 15c66d0
from crystal.
most shard builds I have seen use make with simple cmds like mkdir -p or cp . This will also help those shards be installable on windows
from crystal.
Related Issues (20)
- Loc pragma directly after `def` makes parser skip token
- crystal tool format doesn't work within nested macros
- Range#size returns an Union instead of an Int32 HOT 9
- Inconsistent behaviour regarding line break requirement in method definition HOT 1
- `Module validation failed` with proc in recursive def HOT 3
- Crystal REPL instantly executes statement with intertwined heredoc HOT 1
- FormData part.body.read does not fill buffer HOT 3
- `Hash#rehash` removes `@first` elements from hash
- Add API for `Base64.encode` / `Base64.decode` with an `IO` as the source HOT 3
- Add methods for filling a buffer from an IO greedily/lazily HOT 5
- Enable `ameba` in this repo HOT 19
- formatter cause syntax error. HOT 2
- `Crypto::Subtle.constant_time_compare` does not work with `StaticArray` / Cannot overwrite `StaticArray` variable HOT 2
- Parser failure on argument list with trailing comma HOT 7
- RFC: Tracing HOT 8
- `Crystal::System::User#from_*?` et al. don't work if required buffer size greater than initial buffer size HOT 1
- If any system user entry exceeds `GETPW_R_SIZE_MAX`, retreiving any user is impossible HOT 2
- `IO#same_content?` returns `true` if `stream1` is a prefix of `stream2` HOT 1
- `docs_main.cr` is a mess HOT 1
- Interpreter Error: can't cast Pointer(Void) to (Pointer(Void) | String)
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from crystal.