31 ms·
Will Hare replace C? Or Rust? Or Zig? Or anything else?
- weatherlite 4y agoYou 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?
- linkdd 4y agoOr SQLite - https://www.sqlite.org/whyc.html https://www.sqlite.org/whyc.html
- weatherlite 4y agoThe list is very long. And also I'm not sure for all use cases Rust is a better C.
- sanxiyn 4y agoPostgres certainly can. It's less than two million lines of code. Just Firefox has more Rust code than entire Postgres.
- weatherlite 4y agoIt's possible, just doesn't make much financial sense so I'm not expecting it to happen.
- 0des 4y agoProbably not but I'm happy to try it out if it stays humble and does its job well.
- notRobot 4y agoThis is basically exactly what the article says.
- 0des 4y agoThanks big chief, I read the article as well.
- extropy 4y agoI lost the humble part at variable re-binding and automagical str type. And does the job well at implementation-defined int size and a char = u8 (there is a rune type, so why bother?)
- joelthelion 4y agoJust 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.
- notRobot 4y agoA lot of this is covered in the introduction: https://harelang.org/tutorials/introduction/ https://harelang.org/tutorials/introduction/
- KingOfCoders 4y agoOr nothing at all. Rust has an uphill battle since 10 years which shows it's hard to replace C / another language. Might be Rusts borrow checker that prevents adoption, but I doubt it (though it's the reason I use Rust but don't love it).
- dralley 4y agoRust has only been post-1.0 for 7 years.
- KingOfCoders 4y agoI agree, though to me it's not great of a difference if something is struggling for 7 or 10 years [1] [1] just for reference, 0.1 was announced 2012, 10 years ago, 1.0 was announced 2015, 7 years ago.
- cjg 4y agoAccording to PyPL's numbers, Rust's growth in popularity has been pretty much exponential since 1.0 with a doubling every ~15 months.
- wiremine 4y agoI've always felt Rust completes more directly with something like C++. It's not nearly as expansive, but the mental space and use cases feel more C++-ish to me. Languages like Zig feels more like a replacement for C.
- ZeroCool2u 4y agoI think one thing that has helped Rust make the first serious advances towards C that we've seen in a long time is also the development tool chain. Getting started with Rust on any major platform, besides embedded development though that's coming along, is so much easier with Rustup and Cargo than the bizarre (to the uninitiated) work you have to do to setup and actually understand your development tool chain in C as well as C++.
- JNRowe 4y agoThe announcement mentioned in the article was discussed here¹, along with some interesting user perspective². ¹ https://news.ycombinator.com/item?id=31151591 https://news.ycombinator.com/item?id=31151591 ² https://news.ycombinator.com/item?id=31156298 https://news.ycombinator.com/item?id=31156298
- AshamedCaptain 4y ago> 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. 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).
- throwaway82652 4y agoThat comment is definitely out of line and trolling, but the author's attitude towards safety and security is still incredibly bad. Two wrongs don't make a right. I'm dismayed to see more new languages copying the safety and security features of C (i.e. nothing).
- mplanchard 4y agoI think “incredibly bad” is overstating things quite a bit. Safety isn’t an all-or-nothing game. If it were, Rust would be useless because it’s not Ada or another formally verifiable language.
- ddevault 4y agoHare has significantly more safety and security features than C. Bounds-checked slices, no uninitialized data, mandatory error handling, nullable pointer types, and others still. What it lacks that Rust users object to is a borrow checker.
- CJefferson 4y agoYou don't need a borrow checker -- there are many ways to avoid use-after-free bugs. They don't in Java, or Haskell, or Python, to name 3 languages I work in sometimes. However, I really do think for a new "systems language" nowadays, you do want to look at how major security holes occur in practice, and have a good story on how users should avoid them.
- 4y ago
- dgb23 4y agoHare as a project seems to have a very sober, laser focus. I initially didn't get it, but this article made it click.
- gwbas1c 4y ago> Hare as a project seems to have a very sober, laser focus. I initially didn't get it, but this article made it click. But I don't "get it." Why would I choose Hare over plain old C? What are the motivating features of the language that make it "worth it?" Remember: It's a pretty big hurdle to write something in a lesser-known language. If I had to convince a team of developers to choose Hare over C/C++/Rust, what would be the argument in Hare's favor?
- ddevault 4y agoIt is too early for most, if not all, projects to consider working in Hare over C/C++/Rust. It is a young, incomplete language, still pre-1.0. It may be interesting to those who are open to a more experimental language to work with during its early stages. As it matures, the utility will ideally grow with time.
- deleted 4y ago[deleted]
- maccard 4y agoThis [0] article was shared last week about "why" hare. IMO, there are some reasonable improvements to some of the roughest parts of C - lack of namespacing, abundant use of sizeof, bounds checking (with an escape hatch), forced initializiation, "non-nullable" pointers (i.e. references in C++), however all of those don't really matter in the grand scheme of things because hare won't ever run on mac or windows[1]. [0] https://tilde.team/~kiedtl/blog/hare/ https://tilde.team/~kiedtl/blog/hare/ [1] https://harelang.org/platforms/ https://harelang.org/platforms/
- huachimingo 4y agoSomething like Lua? It wont run because the QBE compiler doesnt have bindings to those OSes. Only x64.
- huqedato 4y agoPointers 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.
- extropy 4y agoJust a nitpick Clang is a specific C/C++ compiler implementation using LLVM, not the C language. Names are hard :) https://en.wikipedia.org/wiki/Clang https://en.wikipedia.org/wiki/Clang
- flohofwoe 4y agoHow would a language that wants to compete with C even work without a feature to directly address memory locations (i.e. "pointers")? I don't understand the "static typing vs type inference" argument, so I'll not comment on that :) (there are plenty of statically typed languages with type inference)
- zozbot234 4y ago> How would a language that wants to compete with C even work without a feature to directly address memory locations (i.e. "pointers")? "Pointer" types could just be library-based and architecture-specific. It doesn't really need to be part of the base language. This would make it easier to support things like GPU-bound code where general memory addressing isn't really a thing, or other features like multiple address spaces, segmented memory or the CHERI memory tagging extension.
- jitl 4y agoI don’t know… after working around the performance limitations of JavaScript and Ruby for a decade, I am happy to have an option that allows me to control (at least to some degree) memory layout of my program. All(ish) code used to be written in C and shell. To what degree had eg JavaScript replaced C already? I think quite a bit.
- euclaise 4y agoC can't be replaced by a language without pointers. If a language without pointers was attractive, a language other than C would already be used. C code is generally used with the intent to make use of pointers and such - we've had less pointy (and more abstract) alternatives forever for use cases that are suited to it.
- devit 4y agoAs far as I can tell it's a useless language that will not replace anything. It's memory-unsafe, so you might as well use C++ instead, or if you want a "newer" language, then use Rust instead.
- NoGravitas 4y agoIt's appealing to a different set of people. C++ and Rust are much larger languages than C. Hare is actually smaller than C. And while Hare doesn't provide the same kind of memory-safety guarantees that Rust does, it does make it easier to write safe programs than C.
- hamter 4y agoSo hare's target niche is people who want to use hare? On the first blog post and the ensuing conversation here that wasn't clearly stated (at least as far as I can tell). It seems a little strange that the programming language's niche would be "idk why not"... but then again why can't it be?
- ddevault 4y agoHare's target niche is stated on its home page: > Hare is a systems programming language designed to be simple, stable, and robust. Hare uses a static type system, manual memory management, and a minimal runtime. It is well-suited to writing operating systems, system tools, compilers, networking software, and other low-level, high performance tasks. I would be happy to clarify further if you're still unsure of what kind of programs are well-served by being written in Hare.
- runeks 4y agoWhat I’m missing are comparisons. A few examples illustrating what makes Hare preferable when compared to C/Rust/Zig.
- ddevault 4y agoI really want to avoid measuring Hare up against other languages. I think it stands on its own merits, and would prefer that people evaluate it in earnest rather than compare bullet points with another language. Nevertheless, there does exist a (dated) comparison with C: https://harelang.org/blog/2021-02-09-hare-advances-on-c/ https://harelang.org/blog/2021-02-09-hare-advances-on-c/ And if you have any specific questions that you want to frame in the context of another language, I will do my best to answer them.
- twh270 4y agoIf you want people to evaluate it on its own merits, then make those merits stand out. As it stands, your intro paragraph ("Hare is a systems programming language...") is so generic that it doesn't tell me why I might want to use it instead of C or Zig or assembly. Where does it excel? What makes it stand out? Bullet points help me quickly decide whether I want to spend time evaluating a language.
- lesgobrandon 4y ago
- tayistay 4y ago> 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. It seems to me that these crusaders (and I've seen a few) think that because you shouldn't build a big bridge out of wood, you shouldn't build anything out of wood. Is the thinking more sophisticated than that? Honest question (and I code in Rust).
- linkdd 4y agoBut wood is so unsafe, it can burn, it can rot, you need to put the nails at the correct spot and most woodworkers are dumb enough to not do that correctly. It should be criminal to build anything out of wood. Heard of forest fires huh? Guess what, they are made of wood! --- Sorry, I couldn't resist.
- Ygg2 4y ago> most woodworkers are dumb enough to not do that correctly. Our wood workers have a track record at that. It's one thing laughing at wooden bridges. The other thing is we already have charred landscape full of them.
- capableweb 4y agoFunnily enough, it might be safer to build big buildings made out of wood than steel, as it takes longer to collapse than for example steel (https://www.nationalgeographic.com/science/article/skyscrapers-of-the-future-will-be-made-out-of-wood https://www.nationalgeographic.com/science/article/skyscrape...)
- ncmncm 4y agoI hear witches are made out of wood...
- lmkg 4y agoIt is, in fact, illegal to build things out of wood. Unless you adhere to a set of best practices called the Building Code.
- vegai_ 4y agoDo 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?
- sanxiyn 4y agoBoth Hare and Zig fix "C's Biggest Mistake": https://www.digitalmars.com/articles/C-biggest-mistake.html https://www.digitalmars.com/articles/C-biggest-mistake.html.
- lelanthran 4y ago> Both Hare and Zig fix "C's Biggest Mistake": https://www.digitalmars.com/articles/C-biggest-mistake.html https://www.digitalmars.com/articles/C-biggest-mistake.html. I think any new language (including Rust, Go, Nim, etc) that wants to displace C should not be trying to fix C's biggest mistake, it should be trying to replicate C's biggest success: simplicity. Hence the growing popularity of Go as a C replacement. I look at Zig and Nim, and they look like viable replacements too. Time will tell.
- linkdd 4y ago> Hence the growing popularity of Go as a C replacement. Fun fact: I've seen more Python projects being rewritten in Go than C projects being rewritten in Go. Is Go a Python replacement?
- lelanthran 4y agoCould be both a C and a Python replacement? Go seems to present simplicity as a selling point, so looks to be a natural next step for both C and Python programmers.
- wtetzner 4y agoC sometimes appears to be simple, but there's a lot of complexity in the language. It's just well-hidden until it bites you.
- gunfighthacksaw 4y ago> will Inevitably, in the steady state? No If some cataclysmic event occurs, perhaps with key industry influencers’ involvement? Maybe
- wheelerof4te 4y agoGood explanation by the author. It just confirmed my initial thougts about this language. "A better C", for the people who respect it's ideology.
- deleted 4y ago[deleted]
- gigatexal 4y agoNo. My money would be on Zig or Rust replacing C. Hare will remain niche as all Lisp-y languages a destined to do.
- extropy 4y agoDoes someone know how the str type works? From lang reference it's pointer/size/capacity struct but none of the examples does any freeing of strings. What kind of magic is this?
- ddevault 4y agoStrings are essentially a usage-constrained slice alias. You can pass a string into "free" and it will free the underlying storage. Check out the spec for the full answer: https://harelang.org/specification.pdf https://harelang.org/specification.pdf They are a very lightweight language feature which is mostly supplemented by the standard library, e.g. the strings module.
- sanxiyn 4y agoMost strings in examples are statically allocated and don't need freeing. There is an example with freeing of strings in the introduction. Search for strings::freeall.
- rasterdog 4y agoalso there a lot of implementations of "pointer/size/capacity struct" for strings in plain C
- cyber1 4y agoOdin, Zig, Jai, Hare, etc - all of these new languages have been mostly inspired by Go, C, and Rust. So let's summarize: 1. Simplicity and readability - C, Go 2. Tiny language - C, Go 3. Modularity - Go, Rust 4. Defer statement - Go 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 6. Strong type system - Go, Rust 7. Manual memory management, pointers - C 8. No OPP in terms of C++, Java 9. No references, just pointers 10. Syntax - Go, Rust 11. Zero cost abstraction and as much as possible minimal runtime - C, Rust Mostly their look like Rust with "defer" but without borrow checker, move semantics, references, RAII, and lifetime annotation. Mb this is what we really need? :)
- the_duke 4y agoPutting Rust and Go together under strong type system is a very odd choice. Rust is inspired by ML family languages and heavily leans on it's type system, while Go is very simplistic in comparison. (This has improved somewhat with the recent addition of generics)
- Gwypaas 4y agoEspecially with how Go handles default values. Suddenly a value wasn't present in a deserialization and now that's a nil pointer. Or if you have a stateful 0 so you can't tell the difference between missing or user choice without a deeply awful extra check.
- robmccoll 4y agoI agree - Go's type system would be perhaps better described as strict. There are rarely cases in which conversion is implicit (not particularly unique to Go, but useful). Between types are aliases of those types? No. Between signed and unsigned? Of course not. Between string and []uint8? No. What about less precise to more precise? Nope. This can be a pain, but overall it avoids some classes of bugs present in languages like C (without getting strict about your compiler flags anyway) and allows you to use types to encode your problem in a way that prevents dumb mistakes.
- 4y ago
- peter303 4y agoAs 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.
- einpoklum 4y agoNeither C++ nor Java were "attempts to improve C". It's true that C++ is almost a superset of C, but most C programming idioms would be discouraged in C++. As for Java - it's a whole different kettle of fish. Intended to run on a virtual machine with opaque high-level abstractions usable by your program; nothing like C. (I don't know ObjectiveC enough to comment.)
- webmobdev 4y agoI am surprised D isn't mentioned here. It seems to have found the right balance between C and Python / C++ ( https://dlang.org/ https://dlang.org/ ) and is also mature. I've been exploring some "lower level" language alternatives to C, and find that D, Ada and Pascal (FPC / Lazarus) hold more appeal to me than many of these new languages.
- Tozen 4y agoThe Pascal/Object Pascal story is quite interesting. It goes to show how important corporate backing and luck are to the popularity of programming languages.
- webmobdev 4y agoIndeed. Check out its successor Oberon by the same creator. It's modern, simple and powerful. The whole language definition is just 17 pages - https://people.inf.ethz.ch/wirth/Oberon/Oberon07.Report.pdf https://people.inf.ethz.ch/wirth/Oberon/Oberon07.Report.pdf ... and yet, no PR behind it, so it is nowhere near the popularity of even the fading Pascal.
- musicale 4y agoNo.
- dgan 4y agosomehow the language & mascot gives a feel of Plan9
- xscott 4y ago> Hare aims to be successful within its niche for the programmers that find its ideas compelling Honest question, what are the compelling ideas? I really don't mean that with any snark. I haven't read through everything on the site, but so far I see: - Uses the `let var: type = value` syntax - Infers `type` from the value when it can - Has arrays and slices of arrays - Uses `defer` for cleanup - Doesn't have a garbage collector - Imports using `use` (vs `#include`) - Module scoping with `::` - Has `match` (not sure about patterns/destructuring) - It looks like `yield` is a return from sub-expressions edit: some more... - tagged union types - non-nullable types (opt in) - utf-8 strings
- ddevault 4y agoTo me, Hare's greatest strengths are in its simplicity, error handling, the standard library, and its documentation. Hare also has a culture of careful and deliberate engineering which values correctness, completeness, and predictability. I asked the #hare IRC channel to add their own thoughts, will edit this comment with any answers: > Simplicity. > I think a strength is the plan for long term stability. > It's simple and the compiler is tiny. > First thing that comes to mind is error handling. > The syntax seems simple to me, like c and go and unlike c++ and rust. > I think a major strength is you can transfer your C expertise. > You don't have to worry about your post-1.0 code breaking or becoming obselete from new language idioms. > Clear communication from the hare dev team about what the project goals are.
- xscott 4y agoI'm certain there is room for a better C, but simple is in the eye of the programmer. I would argue that Scheme is obviously simpler, but most people don't want to write system software in that. I suspect "simple enough" is a threshold/constraint, but not really the goal.
- xixixao 4y agoI am really curious why “println” lives in “fmt” module. I get that it does string formatting, but it also prints, and I would expect “fmt” to only do formatting. This sours my first impression of the language. It makes me expect lots of other counterintuitive decisions in the language.
- giancarlostoro 4y agoI think if you want to compete with Rust, C or Zig you want to have a rich standard library. I still hold that Go'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. I don't have to waste time evaluating web frameworks I can just start coding a website with net/http right away. Oh its production ready!? Amazing! I do wish Go had more things built-in like email and other protocols. If I were maintaining or creating a systems language, I'd invest in the standard library being powerful out of the box. I really secretly wish Rust / D had a web server baked in sometimes. All things said, this is the first I've heard of Hare, and it looks nice to me from what little I've looked at.
- capableweb 4y ago> 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'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. Rust doesn't seem to have that rich of a standard library, bunch of the official documentation asks you to add crates for lots of things. I find myself reaching for external crates for tons of things I'd expect to be in the language as well. I also don't think Go's success can be attributed to one single thing, but probably the biggest attribute would be that they are backed by one of the biggest tech company in the world, who have adopted it wholesale and would do so, no matter what, since they built and control it.
- Ygg2 4y agoProblem with that approach is best demonstrated with Python. Standard library usually comes with strong backwards compatibility guarantees. So it becomes ossified over time. Leading to - standard lib is where libraries go to die. Without stability guarantee, you risk introducing breaking changes between versions, which is worse. And inferior to just downloading a lib with most stars.
- lifthrasiir 4y agoThere are three approaches to standard libraries: 1. Include as much as possible. This has been Python's approach and is showing its limitation: you end up with lots of historical baggages you can't maintain. It took an eon to remove some dead batteries from the Python standard library [1]. 2. Exclude as much as possible. This is the preferred approach for most newer languages, which can't readily determine at which direction the language would be heading. These languages tend to weigh more on third-party libraries with their pros and cons. 3. Pick use cases and design the standard library only for those use cases. It would mean that you have a near-total control over the language's evolution, so you can include whatever you want without thinking about its long-term consequence (because you know a new addition would be necessary for your use case). This can be often seen from some smaller languages, but Go is in my opinion the only mainstream language using this approach and that's only possible due to Google's involvement. [1] https://peps.python.org/pep-0594/ https://peps.python.org/pep-0594/
- newaccount2021 4y ago
- Qem 4y agoMy bet is Nim. Because Python just topped the PL ranks, there is lots of people learning Python as their first/only programming language now. When some of these eventually need to learn a systems language, Nim will have familiar syntax to piggyback on Python's popularity, just like Java or JavaScript did in the past, piggybacking on C curly-brace syntax.
- JackC 4y ago> 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. 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] Which I'd summarize as: let'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? Which isn'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? I don't know, but I'm interested, because I want the next billion lines of code that affect me to do useful stuff and not break. "My goal is not to force anyone who doesn’t like Hare to use it" isn't really an option; I'll be impacted by all the code people write in every language. So: I'm happy to see people make new things that test a new point in the design space! But I'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 "less safe than we know how to make new languages" is still safe enough for a new language in this case? [1] https://news.ycombinator.com/item?id=31151937 https://news.ycombinator.com/item?id=31151937
- joeberon 4y ago
- eggy 4y ago>that Rust is probably the better choice for high-stakes use-cases such as life-critical software 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. [1] https://blog.adacore.com/adacore-and-ferrous-systems-joining-forces-to-support-rust https://blog.adacore.com/adacore-and-ferrous-systems-joining...
- rootlocus 4y ago> We designed Hare to be similar to C, and useful everywhere C is useful Except under proprietary operating systems. It's really not that difficult to compare Hare with C. C works everywhere, Hare doesn't. It's disingenuous to compare languages that aren'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't think anyone had any doubts Hare would not replace C.
- ddevault 4y agoYes, except for proprietary operating systems. However, as vast as the gulf is between Hare and Zig/Rust in terms of portability, far vaster is the gulf between both of those and C. It's disingenuous to compare any of these languages with C in terms of portability, as C is by a wide margin the most portable language of all time. Unlike LLVM, adding a new backend for Hare is a relatively straightforward effort: riscv64 was done by one person in a few months and is only 1,476 lines of code. And again: the answer to the question posed by the blog post's title is "no".
- RealityVoid 4y agoIs C necessarily more portable than Rust? I think not. Of course, you can target any arch under sun with C _right now_. Rust does not have this yet, but you _could_ do so no problem if you wanted to.
- ddevault 4y agoThe same argument can be made of Hare, but the reality is that closing the portability gap between C and any other language is a monumental undertaking which will take decades to complete.
- rob74 4y agoThe phrase "Hare is not interested in taking over the world", especially together with the cute bunny in the top left corner, made me smile. But I'm still a bit suspicious - sure, it looks all cute and fluffy, but there may be some ambition hiding behind those big button eyes...
- MrBuddyCasino 4y agoThis is a language I might enjoy using. Clean, simple, pleasant to look at. Does it have a package manager? Couldn't find anything.
- ddevault 4y agoHare does not have a package manager, by design. We feel that package management is best left in the hands of distributions. We don't want the npm/pypi/crates/etc disease to infect Hare - your dependencies should be chosen carefully and conservatively.
- linkdd 4y ago> We don't want the npm/pypi/crates/etc disease to infect Hare That's a pretty harsh and ignorant statement. Those repositories made developer experience much more enjoyable than the mess that is the C/C++ ecosystem.
- ddevault 4y agoThis is a harsh statement, but not an ignorant one, borne of years of experience with these systems.
- linkdd 4y agoIt is an ignorant one because without those, the industry would be far from where we are now, the cost of project development would be higher, security fixes would have a very hard time to propagate, leaving holes pretty much everywhere. > borne of years of experience with these systems. Which does not dismiss everybody else's experience.
- ddevault 4y agoAnd neither does your experience dismiss mine. I have also seen years of vulnerabilities going unnoticed in pinned dependencies four orders transitively removed from anything the developer has ever heard of, of malware being published without review in PyPI and npm, of bitcoin miners and private key sniffers, of bloated and unreliable code from reckless companies who would prefer to save on FTE salaries by leveraging any code they find lying on the street, all while I've seen the package management system I prefer - the one used by Hare - suffer none of these issues.
- potta_coffee 4y agoHey Rust zealots, you guys ruin every programming language conversation. I'll happily never use Rust because the community is so awful.
- linkdd 4y agoI've learned to like Rust. 1. You don't need to engage with the community to use a programming language 2. The guys "ruining" conversations are a (loud) minority, most of the people I've talked with are light years away from proselytism
- spongechameleon 4y agoI haven't seen anybody mention tooling. I'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've had with Rust has been the language itself. I haven'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.
- ncmncm 4y agoThe only languages Hare can seriously compete with are the other, infinitesimally less niche Zig and maybe Nim. C coders are defined 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. 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. Likewise, Lisp and its offshoots. And Haskell, Erlang, MLs, APLs, Smalltalks, and Adas, all themselves niche. Hare will not be picking up any Forth coders. 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. The normal fate of any new language, absent The Miracle, is to fizzle. It is the certain fate of any language that brings nothing compelling to the table. Hare is exactly such a language. 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.
- akagusu 4y ago> Hare aims to be successful within its niche for the programmers that find its ideas compelling, and nothing further. If you are using and enjoying C, C++, Rust, Zig, or any other language, and don’t find Hare’s ideas all that interesting, then I encourage you to keep using these languages. I think they DON'T want to compete with any language nor attract C/C++/Rust/Zig/Nim/Forth/<name_your_language_here> coders.
- d3nj4l 4y agoSo why does it exist?
- tasuki 4y agoI'd like to know, too! From my point of view, all languages which don't add anything new and improved are a drag on our collective computing experience. I'd be happy if humanity had like three or four programming languages: Idris or some other better-Haskell (for guarantees), Lisp (for simplicity), Rust (for performance), and probably one or two other languages which are unique enough, Prolog or something, K?
- svnpenn 4y agoHare is not replacing any of those. Hare doesnt support Windows, so it will never rise to the level of C, Rust or Zig.
- npigrounet 4y ago
- jmyeet 4y agoThe 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. Existing code and existing engineers are a massive barrier-to-entry. 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't slow you down. It's a complete non-issue. Zig is interesting. I don't know a ton about it. My sense is that Zig is to C what TypeScript is to JavaScript. I mean Zig isn't transpiled into C but the point is that it seems to be very closely related so transition should be fairly easy. Rust most closely competes with C++ (IMHO) but it does something really interesting that C++ just can't do: it tackles ownership and memory safety at compile-time. Yes, C++ has smart pointers but these incur a runtime cost. C++'s features, history and (dare I say it?) baggage mean C++ can't do the same thing. I personally consider this to be an increasingly important issue so Rust has a definite niche. But will it displace C++? The odds aren't in its favor. But it will certainly be viable. C is the funniest one though. Asking "Will X replace C?" is a bit like "Will [search startup] replace Google?" 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 "no".
- bachmeier 4y agoI think D's approach is the right one. It's not a replacement for C, it's a supplement, with no barrier to entry. You can do all of the following: compile C code and call it directly from your D program (no bindings needed), compile D code and run it directly from your C program (no bindings needed), write C code using basically the same syntax but with some additional features (betterC), or write a D program and interoperate with C libraries without writing bindings. I think a lot of C programmers dislike some parts of the language - something that's true of any language - but they like writing C code the way they have for the last X years. If they're willing to give up the preprocessor, they can keep using C. There's no need to replace C. D has support for all the platforms of GCC and LLVM. That's obviously not as many as C, but it's a lot.
- tasuki 4y ago> Verbosity in Java is a big one. IDEs fill it in for you. It doesn't slow you down. It most definitely does! Perhaps not when writing code. But it does take longer to read/scan verbose code. I'd also argue many kinds of refactoring are made slower by verbosity.
- jfk13 4y agoBetteridge's Law says "no". https://en.wikipedia.org/wiki/Betteridge's_law_of_headlines https://en.wikipedia.org/wiki/Betteridge's_law_of_headlines (And so does the article, FWIW.)
- hgs3 4y agoHare 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.
- metaltyphoon 4y agoThis again… no as long as it stays tied to Linux only it has no chance.
- staticassertion 4y ago> 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. lol "moral crusaders" who want software engineers to take a modicum of responsibility for their code
- deleted 4y ago[deleted]
- WalterBright 4y agoD's BetterC is is a modern language that is very C like and familiar, but with modern programming language sensibilities. We'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's much like C++'s #include, except it uses modules instead of a preprocessor. This way you won't need to give up on any of your existing, working, debugged C code.
- Tozen 4y agoThe 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. In the case of Rust, at least they made safety a thing to hang their hat on. As an competitor, how do you "out safety" Rust? Golang carved out a nice niche for itself, and the involvement of one of C'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. Not sure where Hare can find a niche that isn't already occupied or how it's going to make people want to jump ship to them.
- zozbot234 4y ago> As an competitor, how do you "out safety" Rust? Rust is still not totally safe. There's quite bit of code out there that needs to be panic safe, run within a statically-sized arena, be guaranteed to always terminate/progress and so on and so forth. None of these things are ensured by Rust at present (and common language features like arbitrary function calls get in the way of them), while Ada/SPARK and the like at least make some effort to guarantee those.
- verdagon 4y agoIt's not that hard to out-safety Rust, with its unsafe operations and FFI. The Actix fiasco a while ago was a good example of this. Javascript is the gold-standard here IMO. I can also imagine a systems language that is much safer than Rust, it's not hard if you're familiar with recent developments in the PL realm.
- oconnor663 4y ago> moral crusaders from languages like Rust I think I speak for a majority of the Rust community when I say that we're embarrassed by this sort of behavior and we desperately wish that folks would stop it.
- Ygg2 4y agoTo be honest I've seen more people complain about Rust Community being full of crusaders than the calls to RIIR. I've seen like 2-3 calls on Github, while any Rust adjacent thread compalins about Rust crusaders.
- staticassertion 4y ago> I will do another post which addresses the other question: memory safety. How is it that developers feel qualified to talk about subjects they understand so little of?
- T3RMINATED 4y ago
- rogerclark 4y agoI don't understand why new languages ever use the :: notation for scoping. It's hard to type (holding shift for two keystrokes) and visually noisy. Obviously, C++ set the precedent and people are familiar with it. But if you're starting a completely new compiler, why make the same old mistakes with syntax?
- wheelerof4te 4y agoIt is to visually distinguish between module scope and struct scope. A lot of languages made a mistake of using the dot for both scopes. You get used to it.
- mrtranscendence 4y ago> It's hard to type (holding shift for two keystrokes) Not if you've swapped : and ;, like I have!
- ddevault 4y agoGood thing you have to type heaps of semi-colons and double-colons to use Hare!
- Bancakes 4y agoIf developers treat dating like they do programming languages, no wonder there's a demographic crisis. Clang tidy[0] contains 67032 LOC from my calculations. Rust, Zig, whatever comprise millions LOC. Imagine if 1/10 was contributed to static/dynamic analyzers for C/C++ instead. [0] https://github.com/llvm/llvm-project/tree/5da7c040030c4af72dcc21220f579098469c554e/clang-tools-extra/clang-tidy https://github.com/llvm/llvm-project/tree/5da7c040030c4af72d...
- ddevault 4y agoHare is not millions of lines of code; in fact, it is approximately the same size as clang tidy. 17,146 lines in the compiler, 59,271 lines in the standard library. These line counts are just wc -l, which is less favorable than e.g. sloccount. Another 11,036 lines for the qbe backend, while LLVM is tens of millions.
- Bancakes 4y agoI'm summing up the whole repos, everything that was ever written for those languages. Everything that could have gone elsewhere. This path is not constructive. Maybe instead of trying to be original, we can learn from mathematics where theories remain valid for thousands of years.