8 ms·
Arthur Whitney releases an open-source subset of K with MIT license
- KRAKRISMOTT 2y agoThis is probably his last attempt at leaving a legacy given his age. I wonder if Wolfram would do something similar.
- tluyben2 2y agoThere is a lot to learn from him; tiny binaries, super fast performance; programming style you like or don't, that's fine. To have a 200kb binary that's a programming language + database is very nice. It's great we can study a part of it and probably more in the future. We went overboard with bloating and complexity; it's good to be shown you can write current enterprise/commercial products that fits in the memory of an 80s homecomputer without changing your style of programming or tools you use for it. IMHO anyway.
- RetroTechie 2y agoSadly this isn't the norm. Imho software size should reflect complexity of the problem domain. Not arbitrary metrics like say, the capabilities of a system executing it. So "Hello World!" should weigh in at mere bytes. Not KBs or even MBs.
- hardlianotion 2y agoThat's ... er ... cryptic.
- 082349872349872 2y agoJust as Inform 7 works because people who write adventure games are the least likely to mind having to play "guess the verb", K source works because people who write vector languages are the least likely to mind expressing algorithms with, not display: block, but display: inline.
- tetris11 2y agoClicking through the page, I'm still not quite sure what I'm seeing.
- cies 2y agoNot very informative homepage... A lang+db? Fast on one machine? Or does it distribute?
- frankjr 2y agoThe code looks heavily obfuscated. It's more like "source available" than open source. E.g. g(_M,W-=1<<f;xx=M[f];M[f]=x)Ui(M_,Ux=M[i];x?(W+=1<<i,M[i]=xx,x):30>i?_M(i,M_(i+1))+(2*n0<<i):OO())f(_r,pt?x:65535&rx?(--rx,x):e(if(!Tx)n(_r(xU))_M(mx,x-n0);x))f(r_,pt?x:65535&++rx?x:OO()) Edit: Looking at it a bit more, I can't tell if the code is obfuscated or if the author really wrote it like this...
- padthai 2y agoDoes writing in this way has any advantage in practical terms (not aesthetically reasons)?
- IshKebab 2y agoThe only possible advantage I can think of is that you can fit more code on one screen so I guess in theory you can see your context more easily. But that seems pretty minor compared to... well, look at it! I read a couple of other threads and some people try to claim less code = fewer bugs, but that's pretty clearly nonsense otherwise minifiers would magically fix bugs. As for why people actually use this (it seems like they really do), my guess would be that it's used for write-only code, similar to regexes. Like, using a regex you can't deny that you get a lot of power from not many keystrokes, and that's really awesome for stuff you're never going to read again, like searching code in your editor, one throwaway shell commands. But they also tend to be completely unreadable and error prone and are best avoided in production code.
- eigenvalue 2y agoI suppose in our new world of LLMs, using as few tokens as possible means you can cram more in a small context window, which could be helpful in various ways.
- 082349872349872 2y agoMaybe someone could produce an LLM which takes a line of vector language code and expands it into the dozen(s) of lines of equivalent pseudo-algol? (I mean, you could skip the whole hallucination thing and write an exact converter, but that'd be a lot of effort for code that'd probably get used about as much as M-expression to S-expression converters do in the lisp world?)
- hakanderyal 2y agoFor people not accustomed to the style of Whitney, you can read various HN threads from the past to learn more about why he writes programs the way he does. It’s deliberate and powerful. Here is a recent one: https://news.ycombinator.com/item?id=39026551 https://news.ycombinator.com/item?id=39026551 There was an epic post some years ago but couldn’t find it now from my phone.
- tosh 2y agoHow does it compare to the k that you can license from shakti or to ngn/k?
- r8533292 2y agoas of right now it's a desktop calculator, functions, conditionals and loops are missing, you can see its scope here https://shakti.com/k/k.d https://shakti.com/k/k.d
- gitonthescene 2y agoNgn/k is GPL and thus more restrictive. https://codeberg.org/ngn/k/src/branch/master/LICENSE https://codeberg.org/ngn/k/src/branch/master/LICENSE
- klibertp 2y agoOMG, just yesterday I wrote a comment saying that I regret not learning K (I instead chose J) due to being too hung up on the notion of free software at the time... What a coincidence! Now I have no excuses anymore, time to learn K!
- forgotpwd16 2y agoHow those two compare?
- 082349872349872 2y agoK is pragmatically business-oriented, J is what you get after you've been thinking about computing for half a century?
- rscho 2y agoK specializes in financial data, i.e. lists of 1d arrays. Other APLs, and J, are more high-dimensional math oriented and specialize in true multidimensional arrays.
- koolala 2y agoRegret why? It's nice K is finally a viable language for communication and learning.
- rwillink 2y agoHe showed K @ Royal Society & bunch of apl & aplus guys were there. Someone asked , where are the comments? AW said comments get out of date with all the changes, if you can’t read the code you Shldnt be working on it. We then all looked at each other..
- 082349872349872 2y agoSo far the highest ratio of comment to code I've seen is Hsu's thesis (~200 pages of commentary[0] to ~20 lines of code[1]) at 10 pages/line. [0] https://scholarworks.iu.edu/dspace/bitstreams/dcbd5240-8454-4533-bc0c-ac3ee7628b8e/download https://scholarworks.iu.edu/dspace/bitstreams/dcbd5240-8454-... [1] https://www.bonfire.com/co-dfns-thesis-edition/ https://www.bonfire.com/co-dfns-thesis-edition/ (a) come to think of it, theses are one and done (b) thanks to Kragen for pointing out this 02019 work!
- 082349872349872 2y agoHeh, I just noticed Hsu's "above average" shirts: ⊢>+⌿÷≢ One of these days I need to (a) learn more about the Berber culture, and then (b) write an array language which exploits the ⵜⵉⴼⵉⵏⴰⵖ symbology. https://en.wikipedia.org/wiki/Tifinagh#/media/File:Tifinagh_alphabet.png https://en.wikipedia.org/wiki/Tifinagh#/media/File:Tifinagh_... https://www.win.tue.nl/~aeb/natlang/berber/tifinagh/tifinagh.html https://www.win.tue.nl/~aeb/natlang/berber/tifinagh/tifinagh... https://www.edition-originale.com/media/h-3000-saint-exupery_antoine-de_le-petit-prince-version-en-berbere-tamasheq_1958_edition-originale_4_82159.jpg https://www.edition-originale.com/media/h-3000-saint-exupery...
- deleted 2y ago[deleted]
- magicalhippo 2y ago> if you can’t read the code you Shldnt be working on it I don't know this AW guy, but to me that's a huge red flag and a sign that a programmer hasn't worked on anything substantial. Ie non-trivial stuff that's maintained by a team over time. Being able to read the code is irrelevant, as the comments should tell you why the code is doing what it's doing. For example, yeah I trivially can see the code is doing a retry loop trying to create a file with the same name. That looks like a bug, if you can't create the file with that name, you change the name in the retry loop. But the comment will tell me this is due to certain virus scanners doing dumb stuff, so we might have to try the same name a few times. Sure, good code will have few comments as most of it should be self-documenting through good structure and names of classes and variables. But in non-trivial code there will always be places where it is not obvious why the code does what it does.
- nickpeterson 2y agoWell I know what the next episode of the arraycast is going to talk about now.
- pjmlp 2y agoAlready looking forward to when it might be addressed. :)
- dpflan 2y ago“for: hedgefunds banks manufacturers formula1 ..”
- defrost 2y agoK by Arthur Whitney: http://archive.vector.org.uk/art10010830 http://archive.vector.org.uk/art10010830 vector the journal of the British APL Association
- koolala 2y agolet them eat APL
- 082349872349872 2y agoWhen your eng dept comes to you and says "Boss, we want arrays!", then let them eat APL.
- eigenvalue 2y agoThis language is very popular among quant finance people associated with Morgan Stanley. I don’t see the appeal myself. Maybe it helps prevent people stealing the code since it’s so awful looking to work with! At one point I had to learn it and I think I’ve totally forgotten it now— it’s like my brain repressed it. Not my cup of tea, that’s for sure.
- deleted 2y ago[deleted]
- eggy 2y agoMost people I know who actually learn an array language like k or j usually grow to appreciate the expressiveness and cleverness of these languages. Typically, people have your reaction who have only looked at it and tried it very briefly. I'm surprised. Why did you have to learn it? Where?
- eigenvalue 2y agoWas working at a quant pod at Millennium for a bit where they used it. I was ultimately able to use it but everything took me 20x longer than using Numpy/Pandas. The irony was that the Python code was shorter because there were so many more library functions and better abstractions and syntax. So it was slow and unintuitive for zero benefit whatsoever.
- wood_spirit 2y agoBut how did your perf compare to the best of the K kicking quants around you? Were they too being less productive than they would have been in python? I’m not saying they were right or better. Horses of courses. Array languages do my head in and my choice is sql.
- eigenvalue 2y agoI was able to explore new ideas much much faster using Python than the experienced k people could. But creativity is more important anyway. Ultimately, having good ideas/data/signals trumps fancy or fast data wrangling. Glad I’m doing other things now in any case.
- nivertech 2y agoIs this line in a.c enough for MIT license? //k(c)2024 arthur whitney(l)MIT
- defrost 2y agonice to see an exuberantly verbose arthur
- 082349872349872 2y agoThe loquaciousness brings two Calvin Coolidge anecdotes to mind, the punchlines to which are: "you lose" and "with the same hen?"
- Y_Y 2y ago> The President and Mrs. Coolidge were being shown around an experimental government farm. When she came to the chicken yard she noticed that a rooster was mating very frequently. She asked the attendant how often that happened and was told, “Dozens of times each day.” Mrs. Coolidge said, “Tell that to the President when he comes by.” Upon being told, Coolidge asked, “Same hen every time?” The reply was, “Oh no, Mr. President, a different hen every time.” Coolidge: “Tell that to Mrs. Coolidge!” https://quoteinvestigator.com/2018/03/30/coolidge https://quoteinvestigator.com/2018/03/30/coolidge
- Y_Y 2y ago> Once, at a dinner party, the woman sitting next to him said she bet she could get more than two words out of him. Coolidge then famously responded: "You lose.". https://newenglandhistoricalsociety.com/the-mordant-humor-of-calvin-coolidge/ https://newenglandhistoricalsociety.com/the-mordant-humor-of... Remind me of: > Brevity is... wit (Mr. Lisa Goes to Washington)
- vinnyvichy 2y agohttps://en.m.wiktionary.org/wiki/in_der_K%C3%BCrze_liegt_die_W%C3%BCrze https://en.m.wiktionary.org/wiki/in_der_K%C3%BCrze_liegt_die...
- vadiml 2y agoApl always was kind of write only language. But now you probly can paste all code in chat gpt and it will explain it
- PufPufPuf 2y agoThe website reads like an edgy script-kiddy blog. Is K actually a useful project, or is it just a passion project of someone who happens to be sort of famous?
- aebtebeten 2y agoConsider, mutatis mutandis, https://www.smbc-comics.com/comic/why-i-couldn39t-be-a-math-teacher https://www.smbc-comics.com/comic/why-i-couldn39t-be-a-math-... Lagniappe: click on the circular red button underneath the comic, to the right of the orange "RANDOM" :-)
- sph 2y ago> The website reads like an edgy script-kiddy blog. The code does, as well. Either Mr. Whitney's brain is not wired like a regular homo sapiens sapiens, or the entire thing smells of "I am smarted than you and I don't need to lower myself to your level." I do not buy for a single second that for Mr. Whitney debugging IOCCC-level obfuscated code is easier than plain C code. One writes "normal code" because one will have to read it later, and they don't want to spend ages doing so, unless they have to keep an air of superiority about their abilities to their peers. I get that APL is obtuse and dense. But writing obtuse and dense C doesn't turn it into APL.
- JonChesterfield 2y agoI worked with a guy who could handle loops nested half a dozen deep with data dependencies woven through the structure with exactly the same apparent cognitive overhead as for i = 0, N. The sort of structure you get when you arrange a difficult calculation to match the cache hierarchy of the target machine. Didn't do comments or variable names with much enthusiasm. He was superb at finding errors at code review. As in looking through code someone else had written and pulling out the mistakes. Presumably everything looked completely trivial to him, regardless of how tangled the control flow had got. Whitney may be similar.
- MrBuddyCasino 2y agoWhat if he is smarter than you and doesn’t need to lower himself to your level.
- dchest 2y agoEveryone here charges too little for software. the free(MIT license) version is shakti.com/k/k.zip the supported version(supported and 10 to 100 times faster) is $100K per month(minimum) https://groups.google.com/g/shaktidb/c/5SPufca3mo4 https://groups.google.com/g/shaktidb/c/5SPufca3mo4
- nordsieck 2y agoI mean, it really depends on who your customers are. You can charge a lot if you can make the typical financial analyst 20% more productive. Wouldn't work the same way if your core customer base is elementary school teachers.
- jeremiahbuckley 2y agoThey’ve been charging a that amount forever, it’s a crazy ask. But you’ll be happy to hear that the quoted price is about 80% off of the price in 2000, so take advantage of the discount. In 2000 it was $100K/month.
- losvedir 2y agoInflation has been 80% since then, but that doesn't mean it's 80% off. $1000 in 2000 is $1800 today, so a discount of 44%. 80% off would imply it's $5000 today, but prices didn't 5x fortunately. Good joke, though.
- coxley 2y agoGood joke and good follow-through, haha.
- jeremiahbuckley 2y agoI absolutely got it wrong, thanks for the correction.
- pixelmonkey 2y agok is widely used by a handful of big investment banks and big hedge funds for quant/finance stuff. There are only a handful of such companies in the world but they are extremely price insensitive, especially with regard to technology that lets them get a market edge. I suspect this is the dynamic that kx, the company, tapped into over the years. I also suspect this open source release is mainly because investment banks have come around on their desire for open source (rather than proprietary) software over the years, at least on some teams. You can see the open source release doc explicitly positions k vs Python, pandas, and polars. For example, I have an old friend from a major investment bank who used to work on an internal (proprietary) pub/sub system but who, these days, works on integrations between that system and Apache Kafka.
- victorbjorklund 2y agoCan someone explain how it can be "faster" than anything else?
- andrepd 2y agoMy money is on "it's not, and the benchmarks are cherry picked" I mean faster at filtering data than a python script? Sure. Faster than a database or hand-rolled C code? Only if your benchmarks are misleading.
- tluyben2 2y agoNot for all cases, but he (and his team) take the time to squeeze performance out of things where others just say 'it's fast enough'. There was a monh+ long conversation why all most used json parsers are so terribly slow etc. Not many people take the time to try to optimise the last drop of blood out of everything, especially if you have shareholders or deadlines; you settle for 'good enough'.
- magicalhippo 2y agoAnd to be clear, in many, if not most cases, settling for "good enough" is the right call, and spending hours upon hours chasing performance is the wrong call.
- tluyben2 2y agoSure, but not in the case of maximising performance if that is your goal. Which is what we are talking about here… wringing every ounce of overhead from it is basically the business case; at least one of them.
- magicalhippo 2y agoOh sure. Just wanted to stress that that's seldom the case. I see so many cases of wasted optimizations because someone thought performance mattered, leading to unnecessarily complex code or other maintenance issues. In other cases, especially in my sector, it's simply that the customer values lower cost over absolute performance. Of course, not saying you shouldn't be mindful of introducing an O(n^2) algorithm when an O(n log n) can trivially be used, or similar.
- andrepd 2y agoThis reads like the incomprehensible ramblings of a mentally ill patient scribbling in the walls. There is zero context, zero explanation. Very vague or incomplete statements scattered all over the place. I don't understand what someone not already familiar with the project is supposed to take away from this. Is the terseness of the site mean to reproduce the terseness of the language? Is that the gimmick?
- Tomte 2y ago> I don't understand what someone not already familiar with the project is supposed to take away from this. This isn‘t an advocacy piece directed at the general public. You‘re not his audience. Fortunately, there is secondary commentary, like this thread, so we can get an idea what this is about.
- JonChesterfield 2y agoInteresting things in here. #define _(e) ({e;}) //!< isolate expression e in its own lexical scope and clamp it with ; //!< note the outer parens, which is a very powerful c trick: they turn _(e) into a so called //!< r-value, which basically means we can do x=_(e) for as long as e evaluates to or returns //!< at least anything at all, i.e. not void. this macro is fundamental to k/simple implementation. I didn't know that corner of C. Removing the () from the macro does change what you can pass as e, and assigning the result of a block does work as one would expect. edit: -Wpedantic on gcc will tell me ISO C doesn't like the construct but it still compiles it happily. Clang offers -Wgnu-statement-expression-from-macro-expansion So it looks likely that this is the GNU statement expression extension after all and not a part of C. Shame.
- jstimpfle 2y agoYes, this is called statement-expression (instead of expression-statement which is the normal "doer" statement that contains just an expression followed by a semicolon). The Linux kernel makes quite a bit of use of them as far as I'm aware.
- IshKebab 2y agoYou can use these to implement Rust-style `auto x = TRY(...);` in C++ which is pretty nice. Unfortunately MSVC doesn't support this extension.
- shawn_w 2y agoYeah, it's a gcc extension. Details at https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Statement-Exprs.html https://gcc.gnu.org/onlinedocs/gcc-14.1.0/gcc/Statement-Expr...
- mrob 2y agoIs there some application that demonstrates the utility of this language? E.g. it's tempting to dismiss Haskell as something invented by mathematicians more concerned with the elegance of their abstractions than actually getting things done, but Pandoc is so undeniably good and useful that you're forced to admit Haskell can be a good choice. What's the Pandoc of K?
- rscho 2y agoThat's not the idea. In a sense, the Pandoc of K is K itself. I mean its designed for interactive, fast and terse scripting on financial data for quants. And it's incredibly good for that. So almost all substantial K is proprietary.
- mxz3000 2y ago[dead]
- grumpyprole 2y agoThe "killer app" of K is KDB.
- jjtheblunt 2y agoi know Formula 1 has enormous, voluminous, live data feeds streamed from the cars, and god knows where else; kdb/q supposedly enable such.
- stefano 2y agoThose are some very big claims with respect to performance. Has anyone outside of the author been able to reproduce the claims, considering you need to pay 100k/month just to do it? I also wonder if the commercial version has anti-benchmark clauses like some database vendors. I've always seen claims that K is much faster than anything else out there, but I've never seen an actual independent benchmark with numbers. Edit: according to https://mlochbaum.github.io/BQN/implementation/kclaims.html https://mlochbaum.github.io/BQN/implementation/kclaims.html, commercial licenses do indeed come with anti-benchmark clauses, which makes it very hard to take the one in this post at face value.
- JonChesterfield 2y agoArray languages are very fast for code that fits sensibly into arrays and databases spend a lot of compute time getting correctness right. 100x faster than postgres on arbitrary data sounds unlikely-to-impossible but on specific problems might be doable.
- mlochbaum 2y agoYes, when I took a look at shakti's database benchmarks before, they seemed entirely reasonable with typical array language implementation methods. I even compared shakti's sum-by benchmarks to BQN group followed by sum-each, which I'd expect to be much slower than a dedicated implementation, and it was around the same order of magnitude (like 3x slower or something) when accounting for multiple cores. I was surprised that something like Polars would do it so slowly, but that's what the h2o benchmark said... I guess they just don't have a dedicated sum-by implementation for each type. I think shakti may have less of an advantage with more complicated queries, and doing the easy stuff blazing fast is nice but they're probably only a small fraction of the typical database workload anyway.
- wood_spirit 2y agoQuick for building a website? Probably not. Quick for evaluating some idea you just had if you are a quant? Yes absolutely! So imagine you have a massive dataset, and an idea. For testing out your idea you want that data to be in an “online analytical processing” (OLAP) kind of database. These typically store the data by column not row and other tricks to speed up crunching through reads, trading off write performance etc. There are several big tech choices you could make. Mainstream king is SQL. Something that was trendy a few years ago in the nosql revolution was to write some scala at the repl. It is these that K is competing with, and being faster than.
- NKosmatos 2y agoHe might be a smart person, with a very high IQ and on a different level than the rest of us, but by writing with this style, with no comments, with no proper capitalization/style and with this attitude, he’s putting me off (IMHO). Oftentimes, the way something is presented and how the language is used, might be as important as the thing itself ;-)
- sharmajai 2y agoBut but look at all the Turing Award and Putnam Prize winners he was worked with.
- taf2 2y agoI’ve always told myself- no matter how smart my idea is , if no one else understands it it could be as if it didn’t exist.
- cess11 2y agoMight want to read Notation as a Tool of Thought: https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.pdf https://www.eecg.utoronto.ca/~jzhu/csc326/readings/iverson.p... If you want you can switch out his terse names in the .h and .c and see if that helps. I'm not so sure it does, but experience with array languages and a couple of decades with rather advanced C will. As in, experience is what matters rather than "IQ".
- secondary_op 2y agoAnd I though that Skala, FP (monad in X is just a monoid in the category of endofunctors of X) people are pretentious sect, this is so much worse, given their customer base, I immediately presume that this is nothing more than approach to deliberately make things unintelligible for as many people as possible, so that your white collar hedge fund guy would have heart stroke just by glancing at this source code, not even trying to read or understand it, that is one way to treat people and make business, it is despicable. Industry needs to formalise this into well known phenomena much like Security through obscurity [1] so that kind hearted pragmatic people avoid this like a plague. [1] https://en.wikipedia.org/wiki/Security_through_obscurity https://en.wikipedia.org/wiki/Security_through_obscurity
- rscho 2y agoTry it or any other APL for 3 months. You will change your mind.
- gitonthescene 2y agoIt’s not at all clear where you read pretentiousness. Is it the mere fact of its existence?
- hiAndrewQuinn 2y ago... Ah, so this is regexes but for math. Got it.
- xelxebar 2y agoJust packaged it up on my private Guix channel. Here's the package def (along with the one for ngn/k as well) if anyone's interested: https://gist.github.com/xelxebar/c37ab9285b297fed3e9e0f9ce781db9b https://gist.github.com/xelxebar/c37ab9285b297fed3e9e0f9ce78...
- secwang 2y agoHow to compile these codes under clang15?
- carlsborg 2y agoIf you ask ChatGPT to reply in the style of Arthur Whitney, you get amazingly concise summaries. Like a language verion of this code. I use that prompt often.
- doug-moen 2y agoFYI: This only implements a subset of K (I'd estimate 1/3). Calling it a 'release' is an overstatement. The docs state that it is a work in progress. It's also quite buggy (it's easy to get a segmentation fault). The version I saw in January was about 1/3 the size of this version, and also buggy. I hope that the final version of this code is less buggy and more usable. If you want to learn the K language, don't use this version. Any of the other open source K projects are better than this (more complete, less buggy, better documented). This project is good if you want to learn more about the Arthur Whitney C coding style, because it is so small. Other projects written in this style (some open source K implementations, the J language) are huge by comparison.
- Qem 2y ago> Any of the other open source K projects are better than this (more complete, less buggy, better documented). One thing that puzzles me, about array languages, is that despite several open source implementations already existing, like J, its surprisingly difficult to find them packaged in Linux repositories. For example, you can't just "apt install J", or "apt install gnu-apl" on Ubuntu. In J case, it seems the default is just compiling it from source. Is there something tricky about packaging them? The closest to a repository-friendly array language I could find was the klongpy implementation of klong[0], that is pip installable. [0]. https://t3x.org/klong/ https://t3x.org/klong/
- dzaima 2y agoYou can 'apt install apl' for GNU APL. Most open-source array languages though either have very few users, and/or are moving quite fast and thus an apt-packaged version would likely be rather out-of-date quite basically always. Though, for example, nix has J, BQN, uiua, GNU APL, and Dyalog APL (based on quick searches), so the barrier to entry to apt also is presumably rather high.
- gmfawcett 2y agoI could swear that I used to install j902 from apt on Ubuntu. Am I misremembering this?
- vmsp 2y agoI think the link for k.zip was just removed. EDIT: shakti.com/k/k.zip is now returning 404.
- freedomben 2y agoThanks, I thought I was going insane a little bit there :-)
- omnicognate 2y agoI'm going to have to take another run at learning this corner of computing soon, but it's a prospect I'm not relishing. Everything about it rubs me up the wrong way. If you'd like an antidote, have a read of Gerald Jay Sussman's books, where you'll see profound concepts from maths and physics captured in succinct and expressive (as opposed to merely terse) code, accompanied by eloquent explanations devoid of boasts or name dropping and provided free of charge online. That will change the way you think about computing too, but it will be a more pleasant experience.
- philipov 2y agoWhich one do you recommend? The first one I found was "Structure and Interpretation of Computer Programs" https://web.mit.edu/6.001/6.037/sicp.pdf https://web.mit.edu/6.001/6.037/sicp.pdf
- omnicognate 2y agoThat's a good place to start but it's primarily about programming itself. In "Structure and Interpretation of Classical Mechanics" and "Functional Differential Geometry" he applies his approach of using computer programs as a way of communicating concepts to humans to some fascinating maths and physics topics.
- chuckadams 2y agoThe SICP lecture series goes places that the book doesn’t: one of them involved encoding derivatives in a generic way that high-school math never covered. It was mind-blowingly elegant, which is of course why I completely forgot it.
- freedomben 2y agoFor those who haven't heard of or aren't familiar with K, the Wikipedia page[1] has a remarkably helpful brief overview: > K is a proprietary array processing programming language developed by Arthur Whitney and commercialized by Kx Systems. The language serves as the foundation for kdb+, an in-memory, column-based database, and other related financial products. The language, originally developed in 1993, is a variant of APL and contains elements of Scheme. Advocates of the language emphasize its speed, facility in handling arrays, and expressive syntax. There was also a great thread on HN about it as well[2]. [1] https://en.wikipedia.org/wiki/K_(programming_language) https://en.wikipedia.org/wiki/K_(programming_language) [2] https://news.ycombinator.com/item?id=28493283 https://news.ycombinator.com/item?id=28493283
- koolala 2y agoDoes it support imaginary numbers or did they take them out like everyone else...
- cess11 2y agoJ supports them well, so I'd guess K does too. And many programming languages do, for example C# and Racket. I have a feeling it isn't very hard to implement, since that's what you typically do if you need complex numbers in Java.
- mlochbaum 2y agoFunctionality is, at this time, extremely limited (and the first kfun was out in January so I don't think there's really any intention to get this to usability on a short timeframe). No support for paired syntax like parentheses, functions in braces, and square brackets for indexing and function calls. No stranding or tacit functions. I doubt it's Turing complete. Many primitives are unimplemented and others are flaky: for instance calling count (#) on an atom can give an arbitrary number, print garbage, segfault, or allocate memory until it's killed. But it's got vector instruction support. If you're looking for a practical k implementation, I recommend ngn/k, and several other implementations are listed at https://k.miraheze.org/wiki/Running_K https://k.miraheze.org/wiki/Running_K .
- djoldman 2y agoEat your heart out: https://codeberg.org/ngn/k/src/branch/master/0.c https://codeberg.org/ngn/k/src/branch/master/0.c
- lenkite 2y agohttps://shakti.com/k/k.zip https://shakti.com/k/k.zip gives 404 not found
- cristaloleg 2y agotry https://shakti.com/k.zip https://shakti.com/k.zip
- koolala 2y agoCoukd this run in Wasm on OPFS - like how SQlite got official support for OPFS?
- delta_p_delta_x 2y agoThe website, the comments in this thread, and the various C snippets shared here all make me feel very stupid.
- gitonthescene 2y agoDon’t. Feel inspired. Nothing worth learning comes easy.
- deleted 2y ago[deleted]
- PeterZaitsev 2y agoSome big claims, but I wonder if there are some published repeatable benchmarks Also when someone claims 1000x better Performance I want to know why. For example MySQL or PostgreSQL -> Clickhouse I can clearly attribute to column store, compression, vectorization, parallel execution on multiple CPU cores and machines...
- leontrolski 2y agoFor what it's worth, there are some benchmarks of kdb+ (the database built on k) here - https://tech.marksblogg.com/billion-nyc-taxi-kdb.html https://tech.marksblogg.com/billion-nyc-taxi-kdb.html (it's overall a fantastic series of blog posts).
- i_don_t_know 2y agoThe link to the archive ‘k.zip’ has moved to https://shakti.com/ https://shakti.com/ with terse documentation in the ‘education’ section.
- hi-v-rocknroll 2y agoThe source is an IOCCC candidate and has zero tinkering value.
- 1vuio0pswjnm7 2y agoOther than ngn/k ... https://ktye.github.io/kdoc.htm https://ktye.github.io/kdoc.htm https://github.com/ktye/i/releases/download/latest/k.c https://github.com/ktye/i/releases/download/latest/k.c IIRC, some old UNIX versions had an APL interpeter in the userland. For me, a k interpreter could be the ultimate UNIX utility. But interoperability with pipes and other UNIX utilities is awkward to say the least, as is having to use other programming languages as duct tape.
- cristaloleg 2y agoNew link https://shakti.com/k.zip https://shakti.com/k.zip
- dlkf 2y agoDoes the page 404 for anyone else? Is this a Europe thing?
- doug-moen 2y agoSince this was posted, the source code was changed, and a makefile was added. The new version requires ARM 64 or Intel 64 with AVX2. It requires clang-13 (clang-14 and later won't work). Gcc doesn't work. With clang-14, I got build errors. First error: ./a.h:38:30: error: use of unknown builtin ‘__builtin_ia32_pminub256’ [-Wimplicit-function-declaration] Seems to be related to this LLVM change which removed the above builtin: https://reviews.llvm.org/D117798 https://reviews.llvm.org/D117798 When I replaced __builtin_ia32_pminub256 with __builtin_elementwise_min and ditto for max, then it compiles and apparently works.