code_report
code_report
  • 345
  • 3 154 045
J vs BQN vs APL vs Jello
Comparing the J, BQN, APL and Jello solutions to the Maximum Prime Differences problem.
J Playground: jsoftware.github.io/j-playground/bin/html2/
J Primes: code.jsoftware.com/wiki/Vocabulary/pco
BQNPAD: bqnpad.mechanize.systems/
BQN Crate: mlochbaum.github.io/bqncrate/
Dyalog APL: www.dyalog.com/
Dyalog RIDE: github.com/Dyalog/ride
Jello: github.com/codereport/jello
Maximum Prime Difference: leetcode.com/problems/maximum-prime-difference/description/
czcams.com/video/5eneQ9mFbpA/video.html
czcams.com/video/fsIfQqRjc1U/video.html
Chapters:
0:00 Intro
0:25 Brief Problem Description
1:06 J Primes Function
1:47 J Solution (Explicit)
3:36 J Solution (Tacit)
6:13 BQN Solution (Explicit)
7:46 BQN Solution (Tacit)
8:45 APL Solution (Explicit)
10:09 APL Solution (Tacit)
11:00 Jello Solution (Tacit)
12:11 Array Language Comparison
13:38 Outro
Follow me on GitHub: github.com/codereport
Follow me on Twitter: code_report
Follow me on LinkedIn: www.linkedin.com/company/codereport/
zhlédnutí: 3 153

Video

