5 ms·
Show HN: Janetsh – A new system shell
- sdegutis 7y ago> A new system shell that uses the Janet[1] programming language Why have I never heard of Janet before? This ticks every single box so far on my Perfect Lisp Language (and possibly Perfect Language) check list, the language I've been looking for for years but couldn't find. [1] https://janet-lang.org https://janet-lang.org
- molteanu 7y agoHaha. I haven't heard of it either. I though that this was a toy project or something. Seems like it's real business. What don't you like about the other Lisps, like Common Lisp, for example? What boxes still remained unticked? Janet discussion: https://news.ycombinator.com/item?id=19179963 https://news.ycombinator.com/item?id=19179963
- andrewchambers 7y agoI know right? Tiny like lua, really extensible and flexible, fast start time, awesome :D.
- convolvatron 7y agoI have a project that uses free unparsed text with evaluated sexpressions mixed in. I understand that alot of people just dont like sexpressions...but otherwise is anyone really bothered by this style of allowing arbitrary junk at the top level?
- ljm 7y agoI think it’s fine, it’s like you’re saying that every expression is implicitly wrapped in a ‘()’ itself, so the syntax is redundant at the top level in a shell. Not sure I’d appreciate it outside of a shell.
- andrewchambers 7y agoYeah, the shell implicitly adds () in janetsh, but it doesn't do it for you when you are writing scripts.
- akhilcacharya 7y ago> while also supporting the things we love about sh. This is great! Are there any other shells like this? I like the idea of something backwards compatible with bash.
- 314 7y agoOilsh has focused more on backwards compatibility. This approach of adding a small functional language is interesting. The author seems to have done an elegant job with the syntax. Adding this to my list of things to download and play with.
- Spivak 7y agoEs shell is similar but in a less lispy, more bash style.
- rpwilcox 7y agoRash, the Racket Shell, does something similar to this: https://docs.racket-lang.org/rash/index.html https://docs.racket-lang.org/rash/index.html
- sciurus 7y agoxonsh does the same thing for sh and python. http://xonsh.org/ http://xonsh.org/
- codetrotter 7y agoWhy did they subtract one from (length all-files) in the gif?
- 314 7y agoThere is a blank line from find captured in the array. I think it is to remove it from the count.
- andrewchambers 7y agoThat is right, I also just wanted to show you can do some basic calculation easily inline.
- iBelieve 7y agoLooks like the last item in the all-files array is an empty string - maybe that's why? Either that, or the current directory (".") might be included as the first element.
- codetrotter 7y agoIf . was included then .. almost certainly would be as well. But an empty string at the end like you say and as explained by the sibling comment makes sense.
- andrewchambers 7y agoThe empty line after the split was the reason, also to demonstrate how to do arithmetic.
- teilo 7y agoDoes it use the flow of time as a lotion?
- jedieaston 7y agoHow’s the cactus compatibility?
- lintuxvi 7y agoWat?
- smsx 7y agoI believe these are references to The Good Place[1], although I don't usually expect to see pop-culture references as top level comments on HN. [1]: https://en.wikipedia.org/wiki/The_Good_Place https://en.wikipedia.org/wiki/The_Good_Place
- Crestwave 7y agoTo be fair, it is named after the character from that show. It doesn't really add much to the discussion to post references here, though.
- kissgyorgy 7y agoyou lost me on the second bracket :D
- andrewchambers 7y agolisp may be as ugly as bash, but it much more principled and composable.
- hestefisk 7y agoVery neat. Will give this a spin and perhaps a port for FreeBSD if interested?
- andrewchambers 7y agoIf you are up for it, currently it may be a tad difficult to get running, but I am certainly willing to provide assistance. In the future I hope it will support mac/freebsd/openbsd/linux and be easy to install and use.