TE
TechEcho
Home24h TopNewestBestAskShowJobs
GitHubTwitter
Home

TechEcho

A tech news platform built with Next.js, providing global tech news and discussions.

GitHubTwitter

Home

HomeNewestBestAskShowJobs

Resources

HackerNews APIOriginal HackerNewsNext.js

© 2025 TechEcho. All rights reserved.

A Lisp REPL as my main shell

149 pointsby qazwse_over 4 years ago

10 comments

ssivarkover 4 years ago
It’s interesting to note that while no single idea is revolutionary, the design choices in putting together this bunch make for a particularly slick interface where the whole is much better than the usual shell.<p>PS: I look forward to trying this out! Since I don’t know much Common Lisp, are there particularly useful libraries that would make it easy to cover functionality commonly used through the shell? I’d love to see a tutorial with a compilation of examples. EDIT: Found some useful stuff in the CL cookbook (Eg. section on files &amp; directories) <a href="https:&#x2F;&#x2F;lispcookbook.github.io&#x2F;cl-cookbook&#x2F;" rel="nofollow">https:&#x2F;&#x2F;lispcookbook.github.io&#x2F;cl-cookbook&#x2F;</a>
评论 #26087628 未加载
评论 #26070630 未加载
dTalover 4 years ago
&gt;Terminals have no reason to continue to be used in my opinion. Note that this does not mean we shouldn’t use “textual” interfaces, quite the opposite: textual data is a bliss to manipulate. But we can very well manipulate text, along with other types of data, in something other than a terminal, that is faster, prettier, more powerful. (Graphical Emacs is one such example.)<p>I have recently switched to Jupyter&#x27;s qtconsole for my REPL needs - for me, it hits the sweet spot of supporting rich media and interaction without the overhead of running a full web browser stack. I could see it becoming the basis for a next-gen terminal.
评论 #26087639 未加载
junkeover 4 years ago
While not as extreme as what is demonstrated here, I integrate things in my environment with Lisp in a way that is similar to this. I run StumpWM too so I can grab the content of the current X selection and do actions from it (e.g. the content matches a JIRA ticket regex, open it, the text matches a filename, edit it (fun fact, anything can be a filename), etc.).<p>For processes, I wrote something that is not finished, not polished, but if anyone want to steal from it, go ahead:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;christophejunke&#x2F;pipeline" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;christophejunke&#x2F;pipeline</a><p>This allows to spawn processes or threads to pipeline input&#x2F;output, like done usually with | in shells<p><pre><code> (with-pipeline () (program &quot;ls&quot; (namestring (merge-pathnames &quot;bin&#x2F;&quot; (user-homedir-pathname)))) (program &quot;sed&quot; &quot;s&#x2F;a&#x2F;aaaa&#x2F;&quot;) (tee&#x2F;error) ;; &quot;tee&quot; and output a copy to error (program &quot;wc&quot; &quot;-c&quot;) #&#x27;read) </code></pre> <a href="https:&#x2F;&#x2F;github.com&#x2F;christophejunke&#x2F;pipeline&#x2F;blob&#x2F;master&#x2F;tests.lisp#L9" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;christophejunke&#x2F;pipeline&#x2F;blob&#x2F;master&#x2F;test...</a><p>The nmcli.lisp example starts an nmcli process and filters its output to build Lisp objects representing connections:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;christophejunke&#x2F;pipeline&#x2F;blob&#x2F;master&#x2F;nmcli.lisp#L52" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;christophejunke&#x2F;pipeline&#x2F;blob&#x2F;master&#x2F;nmcl...</a>
评论 #26087730 未加载
评论 #26075999 未加载
max_streeseover 4 years ago
I wonder what people think about Ammonite (<a href="https:&#x2F;&#x2F;ammonite.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;ammonite.io&#x2F;</a>)?<p>It&#x27;s not Lisp but Scala so may not be the authors language of choice however it can be used as a Shell: <a href="https:&#x2F;&#x2F;ammonite.io&#x2F;#Ammonite-Shell" rel="nofollow">https:&#x2F;&#x2F;ammonite.io&#x2F;#Ammonite-Shell</a><p>I am personally using it and compared to a classical shell like Bash it&#x27;s really nice for more structured data related tasks (exploring some API, checking some data, creating a bunch of PRs at once, ...).<p>It also makes use of Scala&#x27;s adjustable syntax and functional concepts so you basically get shell piping but in a strongly typed fashion (e.g. `ls.! |? (_.ext == &quot;txt&quot;) | (os.read)` would produce a list of strings representing the contents of all files ending in .txt of the current directory).<p>Also I am curious what people think of PowerShell which as of PowerShell Core is usable on all platforms as well.
评论 #26063382 未加载
评论 #26064497 未加载
评论 #26087716 未加载
skissaneover 4 years ago
&gt; Implement automatic ncurses detection to automatically start a “visual” program in a terminal, even when it’s not known in advance. Is it even possible?<p>There are a couple of techniques:<p>1) Check for use of certain escape sequences in the output.<p>2) Check PTY terminal modes using tcgetattr, especially for raw mode<p>I think combining (1) and (2) you could come up with some heuristics that would work 99% of the time, without hardcoding names of fullscreen apps or anything else like that.<p>(Really this isn&#x27;t &quot;ncurses detection&quot; per se, you can have a full-screen terminal app without using any curses library.)
评论 #26065404 未加载
marcodiegoover 4 years ago
I don&#x27;t get lisp. Actually I think I understand what people like about it. What I mean is that I don&#x27;t know exactly how to &quot;think in lisp&quot;. Is it like writing the AST instead of the text or describing what is needed instead of what needs to be done... I simply don&#x27;t get it.<p>Not sure if I&#x27;m the only one though.
评论 #26065008 未加载
评论 #26068871 未加载
1MachineElfover 4 years ago
You may be forced to use Scheme as as shell when encountering an error booting GuixSD. Back in 2016, support was apparently not good for the AMD bulldozer systems I was trying to install on. The systemd alternative they used, GNU shepherd, crashed on me, and left me in a Guile REPL.
jmercourisover 4 years ago
A very well done article! I wonder what an integration with a Python REPL might look like.
评论 #26062881 未加载
评论 #26068059 未加载
konjinover 4 years ago
Back at uni I ran an experimental lisp shell. A few notes of what was painful and what worked.<p>Outer most parens should be optional, if you&#x27;re running ls you don&#x27;t want to type (ls).<p>Grouping flags, files and options is difficult: ls -lh file could become (ls (h l) file) (ls (flags h l) (files file)) (ls -l -h file) (ls -lh file) none of the options are particularly good or lispy.<p>You need a full editor on the command line. Shells are designed for teletypes, lisps are designed for glass terminals.<p>All in all not I&#x27;m sure that an s-expression based system is the right fit for a low level interface to the computer. That said I did enjoy my experiments a lot more than I did using shells. Were I to try it again I would have it is a higher level language that compiles down to a shell.
评论 #26087756 未加载
ashkankianiover 4 years ago
&quot;rather novel paradigm&quot; is where you lost me. TempleOS&#x27;s integration with HolyC is more featureful than anything you&#x27;ve proposed and it was completed a few decades ago. The idea was surely older than that, too. I&#x27;m just pointing out a very well known case.<p>A bit late on the uptake, but welcome to the party of realizing that the shell is not be all end all of computing.