5 ms·
Is there any context that could help understand wtf I’m looking at? Is this a collection of resources that promote using things other than loops while programm
by schott12521 3y ago
Is there any context that could help understand wtf I’m looking at?
Is this a collection of resources that promote using things other than loops while programming?
Are we advocating for a world without physical loops, eg. Rollercoasters without loops?
- ksherlock 3y agoarray-based programming languages. APL, J, K, etc.
- 0xDEAFBEAD 3y agoSupposing I'm "Joe HN User". I've worked with both Lisp and Numpy. How do array-based programming languages relate? Are they just syntactic sugar for things I could already do in Lisp/Numpy, or is there something more?
- ksherlock 3y agoI suppose if you took numpy and got rid of the python (so ... "num"?) and built a language around that it would be the same idea.
- 0xDEAFBEAD 3y agoThank you!
- epanchin 3y agoAs a slight tangent to your question- kdb/Q works beautifully with numpy, it’s very useful being able to work with numpy from the q prompt and pass objects between the environments.
- rak1507 3y agoWork with numpy from q or q from python? I'm not sure why you'd use numpy when you have access to k/q, they're much nicer.
- kelseyfrog 3y agoIt looks K-centric. The K language provides constructs like each, over, and scan to perform what would be looping behavior in other languages. Having written Scala myself at one point, the thought of a loop-less language crossed my mind. It's amazing what you can accomplish with foldLeft and recursion schemes.
- the_gipsy 3y agoElm doesn't have loops, just fold/map.
- cortesoft 3y agoAren’t those things just convenience wrappers around loops? I don’t understand the fundamental difference.
- dwb 3y agoWhen loopless constructs are a design principle of a language, they become much more than just a convenience wrapper.
- kibwen 3y agoThey're loops with stronger semantics (in other words, they're more restrictive (in other words, they're easier to reason about)), in the same way that loops themselves are `goto` with stronger semantics.
- eesmith 3y agoIt promotes array languages, where operator symbols indicate actions on an n-dimension array (0 = scalar, 1 = vector, 2 = array, etc.) As a trivial example, A + B means the element-wise addition two arrays, rather than use looping to compute the terms yourself. The original array language is APL, which is also known for using its own non-ASCII notation. https://en.wikipedia.org/wiki/APL_(programming_language) https://en.wikipedia.org/wiki/APL_(programming_language) . To give you a sense of what I mean, the implementation of the Game of Life is: life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵} Compare that to how you might implement GoL as a couple of for-loops, with a hard-coded count of the 3x3 neighbor grid. But why use stinking for-loops when you express what the result you want directly, tersely, so you can able see the whole program at once? (OTOH, as I recall, that implementation uses a fixed-width array, which highlights a limitation to using that approch. For GoL you really want to use Hashlife, which isn't so amenable to an array approach.) Many of the links here reference K, a descendant of APL which uses ASCII.
- vardump 3y ago> life ← {⊃1 ⍵ ∨.∧ 3 4 = +/ +⌿ ¯1 0 1 ∘.⊖ ¯1 0 1 ⌽¨ ⊂⍵} Must be fun to type that...
- eesmith 3y agoI copied it from the Wikipedia page, which also shows a layout for an APL keyboard and has a picture with the mechanisms to get your typewriter/printer to handle it.
- bordercases 3y agoIs there an implementation of an APL-like language which transpiles to SIMD operations at the instruction set level?
- eesmith 3y agoA DDG search for "apl simd" finds https://aplwiki.com/wiki/Performance https://aplwiki.com/wiki/Performance as the first match: "APL's array operations are also ideal for implementation with SIMD, or "single instruction, multiple data", operations, that perform a single action on several different values. In some cases, such as scalar functions, the primitives are SIMD operations; in others such as Reverse, they are easily implemented using SIMD—for Reverse, SIMD selection or "shuffle". While experimental SIMD machines (such as the APL-influenced CDC Star-100) were created as early as the 1960s, SIMD computing first entered the personal computing mainstream in the 1990s and has steadily grown in prominence for high-performance computing since then. In APL, CPU vector instruction sets such as Intel's SSE are the most often way to access SIMD optimization, although Co-dfns instead runs on a GPU to attain much higher throughput at the cost of increased overhead and restriction of available algorithms."
- deleted 3y ago[deleted]