!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
5 Jan 2025
@loke:dhsdevelopments.comloke Ah, the glyphCount. OK, that's good. Is this true for all cases where you get an array back? 14:56:31
@_discord_671689100331319316:t2bot.iobrian_e I don't know of an exception off the top of my head 14:57:35
@loke:dhsdevelopments.comlokeI'm going to keep it in native form, but present a façade that makes it look like an array to the programmer.14:57:37
@_discord_671689100331319316:t2bot.iobrian_e huh? how would you do that? :o 14:58:02
@loke:dhsdevelopments.comlokeI'm sure you can do the same in BQN, but you'd have to go to a lower level.14:58:06
@loke:dhsdevelopments.comlokeWell, I leverage the fact that Kap uses lazy arrays. So it's a lazy array that only computes the underlying value when needed.14:58:40
@_discord_671689100331319316:t2bot.iobrian_e ha nice 14:58:49
@_discord_671689100331319316:t2bot.iobrian_e Looked a bit more. Either the length of output is given via an argument to a function, or as a mutated pointer that results in the output length, or in the output struct, or it's literally not a array like the sound buffer pointers. 15:03:26
@_discord_671689100331319316:t2bot.iobrian_e * Looked a bit more. Either the length of output is given via an argument to a function, or as a mutated pointer that results in the output length, or in the output struct, or the pointer isn't an array like the sound buffer pointers. 15:04:06
@dzaima:matrix.orgdzaima loke presumably that'd mean that you'd get segfaults if you indexed the array after an UnloadFont? 15:08:14
@dzaima:matrix.orgdzaima * presumably that'd mean that you'd get segfaults (or worse) if you indexed the array after an UnloadFont? 15:08:20
@dzaima:matrix.orgdzaima I suppose you could track loadedness and make indexing an error if unloaded 15:11:14
@loke:dhsdevelopments.comloke Yes. But since the value was returned from LoadFont, I can mark it as unused after UnloadFont so I can raise an error if someone tries that. 15:11:16
@_discord_671689100331319316:t2bot.iobrian_e wonder what joining two glyph arrays would do. I'd imagine join needs the lengths. 15:11:18
@dzaima:matrix.orgdzaima that's an extremely weird array though 15:11:43
@loke:dhsdevelopments.comlokeActually, since the size is known, the result of the join is also a lazy value.15:11:47
@loke:dhsdevelopments.comlokeIt's a lazy array backed by two lazy arrays, so at no point would it touch the content.15:12:09
@_discord_671689100331319316:t2bot.iobrian_e oh so you're going to implement manually getting sizes of all the arrays from different places? 15:12:54
@loke:dhsdevelopments.comloke Not sure. I can do that. Not sure if I should. 15:13:20
@_discord_671689100331319316:t2bot.iobrian_e hmm alright. what if i index at 5, when would this new lazy array know to switch to the second array? It'd have to know the length of the first. 15:13:58
@loke:dhsdevelopments.comlokeYes, exactly. You can't create a lazy array without knowing its size.15:14:40
@loke:dhsdevelopments.comlokeSo the lazy array knows what offsets the underlying arrays can be found, so it just computes the correct position and calls the underlying array.15:15:16
@_discord_671689100331319316:t2bot.iobrian_e O right! almost forgot. Also remember that some functions return null terminated strings. 15:15:39
@loke:dhsdevelopments.comloke Yeah, right now I just assume that all const char * are strings. How true is this? 15:16:30
@_discord_671689100331319316:t2bot.iobrian_e are arrays in Kap mutable? 15:16:39
@loke:dhsdevelopments.comlokeNo, they're not.15:16:52
@loke:dhsdevelopments.comlokeBut I need to read the entire string to determine its length, since UTF-8 is a variable-length encoding. So it just generates an APL string from it.15:17:52
@_discord_671689100331319316:t2bot.iobrian_e i thought it was true. when isn't it? 15:21:42
@_discord_671689100331319316:t2bot.iobrian_e oh sorry, you replied to my message 15:22:10
@loke:dhsdevelopments.comlokeIt's never mutable. You have to create a new array to change it.15:22:15

Show newer messages


Back to Room ListRoom Version: 6