Live data from Hacker News

Stages of denial in encountering K

nsl.com

71–80 of 432 posts

Re: Stages of denial in encountering K

#71
post #56

K +/!100 Python sum(range(100)) Haskell sum [0..99] Rust (0..100).sum() Ruby (0..99).sum There are plenty of ultra-concise languages for toy problems like these; they are called ‘golfing languages’. Ultimately it's a bit pointless since most of the time people aren't playing code golf. (The issue with setting everything to obscure ultra-compressed keywords isn't that it's not possible to learn those keywords , but th…

The article's point is a meta-point. Congratulations on actually being part of the meme in the article.

Re: Stages of denial in encountering K

#72

> When the entire system fits in a page of code you can understand everything about it from the top down. I'm sorry, but that sounds like the juvenile fantasy of someone who is still in their programming puberty. Good luck fitting an operating system, web browser or air traffic control system into a page of code.

Maybe I should've said a "screen" instead of a "page" (if you have two files open side-by-side and they both fit on your screen it's the same benefit). And I admit it is slightly hyperbolic (to make a point about the virtues of being able to see a significant portion of your project at once). Large projects will be more than one screen of code, although perhaps surprisingly few. (This actually influences how I organize code, in that the "screen" becomes a logical unit, and I try to keep the API surface of each screen really small.) I'm working on a programming language project to try to get even denser.

>Good luck fitting an operating system, web browser or air traffic control system into a page of code.

Aaron Hsu's co-dfns compiler (optimizing compiler for a subset of APL to the GPU) is 3 screens https://github.com/Co-dfns/Co-dfns/tree/master/cmp (I can fit the entire codebase on my three monitors).

This K text editor is way less than one screen https://kparc.com/edit.k (Funny you should mention OS. I'm eager to see how many pages kOS is. AW notoriously hates scrolling.)

Web browsers are a lost cause, I'll give you that one.

Re: Stages of denial in encountering K

#74
post #20

Earlier quoted context omitted.

> The post mocks the mindset featured within your comment. Actually, the post pretends you know nothing about functional programming and then presents K as the solution–but, as the grandparent points out, it’s not the only one. The post actually has no comment on this. (I should also note that smugly mocking a mindset by reducing it to a caricature might help explain why people are exasperated by the post’s patronizi…

The post sort of comments on that by claiming that K's somewhat cryptic-looking operator-style functions are more legible than named counterparts. > Does giving a K idiom a name make it clearer, or does it obscure what is actually happening? sum: +/ raze: ,/ ordinal: > The word “ordinal” can mean anything, but the composition (Didn’t click for me but I also didn’t spend a while on it, whatever.) However, one should n…

everything any of us work with is a cryptic operator, if you think about it...

Re: Stages of denial in encountering K

#75

Earlier quoted context omitted.

Really? That’s quite surprising; I would expect all of them to have some sort of “programming languages” course or similar…what classes do they have then?

My CS program (class of 2007) was mostly c++. There was one semester of Java, but it was optional. We learned fundamentals, discrete math, symbolic logic, and also "databases" (read: MS Access), object-oriented design, and I forget what else. With the benefit of hindsight, I feel like I overpaid for that education :)

I’m a math student minoring in CS and I covered all of that before I’d finished second year. I also covered functional programming in first year.

I’m really surprised your CS degree didn’t cover operating systems, compilers, or algorithms. CS students at my school are required to take all of that stuff (and a lot more, including everything you’ve mentioned) before they even finish 3rd year. In 4th year they’ll be studying things like networking, real-time programming, computer graphics (physically-based rendering), machine learning, and computational math (for simulations, numerical solvers, linear and nonlinear optimization, etc).

Re: Stages of denial in encountering K

#76
My problem with K isn't its syntax, it's its culture: People who are so self-satisfied with their ability to read their own code they refuse to give variables meaningful names, aping mathematical tropes they half-understand at best, because those mathematical equations are only tolerable in the context of a paper where the rest of the lifting is done by natural language prose. They eschew comments without realizing that those comments enable terse expressions by showing you have the basic maturity to express yourself in a way others can understand.

Knuth tried to move us to that state with Literate Programming. How many K programmers use Literate Programming? One? Two? Any?

Re: Stages of denial in encountering K

#79
post #21
post #5

Earlier quoted context omitted.

k is perfectly readable. That's like, one of the biggest points of the post. The post mocks the mindset featured within your comment. None of the languages you listed are quite as readable as k to someone who knows it. All of the languages you listed are significantly slower and feature none of the benefits of a concise notation, even with fast.ai's Python style guide made to imitate Arthur Whitney. http://www.eecg.t…

> k is perfectly readable [...] to someone who knows it A great example of a tautology. Every language in existence passes this test... The real test is a language that is readable by those who don’t know it.

> Every language in existence passes this test...

That's not true. Languages vary tremendously in how readable they are to people that know them. Especially if you set the bar for "knowing" at a consistent number of hours invested.

A language that's total noise at hour zero could also be the easiest to read at hour 20, and 40, and 100, and 1000...

When a language is something you're supposed to be doing real work in, as a core part of your job, it's perfectly reasonable to require some amount of training before you're set loose.

Post reply on HN