3 ms·
Pretty much, yeah! The difference is that in Python the function that calculates a single value looks like: foo(x) ...while the function that calculates a
by thristian 1y ago
Pretty much, yeah! The difference is that in Python the function that calculates a single value looks like:
foo(x)
...while the function that calculates a batch of values looks like:
[foo(x) for x in somelist]
Meanwhile in Lil (and I'd guess APL and K), the one function works in both situations.
You can get some nice speed-ups in Python by pushing iteration into a list comprehension, because it's more specialised in the byte-code than a for loop. It's a lot easier in Lil, since it often Just Works.
- RodgerTheGreat 1y agoA few more examples in K and Lil where pervasive implicit iteration is useful, and why their conforming behavior is not equivalent to a simple .map() or a flat comprehension: http://beyondloom.com/blog/conforming.html http://beyondloom.com/blog/conforming.html
- leephillips 1y agoAnd in Julia it’s foo.(x).
- kelas 1y agojulia is cool, hands down. only typical k binary will be less than 200kb and doesn't need stdlib. it still needs a few syscalls, but we're working on that. and julia has this small and insignificant dependency called llvm. i bullshit you not: kelas@prng ~ % cd /opt/llvm-project kelas@prng llvm-project % du -hd0 14G . kelas@prng llvm-project %