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)
- It's possible to create a Hash with duplicate keys using missing key block and update method HOT 2
- Formatter changes semantics when call is followed by space and `()` HOT 3
- Semantics of `Process.exec` on Windows
- When monkeypatching with `previous_def` with namespaced types in the method signature, that namespace seems to be missed
- `Hash#put_if_absent` can put duplicate keys
- `String#byte_index(Regex)`
- Allow space in cookie value for Set-Cookie header HOT 4
- `Enumerable(T)#to_a` regression with interface type HOT 5
- `previous_def` does not work with top-level funs HOT 1
- Macro blocks bleed scope HOT 1
- Incorrect formatting of multi-line macro expression with comment as first line
- Abstract def overload with free var
- Can't use Atomic with Int128 or UInt128 HOT 3
- When use crystal i with `wezterm`(a popular linux terminal), Alt + TAB will output controller character like [O[I [O[I into terminal. HOT 3
- Audit GH labels HOT 1
- Discrepancy in `String#rindex` for out-of-bound search offsets
- Invalid memory access when dynamically extending type
- invalid instruction when referencing overridden private interface types
- Add method to get an array of modules included in a type
- Allow iterating over defined modules
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.