Zig cc: A drop-in replacement for GCC/Clang - <AUTHOR> https://andrewkelley.me/post/zig-cc-powerful-drop-in-replacement-gcc-clang.html <comment><USER2> > Take a moment to appreciate what just happened here - I downloaded a Windows > build of Zig, ran it in Wine, using it to cross compile for Linux, and then > ran the binary natively. Computers are fun!

> Compare this to downloading Clang, which has 380 MiB Linux-distribution- > specific tarballs. Zig's Linux tarballs are fully statically linked, and > therefore work correctly on all Linux distributions. The size difference > here comes because the Clang tarball ships with more utilities than a C > compiler, as well as pre-compiled static libraries for both LLVM and Clang. > Zig does not ship with any pre-compiled libraries; instead it ships with > source code, and builds what it needs on-the-fly.

Hot damn! You had me at Hello, World!

<comment><USER3> Dlang is a better C. DMD, the reference compiler for Dlang, can also compile and link with C programs. It can even compile and link with C++03 programs.

It has manual memory management as well as garbage collection. You could call it hybrid memory management. You can manually delete GC objects, as well as allocate GC objects into manually allocated memory.

The Zig website says "The reference implementation uses LLVM as a backend for state of the art optimizations." However, LLVM is consistently 5% worse than the GCC toolchain at performance across multiple benchmarks. In contrast, GCC 9 and 10 officially support Dlang.

Help us update the GCC D compiler frontend to the latest DMD.

