<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom"><channel><title>Hacker News: cosmos0072</title><link>https://news.ycombinator.com/user?id=cosmos0072</link><description>Hacker News RSS</description><docs>https://hnrss.org/</docs><generator>hnrss v2.1.1</generator><lastBuildDate>Thu, 16 Apr 2026 21:12:06 +0000</lastBuildDate><atom:link href="https://hnrss.org/user?id=cosmos0072" rel="self" type="application/rss+xml"></atom:link><item><title><![CDATA[New comment by cosmos0072 in "Schemesh – Unix shell and Lisp REPL, now with structured pipelines"]]></title><description><![CDATA[
<p>> I am not familiar with the Scheme ecosystem but see you are implementing a lot within your shell (http client, sqlite support) what is great.<p>Yes. Initially, I wanted to integrate http client, sqlite client etc. directly in the main shell executable.<p>This turned out to be impractical, because it introduces compile-time dependencies on external libraries, and because any bug, vulnerability or crash in the C code would bring down the whole shell.<p>My current solution is to have separate C programs (currently `http` and `parse_sqlite`) that are not compiled by default: you need to run `make utils` to build them.<p>> But does that mean I can produce a Schemesh binary that will include Chez Scheme and run my script on any Linux or FreeBSD host?<p>Yes, exactly. Schemesh is a C program that includes both  Chez Scheme REPL and shell features.</p>
]]></description><pubDate>Mon, 16 Mar 2026 21:00:01 +0000</pubDate><link>https://news.ycombinator.com/item?id=47404800</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=47404800</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47404800</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Schemesh – Unix shell and Lisp REPL, now with structured pipelines"]]></title><description><![CDATA[
<p>Yes, they are similar at first glance. As I wrote:<p>> If you know nushell, they will feel familiar as they are inspired by it - the implementation is fully independent, though.<p>Looking deeper, there are two main differences:<p>- Nushell structured pipelines are an internal construct, and <i>only</i> work with nushell builtins. Schemesh uses actual POSIX pipes, which allows to also insert executables in the pipelines.<p>- schemesh also allows to insert arbitrary Scheme code in the pipelines. Nushell does too, in a sense: you have to write nushell language though</p>
]]></description><pubDate>Mon, 16 Mar 2026 17:16:25 +0000</pubDate><link>https://news.ycombinator.com/item?id=47401856</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=47401856</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47401856</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Schemesh – Unix shell and Lisp REPL, now with structured pipelines"]]></title><description><![CDATA[
<p>First stable release appeared on HN one year ago: <a href="https://news.ycombinator.com/item?id=43061183">https://news.ycombinator.com/item?id=43061183</a>
Thanks for all the feedback!<p>Today, version 1.0.0 adds structured pipelines:
a mechanism to exchange (almost) arbitrary objects via POSIX pipes, and transform them via external programs, shell builtins or Scheme code.<p>Example:<p><pre><code>  dir /proc | where name -starts k | sort-by modified
</code></pre>
possible output:<p><pre><code>  ┌───────────┬────┬───────────────┬────────┐
  │   name    │type│     size      │modified│
  ├───────────┼────┼───────────────┼────────┤
  │kcore      │file│140737471590400│09:32:44│
  │kmsg       │file│              0│09:32:49│
  │kallsyms   │file│              0│09:32:50│
  │kpageflags │file│              0│10:42:53│
  │keys       │file│              0│10:42:53│
  │kpagecount │file│              0│10:42:53│
  │key-users  │file│              0│10:42:53│
  │kpagecgroup│file│              0│10:42:53│
  └───────────┴────┴───────────────┴────────┘
</code></pre>
Another example:<p><pre><code>  ip -j route | select dst dev prefsrc | to json1
</code></pre>
possible output:<p><pre><code>  [{"dst":"default","dev":"eth0"},
  {"dst":"192.168.0.0/24","dev":"eth0","prefsrc":"192.168.0.2"}]
