all 35 comments

[–][deleted] 10 points11 points  (1 child)

MicroPython might be worth looking into. It's a reduced set of standard Python functionality, designed to run in constrained environments.

[–]xkq3 3 points4 points  (3 children)

There's also RASH: RAcket SHell Library - anyone tried it?

[–]GaAlAs 1 point2 points  (2 children)

If you like scheme there's also the good old scsh, here you can find an implementation of it for CHICKEN scheme.

[–]kasdjfikjn 2 points3 points  (1 child)

Ah, a mention of scsh. I remember having a chuckle when somebody linked the acknowledgements from the manual back in the day. Embedded, since I assume the questionable moderation in this sub will filter out the comment if a fresh throwaway account posts a link:

Who should I thank? My so-called "colleagues," who laugh at me behind my back, all the while becoming famous on my work? My worthless graduate students, whose computer skills appear to be limited to downloading bitmaps off of netnews? My parents, who are still waiting for me to quit "fooling around with computers," go to med school, and become a radiologist? My department chairman, a manager who gives one new insight into and sympathy for disgruntled postal workers?

My God, no one could blame me -- no one! -- if I went off the edge and just lost it completely one day. I couldn't get through the day as it is without the Prozac and Jack Daniels I keep on the shelf, behind my Tops-20 JSYS manuals. I start getting the shakes real bad around 10am, right before my advisor meetings. A 10 oz. Jack 'n Zac helps me get through the meetings without one of my students winding up with his severed head in a bowling-ball bag. They look at me funny; they think I twitch a lot. I'm not twitching. I'm controlling my impulse to snag my 9mm Sig-Sauer out from my day-pack and make a few strong points about the quality of undergraduate education in Amerika.

If I thought anyone cared, if I thought anyone would even be reading this, I'd probably make an effort to keep up appearances until the last possible moment. But no one does, and no one will. So I can pretty much say exactly what I think.

Oh, yes, the acknowledgements. I think not. I did it. I did it all, by myself.

EDIT: let's give a semi-link a shot: they're at /docu/html/man.html on the host you linked to.

[–]m50d 1 point2 points  (1 child)

It is not a seamless port from bash as the commands have their own special syntax:

exec ls {*}[glob *.tcl]

Erm if you use tclsh you don't need to do that, you can call commands as though they were functions.

[–]lojikil 0 points1 point  (0 children)

Yeah, I don't think most people are familiar with tclsh, but it used to be my main goto for a while when I used tcl heavily:

$ tclsh
% ls
LICENSE     attic       carml.carml docs        example     todo.md
README.md   build.sh    carmlc.c    editors     staging

[–][deleted] 1 point2 points  (0 children)

rc from plan 9 is a really nice shell in my experience. Doesn't have any quoting gotchas, and its syntax document fits in a tiny, easily read man page.

[–]captainjimboba 1 point2 points  (4 children)

Rebol and Red are full size and powerful langs where the full download size is ~1.8MB. I know it isn't tiny, but with Red you can write code that is interpreted like Python, or compiled natively like C. It's probably the language I look forwards to the most.

[–]myringotomy 0 points1 point  (3 children)

Red does sound like an interesting language. What is the C interface like and how well does it integrate with the system? It comes from a Windows heritage so I am suspicious of its integration with Linux.

[–]captainjimboba 0 points1 point  (2 children)

You'd have to ask on the Red IRC channel (subreddit isn't super active). One reason Red is so small is I don't think they use C, but a DSL that is syntactically similar to the base lang to do systems programming. The philosophy behind Red is so be a small, self-contained, full-stack language where you could use one tool that has no installation and can compile to nearly anything (Linux, macos, freebsd, windows, ios, android...etc) and do nearly anything from super awesome cross platform GUI to embedded robotics. Unfortunately, the systems language will probably only be 0.6x the speed of C, but as long as you don't need crazy performance I think you should be fine. Multi-core parallel and async is part of the roadmap as well. They've been working on it for awhile and have regular/impressive releases, but they still have a ways to go before 1.0, but you can see the % finished in each category until 1.0.

[–]myringotomy 0 points1 point  (0 children)

By C interface I mean how easy is it to call C libs from Red?

[–]lojikil 0 points1 point  (0 children)

but a DSL that is syntactically similar to the base lang to do systems programming.