Help us merge the direct-interface-to-C++ into LLVM D Compiler main. [https://github.com/Syniurge/Calypso](https://github.com/Syniurge/Calypso)

Help us port the standard library to WASM.

<comment><USER4> D seems like its pitch is "a better C++," but "a better C" doesn't seem quite right.

<comment><USER5> D's whole premise of "being a better C++" has always made them look like argumentative jerks. Why build a language on top of a controversy? Their main argument from early 2000s: C++ requires a stdlib and compiler toolchain is not required to provide one. Wtf D? I mean I understand that C++ provides a lot of abstractions on top of C to call itself "more" than C, but what does D provide other than a few conveniences? If you even consider garbage collection or better looking syntax or more consistent, less orthogonal sytax a convenience. It didn't even have most of it's current features when it was first out back in early 2000s. Trying to gain adoption through creating some sort of counterculture what are they? 14?. /oneparagraphrant

<comment><USER6> It is probably the case that D has a brilliant engineer team who doesn't really focus on the PR side of things. D definitely provides value over C/C++ other than a few sugars for the syntax. It is just not communicated that well.

</comment></comment></comment></comment></comment><comment><USER7> Really incredible work and it's been very fun to follow along. The streams where Andrew did the last part of this work can be seen here: [1], [2].

I am really happy that someone is making the effort to steadily simplify systems programming rather than make it more complicated. Linux goes to such incredible lengths to be bug-for-bug backwards compatible, but then the complexities of all of our layers of libcs, shared libraries, libsystemd, dbus, etc cause unnecessary pain and breakage at every level. Furthermore, cross-compiling C code across different architectures on Linux is far harder than it needs to be. I have a feeling that there wouldn't be as much interest in the steady stream of sandboxes and virtual machines (JVM, NaCl, PNaCl, flatpak, docker, WebAssembly) if we could just simplify the layers and layers of cruft and abstractions in compiler toolchains, libc implementations, and shared libraries. Practically every laptop and server processor use the exact same amd64 architecture, but we have squandered this opportunity by adding leaky abstractions at so many levels. I can't wait until installing a program on linux is as simple as downloading a static executable and just running it and I hope zig brings this future.

[1] [https://www.youtube.com/watch?v=2u2lEJv7Ukw](https://www.youtube.com/watch?v=2u2lEJv7Ukw) [2] [https://www.youtube.com/watch?v=5S2YArCx6vU](https://www.youtube.com/watch?v=5S2YArCx6vU)

<comment><USER8> Linux and GCC today have the ability to compile and run fully static executables, I don't understand why this isn't done...

<comment><USER9> N°1 most harmful post on the internet : [https://akkadia.org/drepper/no_static_linking.html](https://akkadia.org/drepper/no_static_linking.html)

I am convinced that Drepper's insistence on dynamic linking has set the linux desktop useability and developer friendliness back literal decades.

<comment><USER10> I work on an embedded linux system that has 256 MB of RAM. That can get eaten up really fast if every process has its own copy of everything.

<comment><USER11> ~15 years ago my "daily driver" had 256MB of RAM and it was perfectly usable for development (native, none of this new bloated web stuff) as well as lots of multitasking. There was rarely a time when I ran out of RAM or had the CPU at full usage for extended periods.

Now it seems even the most trivial of apps needs more than that just to start running, and on a workstation, less than a year old with 4 cores of i7 and 32GB of RAM, I still experience lots of lag and swapping (fast SSD helps, althougn not much) doing simple things like reading an email.

<comment><USER12> Are you sure? I've been running Linux for a long time with no page file. From 4gb to 32gb (The amount of RAM I have now) and have literally only ran out of RAM once (and that was because of a bug in a ML program I was developing). I find it very hard to believe that you experience any swapping at all with 32gb, much less "lots".

<comment><USER11> You've likely not experienced the amazing monstrosity that is Microsoft Teams:

[https://answers.microsoft.com/en- us/msoffice/forum/all/teams...](https://answers.microsoft.com/en- us/msoffice/forum/all/teams-hogging-memory-running- slowly/3a5ddd1a-e4b0-41be-881d-c0d46b9abe23)

There's a screenshot in there showing it taking 22GB of RAM. I've personally never seen it go that high, but the 10-12GB of RAM that I have seen is absolutely ludicrous for a _chat app_. Even when it's initially started it takes over 600MB. Combine that with a few VMs that also need a few GB of RAM each, as well as another equally-bloated Electron app or two, and you can quickly get into the swapping zone.

<comment><USER13> I also experience the same thing with Mattermost (the client also being an Electron app). The memory bloat usually comes from switching back and forth from so many channels, scrolling up to load more chat history, and lots and lots of image attachments (and of course, the emoticons).

<comment><USER11> _scrolling up to load more chat history, and lots and lots of image attachments (and of course, the emoticons)._

I remember comfortably browsing webpages with lots of large images and animated GIFs in the early 2000s, with a fraction of the computing power I have today. Something has become seriously inefficient with browser-based apps.

</comment></comment></comment></comment></comment></comment></comment></comment></comment><comment><USER14> The cross compiling features of Zig look fantastic! Installation is so easy, just downloading and extracting a single file.

Should every compiler stack have prioritized cross compilation over other features? (I vote: YES). Cross compiling programs has always been a PITA for most languages.

It would be great if Zig cc could be paired with vcpkg [1] for a nice cross- compiling development environment. Looks like vckpg requires a C++ compiler though.

1: [https://github.com/microsoft/vcpkg](https://github.com/microsoft/vcpkg)

<comment><USER15> Which reasonably-popular modern languages can be reasonably said to have ignored cross compilation? Interpreted languages like JavaScript and Python obviously don't have any problem, JIT languages like .NET and Java explicitly have a cross-platform layer, and modern compiled languages like Go and Rust specifically have cross-compilation as a goal. Rust still needs a libc though, but that's not Rust's fault, that's the result of trying to work together with the system instead of DIYing everything. (see: problems with Go doing system calls on BSDs, Solaris, etc)

You can't look at C which started in the 1970s and C++ which started in the 1980s and have expected them to even consider cross-compilation, when Autoconf wasn't even released until 1991.

<comment><USER14> I think the benchmark should be distribution. For instance, you mention "JavaScript and Python obviously don't have any problem", but say you want to create a distributable program for the 3 major operating systems, based in one of those languages, and you can't assume the user will have an installed interpreter. I don't think you will find any _standard_ solutions.

Most other languages make it _possible_ to generate some sort of artifact usable from different operating systems but not necessarily easy. I think Java only relatively recently included a standard way to create a bundle including a minimal JVM distribution with an app to make it usable when the user doesn't have an installed JVM (and again, there were a bunch of different non standard solutions of varying quality before that). Even now I wouldn't say the Java solution is easy to use.

I could continue in this fashion with different languages, but you get the idea.

I heard go is pretty good in ease of cross compilation, and well, looks like Zig is doing great in this area too. Ah! .net core is apparently pretty good in this area these days too.

<comment><USER15> That's moving the bar though. Only in the past decade or so has it become reasonable ("reasonable") to include entire runtimes together with an application. Java started in 1995, Python started in 1991. This was an era when one of Java's main targets was SIM cards and other highly minimal devices, so not only would the target already have a JVM, but it would be wholly impractical to ship your own. Even on desktops, downloading just a fraction of Java for each program would be a massive waste of limited bandwidth and disk space.

For that reason, Java and Python didn't start out with fully self-contained bundles as a design goal. It just wasn't practical in the 90s. Obviously, yes, if they had managed to correctly predict and plan for three decades of technological improvement, then sure, we'd be working in a very different technological landscape. But they couldn't possibly have, and solutions built on the old languages are always fraught with disagreement. So, we use new languages, like Go and Rust, which are developed with modern needs in mind.

</comment></comment></comment></comment><comment><USER16> I'd love for a hotlist or even prize for programmers doing awesome stuff like this. Off the top of my head, Andrew, Andreas Kling of Serenity OS, whoever ffwff is ([https://github.com/ffwff/](https://github.com/ffwff/)), Niko Matsakis of Rust, and so on. It'd be very awesome to have a roundtable with some of these people. They could discuss different approaches to design, their own histories and plans for the future. I loved reading Coders at Work, but I felt that there was a missed opportunity by not having the subjects interact with each other. So many of them had similar and very dissimilar ideas/approaches, which would have made for a wonderful discussion.

If someone could do the same but for a younger generation, I think it'd be very valuable.

</comment><comment><USER17> Zig (the language) is very appealing as a "better C than C". Check out [https://ziglang.org](https://ziglang.org) (dis-disclaimer: I'm unaffiliated.)

<comment><USER18> Aye, and it lives up to that claim as well in my opinion, despite being still relatively young and pre-1.0. My favorite thing about Zig is that it has managed to stay simple and solve many of the problems of C without resorting to greatly increased complexity like Rust (which is much more of a C++ replacement than a C replacement in my opinion).

<comment><USER19> Rust is not a C++ replacement, nor a C replacement. It targets its own niche (embedded, realtime, correctness-oriented). It's a totally different development culture. Zig, OTOH, is absolutely a C replacement.

<comment><USER20> My day job is maintaining the toolchains for a popular safety-certified realtime embedded operating system. I have never once been asked to provide a Rust toolchain. Fortran, yes. Ada, yes. Python and Go, yes. By and large it's just C (and more and more C++).

Rust seems to be mostly something "full stack developers" and "back end developers" embrace for server-side toys and hobby projects.

<comment><USER21> Python, on a realtime embedded operating system? Rust isn't really there for embedded development yet. It's great for low-level code on full-blown processors/OSs though

<comment><USER20> Python: customers ask, I deliver.

Top-end embedded processors have GPUs and hypervisors these days and run AI algorithms to, say, detect lane changes and do parallel-parking maneuvers. These days AI means code written in Python and Fortran.

</comment></comment></comment></comment></comment></comment><comment><USER22> Thanks everyone for the kind words! It's been a lot of work to get this far, and the Zig project has further to go still.

If you have a few bucks per month to spare, consider chipping in. I'm hoping to have enough funds soon to hire a second full time developer.

[https://github.com/users/andrewrk/sponsorship](https://github.com/users/andrewrk/sponsorship)

<comment><USER23> Why does zig purposely fail on windows text files by default? Do you really expect a language to catch on when you are purposely alienating windows users by refusing to parse \r for some bizarre reason?

<comment><USER24> And here I was just amazed from the blog post at the Windows support in cross compilation in either direction.

I find it hard to believe that someone could be capable of writing a non- trivial program but not able to change their text editor settings to use \n.

<comment><USER23> Every compiler handles it fine, I just can't wrap my head around why someone would intentionally cripple their software to alienate the vast majority of their potential users. I understand the problem and how to solve it, but it's such a giant red flag there is no way I'll care about this language. Most people probably don't actually understand why it fails and why a simple hello world program fails.

I'm floored that so many people would ignore this barrier to entry and somehow rationalize such a ridiculous design choice. If you make things straight up break for all windows users by default in your new language, it's going nowhere. No rationalization or excuses will change that reality.

<comment><USER25> Among programmers, distinction between CRLF and LF is known. Among non- programmers, you may well see people who will try to write code in WordPad, and that doesn't mean compilera should parse WordPad documents as source files. Do you expect people to write code in Notepad? If not, any reasonable programmer's editor supports Unix EOLs. Guide them to use Notepad++ or VSCode with proper options/plugins, case closed. Otherwise, you may as well complain about handling of mixed tabs & spaces in Python, or the fact that C requires semicolons.

<comment><USER23> Defaults cause zig to error out. This isn't that hard to understand or fix. It isn't even clear when it happens because it's just not something that any other compiler would error on. It isn't about being able to fix it, it about creating an assanine hurdle for anyone trying the language for the first time in windows. No other compiler or scripting language makes someone jump through that hoop. It is completely ridiculous. I still can not believe anyone would defend this decision. Do you want people to use it or not?

<comment><USER26> I have no issue with that decision at all and find it akin to Go forcing users to adhere to gofmt, and I don't use Zig. A good error message would be nice (EDIT: A zigfmt would be even better).

How many developers who try out new languages are even using Windows? I'd imagine most are on a UNIX-like. Regardless, I don't think it's a big deal either way. You could always make a merge request with a fix if you feel so strongly about it.

</comment></comment></comment></comment></comment></comment></comment><comment><USER27> I'm so glad we are seeing a shift towards language simplicity in all aspects (control flows, keywords, feature-set, ...). It'so important in ensuring reliable codebases in general.

<comment><USER28> i would love to see a shift towards small languages, which is subtly different from a shift towards simple languages.

there are plenty of things i feel are serious shortcomings of C (mixing error results with returned values is my big one), but the fact that the set of things the language can do is small and the ways you can do them are limited makes it much easier to write code that is easy to read. and that will always keep me coming back.

</comment></comment><comment><USER29> > uses a sophisticated caching system to avoid needlessly rebuilding artifacts

Reminded me of the Stanford Builder gg[1], which does highly parallel gcc compilation on aws lambda. make -j2000.

So with a zig cc drop-in, you might get highly-parallel cross-compilation?

Though the two caching systems might be a bit redundant.

[1] [https://github.com/StanfordSNR/gg](https://github.com/StanfordSNR/gg)

</comment><comment><USER30> "In order to provide libc on these targets, Zig ships with a subset of the source files for these projects:

musl v1.2.0

mingw-w64 v7.0.0

glibc 2.31"

These are super-important... (Otherwise, someone will be very limited in what they can compile -- the simplest of programs only...).

It's great that you included these, and as source, not as precompiled binaries!

(Also, a well-selected subset is probably the right balance of functionality vs. complexity...)

Anyway, very excited about the future of Zig as a drop-in Clang/gcc replacement!

</comment><comment><USER31> Perhaps I missed this from the blog post since it's unfamiliar to me. Can you compile Linux with this? Like, could you really straight up use this is a drop-in replacement for a whole Gentoo system?

<comment><USER22> I'm guessing the build system of Linux depends on more than just a C compiler, and that's why the answer to the question is "no". If the build system of Linux only depends on a C compiler then my answer would be:

That would be a nice stress test, which would undoubtedly lead to bugs discovered. After enough bugs fixed, the answer would be "yes".

I'll try it!

<comment><USER31> Exciting! This is almost what I was thinking would be lovely about one month ago when I was last hacking on C.

</comment></comment></comment><comment><USER32> Wow, that's one of the easiest ways I've seen to get a C compiler for RISC-V. Going on my list for when I'm playing around with emulators again.

</comment><comment><USER33> Zig is great and I can't wait to try cc! However, Andrew if you're reading this, the std is very confusingly named. It's not a hash map, it's AutoHashMap, it's not a list, it's a ArrayList, etc. I had a lot of trouble finding idiomatic code without having to search through the std sources, like an example with each struct/fun doc would help a ton.

<comment><USER34> To be fair, 'list' is such a generic term it's not really useful. ArraList and LinkedList and even a hash table are all examples of lists, but their performance characteristics vary so wildly that it doesn't make sense to call any of them simply 'list'.

</comment></comment><comment><USER35> Zig looks super cool. I've been wanting to experiment with it for some system software.

Are there any guides anywhere for calling libc functions from zig? I'm interested in fork/join, chmod, fcntl, and that kind of thing. Do I just import the C headers manually? Or is there some kind of built-in libc binding?

<comment><USER36> I think you can call libc by importing the C headers "automagically" but zig does also give you some of these things in its (admittedly still poorly documented) std lib:

std.os.fork: [https://github.com/ziglang/zig/blob/master/lib/std/os.zig#L2...](https://github.com/ziglang/zig/blob/master/lib/std/os.zig#L2732) std.os.fcntl: [https://github.com/ziglang/zig/blob/master/lib/std/os.zig#L3...](https://github.com/ziglang/zig/blob/master/lib/std/os.zig#L3173)

</comment></comment><comment><USER37> I read through the post but I'm still a bit confused as to what parts of this is Zig and what parts are coming from other dependencies. What exactly is zig cc doing, and what does it rely on existing? Where are the savings coming from? Some people are mentioning that this is a clang frontend, so is the novelty here that zig cc 1. passes the the correct options to clang and 2. ships with recompilable support libraries (written in Zig, with a C ABI) to statically link these correctly (or, in the case of glibc, it seems to have some reduced fileset that it compiles into a stub libc to link against)? Where is the clang that the options are being passed to coming from? Is this a libclang or something that Zig ships with? Does this rely on the existence of a "dumb" cross compiler in the back at all?

<comment><USER38> To compile C code, you need a bunch of different things: headers for the target system, a C compiler targetting that system, and a libc implementation to (statically or dynamically) link against. Different libc implementations are compatible with the C standard, but can be incompatible with each other, so it's important that you get the right one.

Cross-compiling with clang is complex because it's just a C compiler, and doesn't make assumptions about what headers the target system might use, or what libc it's using, so you have to set all those things up separately.

Zig is (apparently) a new language built on Clang/LLVM, so it can re-use that to provide a C compiler. It also makes cross-compilation easier in two other ways. First, it limits the number of supported targets - only Linux and Windows, and on Linux only glibc and musl, and all supported on a fixed list of the most common architectures. Second, building Zig involves pre-compiling every supported libc for every supported OS and architecture, and bundling them with the downloadable Zig package. That moves a _lot_ of work from the end user to the Zig maintainers.

Like most magic tricks there's no actual magic involved, it's just somebody doing more and harder work than you can believe anyone would reasonably do.

<comment><USER37> Does the LLVM toolchain that comes with Zig include cross-compilation support? Is that what it is using?

<comment><USER39> Yes.

</comment></comment></comment></comment><comment><USER40> In the Zig main page, there is a claim that making overflow undefined on unsigned can allow more optimization... but the example given is extremely dependent on the constant chosen. Try to change the 3/6 used in C++ to 2/4, 3/8 and 4/8 for example... It is very strange how the clang code generation changes for each pair of constants!

(Also, having undefined behaviour on unsigned overflow can make some bit twiddling code harder to write. Then again, maybe Zig has a bit-twiddling unsigned-like type without overflow check? Zip allow turning off checks, but then it turns off checks for everything...)

</comment><comment><USER41> I really love Zig, it can apparently replace our C toolchain with brilliant, static cross-compilation, including s390 Linux support (mainframe Linux!).

My only gripe is that the syntax and stdlib, although practical and to the point, seem to suffer from some strange choices that somewhat clash with its own, albeit early, "zen" of simplicity.

\- '@' prefix for builtin functions, a little strange and macro-looking for my eyes. Why not just plain keywords? And cleanup some of it: `@cos`, `@sin`, also feel like too much when they are already in the stdlib I believe.

\- |x| for/while list bind var, why not just for(x in y)? Surrounding pipes are really annoying to type in some foreign keyboards and feel totally needless in 99% of the places.

\- inconsistent required parenthesis predicates in block statements in "test STR {}" vs. "if() {}". Either require parenthesis or don't, I don't really care which one.

\- prefixed type signatures, `?[]u32` feels a little off / harder to read.

\- comment-looking, noisy prefixed multi-line slashes `\\\\`.

\- the need to dig deep into "std" to get your everyday lib functions out "std.io.getStdOut().outStream().print()". `@import("std")` repeated many times.

\- consider implementing destructuring syntax early-on to deal with so much struct member depth ie `const { x, y } = p` or `const { math: { add, mul } } = @import("std")`.

\- anonymous list syntax with `.{}` is eye catching as the dot implies "struct member" in Zig, but then the dot is everywhere, specially when you do anonymous structs `.{.x=123}`, maybe consider `[1,2,3]` and `[x=123]` given brackets are being used for array length annotation anyways ie `array[]`.

\- `. _` suffix for lvalue and rvalue pointer deref. Also ` "str"._` is a byte array unroll if I understood correctly. Here `f.* = Foo{ .float = 12.34 };` looks like it's doing something with `.` to get to the struct members but it's actually just a pointer deref. Also looks like a file or import lib wildcard (`file.*`) to my eyes.

\- field access by string clunky `@field(p, "x") = 123;`, with an odd function as lvalue.

Sorry for the criticism, we're seriously checking out Zig for migrating a large C codebase and replacing future C projects. Although we can live with these quirks, they just make the language look a little random and NIH and that worries me and the team. For instance, Golang has great syntax and semantic consistency which is a boost on project steering quality and assured, life-long onboarding for newbees. Please consider widening the spec peer- review process, maybe in a separate Github repo with markdown proposal writeups. Discussing syntax seems superficial given many project and compiler feats under the hood, but it can become sorta "genetic disease" and a deal- breaker for the project on the long run!

This is a pre-release version I know, but it's just that my hopes are really up for Zig as Golang, C++ and Rust never really did it for us as a multi- target sw toochain for various reasons.

<comment><USER33> No for loops with a constant count is also a very strange choice

        for (([100]void)(undefined)) |_, verb| {

And I've been bitten multiple times with line endings having to be \n only.

<comment><USER42> While I agree it's jarring to adjust to Zig's purpose of a for loop (iterate over collections), the syntax here is really pushing you, consciously, to adopt while loops instead. The only snag is that the invariant lives outside the scope of the while, which feels bad.

</comment></comment></comment><comment><USER43> Because you are using nixpkgs...

~~Does `zig cc` cross compiler libgcc/compiler-rt on the fly? Does it compile libc on the fly?~~ Nevermind I did not scroll enough, it does compile on the fly. Whew!

As someone who also cares greatly about cross compilation, compilers definitely should step up their game, but `-target x86_64-windows-gnu` elides many details, unless you are confined to a fix set of platforms.

</comment><comment><USER44> This looks impressive. Cross-compilation is sorely underserved. I will definitely be checking this out.

</comment><comment><USER45> I'm normally not an 'oh my god'-kind-of-guy, but... Oh my god!

Zig looks like a nice language for kernel development as well: [https://github.com/jzck/kernel-zig](https://github.com/jzck/kernel-zig)

</comment><comment><USER46> Looks very cool! Did not see 32-bit RISC-V on the list though, so wondering about that. I would have liked to use Zig cc to build 32-bit RISC-V binaries fast, if that is possible. Doesn't matter if they are freestanding.

<comment><USER22> You can indeed use zig to make riscv32-freestanding binaries (in both zig and C). What is not available is `-lc` for this target.

</comment></comment><comment><USER47> How does Zig compare with Nim and Rust? (putting aside the differences in adoption)

<comment><USER48> Manual memory management is the most important difference

</comment></comment><comment><USER49> Damn, what an awesome project! That's a lot of hard work, and now I want to try Zig. One more oh god save me from programming languages.

</comment><comment><USER50> What are the limitations? Speed? External libraries?

<comment><USER18> Afaik the only drawback is that this functionality is very new and still has some open issues (linked at the end of the post). As stated there are no dependencies for Zig and it is shipped in relatively small tarballs which can be downloaded from the Zig website: [https://ziglang.org/download/](https://ziglang.org/download/)

</comment></comment><comment><USER51> Why is there a sparc backend but no sparc64 backend? sparc64 is what Debian uses these days, so having support for it in Zig would be nice.

</comment><comment><USER52> can zig compile to C? so many languages would be very useful if they could compile to C for embedded systems as native compilers are very unlikely for new ( or even old ) languages

<comment><USER53> Compiling to C source isn't planned for the reference Zig compiler, as far as I know. It's more interested in helping people moving people off of C (see `zig translate-c`).

But for supporting more esoteric targets you might be interested in the goals of this ultra-early-stage assembler. ("Planned targets: All of them.")

[https://github.com/andrewrk/zasm](https://github.com/andrewrk/zasm)

<comment><USER54> As a (part-time) C programmer, I wouldn't really consider a "C replacement" that can't compile to C. Part of the appeal of C is that it's easy to integrate into other projects, regardless of the build system or obscure hardware it might be targeting. If you require a compiler for a language few people have heard of (even a very cool language), it seriously limits your potential user-base.

If you tell me that I can write better, safer code by using Zig, but I can also compile it into a .c artifact that anybody can use, now _that_ is a tempting proposition!

<comment><USER55> Unless you really really need obscure platforms, just forget about it. Make the jump, don't look back.

After you get a taste of a modern toolchain (with cross-compilation, dependency management, but withou not-quite-portable build files to endlessly fiddle with, without outdated compilers to work around), you will not want to have to compile a C file again.

Languages like Zig and Rust are easy to install. Mostly it's just a tarball, so it's less of an inconvenience than getting the right version of autotools.

<comment><USER52> its not obscure platforms, its a ton of embedded platforms (you may consider that obscure, but reality is there are millions and millions of devices out there running software on these "obscure" platforms), most of them don't have many options. At one stage I was writing write my own language to compile to C based around state machines and actors as so many devices tend to be some version (often badly implemented) of those two things. But I ended up moving out of the embedded world and kind of lost my prime motivation for doing it.

</comment></comment></comment></comment></comment><comment><USER56> Can `zig cc` also compile to WebAssembly/WASI?

<comment><USER57> Zig itself does support cross-compiling to WASM/WASI ([https://ziglang.org/documentation/master/#WebAssembly](https://ziglang.org/documentation/master/#WebAssembly)), so there's surely some way to coax 'zig cc' into doing the same (though I haven't tried it).

</comment></comment><comment><USER58> llvm is a bloated hot-mess of a compilation framework, built on a bloated hot- mess of a language (C++).

Folks who have achieved great things with llvm (and C++) have done so 'despite' what they used, not 'because of' it.

This has been my conviction for the past 10 years, and I'm glad I never had to touch llvm with a ten foot pole.

I had no doubts it'll soon be surpassed by a common-sense no-bullshit tool- chain.

Has Zig cc achieved that? Great. No? It will or someone (or I) will develop an alternative that will.

<comment><USER37> > This has been my conviction for the past 10 years

I would suggest holding your convictions more loosely.

</comment></comment><comment><USER59> Wonder whether one can include this in iOS ...

</comment><comment><USER60> You know what you doing! Take off every zig!

</comment><comment><USER61> I don't want to be negative as there's too much of that about but gcc and similar can do some pretty hefty optimisations, and for any real work I suspect those count for a great deal. Just because zigcc can compile C, neat as it is, doesn't make it a drop-in replacement for gcc.

Does yours do loop unrolling, code hoisting, optimise array accesses to pointer increments, common expression elimination etc?

<comment><USER62> Zig uses clang on the back-end, so while IANA compiler expert, I suspect it does all these things.</comment></comment>


New github file browser - <AUTHOR> http://github.com It looks like they implemented the github finder project but there is no information on the blog yet.<p>http://sr3d.github.com/GithubFinder/?utm_source=bml&user_id=sr3d&repo=GithubFinder <comment><AUTHOR> Im sorry I think the note got cut.

It looks like they've implemented a project mentioned on hacker news a while back called Github File Finder.

Its still up and can be found here, [http://sr3d.github.com/GithubFinder/?utm_source=bml&user...](http://sr3d.github.com/GithubFinder/?utm_source=bml&user_id=sr3d&repo=GithubFinder)

The movement and so seems a bit distracting but its definitely faster than a full page refresh

</comment><comment><USER2> Are you referring to the new UI behavior (new at least to me, since this is the first time I've seen this) when you click on directories/files in the repository file browser like in <https://github.com/git/git> for example?

I don't really use the github file browser frequently enough to be able to tell if the async loading of the files/directories is what you're referring to. Plus, linking to the github home page was kind of confusing.

<comment><USER3> Maybe I just haven't got the update yet, but this looks the same behavior as always...

<comment><USER4> It looks similar, but is much faster since it loads folder and file views without a page reload.

</comment></comment></comment><comment><USER5> Hmmm I found it a little bit distracting at first.

</comment><comment><USER6> eh, the slide out to the left is okward, having the file listing slide up and down would feel more natural I would think.</comment>


How to Design Programs, second edition - <AUTHOR> http://www.htdp.org/ <comment><USER2> On this topic, one of my eye-openers was Game Programming Patterns: [http://www.gameprogrammingpatterns.com](http://www.gameprogrammingpatterns.com)

It's classic software architecture patterns, only seen through the lens of performance and design iteration speed, which is the way I see the world even though I don't make what most people would consider games.

<comment><USER3> I've commented at length about this book before; really, just don't bother. It's not very good at patterns, not comprehensive, not clear on how to use them for games or why you might want to use them at all.

Google search "design pattern book". Right, now take any of those books.

If you want game related stuff try "game programming gems".

This book is free... that's literally all it has going for it. Wikipedia has better stuff that you know... actually compiles, etc.

If you got any value out of Game Programming Patterns, I cannot strongly enough recommend you go and read an actually good book on design patterns; you've probably been mislead by its vague hand waving and incoherent discussion of the various topics.

<comment><USER4> I completely disagree. I felt it was a modern followup to the classic Design Patterns (Gang of Four) book. The author is not trying to teach game programming as much as he is demonstrating how they are practical in his line of work.

<comment><USER4> After seeing the original debate I'm sure I won't add anything you haven't heard already: Game Programming Patterns - [https://news.ycombinator.com/item?id=14475489](https://news.ycombinator.com/item?id=14475489).

<comment><USER3> nope.

...but once again I recommend anyone who reads this post go browse wikipedia's design patterns section. Its pretty neat:

[https://en.m.wikipedia.org/wiki/Software_design_pattern](https://en.m.wikipedia.org/wiki/Software_design_pattern)

</comment></comment></comment></comment></comment><comment><USER5> I find that structuring your intro course around how to deal with data in different forms is a fantastic intro. It lets you focus on the vital parts, but in a way that lets you deal with the ugly parts (user interaction and error handling) later on without changing much.

I really like this book.

<comment><USER6> What I also like about this book is that it manages to get to "exciting" programs fairly quickly. Like, for a first time programmer, it can be boring to spend all your time writing things that convert Fahrenheit to Celsius or print staircases out of asterisks with double for loops. In this book, it's very easy to work with images, allowing things to move towards things like basic game development very quickly.

</comment></comment><comment><USER7> Although I like HtDP as a scheme book, I have to say that its title has always been a bit misleading. It certainly doesn't teach you how to design programs, it is rather a good introduction to common scheme programming techniques.

It teaches abstraction and techniques like streams and recursion. In that respect HtPD is very similar to Winston & Horn's _Lisp_.

<comment><USER8> I teach using HtDP, so my opinions are unsurprising here, but this is very wrong. The central ideas in the book are about data-driven design, specifications, systematic design of correct programs, and abstraction of all kinds. These are fundamental program design techniques, not details of scheme programming.

<comment><USER9> Been a while since I took the intro CS course from Matthias at Rice (late 90s), but I do remember he was an eloquent teacher who really illuminated for me the idea that you could simplify the design of complex programs through formal techniques (as opposed to the cowboy coding I had picked up in high school). Whether or not I was always disciplined going forward, I've often felt the nudge to take a deep breath and think a bit more because of the image of Matthias speaking so emphatically about these things in my mind.

<comment><USER10> To see it done with imperative style, check out Stavely's write-up or book on the Cleanroom method:

[http://infohost.nmt.edu/~al/cseet- paper.html](http://infohost.nmt.edu/~al/cseet-paper.html)

I'd like to see a HtDP/Racket attempt at Cleanroom to see what differences or similarities there would be. SPARK Ada and miniKanren, too. It's already closer to them with its algebraic style of specification of programs that use only a few primitives for easier analysis. Edit to add that what DonaldPShimoda describes is exactly what Cleanroom required with its "intended functions."

<comment><USER11> Had a look at the article you linked to, thanks for sharing.

I've done some work (in projects, not academia) on trying to create low-defect software - by informal methods, not formal verification, so the paper was interesting.

</comment></comment></comment></comment></comment><comment><USER12> seems like an interesting addition to SICP. Anyone here who already worked through it?

<comment><USER13> Back in 2013, when Coursera was free, Gregor Kickzales taught _Introduction to Systematic Program Design_. It was based on the principles in HtDP. The videos can be found on his YouTube channel: [https://www.youtube.com/user/gregorkiczales/videos](https://www.youtube.com/user/gregorkiczales/videos) That class has since morphed onto Edx. It is now part of the Edx Software Development "micro-masters". [https://www.edx.org/micromasters/software- development](https://www.edx.org/micromasters/software-development) The origin of all those courses is Kickzales' teaching at University of British Columbia...and the PLT Group centered at Boston University.

In comparison to SICP, HtDP is slower paced and more basic in terms of Computer Science. Not surprising since the intended audience of SICP was MIT undergrads rather than those more toward the middle of the high school academic Bell Curve. The other major difference is that HtDP is a specific methodology utilizing specifications, tests, stubs, and other techniques for writing programs.

In terms of Books as Books, SICP is better written. It has far better type- setting and binding. It is a pleasure to read. And to hold. HtDP has a poor physical format and below average typesetting for a textbook, it's just ugly and awkward all around. HtDP doesn't reflect a Knuthian concern with typesetting and the experience is closer to a bound website than TAoCP. =

<comment><USER8> Are you thinking of the print edition? Both books are typeset using TeX, and both are printed by MIT press, so this is a pretty surprising claim.

<comment><USER13> By "books as books," yes, I mean the print editions. The first edition of HtDP specifically since that is the one I own. By "typesetting" I mean the entire process of producing a physical artifact from an edited manuscript. Thus, I am including aesthetic considerations such as typography, cover design, and binding.

TeX is a technology. In the context of my literary criticism, citing TeX and MIT press is analogous to "styled with CSS and hosted on GoDaddy" in regards to a website. TeX is a tool. MIT Press is a good publishing house and its catalog contains quality, but some of its books are still better than others in terms of typesetting (in the sense described). The differences can reflect authors' goals; publishing economics; and just the times (HtDP came about in the era of the commercial web).

Personally, I find the unconventional physical format of HtDP (8" x 9") awkward. It's unbalanced. The pages are too wide. The compensating increase in font size makes the lines so tall that there is low information density on each page. As a reader, the amount of head/eye movement for a disrupts my concentration. The gutters are far too wide. I suppose that the wide gutters were to accommodate the Lambda icon, but these peter out in the first quarter of the book. Because these could be taken away with little effect their inclusion is a decision that could have been revisited and a more conventional layout considered.

The typography is haphazard. Code on page 191 uses san-serif. Code on page 322 is set in four faces; a mix of serif and san-serif, bold, and italics; and boxes. Page 299 has its own notation. Often its complexity obscures the big ideas: on page 278 the unimportant ideas are in bold (local is irrelevant to the local point of _f_ 's referent) [1] and the diagram's arrows connect the thinnest term and the thinnest term is typeset in _italic_.

Please don't take my remarks personally except in so far as I think HtDP is a book worth owning and reading and that the world is better for it existing in its current form. It's useful and supports an important project that I like. Thanks.

[1] Page 279 uses nested boxes to express locality. These have semantics distinct from boxes on page 322.

</comment></comment></comment></comment><comment><USER14> has anyone got a PDF or EPub of this?

<comment><USER15> This was posted on Reddit last week: [https://my.mixtape.moe/bnkrpd.epub](https://my.mixtape.moe/bnkrpd.epub)

Works fine.

<comment><USER16> Crashes iBooks on my iPad, unfortunately.</comment></comment></comment>


Create your own theme for Google chrome - <AUTHOR> http://www.techdistance.com/2011/09/create-your-own-theme-for-google-chrome.html

<comment><USER2> I create wonderful theme using your article..</comment>


Clinkle Finally Launches to Let You Pay Friends and Earn "Treats" - <AUTHOR> http://techcrunch.com/2014/09/23/clinkle/ <comment><USER2> Omg, nobody proofread that article? Since when did TechCrunch become this horrible at actual...English? Look at these:

"What Clinkle doesn't do is allow instant peer-to-merchant payments via high frequency sounds without a like it was hoping."

"Clinkle was shooting for the kind of "Innovation" with a capital I that we laud in Silicon Valley."

"The app is certainly slick, with tons of delightful little animation flourishes."

Did their writers go full retard?

<comment><USER3> Hey, Clinkle engineer here. We know Josh personally from our time together at Stanford. He really dislikes the company, and hopefully it was quite clear that the article was biased, rushed, and overall pretty unprofessional.

<comment><USER4> I'm not exactly sure that you're unbiased in this discussion either.

While the article may have been rushed, it didn't really seem unprofessional.

<comment><USER5> Wellll the headline is does describe them as a "laughingstock"

<comment><USER6> Some laughingstocks really are laughingstocks ... My only recollection of Clinkle before this article was that the name might not be taken seriously (perhaps during a discussion here on HN). Who declared them to be a laughingstock? Probably not those who invested - and I'm not going to second guess the VC talent that put up their money.

</comment></comment></comment></comment></comment><comment><USER7> As relevant as ever: [https://twitter.com/mrgan/status/384780273721696256](https://twitter.com/mrgan/status/384780273721696256)

@mrgan

—"I'd like to, uh… "pay with clinkle."

—"Excuse me?"

—"Uh, pay with… clinkle?"

—"Do you need the key to the restroom?"

—"Pay… with… clinkle"

</comment><comment><USER8> Please note actual, accurate headline is "Mobile Wallet Laughingstock Clinkle Finally Launches To Let You Pay Friends And Earn 'Treats'"

</comment><comment><USER9> You should take a look at Clinkle's Team page: [https://www.clinkle.com/team](https://www.clinkle.com/team)

All of the Clinkle team members have _quirky and random lol xD_ photos on mouseover.

Except the CFO. He means business.

<comment><USER10> Did you copy and paste the comment from ValleyWag?

He has been there for just a few months. I would bet that he is too busy for selfies.

<comment><USER11> The guy to his left probably spent an extra 30 seconds recording his "silly" face.

</comment></comment></comment><comment><USER12> In general, I like to give new technologies/apps a chance. I have spent some time looking at the payment space and the concept of "treats" is at least interesting. I think the name "treats" undermines what it does.

If you swipe their debit card seven times you get one of these "treats". If this caught on, the network effect may arise where people start paying for friends coffees/small gifts. The question is, is the value of rewards that are giftable > credit card's value. Not sure that it is but I'm also not sure that it is not.

The comments have been brutal but I wouldn't completely dismiss the concept just yet.

</comment><comment><USER10> What a start-up horror story.

> At least Clinkle employs 128-bit AES encryption

This is ground breaking.

</comment><comment> at-fates-hands Unfortunately, this company will remain an SV punch line for a long, long time to come.

</comment><comment><USER13> Why should I use this instead of my rewards credit card?

<comment><USER9> Because it's social.

It's not a particularly compelling argument in 2014.

</comment></comment><comment><USER14> Curious what the author of that article has ever built or created. My guess is nothing. From the looks of his twitter profile, I think that is pretty much confirmed: [https://twitter.com/joshconstine](https://twitter.com/joshconstine)

So easy for those in the pseudo-journalistic world TC and much of the Tech press live in to knock down, destroy and critique.

Meanwhile, more talented folks keep building and creating....

<comment><USER9> Ad hominem aside, a lack of experience doesn't inherently make an argument invalid.</comment></comment>


Global Innovation Index 2019 - <AUTHOR> https://www.insead.edu/newsroom/2019-insead-launches-global-innovation-index-2019-india-makes-major-gains-as-switzerland-sweden-us-netherlands-uk-top-ranking-trade-protectionism-poses-risks-for-future-innovation <comment><USER2> If you innovate without filing patents, your innovation does not count?</comment>


Ask HN: How successful is your 'Donate' button? - <AUTHOR> Hi HNers,
For those of you with side-projects that are free, but have an ongoing donate option (either through a PayPal button, or something more formal like Patreon) - how successful has this been for you?
In this instance, I'm only referring to ongoing, optional donations, not funding options like Kickstarter or Gofundme.
Thanks! <comment><USER2> I'd be interested in this too. I don't recall ever donating through a Donate button, though I've put money in Kickstarter and I always payed above average for Humble Bundle when I bought them.

It seems the tougher part is getting me to pay at all! After that, I'm happy to pay a reasonable amount.</comment>


Ask HN: What are some under-hyped technology trends that deserve more attention? - <AUTHOR> It seems like a lot of HN readers think AI and Blockchain tech are overhyped. What do you think are some under-hyped trends that we should pay more attention to? <comment><USER2> Great question, I'd argue that for Blockchain it's the current projects and their speculative fundraising that are overhyped. Not the technology itself, which unfortunately too few take the time to fully investigate.

</comment><comment><USER3> I still don't think we've seen the end of chatbots.

<comment><USER2> How do we know you're not a chatbot programmed with a strong survivalist instinct? ;)</comment></comment>


Ask HN: Where can I find hungry developers who will get in bed with a startup? - <AUTHOR>

I'm 24, have a business background, and a software-intensive business (that requires enterprise selling -> my role).
Where can I find young, passionate, developers who are willing to trust me as a non-technical person? I understand software architecture, produce wireframing and workflows, but all of the people that I know / have met in Minnesota either:
1. Want to moonlight 20 hrs a week (not available during the day, not committed long term, in it for the money) or
2. Suggest that I contract with a software development firm ($, lack long-term relationship).
How/Where can I find developers who want to get in bed with me?
(personally, we've received seed funding but I don't want a partner to work just for money). <comment><USER3> _Where can I find young, passionate, developers who are willing to trust me as a non-technical person?_

First of all, why are you worried about age?

Anyway, are you looking to hire employees or are you looking for co-founders who will receive some substantial equity stake for joining you? You talk about only finding people who are "in it for the money" but people do have to pay bills... are you offering salary + equity or just salary or just equity or what? In the end, you'll have to sort out what combination is appealing to the people you're looking for.

Beyond that, the answer to your question is really no different than the answer to my question, which is basically going in the opposite direction: "How can I find a hungry sales/marketing/bizdev person to get in bed with my startup?" And the answer really reduces to sales... when you talk to potential co-founders (or early stage employees) you're selling, just as much as when you talk to investors or prospective customers. You have to sell them on you, on your vision, on your ability to build and manage a company, and - <USER2> even more importantly - on their role in this creation you're concocting.

If you approached me, I know I'd need to you convince me that you were serious about the project, invested in the project in some fashion (not necessarily money, but something beyond just an idea), committed to the project; and you'd need to convince me that my role would be something where my needs (whether that be financial, professional, psychological, whatever) would have a reasonable chance of being met.

For example, as a "tech guy" I'd want a fairly strong say in any and all technical decisions (duh, right?) but that would also extend to the the point of including discussion of product features, long-term product strategy, and anything that would have a substantial impact on "my stuff." I doubt I'm alone in this regard, as techies go. So if you come across as "I'm the product idea guy, I just need a programmer to slap this together, and just do what I tell you" then yeah, you're going to get guys saying "sure, pay me market rate and I'll build that for you" or "sure, go outsource to so-and-so software development, inc." Come off as "I'm building this thing and I want people to become a real part of this" and you have a fighting chance.

<comment><AUTHOR> Re: Age - I've found that younger people are hungrier to be successful, will admit when we don't know something, have less obligation (relationships, mortgage) and are willing to work longer hours as we establish a foothold with our company. We're also

RE: finding business talent, you can look to entrepreneurship programs at universities, soph/jr's have to start building companies as part of coursework, some of them will be brave enough to put FT energy into your technology. (provided they see you've invested energy into it yourself, like you mentioned above)

I want to build something alongside a long-term development team. There's been 6 different people who have put hands on my code, and eventually decide to take another job. So by the time they've started producing a new feature, it's on to the next one.

The initial conversations have started like "I'm looking for a long-term developer who can create, design and execute features for an education-related software start-up. We're a team of 2 business guys and have 20 clients, a seed round of investment and ~100k in revenues. Offering salary + equity commensurate with experience."

What are we missing?

Besides looking at each candidate's code samples, how can we evaluate who the right people are to bring in as a CTO or CIO?

<comment><USER3> _What are we missing?_

Hard to say. The Devil, as they say, is in the details. But if you've had a number of people come along, stay briefly and then walk away, well... chances are you're doing _something_ wrong. Maybe it just reduces to picking the wrong people, but it's hard to say.

 _Besides looking at each candidate's code samples, how can we evaluate who the right people are to bring in as a CTO or CIO?_

It sounds like your problem is less about coding skill and more about commitment to the project. Unfortunately, going on what you've said here, it's hard to take even a guess at what you should be doing differently. :-(

</comment></comment></comment><comment><USER4> Learn to program. There is nothing like a programmer who can sell.

<comment><AUTHOR> Is a salesman who can program of any value?</comment></comment>


Pitch Club - <AUTHOR> http://pitchclub.dourp.com/ <comment><USER2> Where does pitch club happen? Online? Coming soon to a city near me?</comment>


Show HN: Ensure that a local Git clone is in sync with a remote - <AUTHOR> https://github.com/oleks/gitsync <comment><USER2> Nice. Handy!</comment>


Ye cannae change the laws of physics -- or can you? - <AUTHOR> http://www.economist.com/node/16930866

<comment><AUTHOR> That a universal 'constant' may vary not just over the age of the universe, but in different directions from 'here', is also an idea in Vernor Vinge's 'Deepness in the Sky'/'Fire Upon the Deep' universe. There, faster-than-light travel and more rapid computation become possible further from each galactic core.

If some physical laws are subject to graduated variation across the universe, the migration of intelligence might be biased in the direction of more- favorable conditions. Perhaps any matrioshka brains with a choice wouldn't be caught dead in our neighborhood.

<comment><USER2> Have you read Greg Egan's _Diaspora_? The "direction" of migration described there is quite interesting:

<http://en.wikipedia.org/wiki/Diaspora_%28novel%29>

<comment><AUTHOR> I've read a bunch of Egan but not _Diaspora_ \-- I'll get to it eventually!

In both _Permutation City_ and _Schild's Ladder_ there are also situations where physical laws are in flux, and characters have to get out of the way of change.</comment></comment></comment>


Regular excess drinking can take years off your life, study finds - <AUTHOR> http://www.bbc.com/news/health-43738644 <comment><USER2> kj</comment>


Show HN: Desktop reminder app for Google Calendar with push support - <AUTHOR> https://chrome.google.com/webstore/detail/owl-reminder-for-google-c/fgfgfbgekocmkfenbpndokpjjbifncoj

<comment><USER2> Nice app. I feel like another biggest advantage would be if we can popup reminder on ctrl+alt+del press. Most of the times users step will go out without realizing meeting scheduled. If user see the popup, it will be reminder for them.

<comment><AUTHOR> That is a very good idea. But it means I need to intercept the default logout behavior of the system. I will check whether that is possible too.</comment></comment>


OpenJDK to Migrate to GitHub - <AUTHOR> https://openjdk.java.net/jeps/369 <comment><USER2>
        Goals:
        Host all OpenJDK Git repositories at https://github.com/openjdk/.

First, LLVM and now OpenJDK? I would be happier if this was creating an official mirror but no; it's the entire project.

There is nothing wrong with having a self-hosted GitLab/BitBucket instance these days. Migrating to Github is basically a no-go for a project like OpenJDK since once GitHub goes down it takes everything with it.

Since OpenJDK is using Mercurial this also means that they have to convert all their mercurial history into Git! Is it really worth the move?

        Alternatives

      1. Keep using Mercurial and the existing OpenJDK workflow. (For repos as large as those for the JDK, we do not expect it to be practical to use hg-git or similar tools to retain a client-side Mercurial version of a server-side Git master repo.)

      2. Use GitLab EE as the external source-code hosting provider.

      3. Use BitBucket as the external source-code hosting provider.

Out of all options: (1) is the best option. (2) is sort of OK but GitLab can be replaced with "open-source hosting provider".</comment>


Tim Cook's Email to Employees About Apple's $1T Milestone - <AUTHOR> https://www.buzzfeednews.com/article/johnpaczkowski/read-tim-cooks-email-to-employees-about-apples-1-trillion <comment><USER2> At Netflix, the milestone we celebrated was subscriber numbers, since that is what drove the business. Someone once asked our CEO why we didn't have a holiday party, and he said in effect that he'd rather celebrate important business milestones, and not a day on the calendar.

It's interesting to me that Mr. Cook is downplaying this, but it makes some sense, since the price of the stock (and therefore the valuation) is only loosely tied to the success of the company.

It seems like the CEOs who really know what they are doing choose their celebrations carefully.

A good lesson to learn here.

<comment><USER3> > At Netflix, the milestone we celebrated was subscriber numbers

I feel like this is the same trap that Facebook fell into. Celebrating subscribers is great until you top out.

<comment><USER4> Why this crazy obsession for meteoric growth? If Netflix tops paid subscribers, it's likely doing incredibly well. Hell, even free subscribers make enormous amounts of money to Facebook.

</comment></comment></comment><comment><USER5> Isn't it a little bit sad to see that Tim Cook in this situation still looks backwards and talks about Steve Jobs in half of the email? Instead of being forward looking and laying out his vision of the future of apple and the products to come? He really is still simply maintaining Jobs' business, trying to repeat what Jobs said as often as possible so that he sounds like him.

<comment><USER6> Every culture has its myths, and in Apple's culture today, no myth is bigger than Steve Jobs. It might be wise of Cook to invoke Jobs at big moments.

He knows he's never going to match that legend... so why try? Instead of fighting it, he uses it to foster a common purpose within the company.

In terms of "maintaining" the business, Apple's share price when Cook became CEO seven years ago was about a quarter of what it is now. Pretty good maintenance.

<comment><USER7> I was just having a conversation with a friend about Tim and his role at Apple.

I posited that Steve probably wasn't the right person to grow Apple to $1T in market cap and that Tim really made it happen. My friend took the opposite side believing that Tim is just running of Steve's ideas and that Tim had relatively little to do with making it happen.

Curious to see what HN thinks.

<comment><USER8> This kind of debate is like who's the GOAT of the NBA, Lebron or MJ. It's gonna be a lot of cherry-picking of data, subjective thoughts, etc. Not that the debate wouldn't be fun or illuminating, just that an objective answer is probably out of reach.

<comment><USER7> For sure. It's not a black and white topic.

This is an interesting topic for me as I find myself asking similar questions about my role at a company I founded.

I founded a company currently valued in the low-mid 8 digits. I successfully brought the company through an acquisition and have doubled revenues since.

I keep coming back to an article I read on HN years ago talking about the 4 types of CEOs: founder, growth, maintenance, death (bankruptcy). While I've found success in 1 and 2, I don't enjoy 2 as much as 1 and I don't think I'd be any good at 3 or 4.

I'm probably experiencing a form of imposter syndrome as the board & leadership are all satisfied with my performance, but the thoughts still linger.

<comment><USER9> Read Rocket Fuel. Its a book I am sure the HN crowd will critique but it has made a large difference in how my biz operates and how multiple founders fill roles. I am very much an "integrator" from the book. I am less of the massive, big picture and more of the day to day execution. Good at growth/maintenance. Not great as a true "founder". And I have managed through near death and it seemingly took years off my life so I'd prefer not to go back to that one!

</comment></comment></comment></comment></comment></comment><comment><USER10> A bit off-topic. I've noticed that P/E ratio (Price / Earnings) is pretty decent for Apple and it doesn't change much. In fact, since 2009 till today P/E stays in corridor between ~10 and ~20. What it means is that $1TB market cap is relatively cheap price for Apple. Their stock price merely reflects growing net income, so their EPS (Earning Per Share) growing steadily over years:

[https://www.macrotrends.net/stocks/charts/AAPL/apple/pe- rati...](https://www.macrotrends.net/stocks/charts/AAPL/apple/pe-ratio)

</comment><comment><USER11> So how much cash has Apple amassed in the last fifteen years or so since the iPhone reign? I'd say enough to keep them floating for at least another 20 years. And a lot of that could be attributed to Cook.

</comment><comment><USER12> HN downvotes anything critical of apple, so heres my criticisms-

>Anti consumer- Proprietary hardware, non standard devices, and a constant cornering of user content. I remember burning CDs from Itunes and ripping them back just to use them on my mp3 player... The hardware is 2x the price of non Apple brand, this should come as no surprise.

>Anti developer- It sounds like at bare minimum I will need a 600 dollar refurbished apple mini to compile my app. And pay for yearly development. And apple intentionally breaks code. Not to mention prior to 2014, they were harsh on app developers denying many people's hard work.

I cannot understand the fandom on HN, why would anyone be a fan of such an aggressive company?

EDIT: 3 downvotes and 0 reasons why? Did Apple buy accounts on HN?

<comment><USER13> > why would anyone be a fan of such an aggressive company?

For all their faults, they brought personal computing quality out of the gutter and actually gave a fuck about UX.

To this day, you can't even reliably search for local files on a win10 system. They literally laid off their QA department.

<comment><USER14> > To this day, you can't even reliably search for local files on a win10 > system. They literally laid off their QA department.

I would've thought this to be an exaggeration, but I have the discord app installed, it's automatically starting at boot, It's pinned to the task bar, but when I search for "discord" in the start menu, it gives me a worthless "search the web" result. It's almost insulting...

<comment><USER15> Ironically there's a Search and Indexing Troubleshooting Wizard built into Windows 10 because the feature is so unreliable but the Start Menu search doesn't find it even when it's working properly.

<comment><USER13> The conspiracy theorist in me says they broke it on purpose to encourage users to migrate to azure or onedrive. Even on 3+ghz CPUs with multi-gbps SSDs, copying hundreds of little files on my win10 OEM pc was painfully slow. I suspect the A/V was scanning every single one. They have every incentive to gimp local file I/O to promote their higher-profit cloud services.

<comment><USER15> That is the Defender real time protection, loves to hog enormous amounts of CPU during any file I/O, you can disable it temporarily but it very aggressively nags you about it. However it does let you exclude specific folders and will not prevent you from doing things like excluding your entire home folder or even C:\\.

</comment></comment></comment></comment></comment></comment><comment><USER16> Steve (alone?) founded Apple?

<comment><USER17> Your pedantry is annoying. "PERSON DID THING on the belief" is a literary turn of phrase.

<comment><USER16> Not sure which pedantry is annoying to you, but I thought it was surprising that the guy running Apple isn't crediting at least both Steves for founding the company on that belief.

</comment></comment></comment><comment><USER18> Mentioned elsewhere, but also the first company that should have paid $1 Trillion in taxes by now.

<comment><USER19> If they made their current net annual income for the entirety of their existence (not even close), then they would've needed to be taxed ~50% to have reached $1 trillion in taxes.

I get (or at least hope) that it's an exaggeration, but I'm not too keen on seemingly witty phrases without substance that get repeated everywhere.

<comment><USER20> Seems reasonable. "People" who make far less than that pay over 50%</comment></comment></comment>


Intrusive Technology Profiling Internet Users on the Verge of Comeback - <AUTHOR> http://online.wsj.com/article/SB10001424052748704243904575630751094784516.html

<comment><USER2> So, if PR is the only thing holding these guys back then surely many ISPs are already doing this secretly, right?

Personally, I encourage everyone to fully exploit any and all data they can get their hands on, for whatever purpose interests them. Until everything is encrypted end-to-end, somebody will always be doing it anyway. The sooner the general public figures that out and starts channeling their outrage into a real solution, the better.

<comment><USER3> Wow, this is getting up votes?

 _I encourage everyone to fully exploit any and all data they can get their hands on_

I think SAP found out where this can lead. A piece of data doesn't have to be under lock and key for it to not belong to you. Moreover, it's not really that hard to be caught when you start scanning "all the data you can get your hands on" rather than all the data you have a legal right to look at.

Edit: ISP could only benefit by doing this publicly since they have to actively sell this to ad-buyers to make money. And it would cost a bit of money to do.

<comment><USER2> I don't encourage it because I think it's a nice thing to do. I just have zero faith in niceness, or the general public's perception of what is nice, to keep them secure.

If all parties were transparent about their self-interest, the nature and scope of the problem would become much more clear to everyone. Instead, we spend all our energy going after the occasional red herring with a curly mustache.

Facebook looking at your referer header? Evil!

Google sniffing open wifi? Dastardly!

Gmail scraping email for adsense keywords? Insidious!

Anything that contributes to this theatre is just helping to keep the masses ignorant.

</comment></comment></comment><comment><USER4> Lots of related discussion over on NoDPI: <https://nodpi.org/> (edit: seems down at the moment)

I actually wrote my LLM. Cyberlaw dissertation on Phorm and the impacts of behavioural advertising.. interesting to see they're still around after getting wrist-slapped by the EU.

</comment><comment><USER5> After reading the article I'm unclear about how the ads are served:

"He says his company also has been placing ads on various websites to test the ad-placement technology and build up a base of advertisers, which now number about 100,000."

Does this mean that they're manipulating the HTML of the site to inject ads, or that they're purchasing spots via an ad network and somehow manipulating those, specific, requests?

<comment><USER6> No need -- they can target individual users already via realtime ad exchanges, like Google AdX. If they're inspecting packets, they can match users to the exchanges' cookies and bid on them.

</comment></comment><comment><USER7> Looks like I'll have to start using my vpn at home too.

</comment><comment><USER8> If we are going to live with ads, they might as well be properly targeted.

My only complaint is that most of the general public doesn't understand what they are opting in for, and those that try to understand it mistake it for something much more nefarious than it actually is.

<comment><USER9> Much more nefarious? Full browsing history, full access to email for many people, all unencrypted IM conversations, and your full search history unless your using https at google or duckduckgo? I can't imagine why people might be upset.

<comment><USER8> Quote: "Both also say they don't collect any personal information, read email, store users' browsing histories or monitor sensitive sites such as health blogs. "

And seriously? Google knows your search history ever since they started up, and use it for their own ads. You have something against your ISP knowing this information, but not Google?</comment></comment></comment>


OpenNVM: new interfaces for non-volatile memory - <AUTHOR> http://opennvm.github.io/

<comment><USER2> Could someone explain to me why we need a special NVM interface vs just using a filesystem on the same medium?

I worked at an embedded system shop for 3 years and this was one of the things that irked me when I worked on code outside of what my team usually worked on. We had a filesystem, accessible with all of the standard C file API... but there was still a lot of stuff being put into this mystical NVM (usually user controlled settings) that then made things like hard resets hairy because even as a developer I wasn't sure what would be wiped when I flashed different software onto the device.

This may have just been bad practice, or a result of carrying over the idea of NVM after filesystems became available. But I don't know why anyone would try to propagate that practice these days.

<comment><USER3> I don't really understand your question here. NVM is non-volatile memory. Stick a filesystem on it and it's still non-volatile memory.

Do you mean they were writing configuration files directly to a known address in Flash instead of using a filesystem? It's much simpler and less resource- intensive and doesn't require writing and maintaining a driver. There are plenty of cases where direct-writes are better, and plenty of cases where a filesystem is better, and a nice big gray area in between.

</comment></comment><comment><USER4> Whats the cheapest ssd device that implements this interface that a developer could play around with?

</comment><comment><USER5> Looks like this is only for FusionIO (at least all the examples are FusionIO only).

Any non-FudionIO SSD that actually support this?

<comment><USER6> Probably not yet but that could change. PCI flash interfaces are going to be standardised as NVMe.</comment></comment>


Women in Tech: Put Your Money Where Your Mouth Is. - <AUTHOR> http://techcrunch.com/2012/07/18/women-in-tech-put-your-money-where-your-mouth-is/ <comment><USER2> >If I appear to be moronic, self-centered, or sexist… it's only because I am (I'm a guy). Still I believe my heart is in the right place, and unlike my head, hopefully it's not in my pants.

What the hell? I feel like I'm watching a US TV commercial.

"Whoops honey, if I didn't have my sports cap on I'd probably lose my head."

"Oh dear, you lovable oaf." _Mother and daughter shake heads at retarded male_

<comment><USER3> I agree. And frankly I find it the most grating thing about my generation: no spine. Stand up and speak. Don't try to soften the message with tired jokes and deflection. Just make your point. If people are angry, they're angry. Listen to their reactions and if you think you were in the wrong, apologize. If you think you were right, defend yourself. But you never, ever, open with an apology.

<comment><USER4> I think it worked. It just disarmed every ad-hominem attack right in the first paragraph.

</comment></comment></comment><comment><USER5> Right, this is just a call for something akin to affirmative action, which has had questionable results at best.

The onus here isn't on women. And the right solution is not to preferentially favor women in the tech field. What you'll end up with is a situation where asshole misogynists consider themselves even more justified in treating women in tech as second class citizens. This time because "they only got there through charity".

The solution is simple. People in tech need to treat other people in tech like human fucking beings, regardless of gender, race, or age. And more importantly, when we see people treating others based not on the quality of their work but on superficial qualities like gender, religion, national origin, sexual orientation, or what-have-you we need to call them out on it. Loudly. Publicly. Repeatedly.

<comment><USER6> I'm a little confused as to what the problem _is_. Is it that there aren't enough women in tech, or is it that women who are in tech aren't being treated fairly?

If it's the latter, then I'm all for fixing that problem. But if it's the former, then it may just be the case that women don't' _want_ to be in tech. I try encouraging my sister to learn about programming and computers all the time, but she'll have nothing to do with it. It has a certain, ah, stereotype when you're good at that stuff that she'd rather avoid (although she's smarter than I am and could probably learn it very quickly).

<comment><USER7> Then that _stereotype_ is the problem that people want to fix. And then it becomes a chicke-and-egg problem: how do you fix the stereotype without having more women in tech? So you try improving things on both sides.

</comment></comment></comment><comment><USER8> I just finished reading "The Blank Slate", a very interesting book by Harvard (and former MIT) psychologist Steven Pinker. In the book, he argues against the politically correct (but factually incorrect) notion that our minds are infinitely malleable at birth, and that our nature is primarily shaped by culture and the environment. On the contrary, genetics and neurobiology play a comparatively tremendous role in determining who we are. And, like it or not, these physical characteristics may differ across individuals, races, gender, etc.

Pinker devotes an entire chapter of the book to gender, and the first half of that chapter to workplace equality. His thesis here is that a lack of 50-50 gender equality in a given profession isn't necessarily indicative of discrimination or unfairness, unless you believe in the blank slate. That is, unless you discount the possibility that women, on average, are interested in different things than are men. He goes on to present a vast amount of evidence that such differences in preference _do_ exist, regardless of cultural conditioning.

This isn't to say that discrimination is non-existent. Many of us have seen (or heard) enough to know that it's alive and well. The point is that we shouldn't arbitrarily strive for _perfect 50-50 equality_. There will always be fields in which men and women outnumber each other by large margins, and that's okay. The best we can do is to try and stamp out discrimination wherever possible.

<comment><USER7> An indication that it is cultural is from looking at other cultures:

 _If you look globally, there are countries where that isn't the image, and in fact, their numbers are dramatically better. I was recently speaking with some of our Oracle engineers from China and they pretty much have a fifty-fifty split of men and women. And they think it's sort of odd that we don't._

[http://www.txchnologist.com/2012/breaking-the-brogrammer- cod...](http://www.txchnologist.com/2012/breaking-the-brogrammer-code-margo- seltzers-views-on-women-in-computer-science)

<comment><USER8> That's interesting, although I'm not inclined to take hearsay of hearsay at face value. It'd be great to see a report with some hard numbers proving that this is the case, and examining the cultural differences that could explain why their numbers are so drastically better than numbers elsewhere in the world.

Also, from a scientific perspective, this is a disastrously imperfect experiment. You cannot rule out the effect of the genes unless you control for that. Looking at a group of people who are physically different AND culturally different , then arbitrarily concluding that any differences are the result of cultures is about as unscientific as it gets.

<comment><USER7> I actually agree with your first statement - I saw that a few days ago, and I'm keeping it in mind provisionally.

As to the second point, humans are not very genetically diverse. Of course there are enough differences that we can sometimes conclude that a particular person's genes come from an ethnic group, but it's not as nearly as varied as even other primates. Basically, we hit a genetic bottleneck sometime in the past 100,000 years. So it's far more likely to be a result of culture than genes.

<comment><USER8> You're right about the lack of genetic diversity, but even that limited amount of diversity can result in drastically different personalities, tendencies, etc. For some truly shocking material on just how much of a role genes can play, look into the studies done on identical twins raised apart vs adoptive siblings raised together.

</comment></comment></comment></comment></comment><comment><USER9> As a guy in tech, I agree wholeheartedly with everything Dave has said, and was surprised he said it in an actually non-offensive way, given his typical writing style..

However, something I took away from this that really surprised me was how little money Dave started with and how little he still has. Don't get me wrong, I would kill to have $300k in the bank, much less $600k+, but I've always assumed that angel investing (despite the small investments) was a game for the incredibly wealthy and I wouldn't be able to invest until I was in my 30's and had exited with more than a few million in the bank. When he points out that anyone with more than $10k lying around can be the next big angel investor, it really jumped out at me. I've never considered investing $5k or so into something I really believe in when $5k-$10k is all I have saved up... However, as he said, it would be hard not to get my money's worth by investing in startups. I'm glad he conveyed how easy it is to become an angel because otherwise I would have never considered it until I had plenty of "fuck you" money.

<comment><USER10> The problem is, you do need to be a millionaire to be an angel investor. IF not you open your investments up to liability unless you really are "friends and family".

This industry is regulated and McClure sorta completely glossed over it.

I would be an angel investor if I was allowed. I would have been doing it for the past 4 years, and I would have much enjoyed doing that. I had 6 figures and 20 years of startup experience and was ready to write checks.

I just never found a way around the need to get accreditation. (Note when you have a successful exit you have cash in the bank, but that doesn't mean you necessarily have a $250k a year job, or $1M in the bank!)

Maybe in the bay area there are lawyers who can set you up to do this even despite the regulations... I dunno.

But this seems to be a glaring omission on his part. Or maybe the law has changed recently and that's why his program could now work.

<comment><USER9> I actually do believe the law changed recently.

[http://www.slate.com/articles/technology/technology/2012/04/...](http://www.slate.com/articles/technology/technology/2012/04/jobs_act_now_ordinary_people_can_lose_big_investing_in_startups_too_.html)

</comment></comment></comment><comment><USER11> Women don't need to be "empowered". It's not some socieo-ecominic reason that's causing girls to steer clear of tech. It's been discussed here before many, many times and women have weighed in. According to them its the culture and insensitivity towards women thats causing skewed gender ratios.

This isn't a problem you can throw money at.

<comment><USER12> There are far fewer women in tech majors than men and that happens before women ever hit the workplace. The skewed gender ratio starts much earlier in life.

</comment></comment><comment><USER13> Okay. I left Google because I was fed up with how things were going over there (read my posts - link in profile - if you want to know more). I started my own little business.

So, okay, let's go. Throw money at me. I'll make more cool stuff with it. I'm mostly a "plumbing" sort of person, but I've been known to make actual top- level user interfaces on occasion too.

Well? Who's with me?

<comment><USER14> I'll bite here on a tangent: are you _really_ interested in taking a $5k check from an individual angel? Do startups (real ones, not just "I started a company!" startups) bother with that stuff? It seems that if you're a three- person YC gang that the effort involved in coming up with an extra week's (if that) worth of runway isn't even close to worthwhile.

<comment><USER13> No, I'm interested in building something useful for a reasonable amount of money. That's what I do: a simple exchange of currency for services rendered.

Is this about women in tech, or is this some nebulous thing about startups? Because I'm all for the former, and don't really worry so much about the latter.

<comment><USER15> _Is this about women in tech, or is this some nebulous thing about startups? Because I'm all for the former, and don't really worry so much about the latter._

Why don't you read the article?

<comment><USER13> I did. What you quoted is what's known as a reply to the person above me.

</comment></comment></comment></comment></comment><comment><USER16> _> I'd like to CHALLENGE every woman in tech who's a) got a nice car, b) owns a nice house, or c) is making over $125K a year_

In the US you need to have an income of greater than $200k/year or assets not including your home of over $1 million in order to be an accredited investor. [1]

You don't have to be an accredited investor to invest in startups, but it does open up the company to additional annoying reporting requirements such that almost all advisors suggest staying away from such. From info on his own assets that he's posted in the past, it seems Dave's chosen to skirt said law himself, but it seems quite brash to (without disclaimer) push others to do the same.

[1] <http://en.wikipedia.org/wiki/Accredited_investor>

<comment><USER17> What's to keep me from investing all my money in my own startup? I note attempting facetiousness, I'm truly curious how they differentiate me starting my own business and investing all my own money (at a substantial percentage of my reported income) or starting a business with a buddy and putting in a serious amount of cash.

<comment><USER16> There's a provision for raising up to $1 million from "friends and family" (specifically pre-existing contacts only, no solicitation). I presume, though am not certain, however, that personal funds of the executives are exempt from that.

[http://www.jdsupra.com/post/documentViewer.aspx?fid=35d8764e...](http://www.jdsupra.com/post/documentViewer.aspx?fid=35d8764e-eee4-4ecc-8ef6-8da9e91b2575)

</comment></comment></comment><comment><USER18> I would suggest that instead of affirmative action in funding women in startups, instead we should encourage successful women in tech to become evangelists. I don't think the issue is as much in the "nobody gives money to women who want to start startups" but rather in the fact that fewer women are in technology because of the cultural bias against it (and as a consequence, less women get funded startups).

Just think, if you are a teenager or college age girl, what women programmers do you currently look up to? They exist, but they need to be more visible to break the perception that "women don't become programmers"

<comment><USER19> Women in this field who try to be more visible are prone to being labeled as superficial, attention-seeking, untalented (and much, much worse) terms [1]. Culture change is what is required.

[1]: [http://www.poynter.org/latest- news/mediawire/175064/forbes-c...](http://www.poynter.org/latest- news/mediawire/175064/forbes-com-contributor-deletes-post-about-sheryl- sandberg-after-people-call-it-sexist/)

</comment></comment><comment><USER20> It's wrong to offer up the idea that women somehow are biologically averse to tech. You need only look outside the US to verify this: Malaysia's tech sector is almost evenly split between men and women.

It's a cultural thing, which we're loth to admit. We look around and say, "We treat women the same around here", not thinking for a second that maybe that's the problem.

I run the Hackbright Academy, a hacker school for women, and I ask all applicants what compels them to apply to our program. Invariably, part of every story is the idea that they were intimidated out of the field in college or high school by their male peers. Whether or not that's the grand reason for the disparity, it's still something that shouldn't be a reason at all.

<comment><USER21> Malaysia may not constitute good evidence for it being a cultural thing. Reason: a young male social outcast in Malaysia can't teach himself computer programming the way a young male social outcast in the United States can. So all programmers are college taught, which results in an even gender split. Whereas in the US, male geeks get a head start as kids and intimidate women in college with their accumulated skills.

<http://news.ycombinator.com/item?id=4062243>

</comment></comment><comment><USER22> Finally. It is hard to believe in this day and age that 99.99999% of women have no chance at receiving VC/Angel investments, whereas men only have a 99.9999% chance at not having access to VC/Angel money.

</comment><comment><USER23> If women founders are being underserved by existing investors that would represent a market opportunity. Someone _should_ exploit it out of pure self interest.

<comment><USER24> Making this even more of a "put your money where your mouth is" situation. Women in tech fund, where are you and your gigantic returns?

</comment></comment><comment><USER25> Did anyone actually read this article?

From the comments, I can only assume not.

He's asking women in tech to act as angels for other women in tech.

This does not seem to be what anyone here is responding to.

<comment><USER26> I agree. I read the post and most comments here apparently didn't get the main point of the article.

</comment></comment><comment><USER27> This doesn't seem to be about women in technology at all, just yet more fluff about startups, founders, exits and angel investors. Maybe Hacker News is the wrong site for me.

</comment><comment><USER28> Old people (older than 40, say) are way under-represented in tech. Can anyone argue with this point? We need culture change, and maybe even affirmative action to force the industry to open up to oldsters. (yes, I'm in the 40+ demographic) In fact, we probably need a whole army of old journalists and bloggers to celebrate the achievements of their beloved demographic, and to get indignant about the injustices when they occur.

And come to think of it, I haven't seen many black or hispanic coders lately. They probably need to impose their demands on the industry as well.

Just kidding. I'm against quotas for oldsters like me, or any other supposedly marginalized demographic. I look for people who simply excel at _writing code_ and _building products_ , which anyone can do if they devote themselves to the craft.</comment>