Hacker News new | past | comments | ask | show | jobs | submit login

> would use the C preprocessor to create his own language and then write the implementation of his language in that self-defined language

Yeah that sounds like the easiest way to make your colleagues hate you

I "love" how we had more languages in the 70s (usually created as a one-off project for people with not so much user friendliness in mind) think m4, awk, tcl, etc




Awk is actually great. M4 not so much.

Some absolute lunatic solved this year's Advent of Code in m4; it was impressive.


Terraform module args used to be very limited, and I didn’t know how to generate JSON it would take instead of HCL, so I actually used m4 to avoid repeating every template n times. And now we are sad because of course Terraform has improved quite a bit.


I used to contribute to an ultima online emulator and I definitely used awk to generate C# classes from a CSV file.


I mean we do have a lot of (perhaps too many) markdown dialects today. Wikipedia, wordpress, github, stackexchange, you name it. Last time I was using a Q&A forum for calculus course, it uses $$ to start and close a MathJax div.


My fave is Jira, where they have one syntax when creating an issue and another for editing it


Well, at least that is the obvious way to delimit a math div, isn't it?


Would you consider doing string processing in C rather than in Awk or Tcl?


It is funny question because I think most languages get string processing right. Pascal gets it right.

Except C.


But BSTR, too, is a C construct.


In FORTRAN, thank you.

(It was a long time ago, and there was no C compiler on our IBM/370...)


TCL is basically THE string processing language... because everything is a string :p.

For short scripts, awk is nice, but most people would use Python nowadays, and die hard Unix greybeards will use Perl or TCL depending on the mood.


Version 8.4 changed it a bit.


> Yeah that sounds like the easiest way to make your colleagues hate you

Well I'm not Whitney's colleague but I really like his code.


What do you like about it? I don’t think it needs to be stated why the majority of people here probably hate it, but I am curious why anyone would actively like it. I can maybe see that there’s a sense of achievement in being able to grok a codebase that is often described as unreadable


It might be unreadable in the same sense as Chinese or Russian is to someone who hasn't learned to read it. Learn to read and it turns out not to be unreadable?

I like it because it makes it easier for me to see the big picture. The forest and the mountain. It doesn't over-emphasize the bark on the trees; it doesn't drag on and make me scroll & jump through a maze of boring minute detail. At the same time, it doesn't actually bury and hide whatever detail there is; it's all there for when you need it. Whitney also generally simplifies things a lot and avoids tedious contortions others would make for portability or some theoretical conception of maintainability, readability, or vague "best practices". It's very straightforward and -- once you get past the Whitney vocabulary and general style -- there are no mountains of abstractions and layers you need to grok before you can work on the code.

The biggest problem is that after getting used to that style, "normal" code starts to feel like kindergarten books with very simple sentences written in horse sized capital letters, a handful per page. Except that those letters are not used to write a short children's story, but a complex labyrinthine machine, and the over-emphasis on minute detail just obscures the complexity and you end up with cross cutting concerns spread over thousands of lines of code and many many files. It might look clean and readable on the surface, yet: there be dragons. And nobody wants to tame those dragons because there's so much code. And then I find myself sighing and asking: why on earth do we need an entire page for what would really amount to a line of code if we didn't insist on spelling everything out like it's babby's third program after hello world? It's just tedious.

Whitney certainly writes his own sort of dragons, but it's easier to keep them all in your head. For example, the b compiler won't work out of the box on multiple platforms. I'm fairly confident I could port it without much effort, as long as the platform meets some basic requirements.


Yeah I don't think anyone likes over-engineered architecture astronaut code with too many layers and unnecessary abstractions, whether that's been formatted in the Whitney style or in a more conventional one. I think what I can't get over are the short identifiers (and filenames) and the way it just looks like a wall of text without any breathing space, though looking at another example someone posted[0] it seems there's a bit more whitespace and structure than I remember.

> Learn to read and it turns out not to be unreadable?

There's the thing, if someone learns Russian they can converse with 140 million people in Russia, similarly Ukrainians and Belarusians will be fine and they could probably make themselves understood through the Caucasus and Central Asia. If you learn to read C written in the Arthur Whitney style you can "converse" with a fairly small number of people who like the Whitney style[1]. So taking the example a bit further, I learned the Cyrillic alphabet in an afternoon and through knowing another Slavic language I can roughly parse the meaning of many Russian things I read (audio is another thing entirely, I can only pick out a handful of Czech/Russian homophones). If I had gotten up to speed with the ngn/k codebase would I be productive on one of the projects you wrote in a similar style, or is there a similar productivity wall where I'd have to first learn some idioms local to your codebase?