The Superpower of C++
zhlédnutí 35KPřed měsícem
In this video, the real superpower of C is demonstrated. It is in response to some comments on czcams.com/video/fsIfQqRjc1U/video.html. constexpr C Solution: godbolt.org/z/e3j63c3b6 Maximum Prime Difference: leetcode.com/problems/maximum-prime-difference/description/ Chapters: 0:00 Intro 0:46 CZcams Comment on constexpr 1:52 Refactor: std::ranges::contains 2:10 Refactor: namespace stdr 2:59 Sho...
1 Problem, 4 C++'s
zhlédnutí 34KPřed 2 měsíci
A video comparing one algorithm implemented in four different C standards: C 11, C 17, C 20 and C 23. Final C Solution: godbolt.org/z/5esaKPhqT Maximum Prime Difference: leetcode.com/problems/maximum-prime-difference/description/ Tweet: code_report/status/1779975970759266568 Chapters: 0:00 Intro 0:39 Problem Explanation 2:41 C 11 Solution 3:49 C 17 Solution 4:00 C 20 Solution 5:10 C...
State of Array Languages in 2024
zhlédnutí 4,5KPřed 4 měsíci
A short video summarizing the state of (Iversonian) array languages in 2024! APL Wiki Open Source Languages: aplwiki.com/wiki/List_of_open-source_array_languages Dyalog APL (Closed Source): www.dyalog.com/ Q (Closed Source): code.kx.com/q/ Array Language Comparison GitHub Repo: github.com/codereport/array-language-comparisons GitHub Star Graph: code_report/status/1750607369959031194...
Top Programming Languages of 2023!
zhlédnutí 5KPřed 5 měsíci
This video covers the top 20 programming languages of 2023 based on www.plrank.com! Top Programming Languages of 2022!: czcams.com/video/b6OXJb0vwwI/video.html Programming Language Rankings: www.plrank.com GitHub Repo Backing Site: github.com/codereport/plr Chapters: 0:00 Intro 0:15 2022 Top 20 Rankings 0:34 2023 Top 20 Rankings 1:10 2023 Predictions Review 2:28 2024 Predictions 3:38 Outro Foll...
BQN vs Uiua #3
zhlédnutí 2,7KPřed 5 měsíci
A video comparing the BQN and Uiua programming languages on the implementation of a simple algorithm called ChunkScan. Livestream Exploration (Timestamped): czcams.com/video/uZ0cM_T4UYM/video.html Previous CZcams Video (BQN vs C ): czcams.com/video/NIFBgWpBGP0/video.htmlsi=7ipy6OGTZGO3L_mi BQN: mlochbaum.github.io/BQN/ Uiua: www.uiua.org/ Chapters: 0:00 Intro 1:26 BQN Solution (Recap) 2:37 Uiua...
BQN vs C++
zhlédnutí 4,4KPřed 5 měsíci
A short video comparing implementing an algorithm in both BQN and C . BQNPAD: bqnpad.mechanize.systems/ BQN Solution: mlochbaum.github.io/BQN/try.html#code=X0NodW5rU2NhbiDihpAge/CdlL1gy5jijL4o4oiY4oC/8J2VqOKKuOKliinwnZWpfQoKMiDDlyBfQ2h1bmtTY2FuIDEr4oaVNg C Solution: godbolt.org/z/aszxP3bfb C Flux Solution: flux.godbolt.org/z/qdPsxsY87 Flux Library: tristanbrindle.com/flux/ Chapters: 0:00 Intro ...
More Functional C++?
zhlédnutí 11KPřed 5 měsíci
More Functional C ? This video is a short response to the czcams.com/video/CVBlYvTenVo/video.html conference talk. Björn Fahller Talks: czcams.com/video/CVBlYvTenVo/video.html czcams.com/video/qL6zUn7iiLg/video.html czcams.com/video/Fzbotzi1gYs/video.html Conor's Talks: czcams.com/video/JELcdZLre3s/video.html GitHub Repo with Code: github.com/codereport/moar_functional_fahller Chapters: 0:00 In...
BQN vs Jelly
zhlédnutí 5KPřed 6 měsíci
BQN vs Jelly
APL vs BQN vs Uiua
zhlédnutí 8KPřed 7 měsíci
APL vs BQN vs Uiua
Python vs Uiua vs BQN
zhlédnutí 14KPřed 8 měsíci
Python vs Uiua vs BQN
BQN vs Uiua #2
zhlédnutí 10KPřed 8 měsíci
BQN vs Uiua #2
BQN vs Uiua
zhlédnutí 47KPřed 8 měsíci
BQN vs Uiua
Uiua! A New Array Language!
zhlédnutí 18KPřed 8 měsíci
Uiua! A New Array Language!
Python vs BQN (1 Problem)
zhlédnutí 4,1KPřed 8 měsíci
Python vs BQN (1 Problem)
Python + AI = Rust
zhlédnutí 7KPřed 9 měsíci
Python AI = Rust
ADSP Episode 124: Vectorizing std::views::filter
zhlédnutí 3,1KPřed rokem
ADSP Episode 124: Vectorizing std::views::filter
Why I Love BQN So Much! (vs Python)
zhlédnutí 14KPřed rokem
Why I Love BQN So Much! (vs Python)
I ❤ BQN and Haskell
zhlédnutí 14KPřed rokem
I ❤ BQN and Haskell
C++ vs Rust: Tuples
zhlédnutí 15KPřed rokem
C vs Rust: Tuples
Top Programming Languages of 2022!
zhlédnutí 10KPřed rokem
Top Programming Languages of 2022!
1 Problem, 24 Programming Languages
zhlédnutí 373KPřed rokem
1 Problem, 24 Programming Languages
How to Make Beautiful Code Presentations
zhlédnutí 119KPřed rokem
How to Make Beautiful Code Presentations
From C ➡️ C++ ➡️ Rust
zhlédnutí 166KPřed rokem
From C ➡️ C ➡️ Rust
Advent of Code 2022 in APL & BQN Day 6!
zhlédnutí 3KPřed rokem
Advent of Code 2022 in APL & BQN Day 6!
Advent of Code 2022 in APL Day 4!
zhlédnutí 2,5KPřed rokem
Advent of Code 2022 in APL Day 4!
Advent of Code 2022 in APL & BQN Day 3!
zhlédnutí 3,2KPřed rokem
Advent of Code 2022 in APL & BQN Day 3!
Advent of Code 2022 in APL & BQN Day 1!
zhlédnutí 4,6KPřed rokem
Advent of Code 2022 in APL & BQN Day 1!
I ❤️ APL & BQN
zhlédnutí 19KPřed rokem
I ❤️ APL & BQN
APL vs BQN vs J vs Q vs NumPy vs Julia vs R
zhlédnutí 28KPřed rokem
APL vs BQN vs J vs Q vs NumPy vs Julia vs R

