!cxPCiPlsXnajakSrqd:matrix.org

Array languages

887 Members
General discussion about APL-like array languages. See #array:matrix.org for other rooms23 Servers

Load older messages


SenderMessageTime
11 Jan 2025
@_discord_671689100331319316:t2bot.iobrian_e the first thing that came to mind was the strength of steel, with the downside of rust 22:51:27
@_discord_795512689320263690:t2bot.iomaya_maya_mayaimage.png
Download image.png
22:51:59
@_discord_795512689320263690:t2bot.iomaya_maya_maya the name "rust" came from the fungus 22:52:08
@_discord_795512689320263690:t2bot.iomaya_maya_maya tho it became... a crab... 22:52:17
@_discord_671689100331319316:t2bot.iobrian_e 22:52:49
@_discord_795512689320263690:t2bot.iomaya_maya_maya changed their display name from Maya (k is not a lisp ;-;) to maya_maya_maya.22:53:03
@_discord_1071186743283437599:t2bot.iojanmakoso As I said 23:00:26
@_discord_795512689320263690:t2bot.iomaya_maya_maya almost 24 hours apart lol 23:04:28
@_discord_768182477449592832:t2bot.iomiku.rb 23:53:08
12 Jan 2025
@_discord_717383956999307376:t2bot.iojacob.abc 14:09:49
13 Jan 2025
@_discord_480607161576062976:t2bot.iogamingking2436 05:43:13
@_discord_811990065394745374:t2bot.iobjorkdi5cord joined the room.14:13:42
@_discord_811990065394745374:t2bot.iobjorkdi5cord This might be a better place. Have any of you read this? https://web.engr.oregonstate.edu/~budd/Books/aplc/ 14:13:43
@_discord_811990065394745374:t2bot.iobjorkdi5cord changed their display name from bjorkdi5cord#0 to bjorkdi5cord.14:13:44
@_discord_476172910839726110:t2bot.ioshad.ow 19:06:19
@ricardin25:matrix.org@ricardin25:matrix.org joined the room.19:25:17
14 Jan 2025
@_discord_328851809357791232:t2bot.io.casenc They're both nlogn :3 21:01:48
@_discord_116306741058207744:t2bot.iovendethiel ≡○∧ :P 21:02:43
@_discord_328851809357791232:t2bot.io.casenc ≍ ∩⍆ :3 21:11:39
@_discord_328851809357791232:t2bot.io.casenc * ≍∩⍆ :3 21:11:49
@_discord_1162491071339712644:t2bot.iopolylokh_39446
A1 ← ≡○∧
A2 ← {s𝕊t:
  c←•HashMap˜⟨⟩
  {𝕩 c.Set  1 + 0 c.Get 𝕩}¨ s
  {𝕩 c.Set ¯1 + 0 c.Get 𝕩}¨ t
  ∧´0=c.Values@
}

A2's about 13x slower than A1
21:12:03
@_discord_604614910030118912:t2bot.iorubenverg ≡⍥⊴ (: 21:12:09
@dzaima:matrix.orgdzaima (bridge had dropped:)
jar: To write is_anagram(s,t), in other languages I'd make a hashmap and count characters. Is arraylangs, would you just write sort(s) == sort(t)?
21:12:17
@_discord_604614910030118912:t2bot.iorubenverg also tbh using a hashmap to check anagrams is crazy in pretty much any language, i'd've never even had that thought 21:13:13
@_discord_718551566336000090:t2bot.iojam3943598 In python the right way to do it is from collections import Counter; Counter(s) == Counter(t) which is a hashmap 21:14:07
@dzaima:matrix.orgdzaima another option is indices-inverse:
   )t:1s a≡○∧b
118us
   )t:1s a ≡○(∧-⟜@) b
1.39us
   )t:1s a ≡○(/⁼-⟜@) b
960.47ns
though that requires having the elements be (convertable to) integers of some non-massive range. (also CBQN has slow character sorting ¯\_(ツ)_/¯)
21:18:17
@dzaima:matrix.orgdzaima * another option is indices-inverse:
   )r a‿b←('a'+1000•rand.Range 26){𝕩⋄•rand.Deal∘≠⊸⊏𝕗}¨ ↕2
   )t:1s a ≡○∧ b
118us
   )t:1s a ≡○(∧-⟜@) b
1.39us
   )t:1s a ≡○(/⁼-⟜@) b
960.47ns
though that requires having the elements be (convertable to) integers of some non-massive range. (also CBQN has slow character sorting ¯\_(ツ)_/¯)
21:18:43
@_discord_1162491071339712644:t2bot.iopolylokh_39446 oh yeah, the performance gap between A1 and A2 gets much smaller with 1000-character strings 21:20:19
@rpanades:matrix.orgpanadestein
In reply to @_discord_1162491071339712644:t2bot.io
oh yeah, the performance gap between A1 and A2 gets much smaller with 1000-character strings
Yeah 13x linear vs nlogn cannot be :)
21:20:55
@dzaima:matrix.orgdzaima some more detailed timings 21:28:06

Show newer messages


Back to Room ListRoom Version: 6