<< 17-01-2024 >>

00:00:53flouerhow do I create an array with variables of a certain (tuple) type? I've tried: const ambientObjects : array = [ new ambientObject(
00:00:53flouer sdf: proc(x,y,z:float32): float32 = x^2 + y^2 + z^2,
00:00:53flouer color: proc(x,y,z:float32): fcolor = new fcolor(r:1.0,g:1.0,b:1.0),
00:00:53flouer )
00:00:53flouer]
00:01:35flouerIs the new keyword valid for creating an unamed variable?
00:02:43*krux02 quit (Remote host closed the connection)
00:06:36FromDiscord<leorize> ther's no new keyword
00:15:42flouerso how do I create an array (or seq) with variables of different types? like const myArray : array = [ myTuple(a:1.0,b:1.0) ]
00:16:14flouer(Thanks, btw! :))
00:16:37FromDiscord<leorize> you kinda did it \:p
00:17:20flouerit doesn't work
00:17:29flouerbecause it's not an object type :(
00:18:24FromDiscord<leorize> https://play.nim-lang.org/#pasty=UeonVZusyZmy
00:18:35FromDiscord<leorize> tuples are anonymous, so you really don't have to give it a name
00:19:43flouerhttps://play.nim-lang.org/#pasty=dKzxnZIdBFFy
00:20:29flouerCan I annotate the types of the tuples I put in the array somehow?
00:21:14FromDiscord<leorize> do it like this if you have to\: https://play.nim-lang.org/#pasty=RBZwfmzDTXAT
00:21:31FromDiscord<leorize> but if you need named type conformance then use `object`
00:21:47FromDiscord<leorize> because tuples wasn't made for this
00:23:09FromDiscord<leorize> for a compiling sample\: https://play.nim-lang.org/#pasty=OBbAOmaWzlJp
00:23:37FromDiscord<leorize> a tuple identity is the order of the fields and the name of them
00:24:34FromDiscord<leorize> which might not be what you want, take this for example\: https://play.nim-lang.org/#pasty=TUyfeDZXYULk
00:24:58FromDiscord<leorize> these two are the same despite having different names
00:25:47flouerAh I see. It just checks the subtypes or something.
00:25:56flouerI think that's good enough for me
00:26:09flouer(or maybe it checks the primitive types)
00:27:29flouerIt just looks like something that should work...
00:28:44flouerand the needed space to work seems cryptic!
00:31:41*rockcavera quit (Read error: Connection reset by peer)
00:32:04*rockcavera joined #nim
00:32:04*rockcavera quit (Changing host)
00:32:04*rockcavera joined #nim
00:32:53FromDiscord<leorize> it's a hack, basically
00:34:24flouerIt's important for the aesthetics for my code =P
00:35:22flouerI wouldn't want to do object1 : myTuple = .... object2 : myTuple = .... object3: myTuple = ... myObjectArray : array = [ object1, object2, object3 ]
00:36:28FromDiscord<leorize> you only need to tag the first one in an array
00:37:11FromDiscord<leorize> nim arrays only support one type, so the type of the first element is forced on all other elements
00:38:20*jmdaemon quit (Ping timeout: 252 seconds)
00:44:18FromDiscord<auxym> In reply to @luteva "what is the common": I have this: https://github.com/auxym/bight, but currently it works with either openArray or pointers. Should easy to add stream-based (https://nim-lang.org/docs/streams.html) overloads to it though, PRs welcome
00:48:00flouer@leorize Do you think it's worthwhile to open a bug report to request the correct type checking in this case?
00:48:23FromDiscord<leorize> no, because this is how tuple is designed
01:04:24flouerI just don't see why I shouldn't be able to create or assign a variable of an arbitrary type. If I can anotate const a = 1.0'f64 or const b = 1.0'f32, I should be able to create type-anotated variables anywhere (even for tuple types), I think
01:07:14FromDiscord<leorize> you can go for it
01:07:32FromDiscord<leorize> and btw there's an alternative form is to do `(a: 1.0, b: 1.0).myTuple`
01:14:53flouerIt seems to break in a nested case too: https://play.nim-lang.org/#pasty=WdAQnrcdOYjb
01:23:44flouerMaybe I got bad habits from trying to put everything into javascript objects and arrays :) (they're very convenient)
01:24:53FromDiscord<leorize> please don't abuse tuples too much \:p
01:31:59flouerCreativity (and ignorance) knows no bounds!
01:36:08*jmdaemon joined #nim
01:51:10*jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in)
01:51:28*jmdaemon joined #nim
01:58:01*jmdaemon quit (Ping timeout: 264 seconds)
02:10:19*Onionhammer joined #nim
02:29:02FromDiscord<4zv4l> thats very annoying↵maybe its because I still dont know Zig well enough but each time I want to do something with it, I find it much easier to do it in Nim
02:45:37FromDiscord<leorize> zig default state is a lot lower level than nim
02:54:28FromDiscord<4zv4l> In reply to @leorize "zig default state is": what do you mean ?
02:54:35FromDiscord<4zv4l> (edit) "In reply to @leorize "zig default state is": what do you mean ... ?" added "by `state`"
02:56:17FromDiscord<4zv4l> sent a long message, see <!doctype html>
02:57:09FromDiscord<odexine> In reply to @4zv4l "what do you mean": the basics in zig are more low level than the basics in nim
02:57:37FromDiscord<odexine> low level meaning more nitty gritty and thus harder for beginners
02:57:59FromDiscord<4zv4l> yeah, I really like zig for that, but I actually never got the need for Zig yet↵I had to make a what I think is low level project and I made it in Nim because it was just much more convenient
02:57:59FromDiscord<odexine> its harder to do things as a beginner in zig than in nim
02:58:26FromDiscord<leorize> and also zig prides itself on the "no hidden execution" rule
02:58:37FromDiscord<leorize> so you lack a bunch of sugar that exists in other languages
02:59:07FromDiscord<leorize> you should try making things in both languages
02:59:19FromDiscord<leorize> they have different way of thinking and learning them can help you out later
03:00:14FromDiscord<4zv4l> sent a long message, see <!doctype html>
03:00:39FromDiscord<4zv4l> In reply to @leorize "you should try making": I wanted to but converting form `u8` to `u16` is really something I dont like to do xD
03:01:17FromDiscord<4zv4l> also there was regex and async involved and in Zig I think it isnt amazingly mature yet (I think async isnt available for the stage2 compiler yet)
03:01:54FromDiscord<4zv4l> In reply to @4zv4l "it was about dll": also it was easier to convince my manager about Nim which looks like Python and generate the doc easily↵rather than Zig which is a bit further from what people are used to
03:03:22FromDiscord<4zv4l> but I love Zig error handling and how easy it is to work with memory and the fact that slice obviously dont allocate memory↵↵I find it harder in Nim with `try`/`except`, annoying that slices allocate memory and having to use `toOpenArray` instead, and working with array seems a bit harder as well in some low level stuff
03:03:35FromDiscord<4zv4l> also null safety in Zig with `?type`
03:03:46FromDiscord<4zv4l> I had multiple segfault in Nim xD
03:15:27*jmdaemon joined #nim
04:53:56FromDiscord<odexine> In reply to @4zv4l "but I love Zig": toopenarray makes slices. [] is not really slicing
04:54:28FromDiscord<odexine> some (a good bit of) people dont like errors as return types
05:02:46FromDiscord<bung8954> if I use https://github.com/status-im/nim-bearssl do I still need compile with `-d:ssl`
05:06:09FromDiscord<4zv4l> In reply to @odexine "some (a good bit": I find it better and clearer↵except if I check the doc I cant guess if a function can raise an error and I am not forced to handle it↵↵meanwhile returning an error, the compiler will tell me I forgot to check the error
05:28:48*flouer quit (Remote host closed the connection)
05:29:12*flouer joined #nim
05:52:26*disso_pch quit (Quit: Leaving)
06:28:18*rockcavera quit (Remote host closed the connection)
06:33:24FromDiscord<nnsee> ugh, pasty seems to be down for whatever reasom
06:51:32Amun-RaI had segfaults in nim, but that was solely my fault
06:53:38FromDiscord<khazakar> In reply to @bung8954 "if I use ": They advertise regenerate.sh but it's not in repo. Is it in bearssl sources?
06:55:56FromDiscord<4zv4l> In reply to @Amun-Ra "I had segfaults in": isnt often our fault when there is a segfault ? xD
06:56:31*azimut quit (Ping timeout: 240 seconds)
06:59:41FromDiscord<bung8954> In reply to @khazakar "They advertise regenerate.sh but": yeah, it's in there, it says for updating library.
07:03:41FromDiscord<nnsee> In reply to @Amun-Ra "I had segfaults in": it is probably very likely my fault, will have to check once I get to the office
07:04:11FromDiscord<nnsee> but as I was having a shower right now, I went through the code in my head and I think I know what the issue is
07:04:13FromDiscord<nnsee> I think
07:04:19FromDiscord<nnsee> will have to see what the error says
07:07:40FromDiscord<nnsee> hrm, other things running on the same machine are down too
07:07:54FromDiscord<nnsee> not all of them? which is the weird thing
07:10:08*madprops quit (Quit: biourvgrt445)
07:10:26*madprops joined #nim
07:10:26*madprops quit (Changing host)
07:10:26*madprops joined #nim
07:11:45FromDiscord<4zv4l> anyone know why I am getting a segfault here ?↵even when I try to print the `repr` of `err` ?↵I took the library from https://github.com/praetoriannero/libpcap/blob/main/src/libpcap.nim https://media.discordapp.net/attachments/371759389889003532/1197075772058382356/image.png?ex=65b9f2b0&is=65a77db0&hm=a2f2022d9b3efaf2d5f0801e197b63f0de83ef7fe8ad999b2532fa790c9c21e3&
07:15:43FromDiscord<4zv4l> I changed the type inside the library and it seems to work
07:15:55FromDiscord<4zv4l> why `ptr char` works but `cstring` doesnt work ?
07:16:05FromDiscord<4zv4l> (I changed the `var cstring` to `ptr char`)
07:16:24FromDiscord<leorize> var cstring is effectively `ptr ptr char`
07:16:35FromDiscord<4zv4l> ptr ptr char or ptr char ?
07:16:45FromDiscord<4zv4l> oooh so it should be cstring without the var
07:17:15FromDiscord<leorize> yep, that wrapper is pretty wrong
07:17:37FromDiscord<4zv4l> I was working with a friend on it but didnt have time so we gave up, I forgot the type were mostly wrong
07:17:38FromDiscord<4zv4l> xD
07:17:44FromDiscord<leorize> I'd recommend building one from scratch \:p
07:17:46FromDiscord<4zv4l> I am working on a wrapper for libpcap again
07:17:58FromDiscord<4zv4l> because I didnt find any lib for Nim which allow to capture packets
07:18:09FromDiscord<leorize> now that we have tools like futhark to generate these
07:18:37FromDiscord<4zv4l> In reply to @leorize "I'd recommend building one": indeed 🤡
07:18:39FromDiscord<4zv4l> https://media.discordapp.net/attachments/371759389889003532/1197077511968936087/dYzuLbt-2685871563.png?ex=65b9f44f&is=65a77f4f&hm=ef8b1b87b568f0044893b53f25306bb86f0294d9eb6fb00fe3f9359f8757029f&
07:18:41FromDiscord<4zv4l> xD
07:18:51FromDiscord<leorize> yea you can't beat pcap since it's both a library and has a driver component (on windows)
07:19:18FromDiscord<4zv4l> In reply to @leorize "now that we have": the library was definitely generate automatically↵no doc or nothing, but I guess the tool used did it wrong
07:19:49FromDiscord<leorize> this one was done by hand
07:20:39FromDiscord<4zv4l> oh, how do you know ?
07:22:00FromDiscord<leorize> the use of `when` and the lack of any annotations on object declaration
07:22:01FromDiscord<leorize> but more importantly, the book chapter they linked was about writing a wrapper by hand \:p
07:22:43FromDiscord<leorize> and importing system and std/net is sus
07:23:34FromDiscord<4zv4l> if I pass a cstring to a function, it cant modify it right ?
07:28:11FromDiscord<4zv4l> how can I pass it and allow it to be modified if `var cstring` isnt right ?
07:28:42Amun-Ra4zv4l: I skipped checking for nils "just for now"… ;)
07:29:25Amun-Raright
07:29:53Amun-Rayou have to be careful not to pass string literal
07:30:03Amun-Rasee chapter: segfault ;)
07:30:48FromDiscord<4zv4l> is there a `strdup` in Nim then to avoid this ? xD
07:31:02FromDiscord<4zv4l> and it isnt a string literal
07:31:41FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:31:58Amun-Rathat err is more of a ptr UcncheckedArray[char] type than cstring one
07:32:14Amun-Ra4zv4l: I can't see pastes
07:32:29FromDiscord<4zv4l> In reply to @Amun-Ra "that err is more": why cstring wouldnt work ?
07:32:31Amun-RaI mean playnim ones
07:32:45FromDiscord<khazakar> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:32:51Amun-Ra4zv4l: it would but you need to make sure it's null terminated
07:33:00FromDiscord<khazakar> In reply to @Amun-Ra "<@329196212282458112>: I can't see": It's backticked code in discord
07:33:04FromDiscord<nnsee> In reply to @Amun-Ra "<@329196212282458112>: I can't see": sorry, give me like 30 minutes
07:33:09FromDiscord<nnsee> stuck in traffic
07:33:30Amun-Rannsee: no worries, I just point that for the conversation
07:33:41FromDiscord<4zv4l> I mean libpcap is supposed to null terminate it I guess (otherwise no way to print the error)↵it seems to segfault when libpcap tries to write into the `cstring`
07:33:50Amun-Raah, I see
07:34:21Amun-Ra4zv4l: I'd make that err a proc
07:34:26FromDiscord<4zv4l> it is supposed to error here (no permission to listen on the interface) but it isnt supposed to segfault when it shows it xD
07:34:39NimEventerNew thread by enaaab460: Orc mm slower than markandsweep in my experience, see https://forum.nim-lang.org/t/10880
07:34:42Amun-Raproc err(): cstring {.inline.} = cast[cstring](errbuf[0].addr)
07:35:42FromDiscord<4zv4l> In reply to @Amun-Ra "proc err(): cstring {.inline.}": proc or template ?↵I would need to pass the buffer to the proc then
07:35:56*PMunch joined #nim
07:37:05FromDiscord<4zv4l> ok it seems to work (with the buffer being global)
07:37:35Amun-Rawha't the argument type in pcapLookupDev?
07:37:54Amun-Rawhat's* ;)
07:38:28FromDiscord<4zv4l> cstring, int, int, int, cstring
07:38:41FromDiscord<4zv4l> device, length, promisc, timeout, err
07:39:33Amun-RaI'm using cstring only for input types, ptr char otherwise
07:40:40FromDiscord<4zv4l> so send `cstring` to function, receive `ptr char` from function ?
07:41:01FromDiscord<leorize> you should move to `https://www.tcpdump.org/manpages/libpcap-1.10.4/pcap_findalldevs.3pcap.html` fwiw
07:41:06Amun-Rayes, that depends on the original meaning really
07:41:42FromDiscord<4zv4l> In reply to @leorize "you should move to": I am still trying to figure out the lib I found just to see how much I need to modify it xD↵but once I know which functions I need to implement to do what I want, I will rewrite only that part
07:41:50FromDiscord<4zv4l> (at least for now)
07:42:10FromDiscord<leorize> > If pcap\_init(3PCAP) has been called, this interface always returns NULL.
07:42:14FromDiscord<leorize> https://www.tcpdump.org/manpages/libpcap-1.10.4/pcap_lookupdev.3pcap.html
07:42:18FromDiscord<leorize> so you kinda can't use it anyways
07:45:55FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html>
07:48:14FromDiscord<4zv4l> sent a long message, see <!doctype html>
07:49:47FromDiscord<nnsee> pastes should now once again be working
07:50:32FromDiscord<nnsee> for whatever reason, everything was green across the board and running as should, but postgres was no longer listening on the docker network interface
07:50:35FromDiscord<4zv4l> are you guys using IRC or Matrix ?
07:50:49FromDiscord<nnsee> if they don't have [IRC] in their name, they're on matrix
07:50:53FromDiscord<nnsee> if they're a bot that is
07:53:46FromDiscord<leorize> your first mistake was using docker \:p↵(@nnsee)
07:53:58*advesperacit joined #nim
07:55:06FromDiscord<nnsee> nothing in the logs indicate that the interface had disappeared or something either
07:55:26FromDiscord<leorize> it could just be a firewall reload
07:55:36FromDiscord<leorize> that kind of thing messes docker up all the time
07:55:46FromDiscord<nnsee> In reply to @leorize "your first mistake was": well I _did_ want to throw it on kubernetes instead :p
07:56:09FromDiscord<nnsee> In reply to @leorize "it could just be": that was my first thought but postgres wasn't listening on the docker interface at all, checked with netstat
07:56:13FromDiscord<nnsee> postgres logs say nothing either
07:56:44FromDiscord<leorize> add a healthcheck next time so it gets auto restarted then
07:57:16FromDiscord<nnsee> for certain architectural reasons, postgres is running on the host itself while applications run in containers, which means that the postgres has to be explicitly listening on the docker interface. I _could_ just spin up another postgres instance in an actual docker container
07:58:04FromDiscord<leorize> I never figured out if sharing postgres is ever a good idea
07:58:32FromDiscord<nnsee> it's not really
07:58:33FromDiscord<nnsee> well
07:58:36FromDiscord<leorize> also can't you just do a wildcard listen then pray that your firewall works? \:p
07:58:36FromDiscord<nnsee> depends on who you ask
07:59:30FromDiscord<nnsee> In reply to @leorize "also can't you just": probably. maybe. users can only connect from predefined whitelisted IP ranges anyways even if the firewall didn't work
08:00:32FromDiscord<nnsee> for docker users, that's a very generous 172.16.0.0/12
08:23:14FromDiscord<4zv4l> (is it normal that dark mode in the doc doesnt work when I do the server with `python -m http.server` ?)
08:24:00FromDiscord<nnsee> i think the dark mode javascript was fucked at one point and the hosted nim doc got a quick fix
08:24:15FromDiscord<nnsee> but i would've assumed that nim 2.0.2 would've shipped with a fix
08:26:14Amun-Ra4zv4l: probably the server has to send a proper content-type
08:26:19Amun-Ralet me check that
08:28:48Amun-RaUncaught ReferenceError: setTheme is not defined
08:29:03Amun-Rachanging theme requires dochack.js to be present
08:29:19Amun-Raand dochack.js is copies only if you append --project to nim doc
08:29:38Amun-Raso: either copy dochack.js maually or call nim doc --project once
08:29:49Amun-Rayou can skip --procject in further calls
08:30:05Amun-Ra"is copies"* → "is copied"
08:30:18NimEventerNew thread by takekikuchi: Asyncdispatch on RTOS(Flat Memory), see https://forum.nim-lang.org/t/10881
08:30:52Amun-Ra(my vps with irc session is lagging today and that's why I write like I write…)
08:30:59FromDiscord<4zv4l> In reply to @Amun-Ra "and dochack.js is copies": thanks !
08:31:04FromDiscord<4zv4l> will use `--project` then
08:31:37Amun-Rano worries :)
08:31:59*PMunch quit (Quit: Leaving)
08:33:39FromDiscord<4zv4l> so many segfaults jesus
08:34:33FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html>
08:34:48FromDiscord<4zv4l> why does it segfault
08:34:57FromDiscord<4zv4l> that should be the same ptr
08:36:01Amun-Rannsee: I can still see #ix=html in code paste links
08:36:59FromDiscord<nnsee> I think that needs PMunch's attention
08:37:15FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=html>
08:37:32Amun-Raah, right
08:37:36Amun-Rathanks
10:02:30FromDiscord<ambient3332> sent a code paste, see https://play.nim-lang.org/#ix=html>
10:02:38FromDiscord<ambient3332> The number of parameters can get quite large
10:03:50FromDiscord<ambient3332> ...without templates or macros that is
10:10:58NimEventerNew thread by drkameleon: Getting std/rationals to work for the JS backend, see https://forum.nim-lang.org/t/10882
10:15:52*mronetwo joined #nim
10:15:57*noeontheend joined #nim
10:15:58*mhcat joined #nim
10:16:00*adigitoleo joined #nim
11:09:45FromDiscord<takemichihanagaki3129> What would make a conversion from float to int illegal in Nim?
11:09:54FromDiscord<takemichihanagaki3129> Someone knows it?
11:18:15Amun-Racan floats have inf values in nim?
11:18:52Amun-Raif not, I can't think of anything
11:19:06*krux02 joined #nim
11:20:06FromDiscord<saffage> In reply to @Amun-Ra "can floats have inf": yes
11:23:20krux02all floats in all programming languages can have inf and nan, because under the hood they all use IEEE floating point operations provided by the hardware. Some languages just want to be smart and try to hide these states.
11:26:20Amun-Rayes, that's what I meant
11:33:01*nazgulsenpai quit (Ping timeout: 276 seconds)
11:37:36krux02Amun-Ra, nim does not hide that it uses IEEE floats.
11:40:39*nazgulsenpai joined #nim
11:57:23*PMunch joined #nim
12:19:20*xet7 quit (Quit: Leaving)
13:38:51*rockcavera joined #nim
13:47:58*nazgulsenpai quit (Ping timeout: 264 seconds)
13:50:32*nazgulsenpai joined #nim
14:16:29*nazgulsenpai quit (Ping timeout: 240 seconds)
14:19:37*jmdaemon quit (Ping timeout: 264 seconds)
14:20:27*nazgulsenpai joined #nim
14:22:54*xet7 joined #nim
14:34:57*azimut joined #nim
14:43:53*flouer quit (Remote host closed the connection)
14:44:19*flouer joined #nim
14:46:04*PMunch quit (Ping timeout: 255 seconds)
14:52:23*PMunch joined #nim
15:00:58FromDiscord<Yardanico> @pmunch with ORC if I use `stuff.insert ' '.repeat(0)` it just wipes the whole string :)
15:01:06FromDiscord<Yardanico> for me it's a simple fix to check if num is > 0, but this might be a bug
15:01:27FromDiscord<Yardanico> basically inserting an empty string I guess
15:01:28FromDiscord<pmunch> Hmm, that sounds buglike indeed
15:01:30FromDiscord<pmunch> Oh wait
15:01:37FromDiscord<pmunch> I guess it might insert a null character?
15:01:46FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=html>
15:01:49FromDiscord<Yardanico> this also wipes the string
15:02:26*azimut quit (Remote host closed the connection)
15:02:49FromDiscord<Yardanico> guess it's because of the move stuff in the system.insert, either it needs to be fixed or docs updated to not use it with empty strings
15:02:53FromDiscord<Yardanico> I'm gonna make an issue
15:02:54FromDiscord<pmunch> Hmm stuf.len == 3 in that case
15:02:56FromDiscord<pmunch> Weird
15:02:59*azimut joined #nim
15:03:06FromDiscord<pmunch> Yeah that sounds like an error
15:03:14FromDiscord<pmunch> Or bug rather
15:04:23*azimut quit (Remote host closed the connection)
15:04:51*azimut joined #nim
15:05:12FromDiscord<Yardanico> or rather, it doesn't actually wipe the string, it just replaces everything with spaces for some reason
15:05:19FromDiscord<Yardanico> len is still 5
15:05:27FromDiscord<Yardanico> oh they're null bytes alright
15:06:15FromDiscord<pmunch> Yeah it seems like it creates a new string, then realises it doesn't have to do anything, and then just returns the empty string
15:07:48FromDiscord<Yardanico> <https://github.com/nim-lang/Nim/issues/23223>
15:08:02FromDiscord<Yardanico> going to special-case it in my code since it's not a big deal and repeat 0 is kinda weird anyway
15:09:57FromDiscord<pmunch> Aha, looked at the implementation
15:10:54FromDiscord<pmunch> It loops over the characters and uses `move` to move the characters from one place to another. And apparently that doesn't work well with characters
15:11:10*azimut quit (Remote host closed the connection)
15:11:22FromDiscord<Yardanico> yeah irc -> discord works now with orc
15:11:40FromDiscord<Yardanico> I'm gonna fork dimscord and replace `move`s with `deepCopy` (with `--deepcopy:on`) to also fix the message update and stuff
15:11:50*azimut joined #nim
15:12:03FromDiscord<pmunch> Right, so it performs a `x[0] = move x[0]` and that `move` sets the origin to zero 😛
15:12:09FromDiscord<Yardanico> heh
15:12:50FromDiscord<pmunch> Seems like a very poor implementation tbh
15:13:24FromDiscord<pmunch> Why does it copy character by character?
15:16:25FromDiscord<Yardanico> updating older stuff is like a puzzle, fix error in that lib, find about that bug, etc etc :P
15:16:42FromDiscord<Yardanico> but hopefully there's nothing else to fix to make it work like before with modern versions of code
15:18:09*rockcavera quit (Remote host closed the connection)
15:18:28*rockcavera joined #nim
15:28:01FromDiscord<Yardanico> well, time to replace the bridge with the new binary
15:28:06*PMunch quit (Quit: Leaving)
15:29:57*FromDiscord quit (Remote host closed the connection)
15:30:22*FromDiscord joined #nim
15:30:53*rockcavera quit (Read error: Connection reset by peer)
15:33:59*rockcavera joined #nim
15:35:06*FromDiscord quit (Remote host closed the connection)
15:35:31*FromDiscord joined #nim
15:35:59FromDiscord<Yardanico> restarted the bridge with the new binary
15:38:13*FromDiscord quit (Remote host closed the connection)
15:39:00*FromDiscord joined #nim
15:39:14*azimut quit (Remote host closed the connection)
15:39:30*FromDiscord quit (Remote host closed the connection)
15:39:52*azimut joined #nim
15:39:52*FromDiscord joined #nim
15:40:39*FromDiscord quit (Remote host closed the connection)
15:40:58*FromDiscord joined #nim
16:45:14*azimut quit (Remote host closed the connection)
16:45:41*azimut joined #nim
16:47:48*azimut quit (Remote host closed the connection)
16:48:18*azimut joined #nim
16:49:56*azimut quit (Remote host closed the connection)
16:50:24*azimut joined #nim
16:52:04*azimut quit (Remote host closed the connection)
16:52:40*azimut joined #nim
17:28:23*rockcavera quit (Read error: Connection reset by peer)
17:28:43*rockcavera joined #nim
17:38:42FromDiscord<MDuardo> Are there any plans to make WASM a compiler target?
17:40:04FromDiscord<MDuardo> Wait...
17:40:10FromDiscord<MDuardo> Screenshot\_20240117\_123953\_Firefox.jpg https://media.discordapp.net/attachments/371759389889003532/1197233917623799909/Screenshot_20240117_123953_Firefox.jpg?ex=65ba85f9&is=65a810f9&hm=eec3dc081c52c880657df8198224d9531d66097c56d2d45b459225bca5b3c532&
17:41:19Amun-Raor… you can set emcc as compiler
17:41:55Amun-Ra(been there, done that)
17:49:03Amun-Rathis is a part of my wasm config, you don't need all of it, https://dpaste.com/5KP7HEVY3
17:51:21Amun-RaI use it as one of targets for my unfinished image browser, you can see image identify part (nim+emcc+wasm) here: https://retro.rocks/work/wasmcanvas/
17:54:32Amun-RaI may write howto if anyone's interested
17:55:30Amun-Ras/may/can/
18:11:25*deadmarshal_ quit (Ping timeout: 260 seconds)
18:34:40FromDiscord<ambient3332> Does the same webassembly "binary" work in both Linux and Windows?
18:35:06FromDiscord<ambient3332> Or do I still have to compile for different OS?
18:35:27Amun-Rano
18:35:32Amun-Rait'll work
18:36:13Amun-Rathere's separate option for enabling wasm on browsers on big endian machines
18:36:46Amun-Rathe default is little endian only (iirc)
18:37:17Amun-Raif set, wasm exec is be+le
18:40:51Amun-Rayou can target pure js with emcc by -s WASM=0 but the resulting file is going to be quite large
18:41:27Amun-Rafor example: my viewer takes 1.5MB (node js target), it's 16MB with emscripten
18:41:46FromDiscord<ambient3332> those are still pretty beefy binaries
18:41:52FromDiscord<ambient3332> unless you're software is also very big
18:42:00Amun-Rait is
18:42:12FromDiscord<ambient3332> (edit) "you're" => "your"
18:42:20Amun-Ra44k lines of code
18:43:09Amun-Ranative linux build (release, stripped) is 2.4 MB
18:49:07Amun-RaI have a separate test page for nim's js target, it's not as complete as wasm one - I've to report an iterator compiler bug (https://retro.rocks/work/ridentify/)
18:51:38Amun-RaI have display routine ready (https://retro.rocks/work/rcanvas/), just not enough time to connect the "dots"
19:36:12*deadmarshal_ joined #nim
20:14:23*rockcavera quit (Read error: Connection reset by peer)
20:16:22*rockcavera joined #nim
20:48:42*rockcavera quit (Remote host closed the connection)
21:00:02FromDiscord<enthus1ast.> sent a code paste, see https://play.nim-lang.org/#pasty=YVbxIHXMkScA
21:00:59FromDiscord<enthus1ast.> it seems to crash the compiler (with exit code 139)
21:05:46FromDiscord<nnsee> the compiler segfaults https://play.nim-lang.org/#pasty=toCdtWVPTVAQ
21:05:57FromDiscord<nnsee> I'm faaaairly sure that isn't supposed to happen
21:06:26FromDiscord<enthus1ast.> ah i do not see this in my shell
21:15:23*khazakar joined #nim
21:19:17FromDiscord<Robyn [She/Her]> Huh... Odd
21:20:13FromDiscord<Phil> ... Can you make generics over the size of an array?
21:20:34FromDiscord<Phil> Like, I don't care the size of the array, it should just work
21:20:41FromDiscord<Phil> was it varargs?
21:21:32FromDiscord<enthus1ast.> In reply to @chronos.vitaqua "Huh... Odd": i guess its because i started to use this `ble.sh` stuff
21:23:28FromDiscord<Robyn [She/Her]> In reply to @isofruit "... Can you make": Wdym?
21:23:40FromDiscord<leorize> static int↵(@Phil)
21:24:05FromDiscord<enthus1ast.> const int should also work
21:24:08FromDiscord<Robyn [She/Her]> You can do `proc myArr[S: static int](a: array[S, int])`
21:25:01FromDiscord<enthus1ast.> sent a code paste, see https://play.nim-lang.org/#pasty=epiHzFKxVMwx
21:25:36FromDiscord<Robyn [She/Her]> I don't think that's what Phil means
21:26:01FromDiscord<enthus1ast.> only Phil knows i guess 🙂
21:29:23FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#pasty=vYBBmrZIYnAF
21:30:52*rockcavera joined #nim
21:38:16FromDiscord<soic> sent a code paste, see https://play.nim-lang.org/#pasty=hgEGrmDvHdty
21:38:40FromDiscord<soic> sent a code paste, see https://play.nim-lang.org/#pasty=EvWgQDGLsPRH
21:39:04FromDiscord<soic> sent a code paste, see https://play.nim-lang.org/#pasty=TybZyqgSCiAy
21:39:30FromDiscord<soic> sent a code paste, see https://play.nim-lang.org/#pasty=BKflRpTxuDgV
21:39:34FromDiscord<leorize> what are you trying to make?
21:41:38FromDiscord<soic> I'm passing a field (e.g. foobar.foo, foobar being an object), getting "foobar.foo" as a string to do something and later manipulate foobar.foo
21:41:58FromDiscord<soic> I'm passing a field (e.g. foobar.foo, foobar being an object), getting "foobar.foo" as a string to do something with it and later manipulating foobar.foo
21:42:11FromDiscord<soic> I'm passing a field (e.g. foobar.foo, foobar being an object), getting "foobar.foo" as a string to do something with it and later manipulating foobar.foo (the field)
21:42:20FromDiscord<leorize> use `repr(field)` to get the string form
21:42:51FromDiscord<soic> oh, that should make it easier
21:42:52FromDiscord<soic> thanks
21:48:21FromDiscord<leorize> you can do the same in templates with astToStr, if that simplifies it
21:50:31FromDiscord<Phil> Also just do yourself a favour for the future and use `:typed` if you can 😄
21:50:59FromDiscord<leorize> don't use typed unless you're a masochist
21:51:40FromDiscord<leorize> field access and typed is pure unadulterated pain, esp once you start transforming them
21:51:45FromDiscord<Phil> Typed gives you some degree of correctness in the stuff you receive, I'd personally appreciate that a fair bit.↵Particularly the symbol access
21:52:20FromDiscord<Phil> Can't say it ever led me astray, neither with mapster nor ThreadButler
21:52:46FromDiscord<leorize> have you seen the typed ast of a object variant field access
21:52:51FromDiscord<Phil> Then again, I'm the type that starts all their macros with a validate section
21:52:52FromDiscord<leorize> and then modifying it?
21:53:21FromDiscord<Phil> I actually don't recall how I dealt with object variant field access
21:53:27FromDiscord<Phil> I know I did at least twice
21:53:33FromDiscord<leorize> the compiler will conveniently forgets that your expression should've a type
21:53:42FromDiscord<Phil> But it was unobtuse enough to slip my mind again
21:54:06FromDiscord<leorize> and it will do it in random places where the fix is equally random
21:54:29FromDiscord<leorize> for passthrough you should be in the clear 98% of the time
21:55:24FromDiscord<Phil> If by passthrough you mean that I just need to generate an expression to access the variant and not need to figure out the value of the variant field just then and there, then yeah that was my usecase most of the time
21:55:58FromDiscord<leorize> why 98%? macros.expandMacros is a typed macro that repr the input typed node and pass it out immediately
21:56:14FromDiscord<leorize> and it still couldn't get your code to compile half the time
21:56:37FromDiscord<nnsee> god i wish i could understand what you guys are talking about
22:05:13*rockcavera quit (Remote host closed the connection)
22:06:04*rockcavera joined #nim
22:06:04*rockcavera quit (Changing host)
22:06:04*rockcavera joined #nim
22:07:23FromDiscord<Robyn [She/Her]> Is there a way to rename `NimMain`?
22:09:53*jjido joined #nim
22:16:09FromDiscord<Robyn [She/Her]> Nvm
22:16:22FromDiscord<Robyn [She/Her]> But anyone know what the best allocator would be for an embedded device? :p
22:17:36*rockcavera quit (Remote host closed the connection)
22:21:58FromDiscord<Phil> In reply to @chronos.vitaqua "But anyone know what": -d:useMalloc just generally
22:22:06FromDiscord<Phil> Embedded may have even better stuff
22:22:27FromDiscord<Phil> But so far my multithreaded stuff has lead me down the rabbit hole that is nim's default allocator having some rough edges
22:22:57*rockcavera joined #nim
22:27:56*jmdaemon joined #nim
22:33:04*rockcavera quit (Read error: Connection reset by peer)
22:34:16*rockcavera joined #nim
22:34:16*rockcavera quit (Changing host)
22:34:16*rockcavera joined #nim
22:43:56*rockcavera quit (Remote host closed the connection)
22:47:23*rockcavera joined #nim
22:54:25FromDiscord<Robyn [She/Her]> In reply to @isofruit "-d:useMalloc just generally": Fair
22:54:30FromDiscord<Robyn [She/Her]> Specifically using WASM so
22:55:10*rockcavera quit (Remote host closed the connection)
22:57:26FromDiscord<Robyn [She/Her]> oof, seems like wasm4's template for Nim cartridges is out of date
22:57:42FromDiscord<Robyn [She/Her]> sent a code paste, see https://play.nim-lang.org/#pasty=brHdXrTaMuJw
22:58:56*rockcavera joined #nim
22:58:56*rockcavera quit (Changing host)
22:58:56*rockcavera joined #nim
23:24:36*advesperacit quit ()
23:32:30*jjido quit (Quit: My laptop has gone to sleep. ZZZzzz…)