</code></pre>
Internally, objects are serialized before writing them to a pipe - by default as NDJSON, but it can be set manually -
and deserialized when reading them from a pipe.<p>This allows arbitrary transformations at each pipeline step:
filtering, choosing a subset of the fields, sorting with user-specified criteria, etc.
And each step can be an executable program, a shell builtin or Scheme code.<p>If you know nushell, they will feel familiar as they are inspired by it - the implementation is fully independent, though.</p>
]]></description><pubDate>Mon, 16 Mar 2026 12:03:42 +0000</pubDate><link>https://news.ycombinator.com/item?id=47397844</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=47397844</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47397844</guid></item><item><title><![CDATA[Schemesh – Unix shell and Lisp REPL, now with structured pipelines]]></title><description><![CDATA[
<p>Article URL: <a href="https://github.com/cosmos72/schemesh/blob/main/README.md">https://github.com/cosmos72/schemesh/blob/main/README.md</a></p>
<p>Comments URL: <a href="https://news.ycombinator.com/item?id=47397840">https://news.ycombinator.com/item?id=47397840</a></p>
<p>Points: 30</p>
<p># Comments: 5</p>
]]></description><pubDate>Mon, 16 Mar 2026 12:03:07 +0000</pubDate><link>https://github.com/cosmos72/schemesh/blob/main/README.md</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=47397840</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47397840</guid></item><item><title><![CDATA[New comment by cosmos0072 in "I traced $2B in grants and 45 states' lobbying behind age‑verification bills"]]></title><description><![CDATA[
<p>Parents already have a lot of control on children' education.<p>Examples: most children believe in the same religion as their parents, and can visit friends and places only if/when allowed by their parents.<p>This is simply extending the same level of control to the internet.<p>Government-mandated restrictions are completely another level.</p>
]]></description><pubDate>Fri, 13 Mar 2026 11:34:50 +0000</pubDate><link>https://news.ycombinator.com/item?id=47363052</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=47363052</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47363052</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Meta Platforms: Lobbying, dark money, and the App Store Accountability Act"]]></title><description><![CDATA[
<p>I am from EU, and contrary to age verification laws in general.<p>My stance is that if somebody is a minor, his/her/their parents/tutors/legal guardian are responsible for what they can/cannot do online, and that the mechanism to enforce that is parental control on devices.<p>Having said that, open-source zero-knowledge proofs are infinitely less evil (I refuse to say "better") than commercial cloud-based age monitoring baked into every OS</p>
]]></description><pubDate>Fri, 13 Mar 2026 11:22:38 +0000</pubDate><link>https://news.ycombinator.com/item?id=47362932</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=47362932</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=47362932</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Scripts I wrote that I use all the time"]]></title><description><![CDATA[
<p>I need this *so* often that I programmed my shell to execute 'cd ..' every time I press KP/ i.e. '/' on the keypad, without having to hit Return.<p>Other single-key bindings I use often are:<p>KP* executes 'ls'<p>KP- executes 'cd -'<p>KP+ executes 'make -j `nproc`'</p>
]]></description><pubDate>Wed, 22 Oct 2025 21:25:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=45675353</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=45675353</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45675353</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Memory access is O(N^[1/3])"]]></title><description><![CDATA[
<p>The math looks suspicious to me, or at least how it is presented.<p>If, as stated, accessing one register requires ~0.3 ns and available registers sum up to ~2560 B,
while accessing RAM requires ~80 ns and available RAM is ~32 GiB,
then it means that memory access <i>time</i> is O(N^1/3) where N is the memory size.<p>Thus accessing the <i>whole</i> N bytes of memory of a certain kind (registers, or L1/L2/L3 cache, or RAM)
takes N * O(N^1/3) = O(N^4/3).<p>One could argue that the title "Memory access is O(N^1/3)" refers to memory access <i>time</i>,
but that contradicts the very article's body,
which explains in detail "in 2x time you can access 8x as much memory" both in text and with a diagram.<p>Such statement would require that accessing the <i>whole</i> N bytes of memory of a certain kind requires O(N^1/3) time,
while the measurements themselves produce a very different estimate:
accessing the <i>whole</i> N bytes of memory of a certain kind requires O(N^4/3) time, <i>not</i> O(N^1/3)</p>
]]></description><pubDate>Wed, 08 Oct 2025 18:27:23 +0000</pubDate><link>https://news.ycombinator.com/item?id=45519119</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=45519119</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45519119</guid></item><item><title><![CDATA[New comment by cosmos0072 in "The subjective experience of coding in different programming languages (2023)"]]></title><description><![CDATA[
<p>For me it's more about "feeling" badly written code, as if it stinks and is unpleasant to look at,
and conversely enjoying nicely written one, and seeing its elegance and beauty.<p>Especially when I have to familiarize with code written by someone else, I usually start by "cleaning" it - small refactorings such as splitting overlong functions and simplifying expressions, that are trivial to prove as correct even without a deep knowledge of the code purpose.<p>Only when the code looks sufficiently clean and familiar, I start adding the requested new features</p>
]]></description><pubDate>Wed, 10 Sep 2025 13:19:36 +0000</pubDate><link>https://news.ycombinator.com/item?id=45197212</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=45197212</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=45197212</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Customizing Lisp REPLs"]]></title><description><![CDATA[
<p>> So, people who use native REPLs, what do you do with them?<p>In my case, I use my interactive shell <a href="https://github.com/cosmos72/schemesh" rel="nofollow">https://github.com/cosmos72/schemesh</a> every day as login shell.<p>You can look at it as heavily customized Scheme REPL, where everything <i>not</i> inside parentheses is parsed and executed as shell syntax,
and everything <i>inside</i> parentheses is parsed and executed as Scheme syntax.<p>Having arithmetic and procedure definition within the login shell definitely feels liberating, at least to me</p>
]]></description><pubDate>Wed, 20 Aug 2025 12:07:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=44961116</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=44961116</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44961116</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Twin – A Textmode WINdow Environment"]]></title><description><![CDATA[
<p>I tried compiling <a href="https://github.com/panzi/ansi-img">https://github.com/panzi/ansi-img</a> and running it inside the truecolor branch of twin, i.e. <a href="https://github.com/cosmos72/twin/tree/truecolor">https://github.com/cosmos72/twin/tree/truecolor</a>
and it correctly displayed an example JPG I tried - no artefacts, and terminal remained responsive.<p>As I wrote above, I am debugging it and fixing some known issues, thus truecolor support is not yet in the default branch</p>
]]></description><pubDate>Sat, 21 Jun 2025 15:48:59 +0000</pubDate><link>https://news.ycombinator.com/item?id=44338443</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=44338443</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44338443</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Twin – A Textmode WINdow Environment"]]></title><description><![CDATA[
<p>You can choose the font with `twin --hs=X11,font=X11FONTNAME`
or `twin --hw=xft,font=TRUETYPEFONTNAME`<p>I will have a look too, the terminal should not crash or stop being responsive</p>
]]></description><pubDate>Tue, 17 Jun 2025 08:36:22 +0000</pubDate><link>https://news.ycombinator.com/item?id=44296915</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=44296915</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44296915</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Twin – A Textmode WINdow Environment"]]></title><description><![CDATA[
<p>If you mean the Unicode glyphs listed at <a href="https://en.m.wikipedia.org/wiki/Block_Elements" rel="nofollow">https://en.m.wikipedia.org/wiki/Block_Elements</a>
they are supported - you just need a display driver that can render them.
For example, `twin --hw=xft` (it's the default) or `twin --hw=X11`, both with a font that contains them</p>
]]></description><pubDate>Mon, 16 Jun 2025 14:32:24 +0000</pubDate><link>https://news.ycombinator.com/item?id=44289927</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=44289927</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44289927</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Twin – A Textmode WINdow Environment"]]></title><description><![CDATA[
<p>Yep, I am well aware of the `;` vs `:` confusion in both 256 color and 24-bit color control sequences.<p>Short of hand-coding "which terminal supports which variant" I do not know any standard mechanism to detect that (beyond the well-known $TERM=...-256color and $COLORTERM=truecolor or $COLORTERM=24bit)<p>I guess I'll have to add command line options to choose among the variants 1...7 you helpfully listed above.<p>My main use it to render twin directly on X11, which avoids all these issues, and while rendering inside another terminal is important and is not going away, I am OK with a few minor color-related limitations (note: limitations, not bugs) in such setup, especially if the other terminal does not follow the relevant standards</p>
]]></description><pubDate>Mon, 16 Jun 2025 14:16:46 +0000</pubDate><link>https://news.ycombinator.com/item?id=44289727</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=44289727</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44289727</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Twin – A Textmode WINdow Environment"]]></title><description><![CDATA[
<p>Author here :)<p>I've been using Twin as my everyday terminal emulator and terminal multiplexer since ~2000,
slowly adding features as my free time - and other interests - allowed.<p>As someone pointed out, the look-and-feel reminds Borland Turbo Vision.
The reason is simple: I started writing in in the early '90s on DOS with a Borland C compiler, and I used the Borland Turbo Vision look-and-feel as a visual guideline (never actually looked at the code, though).<p>The porting to linux happened in 1999 (it was basically dormant before that),
and Unicode support was progressively added around 2015-2016 (initially UCS-2 i.e. only the lowest 64k codepoints, then full UTF-32 internally, with terminal emulator accepting UTF-8). There are still some missing features, most notably: no grapheme clusters, no fullwidth (asian etc.) support, no right-to-left support.<p>Right now I'm adding truecolor support (see <a href="https://github.com/cosmos72/twin/tree/truecolor">https://github.com/cosmos72/twin/tree/truecolor</a>) - it's basically finished, I'm ironing out some remaining bugs, and thinking whether wire compatibility with older versions is worth adding.<p>And yes, documentation has been stalled for a very long time.<p>Retrospectively, I should have switched C -> C++ much earlier: lots of ugly preprocessor macros accumulated over time, and while I rewrote the C widget hierarchy as C++ classes, several warts remain.</p>
]]></description><pubDate>Mon, 16 Jun 2025 12:05:21 +0000</pubDate><link>https://news.ycombinator.com/item?id=44288776</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=44288776</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=44288776</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Faster interpreters in Go: Catching up with C++"]]></title><description><![CDATA[
<p>For optimal speed, you should move as much code as possible <i>outside</i> the closures.<p>In particular, you should do the `switch op` at <a href="https://github.com/skx/simple-vm/blob/b3917aef0bd6c4178eed0c2be3cd0ab26b5be803/main.go#L81">https://github.com/skx/simple-vm/blob/b3917aef0bd6c4178eed0c...</a>
outside the closure, and create a different, specialised closure for each case. Otherwise the "fast interpreter" may be almost as slow as a vanilla AST walker.</p>
]]></description><pubDate>Sun, 06 Apr 2025 19:03:20 +0000</pubDate><link>https://news.ycombinator.com/item?id=43604018</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=43604018</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43604018</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Faster interpreters in Go: Catching up with C++"]]></title><description><![CDATA[
<p>The core idea is simple:
do a type analysis on each expression you want to "compile" to a closure, and instantiate the correct closure for each type combination.<p>Here is a pseudocode example, adapted from gomacro sources:<p><a href="https://gist.github.com/cosmos72/f971c172e71d08030f92a1fc5fa52735" rel="nofollow">https://gist.github.com/cosmos72/f971c172e71d08030f92a1fc5fa...</a><p>This works best for "compiling" statically typed languages, and while much faster than an AST interpreter, the "tree of closures" above is still ~10 times slower that natively compiled code. And it's usually also slower than JIT-compiled code</p>
]]></description><pubDate>Sun, 06 Apr 2025 10:30:56 +0000</pubDate><link>https://news.ycombinator.com/item?id=43600398</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=43600398</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43600398</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Faster interpreters in Go: Catching up with C++"]]></title><description><![CDATA[
<p>Compiling an expression to a tree of closures, and a list of statements to a slice of closures, is exactly how I optimized [gomacro](<a href="https://github.com/cosmos72/gomacro">https://github.com/cosmos72/gomacro</a>)  my Go interpreter written in go.<p>There are more tricks available there, as for example unrolling the loop that calls the list of closures, and having a `nop` closure that is executed when there's nothing to run but execution is not yet at the end of the the unrolled loop.</p>
]]></description><pubDate>Sat, 05 Apr 2025 20:19:47 +0000</pubDate><link>https://news.ycombinator.com/item?id=43596505</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=43596505</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43596505</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Schemesh: Fusion between Unix shell and Lisp REPL"]]></title><description><![CDATA[
<p>You mean a command or builtin `(` inside a traditional shell as bash or zsh?<p>It would be quite limited:<p>internal status would not persist between invocations,<p>and it would only be able to exchange unstructured data (a stream of bytes) with the shell</p>
]]></description><pubDate>Fri, 21 Feb 2025 12:30:57 +0000</pubDate><link>https://news.ycombinator.com/item?id=43126734</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=43126734</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43126734</guid></item><item><title><![CDATA[New comment by cosmos0072 in "Schemesh: Fusion between Unix shell and Lisp REPL"]]></title><description><![CDATA[
<p>That's true.<p>In shells, "test" and "[" are often used after "if", as for example<p><pre><code>  if test -f "some_file"
    do_something
  fi

  if [ "$FOO" != "" ]
    do_something_else
  fi
</code></pre>
Schemesh does not have a shell builtin "if", you switch to Scheme for that:<p><pre><code>  (if (file-regular? "some_file')
    (sh-run {do_something}))
</code></pre>
Thus the need for "test" and its alias "[" is reduced.<p>Also, "test" implements a mini-language full of one-letter operators: `-f FILE` `COND1 -a COND2` `COND1 -o COND2` etc.<p>I really don't miss it, as I find the equivalent in Scheme to be more readable - and of course more general<p><pre><code>  (file-regular? "FILE")
  (and COND1 COND2)
  (or COND1 COND2)
</code></pre>
etc.</p>
]]></description><pubDate>Mon, 17 Feb 2025 07:16:11 +0000</pubDate><link>https://news.ycombinator.com/item?id=43076114</link><dc:creator>cosmos0072</dc:creator><comments>https://news.ycombinator.com/item?id=43076114</comments><guid isPermaLink="false">https://news.ycombinator.com/item?id=43076114</guid></item></channel></rss>