Taking a look at ngn/k!

Поделиться
HTML-код
  • Опубликовано: 4 янв 2025

Комментарии • 12

  • @razetime
    @razetime Год назад +6

    Application is something that throws off beginners, cause functions are all nouns.
    `{2+x}*a` is noun verb noun so K applies verb to both nouns.
    If the k parser sees noun noun , like {2+x}(*a) then it will apply the first noun to the second.
    Happy to know that you've been enjoying K, hope I helped clarify things. I will add this to the tutorial sometime soon (and maybe add the finishing touches)

    • @yernab
      @yernab  Год назад +2

      Oh awesome, thanks, that makes a lot of sense! One last question: are primitives not considered nouns (at least in this case)? Like *|1 2 3 does what you expect, and doesn't get parsed like |[*;1 2 3]

    • @razetime
      @razetime Год назад +5

      @@yernab primitives are always verbs (not nouns) until you put them in parens.
      `*|1 2 3` does what you expect, and (*)|1 2 3 does |[*;1 2 3].
      By putting a verb in parens you are basically converting it to a K train, and hence it becomes a noun.

  • @CaptainWumbo
    @CaptainWumbo Год назад +1

    Really nice. I did a bit of playing with APL this week. I'd love to see a video on what you think of the different array language options out there, if you have the interest. I'm not sure which I should focus on.

    • @yernab
      @yernab  Год назад

      Recommend just picking one and trying it! Lots of skills carry over and there’s a lot of primitive overlap between them. Dyalog APL and BQN have great documentation (Uiua’s is pretty good too).

  • @douglasmennella4525
    @douglasmennella4525 Год назад +3

    You shouldn’t need to transpose the enlist of x at 20:40 to join with y. In recent builds you can join a list of characters in addition to a list of strings. Also enlist each might be a more straightforward way to do what you’ve done here.

    • @yernab
      @yernab  Год назад +1

      Thanks, that's helpful! I think I also figured out @ (apply) isn't necessary for indexing, so that saves a few more chars.

  • @douglasmennella4525
    @douglasmennella4525 Год назад +1

    Very nice video!

  • @eliseulucenabarros3920
    @eliseulucenabarros3920 Год назад +1

    it can runs on my Termux * - *

  • @simonsaville9962
    @simonsaville9962 2 месяца назад

    🤯

  • @anon_y_mousse
    @anon_y_mousse Год назад

    I think I might actually give this one a shot. As far as code golf languages go, not using Unicode garbage puts this language toward the top of my list. Including a REPL that I can use locally is also a nice touch. The implementation in C should make it easier to understand so I could add a save feature for the REPL, even if I do have to use `gcc -E`. I do wonder if he wrote this entire project this way by hand or if he used a minifier.