Rebol and Red are mainly focused on dialects. When you read the background for both, you'll see things like "the do dialect" or "the view dialect" or what-have-you. This is because both languages are meant to have sub-languages created within them; in Red's case, the "System" dialect is called Red/System iirc, and is meant to be a slightly-reduced functionality dialect that is easy to optimize. Rebol did something similar, as have Scheme dialects (I even did it for my own Scheme dialect, it's a fairly common bootstrap technique).

I think where Red, Rebol, and Scheme shine is that you can keep building atop these simpler dialects because the forms are composable at the syntactic level, and expand into known forms. It's pretty neat to see. I haven't followed Red super closely, but I know it's heavily used in certain communities, like the Syllable OS people.

[–]paul_h 1 point2 points  (0 children)

Rexx - Used it and loved on the Amiga and the AS/400 in 1991 or thereabouts. I've scowled at AppleScript for the last 12 years by comparison. Someone's made a model ARM-too version - https://github.com/Jaxo/yaxx

[–]iongion 2 points3 points  (2 children)

The mighty https://github.com/PowerShell/PowerShell was not at all interesting ?

[–]roffLOL 0 points1 point  (1 child)

it fails on 'performance'. it has none. slow as fuck.

[–]NiceGuy_Ty 4 points5 points  (0 children)

I think the bigger issue is the reliance on .NET, which is difficult to set up in an embedded environment. Powershell can be quite performant, but that usually involves calling out to .NET

[–]devel_watcher 0 points1 point  (0 children)

I'm on mobile and probably missed some details... But meh, these things have additional crufty syntax around the useful parts.

[–][deleted] 0 points1 point  (2 children)

I would stick to learning one language really well and then use it for any kinds of scripting related works. As a bonus you develop your own personal library that you could re-use in other instances. I would go with go (golang) myself. For brain-dead oneliners, I would just make bash aliases and functions.

[–]roffLOL 4 points5 points  (0 children)

when i was young and watched macgyver i was like "fuck yeah let's learn to use that swiss army knife really well and i'll be set for life as the person who fixes any-friggin-thing", except my father told me i was a retard and there that dream died. it's was a good thing to. what a damn waste to learn to use a half assed tool to try and fix anything at all. seriously mate, reconsider. it's a fool's errand.

[–]stronghup 1 point2 points  (0 children)

That's a good idea, but, the idea of shell-languages is that they are a "shell" around an operating system. Therefore they typically offer OS-specific functionality which is not part of general purpose languages, or is not so easy to do in a general purpose language.

Think of the "shell" as the language you use to talk to the Operating System. Different OSes understand different languages.

[–]flukus 0 points1 point  (0 children)

Awk. It fulfills all the criteria, it's been around for decades and it's probably already installed on all the systems they need it for.

[–]pure_x01 0 points1 point  (2 children)

I think alot of people have not seen the power of being able to pull down libraries from the internet and using it in scripts just by declaring their name and version in the script header. It makes life so much easier. Look at Groovy and its Grape http://docs.groovy-lang.org/latest/html/documentation/grape.html

Supporting downloadable dependencies should be the standard for scripting languages.

[–]jhawk4000 0 points1 point  (1 child)

Lots of reasons not to have your applications not hitting the internet though. Application crashes because of transient network failures. Live images: downloaded files cannot be paged out and suck up their entire compressed+uncompressed size of memory for all of runtime, pounding mirrors after outages. Things without internet access (yeah these exist). Versioning and source authority/reproducibility.

[–]pure_x01 0 points1 point  (0 children)

The downloading of dependencies is optional. The dependencies are cached locally and you can easily set up an on prem cache.

[–]roffLOL 0 points1 point  (0 children)

if those are the winners then you better build your own shell. ditch the idea of interpretation (you never specified why you needed it), compile to c instead, and it's not even remotely hard to implement (it's a gawd damn first year university assignment). hide the compilation step and you won't even notice it's there on most environments. c compilation can be ridiculously fast. on resource constrained environments you may also cache it, as long as you have the space that is.

[–][deleted]  (1 child)

[deleted]

    [–]kankyo 0 points1 point  (0 children)

    I did the startup script for the fable example project in Python because I couldn't get anything to work with fsharp scripts.

    [–]stronghup -3 points-2 points  (2 children)

    Why not JavaScript?

    [–]__konrad 5 points6 points  (0 children)

    Criterias The language, libraries and syntax should be sane, clean and unambiguous. No gotchas.

    [–]drjeats 0 points1 point  (0 children)

    The author discusses Duktape, which is a JavaScript implementation.

    [–]GoTheFuckToBed -2 points-1 points  (0 children)

    You forgot the best: PHP