IRC Log - 2025-05-27 - ##forth

Channel: ##forth
Total messages: 130
Time range: 01:12:47 - 23:48:22
Most active: nmz (52), cleobuline (45), anthk_ (16)
01:12:47 ##forth <cleobuline> forthBot: 1 756839 << 1 - PRIME? .
01:47:01 ##forth <cleobuline> forthBot: ." Calcul terminé 1 756839 << 1 - est premier "
01:49:53 ##forth <nmz> wow that's a slow prime checking function
01:50:03 ##forth <nmz> what's the implementation
01:50:53 ##forth <nmz> cleobuline: it should be instant
01:51:16 ##forth <nmz> unless you deal with bignums then it should take a bit
01:51:55 ##forth <nmz> mmm
01:51:56 ##forth <cleobuline> for small numbers lik 1 127 << 1 - it should be instant
01:52:04 ##forth <nmz> I know! I'll rewrite it in forth
01:52:19 ##forth <nmz> what forth you using, I'll check
01:52:25 ##forth <nmz> ; luaa -e 'print(math.IsPrimeB(136279841))'
01:52:27 ##forth <nmz> Loading init.lua
01:52:29 ##forth <nmz> true
01:52:31 ##forth <nmz> [nmz@Satellite] [19:51:35] [0.46 0.32 0.27] [0|6]
01:52:51 ##forth <cleobuline> nmz: try 1 756839 << 1 -
01:53:14 ##forth <nmz> what's <<?
01:53:24 ##forth <cleobuline> shift left
01:53:35 ##forth <cleobuline> pow 2
01:53:40 ##forth <nmz> just gimme the number
01:54:44 ##forth <cleobuline> more than 600 000 numbers nmz
01:54:50 ##forth <nmz> you mean this 756839? because its just shifting by 1 there no?
01:55:16 ##forth <cleobuline> no shift 756839 time
01:55:30 ##forth <cleobuline> 2^ 756839
01:55:59 ##forth <nmz> ah, doesn't fit a double
01:56:08 ##forth <cleobuline> it may take one hour tio check if prime
01:59:22 ##forth <cleobuline> nmz: https://pastebin.com/LG4rKZLN
01:59:37 ##forth <cleobuline> -1
02:00:07 ##forth <nmz> 227833 digits
02:00:14 ##forth <nmz> sheesh
02:00:21 ##forth <cleobuline> you can try
02:00:27 ##forth <nmz> nah
02:01:13 ##forth <cleobuline> nmz: i am sure forthBot will do this job , but not sure of the time for
02:02:12 ##forth <cleobuline> it was calculate on a cray 2
02:03:20 ##forth <cleobuline> i take it here https://fr.wikipedia.org/wiki/Nombre_de_Mersenne_premier
02:04:02 ##forth <cleobuline> number 32
02:04:42 ##forth <nmz> time gawk -M -f ./math2.awk -e 'BEGIN {print isprime(2^227833)} '
02:04:44 ##forth <nmz> 0
02:04:46 ##forth <nmz> Executed in 4.43 millis fish external
02:05:10 ##forth <cleobuline> 2^ 756839 -1 nmz
02:05:18 ##forth <nmz> minus 1?
02:05:22 ##forth <cleobuline> yes
02:05:27 ##forth <nmz> why the minus 1?
02:05:46 ##forth <cleobuline> because minus 1 is prime :)
02:06:13 ##forth <cleobuline> 2^227833 is divisible by 2 ....
02:06:35 ##forth <cleobuline> 2^227833 - 1 is prime
02:06:52 ##forth <nmz> oh, you mean -1==true
02:07:18 ##forth <cleobuline> ( 2^227833 ) - 1 the number is prime
02:07:25 ##forth <nmz> or (2^756839-1) or (2^756839)-1
02:08:09 ##forth <cleobuline> (2 ^756 839 ) -1
02:08:38 ##forth <cleobuline> try it
02:09:25 ##forth <nmz> this is gonna take a while
02:09:30 ##forth <cleobuline> time gawk -M -f ./math2.awk -e 'BEGIN {print isprime((2^227833)-1)} '
02:09:41 ##forth <cleobuline> wait
02:10:52 ##forth <cleobuline> if it beat my forthBot
02:10:52 ##forth <nmz> if it runs for more than 10 minutes I'm killing it
02:11:24 ##forth <cleobuline> it may take an hour
02:11:51 ##forth <nmz> yeah I'm stopping it
02:11:55 ##forth <cleobuline> lol
02:11:57 ##forth <nmz> its a waste of electricity
02:12:30 ##forth <cleobuline> running or not a computer use the same no ?
02:12:39 ##forth <nmz> no?
02:12:52 ##forth <nmz> the more CPU usage the more elec usage
02:12:59 ##forth <cleobuline> ha
02:13:12 ##forth <nmz> GPUs also hog, its why they want a bigger power supply
02:13:45 ##forth <cleobuline> labynet@ubuntu:~/new-hash$ uptime
02:13:45 ##forth <cleobuline> 02:13:24 up 27 days, 3:38, 1 user, load average: 2.07, 2.08, 2.08
02:14:06 ##forth <cleobuline> not too much
02:15:48 ##forth <cleobuline> next i will try ( 2 ^859433) -1
02:15:53 ##forth <nmz> date; time gawk -M -f ./math2.awk -e 'BEGIN {print isprime( (2^75683) - 1)}'
02:15:55 ##forth <nmz> 0
02:15:57 ##forth <nmz> Executed in 30.58 secs fish external
02:16:45 ##forth <nmz> you try that one
02:17:23 ##forth <nmz> one less digit, but at least it finished
02:18:29 ##forth <cleobuline> 0 , mean it is not prime
02:19:07 ##forth <nmz> No clue
02:19:18 ##forth <nmz> I wrote it so long ago
02:19:37 ##forth <nmz> ya 0 means not prime
02:48:31 ##forth <cleobuline> 02:43 (cleobuline) forth: MILLI 1 75683 << 1 - PRIME? . MILLI SWAP - .
02:48:31 ##forth <cleobuline> 02:45 (forth) 0
02:49:07 ##forth <cleobuline> 2 minutes
03:01:15 ##forth <xentrac> ya 0 means ya never incremented ya counter, yo
03:21:10 ##forth <nmz> awk is fast
03:21:22 ##forth <nmz> well, more like gmp is fast
03:25:32 ##forth <nmz> oh nice
03:25:35 ##forth <nmz> now its faster
03:25:56 ##forth <nmz> here's a prime number that's good enough 16^16
03:27:53 ##forth <nmz> cleobuline: is prime? flooring and sqrt the limit?
03:30:46 ##forth <nmz> how's your stepping?
03:44:28 ##forth <xentrac> that doesn't sound very prime
03:46:20 ##forth <nmz> xentrac: its a new stepping dance move called priming
03:46:29 ##forth <nmz> yoyoyoyo
03:48:09 ##forth <nmz> J has the best algo for checking if prime, I remember throwing any number at it and the damn thing always returned in less than 30 seconds
03:50:54 ##forth <xentrac> any number?
03:51:19 ##forth <xentrac> do you mean numbers with a thousand digits or more like numbers with a billion digits?
04:00:00 ##forth <nmz> try it
06:17:30 ##forth <deadmarshal_> J is big on mathematics and it's math algos are generally good
06:26:22 ##forth <thrig> odds are it gets evens right
06:29:07 ##forth <forthBot> 1
06:29:07 ##forth <forthBot> Calcul terminé 1 756839 << 1 - est premier
08:29:07 ##forth <forthBot> Environment for cleobuline inactive, freeing...
16:05:37 ##forth <cleobuline> forthBot: MILLI 1 859433 << 1 - PRIME? . MILLI SWAP - . ." 1 859433 << 1 - est premier "
16:06:31 ##forth <cleobuline> may be the result at night ...
17:39:58 ##forth <anthk_> deadmarshal_: k/klang it's fun too
17:40:18 ##forth <anthk_> there was some guide for k in the same play of the joy language
17:40:32 ##forth <anthk_> but when I built k, tons of stuff was closed source, I didn't like it
17:40:46 ##forth <anthk_> I prefer klong/kling.py even if it's slower
17:42:39 ##forth <xentrac> there's also kona
17:58:18 ##forth <anthk_> how fast is it?
18:01:31 ##forth <xentrac> dunno
18:10:53 ##forth <anthk_> btw, on lisp, from t3x, s9fes it's good enough
18:10:59 ##forth <anthk_> and its forth too, but it's an odd blend of f79, some f83 features and a bit of ANS
18:38:42 ##forth <xentrac> hm?
19:03:35 ##forth <cleobuline> forthBot: QUIT
19:03:54 ##forth <cleobuline> forthBot: QUIT
19:04:07 ##forth <cleobuline> it is sleeping
19:12:43 ##forth <xentrac> it is an ex-forthBot
19:43:57 ##forth <deadmarshal_> anthk_: I saw K but haven't used it at all. I also tried APL but like J better. J's concept of rank is very awesome. Especially I like it that ranks in J is explicit, but in APL it's more loose which I don't like
20:01:03 ##forth <anthk_> k should work very similar to j
20:24:40 ##forth <deadmarshal_> +
21:36:52 ##forth <xentrac> deadmarshal_: of operator rank?
21:37:20 ##forth <xentrac> the rank of an array is not very loose at all in J, K, or APL; it's just ρρA
23:26:13 ##forth <anthk_> https://git.sr.ht/~hocwp/10biForthOS wait
23:26:31 ##forth <anthk_> deadmarshal_: I tried k with some 'intro to math' article, it was fine
23:26:42 ##forth <anthk_> altough it woudn't map to klang 1:1, I'm afraid so
23:26:49 ##forth <anthk_> s,klang,klong
23:29:11 ##forth <anthk_> ah, damn
23:29:14 ##forth <anthk_> not k, j
23:35:40 ##forth <anthk_> then there was Joy but that was like Sussman trying to redesign Forth by reading SICP first
23:38:56 ##forth <anthk_> you might need a good chunk of Discrete Math
23:48:22 ##forth <nmz> I just checked and it doesn't support bignum, maybe I need to set something up, oh well