Comment by raverbashing
4 years ago
> 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.
> 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.
5 replies →