Sorry for the questions, I know people who like this style probably have to answer these questions fairly frequently. I am genuinely just quite curious though.

[0] = https://codeberg.org/ngn/k/src/branch/master/h.c

[1] = is there a proper name for this or is it ok to refer to it as "Whitney style"?


I don't know if there's a proper name for it. At least people who are aware of the style would probably recognize Whitney's name so that's the best term I've come up with yet.

For me, the end goal isn't Whitney style, but I've been pursuing effective programming all my life. When I learned to code, I wasn't talking to anyone except my computer, and that alone was exciting enough to make it a life-long hobby and profession for me.

Do you know what brought me to Hacker News? Arc. And Paul Graham's writings about Lisp. The message was never about a popular language that everyone speaks. If anything, it was rather the opposite: pg saw in lisp a powerful and expressive (if niche) language that makes you competitive against larger players who stick to boring mainstream languages. I wasn't interested in competition or startups, but merely in powerful ways to make the computer do what you want. I don't particularly care if I'm the only person on planet earth willing to wield that power; it's for my own enjoyment. Programming for me isn't about "product" so "productivity wall" isn't something I think about, and complaining about productivity wall would be a bit like complaining that getting fit for Tour de France is time consuming, why don't they just drive it by car?

That said, I think there are people who find K, APL, and related languages very productive in their niche. I'm definitely not speaking for everyone.

Anyway, it is the curiosity and desire to discover a powerful way to command the computer that has driven me to study Haskell, APL, PostScript, forth, TLA+, lisps, BQN, K, Erlang, and more. "Whitney C" is just one milestone along the journey, and I don't know where the journey will eventually lead; I'm just not happy with any existing language right now.

So the answer is no, learning Whitney C will not make someone immediately productive with my code, just as learning Java does not make you immediately productive C++. They are different languages. However, anything you learn can shrink the productivity wall; knowing APL or BQN, K, and Whitney C might make it easier to grasp whatever I come up with next. That applies to all of programming in general though; the more you know, the more you know, and some of that knowledge will almost always transfer. There will be familiar patterns and ideas.

I also think people seriously overestimate the productivity wall. As you say, one can learn to read cyrillic in an afternoon. Kana in a weekend. But learning Russian or Japanese is significantly more work than learning the script. In terms of scope, I'd say learning APL or Whitney C is closer to learning kana than it is to learning Japanese.

(EDIT: I also find it ironic that programmers are ostensibly excited about learning new things, yet at the same time programmers really love to complain about languages that look alien won't give a few weekends to learn them)


Good to know re the name, I typed it out a couple of times and wondered if I was just doing something stupid. I really wasn't trying to formulate an attack on this style, if someone or some organization uses it and it works then more power to them. I was really just trying to understand a bit better, but it's possible that is something that I can only really get by experience.

So I find APL, J, K and friends quite fascinating (and J is on my list to try) but I haven't seen much hostility to them. People understandably get a bit intimidated by how different it is but they usually still seem curious. The real hostility is reserved for Whitney C. In this case I don't think it's like - if you'll forgive me for abusing that human language metaphor a bit - an English speaker learning Russian, more like

    ifAnEnglishSpeakerEncountered
    aLocaleWhereEnglishIsWrittenA
    ndStructuredDifferentlyToWhat
    theyWereUsedToSomethingLikeTh
    is.
I can understand why their instinct is to recoil in horror and think "I already know a more standard English, I'm currently learning Russian and Japanese ... I have little patience for trying out this alternate form of English". It's obviously an exaggerated/contrived example, but this is genuinely how that C code appears to an outsider at first blush (or at least it did to me and a couple of my friends).

That said your replies have piqued my interest, I'm gonna have to properly dig through that ngn/k repo some day. If I turn into a Whitney C guy then I'm holding you responsible :D


Yep. It's mostly a knee jerk reaction.

After accustomization with a style that doesn't force explicit declarations of identifiers and their types, verbose type conversions, line breaks and indentation after every statement and brace, etcetra., one could definitely make a different (and similarly exaggerated) human language metaphor. For example, take some English text and feed it through a parser. Feels good to read?

    (S (NP Parsing)
       (VP refers
           (PP to
               (NP (NP the activity)
                   (PP of
                       (S (VP analysing
                              (NP a sentence)
                              (PP into
                                  (NP its component categories and functions))))))))
       .)
That's a bit how mainstream languages feel after using something that hasn't been forced into such an artificial form :) If you're willing to let go of that, you can write sentences and clauses on the same line, almost like prose!


Hehe that's actually a nice way to put it. So it's a little bit like the red pill, you can't really go back after going embracing Whitney C :D




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

Search: