TE
科技回声
首页24小时热榜最新最佳问答展示工作
GitHubTwitter
首页

科技回声

基于 Next.js 构建的科技新闻平台,提供全球科技新闻和讨论内容。

GitHubTwitter

首页

首页最新最佳问答展示工作

资源链接

HackerNews API原版 HackerNewsNext.js

© 2025 科技回声. 版权所有。

Rhombus Language

242 点作者 swatson741大约 2 个月前

17 条评论

pmontra大约 2 个月前
The examples on the home page are a nice way to quickly show the features of a language. I&#x27;ll check the documentation to see how to work with files, make HTTP calls, parse JSON.<p>It&#x27;s the first time in more than 10 years that I actually feel like trying a new language. The last time was Elixir. Since then I had to use Lua (hobby project) and Python (work) but I don&#x27;t enjoy them much. I would have skipped them if I hadn&#x27;t have to use them. Before Elixir I enjoyed Ruby, before that it&#x27;s been Perl 5 in the 90s. Everything else I used in that period and before was because I had to (C, Java, PHP, JavaScript&#x2F;Node) and I skipped many other mainstream languages because they didn&#x27;t look nice to work with (Go, Rust, TypeScript.) I still have to see what&#x27;s writing and running a Rhombus programs looks like so I might discover that it&#x27;s not so nice after all. I&#x27;m hopeful.
评论 #43396729 未加载
评论 #43398257 未加载
评论 #43398586 未加载
评论 #43397107 未加载
评论 #43398858 未加载
dexterlagan大约 2 个月前
I have used Racket in production for a decade and a half, with great success. Racket belongs to a sort of invasive species equivalent in languages, in the sense that once it has a hold on you, all other languages, old and new, vanish from your mind. The elegance of Scheme married with the power of hygienic macros does a great job at tricking your mind into believing Paul Graham&#x27;s Hundred-Year Language idea again.<p>What if Racket and Python had a child? Rhombus represents much, much more to us Racketeers. It may quite possibly be the crown jewel of multi-paradigm meta-programming languages and most importantly, a possible solution to the &#x27;s-expression barrier&#x27;. Who knows, it might even make a dent in the LISP curse. And we were all hoping for this. We were all waiting for this. And so I applaud the enormous effort involved, and I hope it inspires people to try a different approach to programming, and to language in general. It represents an impressive achievement in terms of elegance, pragmatism&#x2F;practicality and efficiency in a language built atop a very solid foundation, coming from one of the greatest lineage of programming languages in history.<p>Like many others, I have been waiting for a killer app, a real showcase of the power of language-oriented programming. I was secretly hoping Rhombus would become a catalyst to the production of something great. While the emergence of LLMs presents challenges, it doesn&#x27;t have to seal the fate of amazing purely and proudly human innovations like this one. My GitHub account may be filled with Racket code few will ever use, but Rhombus gives me new inspiration.<p>Sure, the future of programming might involve neural networks programming CPUs and GPUs directly. We&#x27;re getting there. Yesterday we were programming with cryptic machine language, today we program computers with increasingly natural syntax. Tomorrow we might just tell machines what we need. But that doesn&#x27;t make what we&#x27;re doing now any less significant or exciting.<p>We programmers aren&#x27;t going anywhere just yet, and many of us will keep writing code because we love it, not just because we have to. And now we have this pinnacle of human ingenuity in the form of a beautiful language, a love letter to the art of programming by humans, for humans. Thank you.
评论 #43406043 未加载
lygaret大约 2 个月前
This is racket&#x27;s [rhombus], which might be an interesting second link here; it&#x27;s a scheme, underneath, with the full power of Racket libs available.<p>[`shrubbery`], the replacement for s-exprs, is pretty interesting, expanding s-expr simply with grouping, and then a separate infix-pass on top. I&#x27;ve been playing with using it as the basis for a separate language; it&#x27;s in an interesting place in the AST space, especially given the forethought put into macros.<p>[rhombus]: <a href="https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;rhombus&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;rhombus&#x2F;index.html</a><p>[shrubbery]: <a href="https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;shrubbery&#x2F;index.html" rel="nofollow">https:&#x2F;&#x2F;docs.racket-lang.org&#x2F;shrubbery&#x2F;index.html</a>
评论 #43400846 未加载
评论 #43397328 未加载
rednafi大约 2 个月前
The syntax looks clean, akin to Python, but with terser record types. This would make a nice config or an embedded language like Lua.<p>One thing I’d appreciate here is a “Why Rhombus?” page, even if the rationale is simply that it’s fun.<p>Edit: Turns out there’s a goals[1] page. Rhombus is trying to replace Lisp’s parenthesis-heavy syntax with something cleaner while keeping Racket’s powerful macro support.<p>[1]: <a href="https:&#x2F;&#x2F;rhombus-lang.org&#x2F;goal.html" rel="nofollow">https:&#x2F;&#x2F;rhombus-lang.org&#x2F;goal.html</a>
评论 #43395455 未加载
评论 #43395466 未加载
wavemode大约 2 个月前
From the 2nd example:<p>class Rect(left, top, right, bottom)<p>fun rect_like_to_rect(v): match v | Rect(_, _, _, _): v | {&quot;LT&quot;: [l, t], &quot;RB&quot;: [r, b]}: Rect(l, t, r, b) | {&quot;TL&quot;: [t, l], &quot;RB&quot;: [b, r]}: Rect(l, t, r, b)<p>rect_like_to_rect({&quot;TL&quot;: [0, 2], &quot;RB&quot;: [10, 5]}) &#x2F;&#x2F; ⇒ Rect(0, 2, 10, 5)<p>Isn&#x27;t this wrong? I&#x27;d expect to see Rect(2, 0, 5, 10) instead.<p>It also seems like &quot;RB&quot; was meant to be &quot;BR&quot;.
评论 #43395640 未加载
评论 #43397062 未加载
mapcars大约 2 个月前
Looking through the examples, macros and pattern-matching, for me that would be impressive like 10 years ago.<p>If you want to see really innovative, readable and powerful language check out Red. While the language development seems to be ceased, the ideas (coming from old proprietary Rebol language) of working with code and data go much deeper than just macros: it has built-in DSL (called parse) for making DSLs on the fly and not just pre-runtime code manipulations. <a href="https:&#x2F;&#x2F;www.red-lang.org&#x2F;" rel="nofollow">https:&#x2F;&#x2F;www.red-lang.org&#x2F;</a><p>And there is XL language which might have even more powerful extensibility features, like adding types or pattern matching or asynchronous processing. Sadly I couldn&#x27;t compile and try the only implementation it has, only judging by the docs explaining its ideas. <a href="https:&#x2F;&#x2F;xlr.sourceforge.io&#x2F;" rel="nofollow">https:&#x2F;&#x2F;xlr.sourceforge.io&#x2F;</a>
评论 #43401330 未加载
评论 #43420649 未加载
coolio1232大约 2 个月前
This actually looks good. It&#x27;s like a less-obtuse Haskell. At a glance the features seem to be just the right mix of functional programming paradigms and standard imperative programming.
评论 #43395891 未加载
评论 #43396051 未加载
true_blue大约 2 个月前
I think it&#x27;s clever how the logo is a different shape from Racket&#x27;s to fit the name of the language, but they kept the same colors and kept the lambda in it.
Y_Y大约 2 个月前
I&#x27;ve been cautiously optimistic about Rhombus since the initial &quot;Racket 2&quot; controversy. I&#x27;d have preferred they went with something more like Wisp or Wraith, but it could be a lot worse.<p>I am somewhat troubled by tricks that are &quot;too magic&quot;, like this example from front page:<p><pre><code> class Posn(x, y) fun flip_all([Posn(x, y), ...]): [Posn(y, x), ...] flip_all([Posn(1, 2), Posn(3, 4)]) &#x2F;&#x2F; ⇒ [Posn(2, 1), Posn(4, 3)] </code></pre> Why should the later Posns be flipped? That&#x27;s certainly not what I would expect.<p>(Then again being too magic is working well for Python, e.g. that a&lt;b&lt;c thing)
评论 #43400639 未加载
评论 #43397937 未加载
评论 #43397671 未加载
Tewboo大约 2 个月前
Interesting to see a new language like Rhombus popping up. Always curious to see what innovative features it brings to the table.
orthoxerox大约 2 个月前
I am going to play the devil&#x27;s advocate. What problem does Rhombus solve? An approachable syntax is a necessary, but not sufficient requirement for mass adoption.<p>According to the goals page, its other major feature is an extensible syntax. Why should I prefer it over, say, Scala? Scala has syntax macros, it runs on the JVM and can access Java&#x27;s massive library of libraries, it has been used to implement large and complex projects like Spark and Lichess, what&#x27;s that niche in which Rhombus can defeat Scala or Rust or Elixir?
评论 #43396539 未加载
评论 #43396515 未加载
评论 #43416410 未加载
zerr大约 2 个月前
Does anyone use Racket outside academia? Is it production ready (or friendly)? Especially Typed Racket.
评论 #43397016 未加载
评论 #43404496 未加载
评论 #43398902 未加载
评论 #43396983 未加载
评论 #43398524 未加载
评论 #43397894 未加载
eviks大约 2 个月前
How hard would it be to uniquely extend the language to make *fun* into *fn* and *...* into a single letter *…*?<p><pre><code> fun all_same([str0, str, ...]): all(str0 == str, ...)</code></pre>
评论 #43407286 未加载
评论 #43399085 未加载
评论 #43396722 未加载
datadeft大约 2 个月前
Is it possible to have Hindley–Milner type system for a LISP?
评论 #43397059 未加载
评论 #43398034 未加载
评论 #43409979 未加载
评论 #43398881 未加载
评论 #43399364 未加载
anacrolix大约 2 个月前
This is good to see, but I think too much effort is being used to maintain the prefix style function application. As a result a significant amount of the novelty is just mapping syntax from new to old. Special cases, special cases everywhere, even in an implementation like this which is specifically attempting to allow you to make your own &quot;special&quot; cases.
fithisux大约 2 个月前
Is this a reincarnation of Pyret?
评论 #43397967 未加载
freilanzer大约 2 个月前
Is it statically typed, like Ocaml?
评论 #43441723 未加载