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

科技回声

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

GitHubTwitter

首页

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

资源链接

HackerNews API原版 HackerNewsNext.js

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

Will Hare replace C? Or Rust? Or Zig? Or anything else?

195 点作者 wicket大约 3 年前

43 条评论

giancarlostoro大约 3 年前
I think if you want to compete with Rust, C or Zig you want to have a rich standard library. I still hold that Go&#x27;s success is attributed to the fact that you could build a web application out of the box, minus database drivers. The templating and web server is purely built in to Go itself.<p>I don&#x27;t have to waste time evaluating web frameworks I can just start coding a website with net&#x2F;http right away. Oh its production ready!? Amazing!<p>I do wish Go had more things built-in like email and other protocols.<p>If I were maintaining or creating a systems language, I&#x27;d invest in the standard library being powerful out of the box. I really secretly wish Rust &#x2F; D had a web server baked in sometimes.<p>All things said, this is the first I&#x27;ve heard of Hare, and it looks nice to me from what little I&#x27;ve looked at.
评论 #31248358 未加载
评论 #31248248 未加载
评论 #31248534 未加载
评论 #31248598 未加载
评论 #31249117 未加载
评论 #31248257 未加载
评论 #31248243 未加载
评论 #31252523 未加载
评论 #31250789 未加载
评论 #31248212 未加载
评论 #31248560 未加载
评论 #31248939 未加载
评论 #31248990 未加载
评论 #31252157 未加载
WalterBright大约 3 年前
D&#x27;s BetterC is is a modern language that is very C like and familiar, but with modern programming language sensibilities. We&#x27;re currently working on improving the ability for it to directly import C code in order to provide frictionless access to existing C code. It&#x27;s much like C++&#x27;s #include, except it uses modules instead of a preprocessor.<p>This way you won&#x27;t need to give up on any of your existing, working, debugged C code.
eggy大约 3 年前
&gt;that Rust is probably the better choice for high-stakes use-cases such as life-critical software<p>I would say SPARK2014 or straight up Ada for life-critical software given the maturity and target markets. Rust is heading there, and there is some communication between Adacore and Ferrous Systems (Rust group)[1] taking place that gets me excited, but I will stick with SPARK2014 for now.<p>[1] <a href="https:&#x2F;&#x2F;blog.adacore.com&#x2F;adacore-and-ferrous-systems-joining-forces-to-support-rust" rel="nofollow">https:&#x2F;&#x2F;blog.adacore.com&#x2F;adacore-and-ferrous-systems-joining...</a>
xscott大约 3 年前
&gt; Hare aims to be successful within its niche for the programmers that find its ideas compelling<p>Honest question, what are the compelling ideas? I really don&#x27;t mean that with any snark. I haven&#x27;t read through everything on the site, but so far I see:<p>- Uses the `let var: type = value` syntax<p>- Infers `type` from the value when it can<p>- Has arrays and slices of arrays<p>- Uses `defer` for cleanup<p>- Doesn&#x27;t have a garbage collector<p>- Imports using `use` (vs `#include`)<p>- Module scoping with `::`<p>- Has `match` (not sure about patterns&#x2F;destructuring)<p>- It looks like `yield` is a return from sub-expressions<p>edit: some more...<p>- tagged union types<p>- non-nullable types (opt in)<p>- utf-8 strings
评论 #31248147 未加载
评论 #31248151 未加载
ncmncm大约 3 年前
The only languages Hare can seriously compete with are the other, <i>infinitesimally</i> less niche Zig and maybe Nim.<p>C coders are <i>defined</i> by having seen a thousand languages go by and passed on all of them. C coders like C to the exclusion of all else, or they would have abandoned it long ago. Hare will not be picking up any substantial number of C coders.<p>Hare will not be picking up any C++ or Rust coders. It is a huge step down, offering literally none of what makes either language compelling for its users.<p>Likewise, Lisp and its offshoots. And Haskell, Erlang, MLs, APLs, Smalltalks, and Adas, all themselves niche.<p>Hare will not be picking up any Forth coders.<p>Zig is much more mature, and will maintain its lead. Nim is more mature, but will continue trailing Zig. Hare might chase after Zig alongside Nim.<p>The normal fate of any new language, absent The Miracle, is to fizzle. It is the <i>certain</i> fate of any language that brings nothing compelling to the table. Hare is exactly such a language.<p>A few people may continue using a fizzled language, indefinitely, like people maintaining their DVD collection. But there will be no reason for others to pay it any attention. The overwhelming bulk of the value in any language is network effects, and a fizzled language has none.
评论 #31249965 未加载
评论 #31249270 未加载
评论 #31249868 未加载
评论 #31249146 未加载
评论 #31249942 未加载
评论 #31251913 未加载
评论 #31279994 未加载
评论 #31250388 未加载
评论 #31249867 未加载
评论 #31257883 未加载
评论 #31254609 未加载
评论 #31249213 未加载
评论 #31250538 未加载
rootlocus大约 3 年前
&gt; We designed Hare to be similar to C, and useful everywhere C is useful<p>Except under proprietary operating systems. It&#x27;s really not that difficult to compare Hare with C. C works everywhere, Hare doesn&#x27;t. It&#x27;s disingenuous to compare languages that aren&#x27;t even close to the same portability level. C, Rust and Zig can be used to implement any imaginable piece of software, from desktop to server on almost any architecture and operating system. Hare is a niche language for Linux services, so I don&#x27;t think anyone had any doubts Hare would not replace C.
评论 #31249551 未加载
AshamedCaptain大约 3 年前
&gt; I am even more frustrated with the moral crusaders from languages like Rust, one of whom went as far as to suggest that I should personally be criminally prosecuted if some downstream Hare software has a use-after-free bug.<p>That is likely just trolling, but is also specially obnoxious considering that Rust does prevent use-after-free bugs as much as Java does (i.e. a lot, but definitely not all).
评论 #31247769 未加载
评论 #31251199 未加载
评论 #31248233 未加载
评论 #31249798 未加载
评论 #31248240 未加载
cyber1大约 3 年前
Odin, Zig, Jai, Hare, etc - all of these new languages have been mostly inspired by Go, C, and Rust.<p>So let&#x27;s summarize:<p>1. Simplicity and readability - C, Go<p>2. Tiny language - C, Go<p>3. Modularity - Go, Rust<p>4. Defer statement - Go<p>5. Metaprogramming (generics, compile time, macros) - lots of inspiration and some really fresh ideas like Zig and Jai, Go interfaces, and Rust traits look nice<p>6. Strong type system - Go, Rust<p>7. Manual memory management, pointers - C<p>8. No OPP in terms of C++, Java<p>9. No references, just pointers<p>10. Syntax - Go, Rust<p>11. Zero cost abstraction and as much as possible minimal runtime - C, Rust<p>Mostly their look like Rust with &quot;defer&quot; but without borrow checker, move semantics, references, RAII, and lifetime annotation.<p>Mb this is what we really need? :)
评论 #31248115 未加载
评论 #31254110 未加载
评论 #31280064 未加载
评论 #31248186 未加载
评论 #31249681 未加载
评论 #31248277 未加载
hamter大约 3 年前
So hare&#x27;s target niche is people who want to use hare? On the first blog post and the ensuing conversation here that wasn&#x27;t clearly stated (at least as far as I can tell). It seems a little strange that the programming language&#x27;s niche would be &quot;idk why not&quot;... but then again why can&#x27;t it be?
评论 #31247922 未加载
tayistay大约 3 年前
&gt; I am even more frustrated with the moral crusaders from languages like Rust, one of whom went as far as to suggest that I should personally be criminally prosecuted if some downstream Hare software has a use-after-free bug.<p>It seems to me that these crusaders (and I&#x27;ve seen a few) think that because you shouldn&#x27;t build a big bridge out of wood, you shouldn&#x27;t build anything out of wood. Is the thinking more sophisticated than that? Honest question (and I code in Rust).
评论 #31248029 未加载
评论 #31247991 未加载
评论 #31247948 未加载
评论 #31248138 未加载
评论 #31248067 未加载
JNRowe大约 3 年前
The announcement mentioned in the article was discussed here¹, along with some interesting user perspective².<p>¹ <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31151591" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31151591</a><p>² <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31156298" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31156298</a>
jmyeet大约 3 年前
The barrier to displacing any language is so high that you should consider such an endeavour to be a decades-long effort with a low chance of success. The best you can probably hope for is for something to live in a similar space and being large enough to be viable.<p>Existing code and existing engineers are a massive barrier-to-entry.<p>One trap engineers fall into is we tend to view exaggerate the importance of certain problems. Verbosity in Java is a big one. IDEs fill it in for you. It doesn&#x27;t slow you down. It&#x27;s a complete non-issue.<p>Zig is interesting. I don&#x27;t know a ton about it. My sense is that Zig is to C what TypeScript is to JavaScript. I mean Zig isn&#x27;t transpiled into C but the point is that it seems to be very closely related so transition should be fairly easy.<p>Rust most closely competes with C++ (IMHO) but it does something really interesting that C++ just can&#x27;t do: it tackles ownership and memory safety at compile-time. Yes, C++ has smart pointers but these incur a runtime cost. C++&#x27;s features, history and (dare I say it?) baggage mean C++ can&#x27;t do the same thing.<p>I personally consider this to be an increasingly important issue so Rust has a definite niche. But will it displace C++? The odds aren&#x27;t in its favor. But it will certainly be viable.<p>C is the funniest one though. Asking &quot;Will X replace C?&quot; is a bit like &quot;Will [search startup] replace Google?&quot; The startup landscape is littered with the ocrpses of Google-killers. Likewise the language landscape is littered with the corpses of C-killers. So my money is on &quot;no&quot;.
评论 #31249508 未加载
评论 #31249974 未加载
JackC大约 3 年前
&gt; I am even more frustrated with the moral crusaders from languages like Rust, one of whom went as far as to suggest that I should personally be criminally prosecuted if some downstream Hare software has a use-after-free bug. My goal is not to force anyone who doesn’t like Hare to use it, or issue judgements upon projects which choose another language. In return, I will be pleased if members of other language communities refrain from flaming too much on Hare.<p>This might be referring to comments elsewhere, but I thought there was a pretty thought-provoking debate about safety tradeoffs in the Hare intro thread.[1]<p>Which I&#x27;d summarize as: let&#x27;s say we now know how to prevent, say, 70 out of 100 security bugs in C codebases, without performance compromise, by statically ruling out things like buffer overflows and use-after-free; and we also have good evidence that bugs your language ecosystem is bad at detecting are hard to backport detection for. Is it a good idea to make a language that prevents _most_ of those 70 mistakes, but not all that we know how to prevent, in exchange for being simpler, and therefore reducing the other 30 mistakes and getting more software done that helps people? Or would it be better to avoid investing in or relying on new languages with that tradeoff for infrastructure code, and focus on seeing how simple a language can be that prevent all 70?<p>Which isn&#x27;t a logic question, but an engineering question: does the mostly-safe language prevent 65 out of 70 memory bugs, or 30 out of 70? Does it let you get twice as much done as the safer language, or 10% more done? Does it result in fewer logic bugs than the more complex language, or the same number?<p>I don&#x27;t know, but I&#x27;m interested, because I want the next billion lines of code that affect me to do useful stuff and not break. &quot;My goal is not to force anyone who doesn’t like Hare to use it&quot; isn&#x27;t really an option; I&#x27;ll be impacted by all the code people write in every language. So: I&#x27;m happy to see people make new things that test a new point in the design space! But I&#x27;m _also_ happy to see other people say, wait, before I end up with a ton of this code tucked into the lower levels of my machine and the other hundred billion machines wired up to it, what mix of features would convince me that &quot;less safe than we know how to make new languages&quot; is still safe enough for a new language in this case?<p>[1] <a href="https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31151937" rel="nofollow">https:&#x2F;&#x2F;news.ycombinator.com&#x2F;item?id=31151937</a>
评论 #31248334 未加载
oconnor663大约 3 年前
&gt; moral crusaders from languages like Rust<p>I think I speak for a majority of the Rust community when I say that we&#x27;re embarrassed by this sort of behavior and we desperately wish that folks would stop it.
评论 #31258555 未加载
KingOfCoders大约 3 年前
Or nothing at all. Rust has an uphill battle since 10 years which shows it&#x27;s hard to replace C &#x2F; another language. Might be Rusts borrow checker that prevents adoption, but I doubt it (though it&#x27;s the reason I use Rust but don&#x27;t love it).
评论 #31247888 未加载
评论 #31247763 未加载
评论 #31247688 未加载
评论 #31247679 未加载
评论 #31247669 未加载
Qem大约 3 年前
My bet is Nim. Because Python just topped the PL ranks, there is lots of people learning Python as their first&#x2F;only programming language now. When some of these eventually need to learn a systems language, Nim will have familiar syntax to piggyback on Python&#x27;s popularity, just like Java or JavaScript did in the past, piggybacking on C curly-brace syntax.
Tozen大约 3 年前
The thing about these newer C alternatives, is that they have to provide compelling reasons for people to want to use it. Not just be a little more modern than C, but features that put it over their competitors.<p>In the case of Rust, at least they made safety a thing to hang their hat on. As an competitor, how do you &quot;out safety&quot; Rust?<p>Golang carved out a nice niche for itself, and the involvement of one of C&#x27;s original creators and Google backing it up sure did help out. And Golang has ignited a group of its own alternatives like Odin and Vlang.<p>Not sure where Hare can find a niche that isn&#x27;t already occupied or how it&#x27;s going to make people want to jump ship to them.
评论 #31251364 未加载
评论 #31252084 未加载
dgb23大约 3 年前
Hare as a project seems to have a very sober, laser focus. I initially didn&#x27;t get it, but this article made it click.
评论 #31247853 未加载
rob74大约 3 年前
The phrase &quot;Hare is not interested in taking over the world&quot;, especially together with the cute bunny in the top left corner, made me smile. But I&#x27;m still a bit suspicious - sure, it looks all cute and fluffy, but there may be some ambition hiding behind those big button eyes...
svnpenn大约 3 年前
Hare is not replacing any of those.<p>Hare doesnt support Windows, so it will never rise to the level of C, Rust or Zig.
wheelerof4te大约 3 年前
Good explanation by the author.<p>It just confirmed my initial thougts about this language. &quot;A better C&quot;, for the people who respect it&#x27;s ideology.
hgs3大约 3 年前
Hare looks great! As someone who primarily works in C, the only language I consider a realistic C successor is Zig, D (with the -betterC flag), and now Hare. I do think a C successor needs good interoperability with C. I wonder if the creators of Hare are planning to add a Hare to C transpiler? That would certainly help with portability.
peter303大约 3 年前
As C approaches its 50th anniversary in 2023, people are still trying to improve it. First it was data abstraction C++, ObjectiveC, Java. You could sort of hack that in original C with structures and virtuals. Now is back to improving basic C itself.
评论 #31248102 未加载
评论 #31248401 未加载
0des大约 3 年前
Probably not but I&#x27;m happy to try it out if it stays humble and does its job well.
评论 #31248022 未加载
评论 #31247637 未加载
Bancakes大约 3 年前
If developers treat dating like they do programming languages, no wonder there&#x27;s a demographic crisis.<p>Clang tidy[0] contains 67032 LOC from my calculations. Rust, Zig, whatever comprise millions LOC. Imagine if 1&#x2F;10 was contributed to static&#x2F;dynamic analyzers for C&#x2F;C++ instead.<p>[0] <a href="https:&#x2F;&#x2F;github.com&#x2F;llvm&#x2F;llvm-project&#x2F;tree&#x2F;5da7c040030c4af72dcc21220f579098469c554e&#x2F;clang-tools-extra&#x2F;clang-tidy" rel="nofollow">https:&#x2F;&#x2F;github.com&#x2F;llvm&#x2F;llvm-project&#x2F;tree&#x2F;5da7c040030c4af72d...</a>
评论 #31257908 未加载
spongechameleon大约 3 年前
I haven&#x27;t seen anybody mention tooling. I&#x27;ve played around with Rust for purely academic reasons and love how cargo just makes everything work. Feature flags, a built-in test harness, cross-platform compilation, the only fight I&#x27;ve had with Rust has been the language itself. I haven&#x27;t used it but I like how feature-rich the Zig compiler is too. I really hope strong tooling remains a focus for these newer languages.
dgan大约 3 年前
somehow the language &amp; mascot gives a feel of Plan9
MrBuddyCasino大约 3 年前
This is a language I might enjoy using. Clean, simple, pleasant to look at. Does it have a package manager? Couldn&#x27;t find anything.
评论 #31248571 未加载
rogerclark大约 3 年前
I don&#x27;t understand why new languages ever use the :: notation for scoping. It&#x27;s hard to type (holding shift for two keystrokes) and visually noisy.<p>Obviously, C++ set the precedent and people are familiar with it. But if you&#x27;re starting a completely new compiler, why make the same old mistakes with syntax?
评论 #31252573 未加载
评论 #31252853 未加载
joelthelion大约 3 年前
Just read the original announcement. It hardly contains any useful information regarding the language itself. How does it deal with memory management? What kind of typing system does it use? What makes it better than C? etc.
评论 #31247651 未加载
vegai_大约 3 年前
Do these modern C-replacement languages like Hare and Zig have exactly the same security problems related to memory allocation, or do they have additional safeguards against them that C does not?
评论 #31247989 未加载
extropy大约 3 年前
Does someone know how the str type works? From lang reference it&#x27;s pointer&#x2F;size&#x2F;capacity struct but none of the examples does any freeing of strings.<p>What kind of magic is this?
评论 #31248119 未加载
评论 #31248164 未加载
评论 #31248948 未加载
weatherlite大约 3 年前
You can replace C for new code (arguably) but how the hell does one replace legacy C? Can Unix realistically be rewritten in something else? Or Postgres?
评论 #31247819 未加载
评论 #31247907 未加载
gunfighthacksaw大约 3 年前
&gt; will<p>Inevitably, in the steady state? No<p>If some cataclysmic event occurs, perhaps with key industry influencers’ involvement? Maybe
jfk13大约 3 年前
Betteridge&#x27;s Law says &quot;no&quot;.<p><a href="https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Betteridge&#x27;s_law_of_headlines" rel="nofollow">https:&#x2F;&#x2F;en.wikipedia.org&#x2F;wiki&#x2F;Betteridge&#x27;s_law_of_headlines</a><p>(And so does the article, FWIW.)
staticassertion大约 3 年前
&gt; I will do another post which addresses the other question: memory safety.<p>How is it that developers feel qualified to talk about subjects they understand so little of?
gigatexal大约 3 年前
No. My money would be on Zig or Rust replacing C. Hare will remain niche as all Lisp-y languages a destined to do.
musicale大约 3 年前
No.
metaltyphoon大约 3 年前
This again… no as long as it stays tied to Linux only it has no chance.
devit大约 3 年前
As far as I can tell it&#x27;s a useless language that will not replace anything.<p>It&#x27;s memory-unsafe, so you might as well use C++ instead, or if you want a &quot;newer&quot; language, then use Rust instead.
评论 #31248120 未加载
huqedato大约 3 年前
Pointers hell and static typing.... No chance to replace Clang. Only a C-like lang without pointers and type inference would lure programmers to replace C. Something less hostile to the developer.
评论 #31247839 未加载
评论 #31248468 未加载
评论 #31248037 未加载
评论 #31247893 未加载
potta_coffee大约 3 年前
Hey Rust zealots, you guys ruin every programming language conversation. I&#x27;ll happily never use Rust because the community is so awful.
评论 #31248761 未加载
staticassertion大约 3 年前
&gt; I am even more frustrated with the moral crusaders from languages like Rust, one of whom went as far as to suggest that I should personally be criminally prosecuted if some downstream Hare software has a use-after-free bug.<p>lol &quot;moral crusaders&quot; who want software engineers to take a modicum of responsibility for their code