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.

Magritte: A Language for Pipe-Based Programming [pdf]

114 pointsby selfover 5 years ago

16 comments

akavelover 5 years ago
I must make a mandatory fanboi shoutout to: <a href="https:&#x2F;&#x2F;luna-lang.org" rel="nofollow">https:&#x2F;&#x2F;luna-lang.org</a>
评论 #20855966 未加载
评论 #20856141 未加载
评论 #20854436 未加载
lioetersover 5 years ago
In this linked document for Magritte, it describes its pipeline operator in a section called &quot;Syntax Design - Linear Composition: Why Not Lisp?&quot;.<p><i>..The problem is the prefix-only calling convention that requires a back-and-forth movement of the cursor, and causes the expression to expand leftwards, opposite of the direction of the user’s typing.</i><p><i>While some languages have some support for linear composition using operators such as Clojure’s arrow macros or OCaml’s |&gt; operator, the integration of these macros with the underlying subsystem is shallow.</i><p>I question this last statement.<p>Just this weekend I was reading about Hy&#x27;s (based on Clojure&#x27;s) threading macros:<p>&quot;Threading macros, also known as arrow macros, convert nested function calls into a linear flow of function calls&quot;<p><i>-&gt; (or the threading macro) is used to avoid nesting of expressions. The threading macro inserts each expression into the next expression’s first argument place.</i><p><i>-&gt;&gt; (or the threading tail macro) is similar to the threading macro, but instead of inserting each expression into the next expression’s first argument, it appends it as the last argument.</i><p>At least to me this seems far from &quot;shallow&quot; and even more useful&#x2F;flexible than the pipeline operator.
评论 #20857325 未加载
chubotover 5 years ago
This looks cool! I linked it on my wiki page of alternative shells:<p><a href="https:&#x2F;&#x2F;github.com&#x2F;oilshell&#x2F;oil&#x2F;wiki&#x2F;ExternalResources" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;oilshell&#x2F;oil&#x2F;wiki&#x2F;ExternalResources</a><p>(which is cited on the first page of the thesis!)<p>I hope that Oil can a lot of these things in a backward compatible way, but I still have to read it and understand it more.
评论 #20855655 未加载
jpfedover 5 years ago
The twist here is that this language doesn&#x27;t use actual pipes; it just creates representations of pipes that can be used by a different interpreter.
评论 #20854557 未加载
compressedgasover 5 years ago
&gt; The implementation is written in Ruby, and the source code is publicly available at <a href="https:&#x2F;&#x2F;github.com&#x2F;prg‑titech&#x2F;magritte" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;prg‑titech&#x2F;magritte</a>.
评论 #20856253 未加载
guicho271828over 5 years ago
<p><pre><code> 1.4 The Desktop-Scripting Problem Related to the shell-language design problem is the desktop-scripting problem: How should unrelated programs written in different languages be integrated—especially in an ad-hoc manner in a desktop environment? Such a task can require a large amount of glue code, written by users who are unfamiliar with the inner workings of the programs they are using. Notable attempts at solving the desktop-scripting prob- lem include the TCL language [Ousterhout, 1989] and Guile Scheme [Blandy, 1998]. However, while most of these approaches use a large, robust language, it still remains difficult to integrate them with external programs—instead putting the burden on those programs to integrate with their system. We believe a shell-based approach is promising </code></pre> Hmm, Scheme as a large language? Well, I don&#x27;t know much about the extensions Guile Scheme has over RxRS, would hope for someone to add info here.
评论 #20854893 未加载
评论 #20854174 未加载
pugworthyover 5 years ago
It is mind boggling that despite the name, they did not (given the (I assume) joke with the name) say, &quot;Ceci n&#x27;est pas une pipe&quot; anywhere in the paper. Only once does the phrase, &quot;This is not&quot; occur, but completely out of context of Magritte&#x27;s most famous painting.<p>I&#x27;m serious - this isn&#x27;t Joke 101, but this is Marketing 101 in some respects.
评论 #20855622 未加载
评论 #20855401 未加载
评论 #20855235 未加载
usgroupover 5 years ago
I wrote clojure for a while. Forward chaining basically facilitates pipe based programming. When it fits it’s great, but when it doesn’t try code is ugly.<p>Some computations just want to be imperative. IMO, if you can avoid developing programming fetishes; power to you.
breckover 5 years ago
Looks interesting!<p>Side note: here&#x27;s another &quot;Magritte&quot; from 1983: <a href="http:&#x2F;&#x2F;reports-archive.adm.cs.cmu.edu&#x2F;anon&#x2F;scan&#x2F;CMU-CS-83-132.pdf" rel="nofollow">http:&#x2F;&#x2F;reports-archive.adm.cs.cmu.edu&#x2F;anon&#x2F;scan&#x2F;CMU-CS-83-13...</a>. Is there a connection?
评论 #20854200 未加载
_fbptover 5 years ago
Reminds me of nushell, which pipes around 2D tables (which can instead store hierarchical structured data, for example when reading toml files): <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20783006" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=20783006</a>
mark_l_watsonover 5 years ago
Except for the comparisons with Lisp in the third section, I thought the idea of pipes with complex data structures to be a pretty neat idea. Also, this is for a Master’S Thesis from the University of Tokyo? That looks like a lot of work for a MS thesis.
userbinatorover 5 years ago
Taking &quot;pipe-based programming&quot; to its logical conclusion results in <a href="http:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;pipelogic&#x2F;" rel="nofollow">http:&#x2F;&#x2F;www.linusakesson.net&#x2F;programming&#x2F;pipelogic&#x2F;</a>
wppickover 5 years ago
The problem as it&#x27;s defined in this thesis sounds a lot like the problem of microservice architecture. I&#x27;m curious how something like protobufs would compare in solving this problem
j88439h84over 5 years ago
Mario provides an implementation of shell pipes for Python.<p><a href="https:&#x2F;&#x2F;github.com&#x2F;python-mario&#x2F;mario" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;python-mario&#x2F;mario</a>
评论 #20855186 未加载
estomagordoover 5 years ago
Just remember to pipe with the | character. ¦ n&#x27;est pas une pipe.
评论 #20861633 未加载
whaddawhatover 5 years ago
This is not a programming language