1. 19
  1.  

  2. 8

    Is it just me or are other people also bothered by the over use of emoticons and the low quality of this writing? I wish that style of writing would stay confined to SMS and not bleed into technical articles.

    1. 14

      I don’t know how you measure “quality of writing”, but I thought it was fine.

      No typos I could read and good sentence structure. Tasteful use of emojis I thought. Distasteful would be every one or two paragraphs, but they only used like 5 in the whole article.

      Just a different way to express. A waaaay more casual one.

      1. 5

        i’m a fan of emoji used to decorate text, but not used to replace words.

        1. 3

          That’s a good way to put it. Indeed.

        2. 5

          Tasteful use of emojis I thought.

          Maybe it’s just me but when I see “Oh 💩, it compiles to JavaScript.” I just have to think of trying-to-be-cool parents, which I just find tiering. And that’s setting aside that I don’t believe vulgar language should be used at all in written documents.

          1. 1

            Can’t disagree with that, tbh (on the use of the shit emoji).

          2. 1

            “Tasteful use of emojis” sounds like “subtle trolling” to me.

            Although it’s ok, I only see the same “tofu box” emoji.

            1. 1

              ‘Subtle trolling’ is quite like emoji use in that if you notice it, it’s wrong. The whole point of trolling is to rial someone up without them realising they’ve been rialed up.

              1. 3

                Did you mean to write “rile” or is this comment itself an example of subtle trolling? ;) ❤

                1. 1

                  I did mean to write ‘rile’, yeah.

                2. 1

                  I am reacting to the over-use of emoji as a way to get personal. It’s good, but companies tends to use it to promote a product, so I have gotten allergic. Made with :love: by $BigCorp. Put a :tiger: in your :engine: …

                  On the other hand, I see no reason against putting emoji on one’s own blog, readers are not pushed straight onto the posts after all…

            2. 4

              Didn’t bother me since it was at least a different style. I like seeing a mix of styles. If it annoyed you, I think you’ll like some of his comments on the HN thread which get right to the point. Specifically, he as a list of what’s bad and what’s great.

              1. 0

                Indeed, these are more substantial. I might be a little bit burned out by the “code ninjas” out there and the impression that software engineering is a dying art. Now you can do a two month bootcamp on React and VSCode and get a job. Even Google stopped asking for CS degrees.

                1. 5

                  Careful. In my day job I work on implementing dependent type systems, with an eye for improving low level binary format parsing by leveraging formal verification. And yet I dropped out of CS and I use VS Code. Opening up other pathways to people getting into programming does not mean that we have to discount the importance of a high quality CS education. We would also be wise to not assume that a CS degree correlates with a good aptitude for programming.

                  1. 1

                    Yes, you’re absolutely right, and I’d really like a wider range of people get into software engineering, CS degree or not. However, from my anectodal experience, I find there is a growing gap in knowledge and values, and am wondering why it seems so.

                    1. 4

                      I find in fact that many university courses are actually doing more harm than good, pedalling decades old software engineering practices (like the gospel of Java, OOP, imperative programming and UML) rather than teaching core principles of programming languages, mathematics, and algorithms that age more slowly, and are critical to encouraging and inspiring the next generation of CS researchers. This is partly industry’s fault, and partly the fault of universities.

                      I see industrial programming as more a vocational trade, and employers should shoulder more of the burden of teaching up-to-date best practices. Let the universities do what they do well: theory, and don’t expect CS graduates to be excellent programmers from day one, but do expect them to be able to eventually become much more effective and nimble in the long run than a entry level boot-camp employee (depending on that eployee’s desire for self-education). By the same token I think universities should not get caught up in chasing the treadmill of the latest technology, and be up front to prospective students about that.

                      1. 2

                        This is really spot-on. I studied in France, where the curriculum is much more theoretical (hence less dependent on the technology of the day), but living and working in North America I see that a lot of CS graduates trained to specific tools & technologies without a good understanding of the underlying principles. This makes new recruits ready to use technicians if you use the technology of they day, but if you use anything exotic both parties are facing a lot of pain.

                        1. 1

                          The best we can do is try to swallow our sadness and frustration, and do a best to inspire and excite the next generation of programmers. I find new programmers are often far more receptive to more interesting ideas, including formal verification, rich type systems, and functional programming. I always treat a new programmer as a great opportunity: we have the power to shape their future directions through the doorways we open to them, and the opportunities we provide.

                          1. 2

                            I like your enthusiasm, it’s good to be reminded of that. Thanks a lot for the conversation!

                  2. 2

                    Even Google stopped asking for CS degrees.

                    As far back as 2008, Steve Yegge was saying you don’t need a CS degree to get a job at google: https://steve-yegge.blogspot.com/2008/03/get-that-job-at-google.html

                    So I would say Google’s hiring practices and the bootcamp movement are largely unrelated, at least, seeing as I was a relatively early bootcamp grad and that was in 2011/2012.

              2. 0

                You have a binary that is fast (2 ms), small (107 kB) and dependency-free.

                Ya, that’s true because nim compiles to c! Then it compiles to a binary by using gcc or clang (for example).

                So it’s not actually dependency free… you’ll need a unix environment at least to provide stdout/in IO.

                Nevertheless it’s interesting – although I haven’t had the impression that it’s quite that unknown… I believe I heard about it the first time somewhere around 2014. Although I’ve never used it myself, I’ve always seen articles about it from time to time.

                1. 6
                  $ nim c hello.nim 
                  Hint: used config file '/nix/store/ab449wa2wyaw1y6bifsfwqfyb429rw1x-nim-0.18.0/config/nim.cfg' [Conf]
                  Hint: system [Processing]
                  Hint: hello [Processing]
                  CC: hello
                  CC: stdlib_system
                  Hint:  [Link]
                  Hint: operation successful (11717 lines compiled; 2.748 sec total; 22.695MiB peakmem; Debug Build) [SuccessX]
                  $ ./hello 
                  Hello, world!
                  $ ldd hello
                  	linux-vdso.so.1 (0x00007ffe06dd1000)
                  	libdl.so.2 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libdl.so.2 (0x00007f4a0c356000)
                  	libc.so.6 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/libc.so.6 (0x00007f4a0bfa2000)
                  	/nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib/ld-linux-x86-64.so.2 => /nix/store/fg4yq8i8wd08xg3fy58l6q73cjy8hjr2-glibc-2.27/lib64/ld-linux-x86-64.so.2 (0x00007f4a0c55a000)
                  $ ls -hal hello
                  -rwxr-xr-x 1 andy users 185K Sep 22 15:53 hello
                  

                  This depends on libc and a runtime dynamic linker. If you built this on your machine and sent me this binary I wouldn’t be able to run it because NixOS has a non hard-coded dynamic linker path.

                  Can’t help but do a comparison here…

                  $ time zig build-exe hello.zig 
                  real	0m0.309s
                  user	0m0.276s
                  sys	0m0.035s
                  $ ./hello 
                  Hello, world!
                  $ ldd hello
                  	not a dynamic executable
                  
                  $ ls -ahl hello
                  -rwxr-xr-x 1 andy users 390K Sep 22 16:01 hello
                  
                  1. 2

                    I’ll be honest and say that I don’t know how to achieve this using C off the top of my head, but I’m willing to be that it is possible. If it’s possible in C, it’s also possible in Nim.

                    Please keep in mind that Nim links with libc dynamically by default, there is nothing stopping you from statically linking libc into your executables if you so wish.

                    1. 1

                      But will they still be as small?

                      1. 2

                        Of course not. But then I also don’t really care about binary sizes, as long as they’re not ridiculously large.

                  2. 1

                    I think that’s a pretty silly definition of dependency free

                    1. 4

                      I guess it depends on your perspective, but it does seem like an extremely pedantic definition. In that case, every Unix C program is dependent on a libc and Unix kernel… but generally we don’t talk about dependencies like that.

                      I will say this tho: I wish languages like nim & zig focused more on tree shaking to get down to the size of C, or as close as possible. Would help in other environments, such as the embedded space, and would be generally better for all.

                      1. 2

                        I wish languages like nim & zig focused more on tree shaking to get down to the size of C, or as close as possible. Would help in other environments, such as the embedded space, and would be generally better for all.

                        Do you have an example of how Zig doesn’t do this?

                        1. 1

                          (edit also I apologize for the late reply, I’m on client site this week)

                          it’s been a while since I last built Zig (I use a local Homebrew, so I ended up having to manually link LLVM and Clang, which wasn’t bad once I figured out how to do so), but even the example displayed above was 390K, so potentially large parts of the Zig RTS is included therein. I think Zig is probably the best of the bunch (I’ve recommended several clients to look into it as part of their roadmap for future embedded projects!), but I do think some room for improvement wrt what’s included could be made.

                          As an aside, I thought I’d try and see if Zig was included in Homebrew now, but the build is dying:

                          [ 65%] Built target embedded_softfloat
                          make[1]: *** [CMakeFiles/embedded_lld_elf.dir/all] Error 2
                          make: *** [all] Error 2
                          
                          1. 2

                            There are a few things to know about the size of the above example. One is that it’s a debug build, which means it has some extra safety stuff in there. It even has a full debug symbol parsing implementation so that you get stack traces when your program crashes. On the other hand, if you use --release-small then you get a 96KB executable. (Side note - this could be further improved and I have some open bug reports in LLVM to pursue this.) The other thing to note is that the executable is static. That means it is fully self-contained. The nim version (and the equivalent C version) dynamically link against the C runtime, which is over 1MB.

                            So the Zig runtime is smaller than the C runtime.

                            I recommend to wait 1 week until zig 0.3.0 is out before trying to get it from homebrew. The Zig PR to homebrew had llvm@6 in it, to prevent this exact problem. They rejected that and said we had to drop the @ suffix. So naturally it broke when llvm 7 came out.

                            1. 1

                              Oh I realized that Zig was statically linked, but I did not realize that it had no further dependency on libc; that’s pretty interesting. Zig has been on my radar since I first caught wind of it some time ago (I enjoy languages & compilers, it’s part of my job & my hobby), but it’s interesting to see no further links!

                              Previously I fought with getting Zig built out of git directly; the fighting was mostly surrounding linking to LLVM deps in Homebrew, because the two didn’t seem to like one another. Once it was working tho, it was pretty sweet, and I used it for some internal demos for clients. I’ll certainly wait for 0.3.0, it’ll be neat to see, esp. given the new info above!

                              1. 2

                                As of this morning 0.3.0 is out! And on the download page there are binaries available for Windows, MacOS, and Linux.

                                1. 2

                                  Trying it now, and thank you so much! It runs right out of the box (which is so much easier than fighting with a local homebrew install) on Mojave!

                      2. 1

                        My point is that it couldn’t be executed in a Windows or Plan 9 environment. When people like saying the only IDE they need is Unix, it’s worth pointing out that that means they don’t only need a specific program, but a whole OS – and that’s a dependency in my eyes.

                        1. 1

                          WSL exists and Plan 9 is an irrelevant research operating system. Something that depends on POSIX is depending on the portable operating system standard. It’s the standard for portable operating systems. It’s a standard that portable software can rely on existing on every operating system. If your operating system doesn’t support POSIX then you have no right to complain that software isn’t ported to it, IMO.

                          You don’t need a particular OS, you need any OS out there that implements POSIX, which is all of them in common use.

                          1. 1

                            I don’t care about rights, and that’s not what I meant. I understand your point, but I wanted to say was that the way the author phrased it made me hope (naively, maybe) that there was some actual technology behind Nim that makes it OS independent (since, as I’ve already said, I think a OS is a dependency, regardless of which standards may or may not exist).