HNHacker News
TopNewBestAskShowJobs

groovy2shoes

1,904 karma · joined February 3, 2011

https://github.com/baguette

cmburget@gmail.com

my topcolor is 8674a9

submissionscomments
groovy2shoes··on The Lazy Developer's Guide to Command Line Building with C#
> Sorry to hit you with that one.

Don't worry about it. I had it coming ;) Sometimes when I don't have a lot of time to comment, I'll make a shitty (snarky, snide, abrupt, or cetera...) comment, then come back later when I have the time and provide a more detailed comment. It might not be the best thing to do, but anecdotally I get more engagement from others if I do it that way than just waiting to write the longer comment in the first place. I don't expect anybody to know that, though, so I know that I run the risk of coming off as abrasive and I don't expect people to necessarily be super nice about that...

> More a comment on you basically have to deal with Visual Studio if you want a solution file. ... Working with solution files is painful without the IDE they're made by, and fairly undocumented in places where it matters. ... Just wanted to say that working with Solution files outside of Visual Studio is somewhat unsupported, and could be more difficult than expected.

Agreed on all counts. These things can be pretty frustrating. The saving grace is that the information you'd need to build the project can be identified in the file and extracted for use in some other format. Far from ideal, to be sure, but it means you're not completely out of luck if all you have with the source files is the solution file. The situation could be much better, though.

> (And you are indeed right that %proj files are indeed XML [0], and incredibly verbose, even for XML.)

I thought so, but it's been a while since I've had to deal with a VS project. And, yeah, Microsoft's record with XML in general has always seemed to be pretty damn verbose to me.

groovy2shoes··on The Lazy Developer's Guide to Command Line Building with C#
Whoa, the GP asked what to use to edit the files, not what to use to write them from scratch :p

Yeah, they're plain text, but they're pretty nasty, for sure.

I'm not a Windows developer anymore (haven't been for over a decade now), but my understanding is that if you're going to be doing a whole project from the command line, you're going to want to use MSBuild[1], FAKE[2], or perhaps nmake[3] (which is old-skool and not particularly compatible with the usual %nix makes, but will at least be familiar for many developers coming from %nix).

Of course, there's no (technical) reason you couldn't use some other generic build tool with the Visual Studio command line tools, but other Windows developers will likely not be prepared to deal with them.

[1]: https://msdn.microsoft.com/en-us/library/0k6kkbsd.aspx

[2]: http://fsharp.github.io/FAKE/

[3]: https://msdn.microsoft.com/en-us/library/dd9y37ha.aspx

P.S., I don't think those are hashes—just UUIDs. I've edited the solution files by hand before without touching the UUIDs and they continued to work fine. IIRC, the various %.%proj files are also plain text (XML, I think, but I could very well be wrong). Unfortunately, I don't know how to answer your other questions, other than that I think you can usually open solution files for older versions in newer versions, but not vice versa.

EDIT:

P.P.S. Pretend the various '%' characters are asterisks. Couldn't get them to stop italicizing everything...

groovy2shoes··on X86 Assembly Guide
Sure, but the principles are the same. The mnemonics are the same, the registers discussed are still around (there are more registers now, but the ones in TFA didn't go anywhere), addressing modes are the same, the stack still grows downward, the MASM syntax and directives are still the same, and the code still runs on modern hardware. Perhaps most importantly, the mindset you use while writing code in x86[_64] assembly language is still the same.

Actually, my experience has been that once you learn the ropes of programming in one assembly language[1], picking up any other assembly language is just a matter of perusing the proper reference manual(s) to find an architecture overview, useful instructions, calling convention(s)/ABI, and the syntax accepted by your assembler. While a tutorial for some new-to-you assembly language may be convenient, it's typically not necessary so long as you've got the manuals (which you really should have if you plan on writing programs in or compilers to an assembly language, regardless of any tutorials or textbooks you might have).

[1]: You can cut your teeth with any assembly language, really. However, I feel like it might be a little easier to start with a CISC instruction set architecture, because they tend to be designed with human programmers in mind, while other types of ISA (RISC, EPIC, etc.) are typically designed with "automatic programmers" (compilers) in mind.

groovy2shoes··on The Lazy Developer's Guide to Command Line Building with C#
Does Visual Studio not come with nmake anymore? While I prefer BSD make, nmake wasn't half bad. Had all the essentials and then some.
groovy2shoes··on The Lazy Developer's Guide to Command Line Building with C#
Text editors?
groovy2shoes··on WebRTC: the future of web games
Oh, how I wish I could upvote this 100 times. Nay, 1000!

It was already bad enough 10ish years ago when it was a comparatively small pile of hacks, and there was hope that something could be done about it. But now? It's an enormous pile of hack upon hack. Full stack engineer? More like full hack engineer!

The main reason I worry about losing my job or moving to a new location is that web development jobs are a dime a dozen nowadays, while more traditional development is seeming less and less relevant. As much as I hate C++, I'll stick with it over the monstrosity that is Web 2.x.

[Insert the usual complaints about shitty languages, tooling, and gazillions of frameworks / reinvented wheels here.]

groovy2shoes··on CakeML – A Verified Implementation of ML
> SML was literally designed to do proving.

So was Caml (and its precursor Le-ML), originally :)

That it grew so far beyond that I think is a consequence of it not having a formal definition like SML. This allows the developers to extend the language willy-nilly without going through the grueling task of extending a formal semantics. On top of that, as another commentor pointed out, is the fact that there's a single "reference implementation", which means that users don't need to worry about getting locked-in when opting to use new functionality.

That said, SML is still a fantastic base for new research projects in the PL space, mostly for the very same reasons it hasn't seen nearly as much adoption in the "practical" space as Caml: it's a small, simple, well-understood, and formally-specified language that grants researchers an excellent starting point for their inquiries and experiments.

groovy2shoes··on Why recursive data structures?
In some other languages, even the notation itself has obvious parallels between data definition and process definition. Consider a list and `map` in Standard ML:

    datatype 'a list =
      Nil
    | Cons of 'a * 'a list;
    
    val rec map : ('a -> 'b) -> 'a list -> 'b list =
      fn f => fn xs =>
        case xs of
          Nil          => Nil
        | Cons(x, xs') => Cons(f x, map f xs');
The case analysis of a list is obviously isomorphic to the definition of a list, in the sense that the data and the process have the same shape: a list is a `Nil` or a `Cons(item, more list)`, while a function that traverses a list checks if a list is `Nil` and does something, otherwise it's a `Cons(...)` and it does something else. The linear recursive nature of the list definition lends itself naturally to algorithms which are similarly linearly recursive. (`map` itself can be said to create homomorphisms, but that's beside the point here; I use this particular example only because it happens to be the simplest non-trivial one I could think of).

Okay, so perhaps this isn't quite what "isomorphic" means in category theory, or topology, or graph theory, or set theory, or what have you. Even in mathematics, though, it's obvious that terminology gets borrowed between the branches when there are concepts that are somehow related. Why should programming be any different? So, I argue that it's not wrong to use "isomorphic" in the sense that you have—in fact, it's a term that I've seen used in the same sense on numerous occasions, and something that I think experienced programmers have internalized. In this case, the structure of the data, that is, a linearly recursive collection of elements, precisely matches the structure of the process, that is, a linearly recursive traversal of elements. Whether or not there actually exists an isomorphism between the two is irrelevant to the notion that the two are isomorphic, that is, they have "equal shapes".

I think a habit of thinking of words in an etymological way leads naturally to borrowing those words for similar concepts. This is neither the first time such a thing has happened, nor will it be the last. To knowledgeable parties, your use of the word communicated a characteristic of your program in a succinct way that you continued to illustrate—that the shape of the quad tree data structure reflects the shape of the algorithms used to process instances of said structure.

One might say that the various meanings of the term "isomorphic" are... isomorphic ¬_¬

groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
Cool, thanks for the pointers :)
groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
I definitely "feel" the Limbo influence, but I've not worked with Oberon-2 (only the original Oberon, and only a bit), so I didn't pick up on it. I do "feel" the C influence as well, though.
groovy2shoes··on How (Not?) to Use Python’s List Comprehensions
Have an upvote for the fun-factor of your comment, but know that I find the aesthetics of the two to be about the same.
groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
Ah, cool. I wasn't thinking of Oberon-2 or Active Oberon as separate languages when I made that statement. I didn't know Modula-2+ had GC, and was unfamiliar with Component Pascal or Zonnon. Thanks!
groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
I didn't miss that at all. According to Pike, it was actually Griesemer's idea to start with C.
groovy2shoes··on Chrome browser for businesses
Yes, function declarations did look like that. And GCC accepts it totally silently in pedantic ANSI C mode, not even warnings:

    11:44:57 cory@tizona /home/cory/Workspace/test
    $ cat knr.c
    #include <stdio.h>
    
    main(argc, argv)
            int argc;
            char **argv;
    {
            int z = foo(3, 4);
            printf("foo is %d\n", z);
    }
    
    foo(x, y)
    {
            return x + y;
    }
    
    
    11:44:59 cory@tizona /home/cory/Workspace/test
    $ gcc -std=c89 -pedantic -o knr knr.c
    
    11:45:07 cory@tizona /home/cory/Workspace/test
    $ ./knr
    foo is 7
    
    11:45:11 cory@tizona /home/cory/Workspace/test
    $ gcc -v
    Reading specs from /usr/lib64/gcc/x86_64-slackware-linux/5.3.0/specs
    COLLECT_GCC=gcc
    COLLECT_LTO_WRAPPER=/usr/libexec/gcc/x86_64-slackware-linux/5.3.0/lto-wrapper
    Target: x86_64-slackware-linux
    Configured with: ../gcc-5.3.0/configure [...]
    Thread model: posix
    gcc version 5.3.0 (GCC) 
I seem to recall the compatibility was deliberate on the part of the ANSI C WG, for hopefully obvious reasons.
groovy2shoes··on How to Run a More Secure Browser
And, upon looking at your profile, I'm putting my foot in my mouth. Like, the whole thing, heel and all. :)
groovy2shoes··on How to Run a More Secure Browser
Upon re-reading the thread, I think you're right. Sorry!
groovy2shoes··on A Paper Algorithm Notation
Lisp was designed in the same way. As I recall, it was Steve Russell who demonstrated that it could be implemented on machines of the day.
groovy2shoes··on Rust vs C Pitfalls
I can only attest to my own experiences at various corporations, and those corporations want to thoroughly vet any software platform before targeting it and supporting it for customers.

As to my own concerns (rather than corporate concerns), here's where I'm coming from:

When I wind up choosing C for a particular project, I don't use it because I like it (I don't particularly like C). Typically, I use it because there are three factors I've considered: 1) This particular project needs the low-level access or performance characteristics provided by a systems language, and 2) C is such a language, 3) C is ubiquitous.[1]

The thing is, every platform for the last 25 years or so has had a reliable ANSI C compiler. If the goal of my project is to be cross-platform, then a carefully-written application in standard C is guaranteed to be able to reach the widest number of users, many of whom won't have to do or install anything to build my application, since many environments already include a C compiler without any additional installation necessary (think Unix, BSD, a shrinking number of Linux distros, ...). Using C puts my application on the path of least resistance for potential users.

Similarly, if I'm writing a library, every language with an FFI can trivially access a library written in C. Even without an FFI, most languages can interface with C code through some kind of bindings (like the Lua-C API, for example). Again, choosing C is a path to wide adoption.

Again, I don't particularly like C as a language. However, right now, it has an undeniable advantage as a platform. I do like Rust, however, and I would love to see Rust give C the boot. In order to do that, it needs to eventually (one day when the rate of additions/changes to the language has slowed and it has grown more stable/mature) offer a platform that can be relied on to "just work" on any given platform with minimal fuss and without any sudden changes. As such, both the "end-programmer" and the compiler-writer in me would like to see some version of Rust (again, eventually) that is "set in stone" and widely available, which really would solidify that notion of stability/maturity.

I'm not advocating for Rust to stop innovating. For all I care, the "standard" can be a simple snapshot of some state of the language, the way the Haskell Reports seem to be nowadays: GHC keeps on iterating and innovating the language, yet there's still a standard updated every x years that provides a static target. But for that designated snapshot, I want to see a compiler (or two, or several) and a bunch of libraries that are supported for the long haul.

It's simply a matter of "C has this, it's an important property thereof, and any replacement will need it, too".

[1]: Some other projects demand C because they constitute contributions or extensions of other projects that are already written in C; e.g., kernel code for an existing OS that is written in C.

groovy2shoes··on Chrome browser for businesses
Yup. Likewise, the version of `wc` from Kernighan & Plaugher's «Software Tools in Pascal» still compiles and runs with any ol' ISO Pascal compiler, and still does exactly what the manpage says it does.

As an aside, I'm pretty sure K&R C is a subset of ANSI C, so any ANSI C compiler should be able to compile K&R C.

groovy2shoes··on Rust is mostly safety
I'm inclined to agree. It took me a week or two of daily usage to finally "get used" to the borrow checker. It's a bit of a paradigm shift, to be sure, but it's not insurmountable. In fact, I think learning Rust has made even my C code better, because now I'm in the habit of thinking thoroughly about ownership and the like, which is something that I did to an extent before (because you have to to write robust software without a GC), but it was never explicit and I never would've been able to articulate the rules like I can now.

That said, I still occasionally have problems where I feel like I'm doing something "dirty" or "hacky" just to satisfy the borrow checker. It's easy to program yourself into a corner and then find yourself calling `clone()` (the situation, I've been told, has gotten much better in recent releases with improvements to the borrow checker, but alas I haven't had a chance to play much with Rust in nearly a year).

Another thing that I still find difficult is dealing with multiple lifetimes in structs, to the point that I usually just say "to hell with it" and wrap everything in an `Rc<T>`. And sometimes there's simply no safe way (afaict) to do some mutation that I want to do without risking a panic at runtime (typically involving a mutable borrow and a recursive call), which leads to a deep re-thinking of some algorithm I'm trying to implement. That's not Rust's fault, though—it's a real, theoretical problem that arises in the face of mutation. In time, I'm sure there will be well-understood patterns for handling such cases.

groovy2shoes··on How to Run a More Secure Browser
PPAPI plugins are sandboxed. That's their major difference from NPAPI plugins. The API itself is otherwise extremely similar.
groovy2shoes··on How to Run a More Secure Browser
Do you mean Xorg rather than X11? X11 is just a protocol (or a set of protocols, depending on how you look at it). Xorg, on the other hand, is the most popular implementation. There are (were?) others, some of them much smaller in terms of source code (but also features, platform support, etc.).
groovy2shoes··on Facebook Doesn’t Tell Users Everything It Really Knows About Them
Yep. I also remember hearing "records" in addition to "files" back in "the day". The reason, of course, these terms have come into computing is by analogy with their "old-world" counterparts.

That said, I wouldn't consider it wrong, per se, to call it data or information these days. Strictly-speaking, old files and records do constitute data, whether they happen to be digitized or not.

groovy2shoes··on Problems with CSVs
Sorry, I just saw this question of yours!

I was an early adopter of EDN, and wound up rolling my own parser in Python. EDN is simple enough that you can realistically roll a parser for it, complete with tests, in one or two working days. I find this to be a huge advantage—EDN doesn't really have any corner cases, so implementation is very straightforward.

groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
Since when is Go "based on Oberon"? Pike himself claims that it was "based on C", with obvious influence from his own work on Squeak and Newsqueak.
groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
> The language was designed by an expert on Wirth-style languages plus the two inventors of C.

Did Dennis Ritchie have a hand in creating Go? I must have missed that.

While Ken Thompson's earlier B language no doubt had an influence on C, Dennis Ritchie is widely regarded as the creator of C, which is really rather different from B, borrowing more heavily from BCPL and Algol-68. As an early (and heavy) user of C (perhaps the earliest, besides Ritchie himself), I'm willing to concede that he had enough input on C's design to be called a co-designer or co-creator. But which other "inventor of C" played a role in the creation of Go?

I also find it hard to label Rob Pike as an expert in any kind of language design. An expert in windowing systems and concurrency, perhaps, but language design? Hell, no. Even his earlier design, Newsqueak, was more of an experiment in concurrency than in language design—and it notably was a collaboration with Luca Cardelli, an expert in ML and OOP who also worked on Modula-3, and whose influence can be seen in Modula-3's several very ML-like constructs. Articles like this one[1] by Pike only serve to reinforce my thoughts that he, though a rather smart guy otherwise, is really rather ignorant about language design and about the role of types in programming in general.

> The Wirth languages ... had GC's but also allowed manual management.

None of Wirth's languages had GC until Oberon, as far as I'm aware. And spiritual successors by other groups, like Object Pascal and Ada, never really picked up on GC, either (Ada had GC as an optional part of the standard, but was removed in the latest standard because it was so rarely provided by implementations). As far as I can tell, Modula-3 is the only other "Wirth-style" language to provide GC.

Modula-3 was indeed a great language, and I think it's a real shame that it didn't get picked up more widely. At a time, it had several really solid implementations, and the language's definition is very short while still providing a plethora of useful features for programmers. The silver lining is that it was, at least, a very influential language, despite its limited adoption.

Oberon, on the other hand, was a very spartan language that offered little in terms of features, and it exhibited that Wirth really didn't grok OOP at the time he designed it (which, if I recall correctly, is something he later admitted, though I'm having trouble finding a citation at the moment). Some of Oberon's issues were fixed in later versions of the language, but some of its issues were also "doubled down" in later versions, as well.

> Another alternative was Delphi, which succeeded for a while. Way more productive and crash-resilient than using VC++.

Delphi was indeed a real alternative for a while, and while you're right that it was more productive than VC++, that's not saying much. Later versions of Delphi grew to C++ levels of size, complexity, and hairiness, and that's reflected in Free Pascal's implementation, as well. It's something that I've lamented on more than one occasion because I remember how great it was and feel as though it could still be great with a bit of streamlining.

[1]: https://commandcenter.blogspot.com/2012/06/less-is-exponenti...

groovy2shoes··on A new year resolution to have Crystal reach the 1.0 milestone in 2017
Modula-3, at least, had generics.
groovy2shoes··on Why Clojure? (2010)
Clojure's loop/recur is pretty much a degenerate version of Scheme's named let, which has been part of Scheme since long before Clojure was a thing:

  (define (sum xs)
    (let loop ((acc 0)
               (xs xs))
      (if (null? xs)
        acc
        (loop (+ acc (car xs)) (cdr xs)))))
It's often used in Scheme for iteration, including cases where you would otherwise need to define a helper function to implement an iterative (tail-recursive) version of a function, as I did with sum above.

The named let construct is more general than loop/recur, since you can supply a name and properly nest the forms.

groovy2shoes··on Why Clojure? (2010)
Indeed, they are distinct concepts. However, in Clojure, only a small handful of datatypes allow mutation (sorta like refs in ML, but thread-safe and with various semantics depending on how that thread-safety should be handled). All of the usual datatypes are immutable (lists, vectors, hashmaps, sets, strings, etc.). If you need mutation, you need to wrap your object up in a "mutable box".
groovy2shoes··on Rust vs C Pitfalls
C does have a standard library. It's described in full in the ANSI/ISO/IEC standard for the C programming language, and it's on your system, likely called libc or something along those lines.

Anyway, I don't think that's a problem with my concept at all. What I want for Rust, and what I think will eventually be feasible for Rust as the language matures, is a standard that can be shared by compiler writers and Rust programmers. A standard is worthless if it's inadequate (see ISO Pascal or ISO Basic, for example), so it's a good thing that right now Rust is iterating quickly and improving rapidly. But eventually, there's going to need to be a stationary target for compiler writers to aim for, and for Rust programmers to be confident that the code they write today won't be littered with deprecated features, anti-patterns, and worst practices tomorrow.

Frankly, I don't see wide adoption happening in the corporate world until there's an LTS compiler at the very least.

← PreviousPage 6 of 34Next →