I ❤️ APL & BQN

  Рет қаралды 19,564

code_report

code_report

Күн бұрын

Пікірлер: 61
@hkp9257
@hkp9257 2 жыл бұрын
Coming home from salsa dancing where I try not to break my legs to a video of Conor where I try not to overload my brain. Perfekt evening :)
@JamesSully
@JamesSully 2 жыл бұрын
I'm gonna have a crack at doing Advent of Code 2022 in BQN (starts in 4 hours) You should do it too so I can learn from your solutions!
@code_report
@code_report 2 жыл бұрын
I plan on posting a few videos 🙂
@JamesSully
@JamesSully 2 жыл бұрын
@@code_report nice!
@c4tubo
@c4tubo 2 жыл бұрын
Superb! I've been listening to all of the ArrayCast podcasts and been hungering for more of these videos from you. It would be especially nice to get more stuff on BQN since you have convinced me that it is the best array language to use.
@echoes6092
@echoes6092 Жыл бұрын
I love this! I do feel like APL instructions tend to map to lines in other languages, somewhat (though of course instructions can be combined onto lines in other languages too, e.g. you can do 2 + 3 * 4 in almost every language). APL instructions are one character, and not counting the parentheses (since those probably wouldn't be necessary, splitting it up onto lines) the solution given in the video has 11 characters. APL definitely looks much more concise-and it is, for sure-but if you mapped the APL instructions to Python words, and added back in the necessary variables, you'd have a Python solution. What I love about APL most isn't the fact that the solution is 13 characters; what I love is that there's no redundancy.
@yarrowification
@yarrowification 2 жыл бұрын
Yess code report is back spreading the array gospel
@bighomem69
@bighomem69 2 жыл бұрын
code report upload??? what a pleasant surprise!!
@gtdmg489
@gtdmg489 2 жыл бұрын
I have a hunch that aliens might read this code easier than us.
@boredstudent9468
@boredstudent9468 2 жыл бұрын
Just be obligatory reminder, that beeig verbose is not necessarily a bad thing. I much rather read in German than in Ithkuil. And i can mich easier comprehend what's happening in a Rust programm than Perl or even APL.
@arisweedler4703
@arisweedler4703 2 жыл бұрын
This is an APL fan account, sir, please take your correct opinions about scalable software elsewhere (jokes aside the obligatory reminder is received and respected) Terse code can be fun, and more truthful than verbose. Bad code is the real only enemy
@boredstudent9468
@boredstudent9468 2 жыл бұрын
@@arisweedler4703 i know it is, and i kinda love it, thats why it's just the reminder not a rant essay. Sometimes i just need a little anger outlet.
@lucastavano4288
@lucastavano4288 2 жыл бұрын
It's also nice to add that good code is always code that is maintainable, following clean code principles, when working in big companies, it's always good bein verbose when you gain simplicity with it, making other devs comfortable to maintain and improve your code. Just as a reminder that we don't write code for ourselves, but actually for other devs to be able to maintain and grow our codebase ☺️
@soyitiel
@soyitiel 2 жыл бұрын
Reminds of another code_report video about a problem with two apl solutions, one slightly less "verbose" than the other, but also less performant. There's beauty and ungliness in both sides. Both ends can either make it easy on the eye and mind, but also they can obscure everything. Maybe, like in most things in life, the key is balance
@darcy6698
@darcy6698 2 жыл бұрын
unless u go the other extreme .... toki pona
@abrudz
@abrudz 2 жыл бұрын
In BQN you can use the Cells 1-modifier instead of Rank 1.
@code_report
@code_report 2 жыл бұрын
Oops, I forgot 🙃
@NikolajLepka
@NikolajLepka 2 жыл бұрын
Yeah I was thinking the same thing
@ancbi
@ancbi 2 жыл бұрын
While I have heard about APL, I still the title as a 'I love apple and bacon'.
@Evan490BC
@Evan490BC Жыл бұрын
BQN is bad for you. Too much potassium nitrate and salt.
@PEGuyMadison
@PEGuyMadison 2 жыл бұрын
Do you have recommendations on learning APL? I am on MacOS so it has to work on that platform.
@TagetesAlkesta
@TagetesAlkesta Жыл бұрын
Bro really pulled out the standard galactic alphabet for this one
@cusaint3596
@cusaint3596 Жыл бұрын
It will be great if you or someone provide separate tutorials on how to use BQN, J, and APL for very beginners. I would find more useful to learn how to install the programs and how to use each command (explained in a series of videos), and then some basic demonstrations/samples. That means: from zero to intermediate to advanced. The ones you are currently providing are advanced.
@code_report
@code_report Жыл бұрын
I have a getting started video with APL: kzbin.info/www/bejne/m3Kmq6iHfNVmjNk
@cusaint3596
@cusaint3596 Жыл бұрын
@@code_report Thank you, but that one is to install Dyalog on Ubuntu. It would be nice to have a tutorial specific to BQN that shows how to install it on Windows and the explanations on at least the most important commands. I did not find BQN tutorials on KZbin that show the basics of BQN.
@cusaint3596
@cusaint3596 Жыл бұрын
@@code_report Thank you for the getting started video with APL, but that one is mainly about how to install Dyalog in Ubuntu and only a few commands. I have not found a KZbin tutorial that shows the basics of BQN: How to install it in Windows, what editor is most recommended to type the commands, and an explanation of the commands specific to BQN. The same for J. Yes, I can visit websites related to those, but it will be nice to have KZbin videos that actually show how.
@kacperuminski1547
@kacperuminski1547 2 жыл бұрын
It's been 84 years...
@billr3053
@billr3053 2 жыл бұрын
Negating the entire boolean array and then re-summing everything seems inefficient. You would get the same result by simply subtracting the row and column sums from their axis lengths. Incorporating that shortcut into the final outer product cleverly may in fact eliminate the need for outer product, I think. Also, in my opinion, the problem statement is needlessly obscure and difficult to follow. It’s like they’re trying too hard to not give away obvious candidate algorithms.
@_tsu_
@_tsu_ Жыл бұрын
Well, the whole expression should be optimised out into a single pass algorithm before execution so it's all good.
@0LoneTech
@0LoneTech 6 ай бұрын
Something like this? +⌜´ ((2×+´)-≠)˘¨ ⋈⟜⍉ grid Take both the matrix and its transposition, subtract the axis length from twice the sum (since each 1 is a missing 0 also), and make a sum table from those two vectors.
@585ghz
@585ghz 2 жыл бұрын
😲 wowww Nice solution!!!
@lucaayfmlyysiaejdsrtnnervd4646
@lucaayfmlyysiaejdsrtnnervd4646 Жыл бұрын
I don't understand a character that's there, but it's BEAUTIFUL!
@davidprock904
@davidprock904 Жыл бұрын
If I don't know bqn or apl, and I learn bqn first, would there be any need to learn apl? Didn't bqn come from apl? Does apl offer something that bqn doesn't??
@mumujibirb
@mumujibirb Жыл бұрын
nice language and solution but the syntax uses goofy ahh symbols, which are nice in a way but hard to convey their meaning
@arraymac227
@arraymac227 Жыл бұрын
Is BQN just a transliteration of APL, or of J for that matter?
@0LoneTech
@0LoneTech 6 ай бұрын
No. There are differences in features like first class functions, role conversions, namespaces, affine characters, leading axis model, how to overlap shared glyphs, etc. But they probably share considerably more.
@vaaaaaas
@vaaaaaas 2 жыл бұрын
Less is more. Flatter is better. Unicode thighs save lives.
@spacelem
@spacelem 2 жыл бұрын
My Julia code was "solution = sum(X, dims=1) .+ sum(X, dims=2) .- sum(X.==0, dims=1) .- sum(X.==0, dims=2)", but I'm not sure if I can reduce that any further. Weirdly I tested it with a 100x100 matrix and that version seems to scale better than the longer fully looped version (going from 6.5x slower with the 3x2 matrix to 74x faster).
@nunzioturtulici9636
@nunzioturtulici9636 Жыл бұрын
I like Julia too [sum(v+w) for v ∈ eachrow(2X.-1), w ∈ eachcol(2X.-1)] (actually one should use a let to avoid computing twice 2X-1)
@IantoCannon
@IantoCannon Жыл бұрын
Code golf is the best golf
@H2CO3Szifon
@H2CO3Szifon 2 жыл бұрын
This is all nice and everything, but a NumPy-based Python solution would be a two-liner and a **ton** more readable (and anyone doing serious matrix manipulation in Python would use NumPy anyway): y = 1 - x diff = np.add.outer(x.sum(axis=1) - y.sum(axis=1), x.sum(axis=0) - y.sum(axis=0))
@romaing.1510
@romaing.1510 2 жыл бұрын
Easily readable one liner numpy solution (as it is always possible): 2 * (grid.sum(axis=0) + grid.sum(axis=1, keepdims=True)) - sum(grid.shape)
@jamieg2427
@jamieg2427 2 жыл бұрын
how dare you offend the (actually surprisingly sizeable) hoards of bqn-invested children.
@semurgx
@semurgx Жыл бұрын
beautiful, but not readable who cares!?
@torarinvik4920
@torarinvik4920 2 жыл бұрын
If you want an extra challenge, try solving it in Prolog
@jayantchoudhary1495
@jayantchoudhary1495 2 жыл бұрын
why, seems pretty straightforward?
@torarinvik4920
@torarinvik4920 2 жыл бұрын
@@jayantchoudhary1495 I don't know if you actually have used it or not. But Prolog is so limited and imo difficult, it's probably one of the few languages where making a compiler and interpreter for it would be easier than actually learning how to properly use it. I might not have enough experience with Prolog to be a proper judge but for me at least it's difficult and frustrating even for trivial tasks.
@jayantchoudhary1495
@jayantchoudhary1495 2 жыл бұрын
@@torarinvik4920 oh i have used it to solve may of the previous years advent of code problems. The problem usually is execution speed as I am still not good at optimization. For this particular problem just 1)take row wise and column wise sum (with accumulate) 2)subtract n from it ( from the n by n grid provided) to get sum of zeros 3) plug the formulas it's done.
@torarinvik4920
@torarinvik4920 2 жыл бұрын
@@jayantchoudhary1495 Nice :)
@bzboii
@bzboii 2 жыл бұрын
For some reason the algorithm (™) chose not to present me this video but I’m very happy I found it now! code_report Leetcodes are back bb!
@steveAllen0112
@steveAllen0112 2 жыл бұрын
This works, too: -⍥(+/∘.++⌿)∘~⍨ Basically, pass the argument to both tines of the fork, preprocessing the right side with negate.
@johnsmith-zr2br
@johnsmith-zr2br 2 жыл бұрын
solution
@arraymac227
@arraymac227 Жыл бұрын
Where you have: x ← ... x this also works: ⊢x←...
Implementing C++'s std::partition in BQN
9:04
code_report
Рет қаралды 9 М.
APL vs BQN vs Uiua
18:09
code_report
Рет қаралды 8 М.
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.
UFC 287 : Перейра VS Адесанья 2
6:02
Setanta Sports UFC
Рет қаралды 486 М.
1 Problem, 24 Programming Languages
19:29
code_report
Рет қаралды 377 М.
Python vs Uiua vs BQN
15:47
code_report
Рет қаралды 15 М.
APL + Game of Life = ❤️
14:46
code_report
Рет қаралды 35 М.
I made Tetris in C, this is what I learned
15:15
Austin Larsen
Рет қаралды 27 М.
FORTH - Better than BASIC?
14:30
NCOT Technology
Рет қаралды 42 М.
Finding the Most Beautiful APL Solution!
13:27
code_report
Рет қаралды 6 М.
Dynamic Programming isn't too hard. You just don't know what it is.
22:31
DecodingIntuition
Рет қаралды 238 М.
7 Outside The Box Puzzles
12:16
MindYourDecisions
Рет қаралды 307 М.
The Ultimate Tier Programming Tier List | Prime Reacts
26:57
ThePrimeTime
Рет қаралды 524 М.
BQN vs Uiua #2
13:02
code_report
Рет қаралды 10 М.
Маусымашар-2023 / Гала-концерт / АТУ қоштасу
1:27:35
Jaidarman OFFICIAL / JCI
Рет қаралды 390 М.