@KamilaSzewczyk this is the way it works now. it's the k4 model (the most widely used k/q from kdb+), you use suffixes to specify type width in literals, e.g. 1 2 3j for 64bit, i for 32bit, h for 16bit, etc. this gives the programmer fine-grained control and slightly better performance because no overflow checks need to be done.
but it's also very tedious to program this way - you have to be constantly aware of the bit widths. so i decided to listen to the advice from aplers/bqners/k9ers and started refactoring my code for this model of ints overflowing into wider ints.
so, it's a question of: 0. how to organize my arith code so it still fits on a page or two, 1. make sure it ends up vectorized properly in the binary, 2. deal with alignment issues - padding after the end of a vector shouldn't generate false positives for overflow
i haven't tried yet looking at the asm __builtin_add_overflow() produces in a vectorized loop. it would be interesting to see how it deals with the lack of an overflow flag for simd instructions.
heh, {,⎕csv⍠'Separator'(⎕ucs 10)⊢⍵} adds a single trailing empty element (even if there's no trailing newline). Otherwise, that's a builtin for reading lines of a file :D
@Adám I'm learning by myself. I have found some resources so far like the APL wiki, this chat, dyalog.tv and your presentation on APLcart! my background is JavaScript so everything is very alien to me and pointers are always welcome!
guys me and my Buddy came with a weird but a great idea
would it be possible to write a malware in APL? It would be crazy and really cool to look while cybersec people will try to reverse engineer it and read it 🥲
for checking the amount of divisors, the first two solutions use the semi-straightfoward solution
and the second one is using the "optimization", given that the amount of divisors is equal to the product of incremented exponents in a number's prime factorization
Question: What should the result of 1 ⌽∵ 0 0 1 be? (note, ∵ is the bitwise modifier operator). Since I haven't implementation rotation/shift yet, all the bitwise functions have been plain scalar function. But rotation brings that into question. The possible solutions are 8000000000000000 0 0 or 0 0 8000000000000000
@KamilaSzewczyk replacing my much more stupid way of getting the factors with your way sort of works, but {×/1+1↓2 pco⍵} returns a 1 element vector not a scalar, try sticking a ⊃ in front and maybe that'll work?
@KamilaSzewczyk APL is, but Dyalog isn't. It does all kinds of funky things like stackless traversal for e.g. ∊ by writing pointers into arrays it's iterating through
@pitr @rak1507 @KamilaSzewczyk @RGS This week, I'm intending to experiment/prototype a new system for loading code on demand. Can we find a time that fits everyone?
Mon, Tue or Wed for me, after 4pm like rak said is fine.
@dzaima I don't think this is the same thing,is it? What you linked is about an "open session", which doesn't look the same as a prototype to load code on demand.
It depends of course on what kind of program you're trying to write. If you're programming orbital mechanics or anything else related to astronomy, then Hashem recommends Haskell, as it says in the piyut (liturgical poem) called Keil adon:
טוֹבִים מְאוֹרוֹת שֶׁבָּרָא אֱלֺהֵינוּ
יְצָרָם בְּד...
@ngn I think you might have to actually compute the upper half-result. Vector multiplication in x86 is horrible. You might actually want to do each type separately by hand.