Giter VIP home page Giter VIP logo

Comments (3)

ysbaddaden avatar ysbaddaden commented on May 26, 2024 1

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.

straight-shoota avatar straight-shoota commented on May 26, 2024

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

private def exit_code_command(code)
).

from crystal.

dsisnero avatar dsisnero commented on May 26, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.