Komentáře

  • @Arniores
    @Arniores Před 2 dny

    What a great video

  • @simonmichael6814
    @simonmichael6814 Před 7 dny

    Nice comparison!

  • @enzoding7558
    @enzoding7558 Před 7 dny

    really appreciated

  • @lucascamelo3079
    @lucascamelo3079 Před 8 dny

    Python = English APL = Mandarim

  • @GY-bd9bo
    @GY-bd9bo Před 12 dny

    your biggest mistake was showing the world you're a hasan fan

  • @marcthatcher
    @marcthatcher Před 14 dny

    This is all good stuff but the fact that you need to spend so long justifying using glyphs tells you why they are the wrong choice. And typing words which turn into glyphs is very clever but just makes it worse! Just stick to the words!!

  • @danishamjad5807
    @danishamjad5807 Před 16 dny

    Why didn't I have this when I was studying SICP 13 years ago? :/ Great content! Keep it up.

  • @NabekenProG87
    @NabekenProG87 Před 16 dny

    7:22 ok, now I see how you came to like array languages

  • @lpbigfish3730
    @lpbigfish3730 Před 16 dny

    This is the thing, that bothers me about Haskell, imagine explaining the code someone and the it comes down to 5 min talk about just 3 ascii characters that do something, which can be done with just one extra function 😂😂

  • @droid806
    @droid806 Před 18 dny

    Hi man! I'm back here from a couple of years away and I see you completed shift the channel. It's not about algorithms anymore but about these esoteric languages. Please go back to C++ and algorithms or "fork" the channel, a lot of ppl here is hostage to the previous content and don't think is fair.

  • @piraloco5864
    @piraloco5864 Před 18 dny

    Hey, i want to thank you a lot for all of your incredible videos, recently, while watching your videos, i got the idea to make a stack-based programming language. Here is a solution i made for this problem my new language GRP (grape, totally did not steal APLs naming scheme): MaxParenDepth :: {$> . '(' = {if , 1 else ')' = {if -1 else 0} }} {&> 0 /=} {<# +} {<.> =+=} :: "1+(3-(4*6)+(7/(2-3))-1)" MaxParenDepth |<< Here is a version without the custom operators and with documentation: MaxParenDepth :: {Map . '(' = {if , 1 ; Maps over the string/char array, and returns 1 if the character is equal to '('. The comma ignores the duplicated argument (current character) to make this solution point-free else ')' = {if -1 else 0} ; If the character is equal to ')', return -1, else 0 }} {Filter 0 /=} ; This part filters out the elements that are equal to 0 (keeps 1 and -1 only) {ScanLeft +} ; Scans left with the plus operation {Reduce Max} ; Self explanatory :: "1+(3-(4*6)+(7/(2-3))-1)" MaxParenDepth Print ; Calls the function and prints the result

  • @landin1181
    @landin1181 Před 18 dny

    I watch and am interested. But I also wonder what the benefit of a language like this is? I just have 0 idea. 😅

  • @AndrewHelgeCox
    @AndrewHelgeCox Před 19 dny

    It makes sense to terminate the contains algorithm early if a prime greater than the number being looked up is seen. Like this: template <std::ranges::input_range R, typename T> constexpr auto contains_early_terminate(R&& range, const T& value) -> bool { for (const auto& elem : range) { if (elem > value) { return false; // Terminate early if an element greater than the value is found } if (elem == value) { return true; // Return true if the value is found } } return false; // Return false if the value is not found } constexpr auto is_prime(int n) -> bool { // return std::ranges::contains(primes, n); return contains_early_terminate(primes, n); }

  • @AndrewHelgeCox
    @AndrewHelgeCox Před 19 dny

    This came out of a leetcode question for which the test cases are not known at compile time so in that context, constexpr would only be useful to generate the prime table rather than hardcoding as literal values. For that case, the most interesting solution is the 100 bools one. By stuffing the bools into individual bits of a 128 bit SIMD register you can get them out again with a short instruction sequence of shifting, masking and moving to a general purpose register. Presumably C# would have the advantage there with its native SIMD types although we do have `std::experimental::simd` and various non-standard libraries and architecture and compiler-specific intrinsics.

  • @davidzwitser
    @davidzwitser Před 19 dny

    Super interesting and inspiring. I love the way Marshall thinks and creates. Fundemental and endlessly innovative

  • @TankorSmash
    @TankorSmash Před 19 dny

    1:34:50 "and another thing!" love the length of this, I really enjoy that I get a lot of content from this.

  • @dharmatech
    @dharmatech Před 20 dny

    For the folks that want a more readable solution in BQN: Sum ← +´ MapGtZero ← {0 < 𝕩} ScanAdd ← +` SortDown ← ∨ MaxScore ← { Sum MapGtZero ScanAdd SortDown 𝕩 } MaxScore ⟨2, -1, 0, 1, -3, 3, -3⟩

  • @piraloco5864
    @piraloco5864 Před 21 dnem

    Amazing episode! Really looking forward for the continuation of this series! ❤

    • @TankorSmash
      @TankorSmash Před 20 dny

      Yeah, it's fun to deep dive into all this stuff. Always interesting to hear more

  • @peterdamaris7112
    @peterdamaris7112 Před 25 dny

    Scala 3 can run any code at compile time. In fact I think it provides three different ways of running code at compile time, although one of those - the type system, is ~decidable rather than arbitrary code.

  • @hebozhe
    @hebozhe Před 25 dny

    Smullyan and Priest write some of the most accessible logic books. I don't study much in this area of logic, but I'd definitely pick through the Smullyan text if I wanted a quick comprehensible dive. Good recommendation.

  • @ganeshjaggineni4097
    @ganeshjaggineni4097 Před 26 dny

    NICE SUPER EXCELLENT MOTIVATED

  • @user-tw2kr6hg4r
    @user-tw2kr6hg4r Před 27 dny

    This should work too int calculate (int bottom, int top) { if (top < bottom) return 0; if (top < 0) return -calculate(-top, -bottom); if (bottom < 0) return calculate(0, top) - calculate(0, -bottom); bottom -= 2; bottom += bottom & 1; bottom >>= 1; top >>= 1; bottom *= bottom + 1; top *= top + 1; return top - bottom; } 30 instructions with o2

    • @user-tw2kr6hg4r
      @user-tw2kr6hg4r Před 27 dny

      41 with o3

    • @user-tw2kr6hg4r
      @user-tw2kr6hg4r Před 27 dny

      im kinda stupid, it turns out; you can simplify to int calculate (int bottom, int top) { if (top < bottom) return 0; if (top < 0) return -calculate(-top, -bottom); if (bottom < 0) return calculate(0, top) - calculate(0, -bottom); bottom = (bottom - 1) >> 1; bottom *= bottom + 1; top >>= 1; top *= top + 1; return top - bottom; } obviously the 2nd and third statements can be left out if the numbers are always positive. anyway, same length in assembly since the compiler is black magic

  • @exismys
    @exismys Před 27 dny

    Let's be honest: this was not the point of original video

  • @machine.angel.777
    @machine.angel.777 Před 28 dny

    Just for fun, here's the code in Uiua: Calc ← /+▽¬◿2.↘-1:+1⇡:

  • @Leonhart_93
    @Leonhart_93 Před 28 dny

    When will people just accept that functional programming is a great way of taking clear and concise code and then completely murder it, obfuscating its meaning for everyone else in the process? Just because someone doesn't like the "normal" way of doing things. Yeah yeah, it's stylish because you are the special one doing it, I don't care. Just write the shortest version that uses the most basic tools and avoids std functions where they aren't really required for anything.

  • @H2CO3Szifon
    @H2CO3Szifon Před 28 dny

    The final point-free solution seems needlessly complicated. All you need is: {+/⍵×∨⌿0=3 5∘.|⍵}

  • @0LoneTech
    @0LoneTech Před 29 dny

    You could also use the shape directly rather than just one side length. I.e. instead of =⌜˜↕≠ you can use =´¨↕≢ Downside: It would no longer error out for rectangular matrices, but check diagonals from the top corners.

  • @Supremebubble
    @Supremebubble Před měsícem

    Python can be made even more intuitive: def maximum_difference(nums): differences = [nums[j] - nums[i] for i in range(len(nums)) for j in range(i+1, len(nums))] return max(differences) if len(differences) > 0 else -1

  • @okefejoseph6825
    @okefejoseph6825 Před měsícem

    How do I get the logos?

  • @DirtMcGurtskie
    @DirtMcGurtskie Před měsícem

    Haskall is... has a different syntax. Pretty sure that's my next one to learn.

  • @quirkyquester
    @quirkyquester Před měsícem

    Yepp, great time complexity analysis!

  • @TankorSmash
    @TankorSmash Před měsícem

    I was looking for this upload, but I had to swap to the Live tab in your channel, rather than my subscription feed. Thanks to Kaikalii for making Uiua, and Code Report for putting this podcast together!

  • @hwstar9416
    @hwstar9416 Před měsícem

    idk I feel like this isn't as useful as you make it out to be. Realistically your program will mostly be runtime data.

  • @alexisens8989
    @alexisens8989 Před měsícem

    The solution I came up with was first noticing that, instead of removing an element, we can just replace it with 1 (neutral element of the multiplication). This can easily be done using the "@" operator. The solution becomes (for example): {(⍳≢⍵){×⌿1@⍺⊢⍵}¨⊂⍵}

  • @amadocabrera5007
    @amadocabrera5007 Před měsícem

    Loving your podcasts. Btw, I think that the audio was unbalanced and a little low.

    • @code_report
      @code_report Před měsícem

      Yea, I will fix it for next time. And I normalized the audio for the audio only podcast 👍🏻

    • @amadocabrera5007
      @amadocabrera5007 Před měsícem

      @@code_report thanks, looking forward to the next episodes. <3

  • @sergeibatiuk3468
    @sergeibatiuk3468 Před měsícem

    ... "Even though this is hard to read' ...

  • @sergeibatiuk3468
    @sergeibatiuk3468 Před měsícem

    Wins what?

  • @addcoding8150
    @addcoding8150 Před měsícem

    nice. second monitor food :)

  • @chickenonaraft508
    @chickenonaraft508 Před měsícem

    I think the Scala version was the cleanest

  • @hidude1354
    @hidude1354 Před měsícem

    nice solution, only thing to add is that k is bounded by n so we can just write the time complexity as O(n^2 logn)

    • @quirkyquester
      @quirkyquester Před měsícem

      Nope, we doing only k pushes, the heap size is max n, so we doing log n each push, so it’s k log n

    • @hidude1354
      @hidude1354 Před měsícem

      @@quirkyquester Once again, k is bounded by n. This means k = O(n^2). You can say O(klogn) but O(klogn) = O(n^2logn)

    • @hidude1354
      @hidude1354 Před měsícem

      you could only change it to a different bound if you did some amortized analysis on k, but otherwise k = O(n^2)

  • @skeleton_craftGaming
    @skeleton_craftGaming Před měsícem

    You know It's very easy to forget. You can use namespace like that. [That makes using ranges, and Chrono significantly easier.] Well I mean the calculations do happen. They just happen to compile time instead.

  • @kaikalii
    @kaikalii Před měsícem

    Thanks so much for having me, Conor! Looking forward to your future episodes.

  • @c4tubo
    @c4tubo Před měsícem

    Great show and kickoff, with some of my favorite programming language topics and bird-brains (combinators joke ;-)).

  • @jashanswork
    @jashanswork Před měsícem

    what an explanation

  • @mehdiyahiacherif2326
    @mehdiyahiacherif2326 Před měsícem

    I like how dynamic languages are trying to be static like python hints and typescript Static panguages are trying to be dynamic with var, and removing types from definitions

  • @gentlemanbirdlake
    @gentlemanbirdlake Před měsícem

    I would like to see how to enact side effects from these terse array languages, more inline effects than just the implicit return at exit. Like in order to actually do something with all this efficient syntax as they run perhaps indefinately like a program loop and incorporating input from one or more streams of unknown termination.

  • @ShadowKestrel
    @ShadowKestrel Před měsícem

    'is paralleled by no other language' zig: am i a joke to you?

  • @user-dw5ch6ux3u
    @user-dw5ch6ux3u Před měsícem

    here is my own uiua attempt : ≍[]⊚≠2♭⊟/+⍉:/+.≠0 not as elegant as yours but still works

  • @uraid
    @uraid Před měsícem

    I’m a stickler for verbosity. I don’t like your python solution because I’d rather a much longer but easier to read function, yes even if it’s less performant

  • @uraid
    @uraid Před měsícem

    Interesting because I would rank it… exactly opposite. I like the readability of imperative code and despise whatever that 4 character mess is. Er, no offense