Hacker News new | past | comments | ask | show | jobs | submit login
Announcing The Zig Software Foundation (ziglang.org)
263 points by kristoff_it on July 11, 2020 | hide | past | favorite | 84 comments



When I looked into starting an official non-profit around the Ardour (https://ardour.org/) project, I was a little disappointed to find out how much success made it much more complicated.

Founding a non-profit that deals with less than about US$10k a year is pretty easy, and seems worthwhile.

Go above that number (let alone up towards the levels where you can actually pay people to work full time on somethine), and you need a real board with real officers, and the board needs board insurance to imdemnify them against charges of financial malfeasance.

That was just the first complication I came across. After finding a couple more, I just gave up. I've love to have a "real" non-profit associated with Ardour, since that's entirely the way we conceive of the project, but the legal aspects to it when you're actually pulling in $100k a year or more just don't seem to justify the extra complications and requirements.


You might be interested in Hack Club Bank (https://hackclub.com/bank/), which we built for our students at Hack Club after they kept having the same problem (but with smaller amounts of money).

Today there are hundreds of student orgs running on Hack Club Bank, a few larger orgs (one with a budget of ~$100K/year, one that just signed on with anticipated budget of $1M/year), and now Hack Club HQ itself runs on Hack Club Bank (our finances are also open source on it - https://bank.hackclub.com/hq/).

While the page on Hack Club Bank on our website is still focused on student-led hackathons, we've recently started support for nonprofits not led by students. Perhaps it might be a good fit for Ardour?


Have you considered registering your foundation in another country? For example The Document Foundation - the non-profit organization behind Libre Office - is legally registered in Germany. Here is what Florian Effenberger the foundation's Executive Director had to say about the decision to register in Germany in an interview in 2011 (my translation):

"You have decided to establish the Document Foundation in Germany. Why should it become a foundation under German law?

A lot of people have asked whether it is necessary to establish the Document Foundation in Germany, because such a large amount of foundation capital is required here. In contrast, countries such as Great Britain or the United States offer similar legal constructs for a foundation without the requirement for a high foundation capital. The Steering Committee, after a thorough investigation, decided in a public telephone conference that the location of registration of the future foundation should ideally be Germany.

Germany is the best choice for the future foundation for several reasons: Not only do German foundations stand for security, stability, and trustworthiness, but Germany also has a large distribution of free and open source software. The roots of the product lie in Germany in the mid-1980s. In addition, Germany offers advantages in terms of taxes, tax deductibility for donors, as well as in terms of the foundation's activities, which are not restricted to a specific country from Germany.

Most importantly, many active members of the community who are willing to advance the Foundation are from Germany. Even if other countries would require fewer resources to set up the Foundation - if people who are willing to advance the Foundation are not on site, there would be higher costs for representatives and lawyers. Ultimately, however, a solid financial basis for the foundation would also be required in other countries."

Original source of the interview in German: https://ikhaya.ubuntuusers.de/2011/03/10/interview-mit-der-d...


That interview sounds more like an argument not to register your non-profit in another country. The main argument given is "because LibreOffice is German, and many of the people who would be involved in setting it up are German".


Yes, it's not a very compelling argument to register in Germany. I posted it more to point out that other countries are worth to consider and that running an open source non-profit in another country is more than a theoretical option. There advantages and disadvantages.


Well this is exciting. The biggest risk of Zig, among many risks, seemed to me to be that it was a one-individual show and so privy to their whims and subject to their ongoing interest and availability. Seeing an organization created with the intent to foster its development is a step in the right direction.


I mean its not anything different than PHP, Nim, Ruby, etc in terms of a one man show.

Even so its nice to have a org like this for Zig, might even make me to try it out.


PHP and Ruby both have many community contributors, and deep-pocketed corporate supporters. Nim has less of this, but still has a healthy community of contributors and users.



This is great Zig is one of the projects I think has a real future and have enjoyed programming in. In terms of languages for the web with WASM I think it has massive advantages over Rust. I love that it’s gaining traction and only wish I had more spare time to actually help out.


> In terms of languages for the web with WASM I think it has massive advantages over Rust.

Can you please elaborate what are those?


Not the OP, but I have the same opinion (I think):

Zig being better than Rust for targeting WASM is similar to C being better than C++ for that use case. High-level abstractions usually work against a minimal binary size, and WASM is a platform where the size of the 'executable' is very important.

Both C and Zig typically generate smaller binaries 'by default' by avoiding and discouraging high-level abstractions which are so fashionable now both in 'modern C++' and Rust.

Of course it is possible to create really small-sized binaries both in C++ and Rust if you're really careful and use an "embedded programming mindset", but this is not how those languages are taught, it's not the 'default' and you'll loose most of the high-level features that differentiate C++ and Rust from C or Zig anyway.

I wrote a blog post about that topic a while ago: https://floooh.github.io/2018/05/01/cpp-to-c-size-reduction....

This was when I just switched from using C++ to C as my 'default language', so that whole idea was quite new to me at the time, and that surprise is reflected in the blog post. In the meantime I have a better idea why higher level languages tend to cause bloated software, despite promising "zero cost abstractions".


> When I worked at a publicly traded dating website, female users were known internally as "inventory". It makes sense from a certain perspective, if your primary focus is extracting value from paying customers. But when your motto is "together we serve the users", it would be ridiculous to imagine something so inhumane. To me, this is the crux of the issue. I’ve never been more motivated in my life, than to serve the community around me, and help people accomplish their own goals.

"It is not from the benevolence of the butcher, the brewer, or the baker that we expect our dinner, but from their regard to their own interest." - Adam Smith

It's great that you're motivated by helping people. Sincerely. But most people aren't built that way. We get up on Monday morning to make a small circle of precious lives better, not just anyone's. Maybe it shouldn't be that way, but it is. Therefore reorganizing society around service rather than profit likely means a much smaller economy. To many people that's a feature.


“But most people aren’t built that way” seems to be a pretty big assertion that, if really that obvious, would seem to imply some of the central questions posed and grappled with by centuries of religion and philosophy — “are humans naturally greedy or generous?” or the age-old government/cultural policy debates on collectivism versus individualism — are nothing more than superfluous navel gazing.

I don’t have an answer either way. But I’m inclined to question this idea that just because things are the way they are now means that is the way they always were and will always be. How many people would be happy to expand that “small circle of precious lives” they make better if they could, but can’t due to the fact that, modern life now is seemingly a tangle of actively contradicting incentives? And how many people would, if they knew others would provide for all their needs and wants, act as solely a parasite to the system that feeds them? And would it be a critical mass that makes the whole system untenable, or just a relatively small group of bad apples accounted for by the number of people who give more than they take?

Again, I don’t know the answer, and I do not pretend to. But I do think a blanket statement that more people are greedy than generous is more a commentary on modern politics - that maybe our current system of society forces people to behave that way - than the human condition.


> “are humans naturally greedy or generous?”

I would say this one in particular is ill-posed. Paraphrasing hirundo, people are naturally generous toward a small circle of precious lives (and skeptical at best of the rest of the world). Asking about their attitude in general is meaningless.


> "people are naturally generous toward a small circle of precious lives (and skeptical at best of the rest of the world)"

Yes, that's a paraphrase of Hirundo's point. However, my point is that this assertion is by no means universally nor obviously a hard truth, and indeed still a large area of philosophical debate.


>It's great that you're motivated by helping people. Sincerely. But most people aren't built that way.

Or that's what an 18th century quote says. Several centuries of later evolutionary, psychological, and sociological research doesn't much agree...


Just because it’s a non-profit, doesn’t mean the folks working for it won’t make money and have decent lives. In fact the post pretty clearly states that as a desired goal, “Part of the goal of the ZSF is to provide excellent jobs that make people happy to work, and leave them financially well off, as well as having gained the kind of work experience that they wish to invest in for their own careers.”

Now the question I have, is it possible to create recurring revenue at a non-profit that is based of contracts with customers, or must all the revenue come from donations?


> is it possible to create recurring revenue at a non-profit that is based of contracts with customers?

Yes definitely. The main difference from for-profits is that the revenue have to be spent towards the mission and not blindly creating more profit.


> is it possible to create recurring revenue at a non-profit that is based of contracts with customers

Sure. I once worked at a non-profit that provided educational material to schools on a subscription basis. There is a line somewhere, as eventually the non-profit starting providing additional services to those same schools that required them to keep a second set of books and pay taxes on those activities.


In my experience, the people who talk about how everyone else acts selfishly tend to be the most selfish of all.


See also Milton Friedman


That speaks to your cognitive biases.


Hey, I disagree pretty strongly.

The butcher, the brewer, or the baker likely takes pride in the role he has in feeding and enriching families around him. But he's also got to feed his own. And the fact that there's money involved gets him to work on those days he'd -reaaaaally- rather not go. But money isn't enough to feel fulfilled in one's work.

And if you don't feel fulfilled in your work and your work's role in society: I'm sorry for you.


adam smith ALSO wrote the Theory of Moral Sentiment, which I think also falls in line with some of the things written in the announcement.


I don’t know about the particular dating company, but I use “inventory” sometimes simply because it’s shorter than “all profiles of people with matching attributes and preferences eligible to be suggested to the viewer”. It might be inhumane, and I wouldn’t use it in a press release, and I don’t mean to demean any user by it, I’m just trying to save time and spend it on making whatever product I’m working on better for the people using it.


This is a "smaller" economy as in "more tight-knit," not as in "smaller GDP."


Smaller as in the butcher, brewer and baker don't work as hard so beef, beer and bread are more scarce.


> Therefore reorganizing society around service rather than profit likely means a far smaller economy.

It probably just means you get outcompeted by people who put profit first and can afford to pay their employees more competitive wages, invest higher amounts in Capex and R&D, and generally best you at running a firm.

Profit is the goal we're all maximizing for, like it or not. And greed is inherent to human being, which makes Capitalism the most successful economic system given that the inherently greedy efforts of an individual eventually creates prosperity for the collective (over a long enough time-horizon and with regulations aiming to prevent local maxima such a factory with 20-hour shifts)

It seems to me that we can't change greediness, and we can't change the fact that companies run on profit. What we can seem to change is customers' preferences. If we ingrain into people's mindsets that buying from companies that aim to serve the collective (seek the global maximum over local maxima), then we can nudge corporations to act on the behalf all of us rather than just its stakeholders


> Profit is the goal we're all maximizing for, like it or not.

It's quite easy to show this is not true: if someone is selling a product or service and making $100,000 a year, and you offer them the opportunity to make $199,000 a year with the condition that half is locked away in an account they can never spend, just about nobody would take that offer.

As the blog post says, "The whole point of money is spending it to enrich your life and the lives of those around you. It’s a means to an end; it’s not the end in and of itself."

(You seem to understand this already when you suggest that customer preferences can be shifted - if it were true that we were all maximizing for profit, why on earth would someone buy, say, toothpaste for $4 from a company that claims to be doing good for the world when they could instead buy equally-functional toothpaste for $3?)


> if someone is selling a product or service and making $100,000 a year, and you offer them the opportunity to make $199,000 a year with the condition that half is locked away in an account they can never spend, just about nobody would take that offer.

Then that's not really making $199,000 a year. They'd be making $99,500 which is less than the profit-maximizing scenario that pays $100,000


That's because you've redefined "profit" to "usable profit," showing that profit is not the goal in and of itself.

My point, and the point of the author of this blog post, is that nobody is motivated by "haha numbers go up." We're motivated by wanting to do things with our profit - our goal is not to accumulate money but to spend it (either now or in the future).

Maybe a better example is, if someone were making $100,000 now, and they had the opportunity to move to a country where they'd make $199,000 but the cost of living were twice as expensive, would they take it?


It's true, you can't stop that which you accept and toil for.

The arguments you're making are familiar to the gray-hairs in open source software. It was long predicted that our efforts would fade under competition with the Oracles and Microsofts of the world.

> Profit is the goal we're all maximizing for, like it or not.

You're not alone in your bubble, but you might want to peek outside of it once and a while.


> > Profit is the goal we're all maximizing for, like it or not.

> You're not alone in your bubble, but you might want to peek outside of it once and a while.

Nice shallow dismissal, but I'm talking about corporations, not "my bubble". By and large, they are maximizing for profit. And you're happy to have the goods and services they provide, and they provide more of those if they are profitable than if they aren't, so indirectly you are still hoping everyone profits.


Me? Personally? No, your guesses miss the mark about what I want; I a very spartan life compared to most americans and really wish others would do the same. I was speaking to your narrow perspective on collective entities.

Zig pleases my spartan sensibilities, and personally I'm delighted that it's forming a more durable arrangement without needless profiteering. Like the EFF and other open source foundations, there's a chance to good work, to make the world a better place, without ruthless profiteering.


> Profit is the goal we're all maximizing for, like it or not.

Err, no. People want happiness, fulfilment, friendship, joy, meaning, safety, and a bunch of other things. Money can help obtain some (but not all) of those things, but it is instrumental in all cases.

> It seems to me that we can't change greediness, and we can't change the fact that companies run on profit.

Plenty of countries run system which are not optimised purely for profit. For example, Germany's corporations frequently act in the public good in ways that don't maximise their own profit. From my perspective, such countries seem to be doing much better than the US which is closer to being purely profit driven.

> It probably just means you get outcompeted by people who put profit first and can afford to pay their employees more competitive wages, invest higher amounts in Capex and R&D, and generally best you at running a firm.

This is a problem with our economic system, not a virtue, or even a necessary property.

> Capitalism the most successful economic system

Capitalism is only seen as successful because it has historically been competing with communism and feudalism. These are from the only possible economic systems. And given all its faults it seems far from likely that Capitalism is the best one.


As a German, I'd not put so much trust in German companies. Remember VW? Or Siemens and the coal mine in Australia? Or any other of the big automobile companies? Or Bayer and pesticides? There are plenty of examples.

However, I'd like to hear examples, which make you think German companies are any different in their greed than US ones.

Personally I think companies here are just as greedy and usually only do something non-profit oriented, if it is required by law or the publIc upset would mean bad business.


The Rhineland model means not only shareholders are recognized as stakeholders. This is implemented in things such as workers councils. Sure, it not perfect, and it wouldn't catch crimes such as the exhaust scandal, but it requires by law that a company not only looks after shareholders. It's a much better idea than the Anglosaxon model that has taken the world by storm, and I wish the world would look more to the Rhine countries. Germany/Switzerland/Netherlands are some of the best rated countries to live. We should have more of such policies and laws, not less.


Maybe an unpopular opinion among Zig programmers, but the lack of operator overloading is/was the true buzzkill for me as someone that tends to do a lot of math/science work in C and C++ both. Getting operators in C++ is one of the biggest productivity boosts compared to when I work in C.


I can understand the annoying part of it if that is the way you would do it elsewhere. Don't you feel that it would to some degree go against zig's goal of as little hidden control flow as possible?

And wouldn't it be possible to create something very close to what you are asking for with a bit of comptime coding? Have the function work on a comptime decided type. I mean I get that you won't be able to use the operator symbols as names and you would lose infix syntax. Is those what you are after?


I don’t understand that goal I think is the issue. I have no issues with understanding control flow with just... functions and operators? Sure you can’t glean it from a glance at the textual representation of code you aren’t familiar with, but day to day that’s literally never a problem. We have tools for that.

A control flow problem worth solving is understanding async and multithtreaded code.

And yes the expressiveness of actual infix operators is, to me, a strict requirement. The language is for humans, not machines after all, and stuff like add(mul(add(a, b), mul(a, c))) for, say, dual quaternion a, b, and c is a non starter. Most of my code would unfortunately become unreadable and there are often no sensible variable names for those intermediate results.


I think it's fine to say why Zig doesn't work for you as long as you make it clear what the limitation is and why, and don't use that as an argument to say it's a bad language - just a bad fit for your particular use-case.

Out of curiosity, aren't there other languages designed with more appropriate expressiveness for your needs then? Julia, for example?


C++ is actually the sweet spot for expressiveness and complete control needed for the work I do on consoles and embedded devices. I was excited for zig because in many respects it really does feel like a better C, but I think philosophically, it’s more oriented around building particular types of systems. Disclaimer, I’ve sunk only about 35 hours into Zig so it’s possible it would be different with more experience but that’s about all the time I can realistically afford for a trial run of a new technology these days.


Personally having done a bunch of mathy things both ways you get used to expressing thing without overloading. On balance I would opt for overloading because it feels natural to me but it’s a niggle rather than anything serious.


Operator overloading leads to a complex binary interface. Avoiding complexity in this area is important given that simple binary interface is a huge reason why reusable software is still written in C.

https://youtu.be/Gv2I7qTux7g?t=2m


I'm puzzled. Operators in C++ are just function calls. How do they lead to a complicated binary interface? I only watched three minutes of the video but he doesn't talk about operators during that period.


Because you need to specify the types of the operator in the symbol name as well.


But isn't the name is still needed if you define a function instead of overloading the operator?


that just means you need a mangled name in the symbol table. I don't really consider that part of the "binary interface". The big problem with this in, for example, c++, is that the name is mangled in an implementation defined way. If the way the operator name is mangled is well specified, there's no reason it couldn't be used as a C function from another language.


> that just means you need a mangled name in the symbol table

That alone is already enough to stop most if not all foreign language interfaces from resolving a symbol to a function pointer. That's the simplest hurdle to overcome. There are also complex mechanisms to deal with such as virtual method tables that figure into the calling conventions of overridable methods. Not even C++ compilers manage to keep the ABI stable between every compiler version: sometimes libraries compiled with a new version cannot be used with software compiled by an old version. Rust doesn't even have an ABI specification yet.


virtual method tables and operator overloading are orthogonal problems. Sure in many languages operator overloading is done using virtual methods, but it doesn't have to be. Operator overloading can dispatch based on static types rather than dynamic types.

That said, I do wish that there was a standardized way to expose vtables across foreign language boundaries. Although, I understand that differences in how vtables work across different languages, or even different implementations of the same language (cough cough c++ cough cough) would make creating a useful standard difficult.


Ok so (seriously), as an experiment, compile a c++ code file that overloads, say, "+" into a .so file (let's keep it to elf format then) and let us know what the "true" name of the corresponding function is by hexdumping the .so


Many non-extern C++ names are mangled in .so files, not just operators. I don't see how that affects the ABI (i.e. the calling conventions of the functions). It just means you need to use a library to demangle in order to call the correct function.


Yes, and it is a choice to not support any of them due to complexity. And as a result, you don't get operator overloading.

Zig supports C ABI, not C++ ABI.


You are confused. Supporting the C ABI and operator overloading are orthogonal. One is about conventions for saving registers and such. The other is about the naming of functions. Zig probably has a principled reason to not support operator customization, but ABI concerns aren't it.


You were the one that brought up C++, so if I'm confused, it's because what you wrote.


I did bring up C++, but I did not bring up operators. The question at hand is whether ABI concerns prevent operator overloading. Plainly, that is not an issue.


Just run the hexdump as it is through c++filt and be done. Yes, name mangling is an inconvenience and sometimes it is annoying, but it's not as bad as you make it sound.


and so now you have to add another tool to your toolchain, and if you want to become self-hosting, you have eventually refactor the whole thing, etc... And Zig doesn't generally have plans to support the same types that are available in C++ so realistically the only thing you get is operator and basic function overloading.

And in the C++ community, doing exports for interop as "extern C" (in general, because many other languages prefer it) is accepted anyways. Would you make the choice to add that complexity?


Very familiar with myriad abi issues and tbh, I don’t care. The compiler managing the mangling means that I the programmer do not. Also, I can easily expose a stable c extern abi from a c++ library but use overloading internally.


Part of Zig's core philosophy is that you can readily assess the "cost" of any particular expression is doing. There are no hidden function calls. If an expression doesn't contain (), you can be completely confident that it's not jumping away to some other piece of code.

btw, I know it's not as nice as first-class operator overloading, but Zig's comptime might enable writing DSLs for e.g. vector/matrix math: https://www.reddit.com/r/Zig/comments/g83h12/comment/foleoa8


Comptime is certainly nice but not usable in this context I’m afraid.

Also I’ve heard that argument a ton. It’s total complete rubbish as far as I’m concerned. Extrapolating, if you see a function call, what really can you say about the “cost” of that function? To me, without actual investigation, the answer is zilch. The function might be inlined, in the i-cache, referencing a lazily loaded symbol. It might be a small function, it might be huge, it may flush the cache, idk. If the goal was to be able to estimate the performance at a glance, well, we should use assembly, and even then the performance isn’t always clear.


This is a good point.

The right way to do this is to support arithmetic operators for types that implement a specific interface.


The show is live here: https://zig.show


Congrats! This looks like it has been done well. Good news for Zig and I hope it sets a good example for other organizations to follow.


I'm looking forward to Zig getting better. I tried writing an x86 OS in it, but some 0.6.0 known compiler bugs (I think it was some union-related stuff) broke what I was trying to do. I think it's supposed to be fixed in 0.7.0, so I'm waiting for that.


Anyone following Zig knows how far away is it from 1.0?


You can see the planned releases in the milestones on GitHub: https://github.com/ziglang/zig/milestones

I would say at least two more years then.


Can't wait for 1.0 to come out. I love the pointer syntax. I think it is a good idea to keep the C type annotation as it has become standard and for use, the dot notation is really less confusing for beginners.


Take off every 'ZIG'!! You know what you doing. Move 'ZIG'. For great justice!


Yet another programming syntax


Now that there are multiple people, I wonder if they will fold in the separate program needed to parse tabs and carriage returns.


> The Zig language accepts hard tabs and carriage returns. The self-hosted compiler implements the Zig language correctly; accepting hard tabs and carriage returns. However, the self-hosted compiler is not yet complete, and what people are using in reality is the stage1 compiler, which does not accept hard tabs.

https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-force-m...


That seems to imply that zig is only right now being used to make the self hosted compiler.


Something tells me Zig developers have more important matters to focus on than being able to indent code with tabs.


They already made a formatting tool that parses carriage returns and tabs. It's not exactly rocket science to not fail on tabs and carriage returns either.


Instead of complaining about in on Hacker News, how about you try to submit a patch to make it work? That strikes me as far more productive.


It isn't about doing the actual work, they make the zig compiler break on carriage returns and tabs for ideological reasons of annoying people on windows and people who use tabs. There is no technical barrier to making it work, it's just a giant red flag of bad judgement that anyone would do that.


If you look at [1] and [2] it's strikingly clear why not tabs, stage1 is for building one program that is the next state compiler so while it's possible to build other programs you're expected to wait for it's completion before all of the minor features (tabs, crlf, etc) are available. Also, I find that the "hard tabs" complaints are rather silly provided the following is stated on the wiki:

Hard tabs are not accepted by stage1 because:

- It doesn't need to. All of the self-hosted compiler source is formatted with zig fmt and so there are no hard tabs. The complexity of dealing with hard tabs need not be present in stage1.

- zig fmt is not fully stable yet; use of zig fmt is not yet ubiquitous. If stage1 accepted hard tabs, then in practice, there would be accidental mixing of tabs and spaces.

[1]: https://github.com/ziglang/zig/wiki/FAQ#why-does-zig-force-m... [2]: https://github.com/ziglang/zig/issues/544g


So this is all for tax purposes, that sponsors can deduct their payments, and Andrew doesn't have to pay VAT on his income?


No it's to make sure donors know that the money they give will have a legal obligation to be used to achieve the mission statement of the organization.


No, this is to make the transition from a one-man show into a sustainable organization.


The organization bits came with >1000 issues, needing more committers. Now there are 8 committers and 1200 issues. And probably a dev list to handle internal issues.

I don't see the need for a financial organization, other than my arguments. Sustainability is much better without another entity interfering.


Yes. That is clearly exactly what is going on here. It's all about money. That's why the blog post explicitly talked about how focusing on money is a mistake.




Consider applying for YC's Spring batch! Applications are open till Feb 11.

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: