<< 18-12-2022 >>

00:12:28*ltriant quit (Ping timeout: 272 seconds)
00:39:04FromDiscord<Elegantbeef> Hmph fun and confusing bug that probably is due to typerel
00:44:23FromDiscord<Yepoleb> Is switching async backends only possible if the library implements support for it?
00:45:32FromDiscord<Yepoleb> i wanted to use ws with chronos, but apparently Futures are not compatible
00:46:39FromDiscord<Bung> that need ws support that
00:47:10FromDiscord<Bung> some libs support by use `asynBackend` compile flag
00:49:05FromDiscord<Yepoleb> sad, thanks
00:49:26FromDiscord<Elegantbeef> You could likely use `patchFile` to replace them
00:50:13FromDiscord<Elegantbeef> Would be nice if the async backends where implemented inside module level
00:51:07FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iS4
00:51:11FromDiscord<Elegantbeef> were implemented\
00:52:48FromDiscord<!&luke> how can i format the json that is outputted from jsony's `toJson` function
00:54:07FromDiscord<Elegantbeef> Dont think jsony supports prettying
00:54:26FromDiscord<!&luke> damn
00:54:51FromDiscord<!&luke> do u know any other json library that can format it
00:54:54FromDiscord<Elegantbeef> Well it's aimed for speed and users can write their own hooks
00:54:59FromDiscord<Elegantbeef> std/json
00:55:10FromDiscord<!&luke> ive heard its slow tho
00:55:20FromDiscord<Elegantbeef> What you want is slow
00:55:30FromDiscord<Elegantbeef> Even if it is slow how many Json files are you reading/loading
00:56:07FromDiscord<!&luke> 1
01:16:35FromDiscord<<She>Horizon</Her>> Is speed a concern for your application? If If is, jsony is your best bet
01:16:46FromDiscord<<She>Horizon</Her>> Well, I'm not sure about best
01:17:16FromDiscord<<She>Horizon</Her>> But there'd be no reason for prettifying JSON in an environment where speed is top priority, imo
01:17:41FromDiscord<<She>Horizon</Her>> Otherwise, using `std/json` as beef said is probably a good idea
01:27:48FromDiscord<Bung> `./koch temp c ../pixie/src/pixie/fileformats/jpeg.nim ` `Error: cannot open file: pixie/common ` how to solve this ? I can't run from nim root directory or the package root directory
01:28:18FromDiscord<Elegantbeef> `nimble develop` inside the pixie folder i imagine
01:30:48FromDiscord<Bung> oh, thanks! that works
01:51:19FromDiscord<!&luke> In reply to @Event Horizon "But there'd be no": It’s user facing json so I just decided to have reads done by jsony and writes preformed by std/json
01:52:11FromDiscord<<She>Horizon</Her>> Fair enough
02:17:17*moonlit quit (Remote host closed the connection)
02:17:34*moonlit joined #nim
02:21:12*moonlit quit (Remote host closed the connection)
02:21:35*moonlit joined #nim
02:28:00arkanoidI'm trying to use threads + locks, but I was facing deadlocks so I went debugging. At the end I made a silly test and I put mylock.acquire and mylock.release as top and last statements of my threaded function (making threads basically useless), but I still got deadlock! (?!?)
02:30:28arkanoidsame effect when nesting the whole body of my threaded function into "withLock mylock: ..."
02:30:42arkanoidis nim lock mechanism actually tested?
02:31:08FromDiscord<Yepoleb> what's koch doing there?
02:33:15FromDiscord<Bung> it's for compiler dev , see full stacktrace
02:34:06FromDiscord<Elegantbeef> Yes arkanoid
02:34:13FromDiscord<Elegantbeef> Do you mean to use `tryAcquire`?
02:34:51FromDiscord<Elegantbeef> `acquire` will attempt to grab the lock and if it fails it spins there
02:34:59FromDiscord<Elegantbeef> So if both threads lock you create a deadlock
02:36:00FromDiscord<Rika> Why would two threads fail to acquire the lock at the same time? That kinda sounds like it defeats the purpose
02:36:29arkanoidElegantbeef, but having the whole threaded function within a "withLock" block, the only thread able to run it would release the lock at the end of the body, and another thread would take it. I see no use of tryAcquire here
02:36:48arkanoidI know it's a silly test, but tryAcquire should not be required here
02:36:59FromDiscord<Elegantbeef> Without reproduction it's hard to say what the issue is
02:37:03arkanoidunless the lock is not automatically released at the end of the withLock block
02:37:13FromDiscord<Elegantbeef> it is
02:37:33arkanoidI'll try to reproduce a smaller example
02:42:24FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4iSk this works as one expects
02:49:55arkanoidElegantbeef: I'm starting questioning basic life questions now. What is happening here? https://play.nim-lang.org/#ix=4iSm
02:52:41FromDiscord<Elegantbeef> You are incrementing a value
02:53:04*Trajan joined #nim
02:53:04FromDiscord<Elegantbeef> sent a code paste, see https://paste.rs/ffX
02:53:32arkanoidwhy the dereference operator creates a copy?
02:53:38FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4iSn
02:53:47FromDiscord<Elegantbeef> Cause that's what referencing a value type does?
02:53:52FromDiscord<Elegantbeef> derferencing rather
02:54:14FromDiscord<Elegantbeef> If you have a pointer and you say "let's get the value at the pointer" what do you expect to happen it to return a pointer?
02:54:50FromDiscord<Elegantbeef> Dereferencing is removing the pointer so `(ptr int)[] -> int`
02:55:16FromDiscord<Elegantbeef> It's the same for `ref` aswell `(ref int)[] -> int`
02:55:18arkanoidI though that assigning a variable from there would not generate a copy
02:55:39FromDiscord<Elegantbeef> It has to generate a copy cause that's what you're saying
02:56:08arkanoidwell, good to know. I'm not used to unsafeland, this makes a difference. Let me fix real thing
02:56:29FromDiscord<Elegantbeef> `var accumulator = rawAccumulator[]` accumulator is to be on the stack since it's locally scoped variable
02:56:42FromDiscord<Elegantbeef> This means the onlything one can do is copy the value we get from the pointer
02:57:14FromDiscord<Elegantbeef> If you want to alias the pointer you can just do `var myAcc = rawAccumulator`
02:57:44FromDiscord<Elegantbeef> But any dereferencing unless passed into a `var int` will cause a copy just by how pointers work
02:58:07FromDiscord<Elegantbeef> since dereferencing is an L-Value it can be passed into a proc and it'll mutate the value on the heap
02:58:09arkanoidI need to learn when the dereference operator is called automatically and when not, otherwise I fear doing pointer math
03:00:09FromDiscord<Elegantbeef> In Nim it's only ever called automatically on field access
03:01:43FromDiscord<cia.gov> does std/strutils have the option to turn string to seq[byte]
03:02:26arkanoidwell, no? how do you explain https://play.nim-lang.org/#ix=4iSp ?
03:04:59FromDiscord<Elegantbeef> `inc (rawAccumulator.number)` works
03:05:24arkanoidI'm puzzled now
03:07:39arkanoidI've always though f foo.bar was the same of f(foo.bar)
03:14:47FromDiscord<Elegantbeef> This is likely an issue with the field dereference on `ptr`
03:15:15FromDiscord<cia.gov> is there `^=` in nim?
03:15:22FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4iSs works
03:16:18FromDiscord<Elegantbeef> `a = a xor b` you can always make `^=` and operator but it's a bit ambiguous
03:16:29arkanoidElegantbeef, well, should I report it?
03:17:20FromDiscord<Elegantbeef> Well https://play.nim-lang.org/#ix=4iSu also works
03:17:30*arkurious quit (Quit: Leaving)
03:17:38FromDiscord<Elegantbeef> Yea i just trusted you
03:17:40FromDiscord<Elegantbeef> your code works
03:18:17FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=4iSv runs fine here
03:19:45arkanoidO_o
03:21:05FromDiscord<Elegantbeef> What version of Nim are you on?
03:21:07FromDiscord<Elegantbeef> And why is it like 0.1.8 😄
03:22:58arkanoidok, I think I've got the problem: it's random. I confirm that this code https://play.nim-lang.org/#ix=4iSv on my machine goes correct result 33%, deadlock 33%, SIGSEGV 33%
03:23:23arkanoidnim 1.6.10
03:23:29FromDiscord<Elegantbeef> What OS/CPU
03:23:32arkanoidlet me re-do skipping config files
03:23:42arkanoidx86_64 ubuntu 22.04
03:25:16FromDiscord<Elegantbeef> When i throw it up to 100x100 i do get similar behaviour
03:26:22arkanoidwhat do you mean with throw it up 100x100
03:26:33FromDiscord<Elegantbeef> `0..100` and `step == 100`
03:26:46arkanoidah ok
03:27:00FromDiscord<Elegantbeef> Do you have fewer than 10 threads?
03:27:32arkanoidwell, I get the same erroneous behaviour even with 5 threads
03:27:39arkanoidbut yeas 100x100 is more frequent
03:27:58FromDiscord<Elegantbeef> I dont get it with my cpu so i can only imagine the issue is threadpools + threadcount
03:28:17arkanoidI'd correct the % to 80% correct output, 19% deadlock, 1% SIGSEGV
03:28:41*wallabra_ joined #nim
03:30:00*wallabra quit (Ping timeout: 252 seconds)
03:30:13*wallabra_ is now known as wallabra
03:32:11FromDiscord<Elegantbeef> https://github.com/status-im/nim-taskpools does work reliably but i guess it hasnt been updated for 1.6.x+
03:40:25arkanoidI'm opening an issue on github
03:40:45arkanoidI'm thinking about the title, twice
03:40:49arkanoidany idea?
03:41:17FromDiscord<Elegantbeef> 'Threadpools can cause unreliable behaviour when saturating thread count'
03:41:32FromDiscord<Elegantbeef> Though i imagine threadpools are getting asked for taskpools and friends but idk
03:43:09FromDiscord<Elegantbeef> axed
03:43:09FromDiscord<Elegantbeef> Jesus i can write words
03:43:33arkanoidwhere are you reading 'Threadpools can cause unreliable behaviour when saturating thread count'
03:44:25FromDiscord<Elegantbeef> That's the title
03:44:30FromDiscord<Elegantbeef> You asked for a title
03:45:01arkanoidoh!
03:45:07arkanoidsorry, I need a coffee
03:45:36arkanoidI though you were pointing me to a hint saying that I was using std/threadpool unproperly
03:47:56arkanoidbut I get same unreliable result with 10x10, that is lower than 256
03:49:11FromDiscord<Elegantbeef> I get no issues with 10
03:49:30FromDiscord<Elegantbeef> I mean system threads
03:52:47arkanoidI get it using 2x2
03:53:10arkanoidthis https://play.nim-lang.org/#ix=4iSD
03:54:05arkanoidI get it even with 1x1
03:56:02FromDiscord<Elegantbeef> I do not
03:57:32arkanoidwell, this is weird, when problem happens (20% of cases) it does not even print "a" https://play.nim-lang.org/#ix=4iSE
04:02:55arkanoidI will stop blaming nim, and start blaming the OS
04:06:04NimEventerNew thread by jasonfi: Proposed method of defining models with Nim code in Nexus, see https://forum.nim-lang.org/t/9736
05:03:43*Trajan quit (Quit: Client closed)
05:17:48FromDiscord<albassort> theres a memory leak directly correlated to a string array im inserting into a c function
05:18:06FromDiscord<albassort> i free the pointer on the nim side, but, somewhere in C the data is being coppied
05:18:13FromDiscord<albassort> but i cant figure out where
05:25:49FromDiscord<Elegantbeef> Did you valgrind?
05:44:57FromDiscord<albassort> turns out the massive array im making in nim isn't getting freed
05:45:23FromDiscord<albassort> i don't know if this is normal
05:45:52FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iSS
05:46:51FromDiscord<albassort> yea i know im allocated like 1gb of data then complaining when theres a memory leak
05:47:29FromDiscord<albassort> but i would expect input to be freed after
05:51:17FromDiscord<Elegantbeef> Nim doesnt return memory to OS afaik
05:52:30FromDiscord<albassort> In reply to @Elegantbeef "Nim doesnt return memory": if thats the problem then the leak should go away if i do rand(0 ..9)
05:52:53FromDiscord<albassort> it does not
05:53:03FromDiscord<Elegantbeef> Is it actually a leak?
05:53:26FromDiscord<albassort> well, it shouldn't reclaim more memory because the arrays are of uniform size
05:53:33FromDiscord<albassort> but it continues to
05:56:48FromDiscord<albassort> actually is completely unrelated to nim
05:56:54FromDiscord<albassort> hmmm why are you so strange c
05:58:51FromDiscord<albassort> ah found it
05:58:54FromDiscord<albassort> i wasn't using deallocCStringArray
05:58:57FromDiscord<albassort> just dealloc
06:14:51arkanoiddamn, I'm bridging python and nim, but being unable to use fieldPairs on objects with same field names but different types is making my work really tedius. How can I make a think that would work like this but help when there are 20+ fields? https://play.nim-lang.org/#ix=4iT1
06:15:31FromDiscord<Elegantbeef> Why cant you use fieldPairs on objects with same name but different types?
06:17:47arkanoidError: type mismatch: got 'NimSide' for 'inputTensor' but expected 'PySide = object'
06:18:00FromDiscord<Elegantbeef> That doesnt help
06:20:54arkanoidhttps://play.nim-lang.org/#ix=4iT3
06:22:16FromDiscord<Elegantbeef> Do two for loops with `when name == nameb`
06:26:30arkanoiddamn, I feed so stupid now: https://play.nim-lang.org/#ix=4iT5 ... thanks
06:26:53FromDiscord<Elegantbeef> Cheers
06:31:36arkanoidnow I need to get the "float64" out of Tensor[float64] at compile time within that loop. I'm pretty sure I've done that before, don't remember the function
06:32:27FromDiscord<Elegantbeef> `typetraits.genericParams`
06:38:40FromDiscord<Elegantbeef> Can also do something like `typeof(myTensor[0])` or whatever accessor returns a float
06:39:55arkanoidn = asNumpyArray[genericParams(n.type).get(0)](p).toTensor compiled nicely!
06:40:03arkanoidlet's hope about the tests ...
06:51:30FromDiscord<cia.gov> why is everyone a bot?
06:52:48*v9fk joined #nim
06:53:32FromDiscord<Elegantbeef> Matrix + irc
06:55:06*v9fk quit (Remote host closed the connection)
06:55:32*v9fk joined #nim
06:59:25FromDiscord<Bung> @cia.gov\: why given that nick name? make me feel monitored
06:59:36FromDiscord<cia.gov> 😈
07:18:01*wallabra quit (Quit: ZNC 1.8.2 - https://znc.in)
08:04:34FromDiscord<Bung> what's "ICE" in issue ?
08:05:47FromDiscord<Elegantbeef> Internal compiler error
08:08:15FromDiscord<Bung> is that abbreviation widely used? I can't get it from google
08:09:44FromDiscord<Elegantbeef> for compile development i think so
08:13:56FromDiscord<ShalokShalom> There is a AI code assistant, that supports Nim and is free by default:↵↵https://replit.com/site/ghostwriter
08:31:21FromDiscord<demotomohiro> IC = incremental compile↵ICE = internal compile error↵Abbreviations I saw on Nim chat/forum.
08:33:32FromDiscord<ShalokShalom> Kill all abbreviations
08:33:42FromDiscord<ShalokShalom> With fire please
08:33:54FromDiscord<ShalokShalom> thanks
08:34:00FromDiscord<Luckayla> Internal Combustion Engine
08:34:21FromDiscord<ShalokShalom> ICE is a type of train in Germany
08:34:30FromDiscord<Luckayla> It's a type of frozen water as well
08:34:39FromDiscord<Elegantbeef> No that's ice
08:34:48FromDiscord<Bung> 🙄
08:35:13FromDiscord<Bung> well it's "U.S. Immigration and Customs Enforcement" on top of google result
08:35:17FromDiscord<ShalokShalom> "Oh, make your code explicitly and unambiguous"
08:35:24FromDiscord<Luckayla> In reply to @Elegantbeef "No that's ice": No you're thinking of methamphetamine
08:35:29FromDiscord<ShalokShalom> "Also, abbreviate everything"
08:35:41FromDiscord<ShalokShalom> 🤦‍♂️
08:35:54FromDiscord<ShalokShalom> (edit) "explicitly" => "explicit"
08:35:56FromDiscord<Elegantbeef> No one abbreviates it in the code
08:36:16FromDiscord<ShalokShalom> Everything in Nim is abbreviated
08:36:20FromDiscord<Elegantbeef> People only abbreviate it talking about it cause no one wants to say internal compiler error
08:36:28FromDiscord<Elegantbeef> "Everything"
08:36:32FromDiscord<ShalokShalom> Even the name of the language 😄
08:36:42FromDiscord<Elegantbeef> Nim isnt technically abbreviated
08:36:48FromDiscord<Elegantbeef> It's completely removed from Nimrod
08:36:49FromDiscord<ShalokShalom> In reply to @Elegantbeef ""Everything"": Well, the libraries, the keywords etc
08:37:02FromDiscord<ShalokShalom> In reply to @Elegantbeef "It's completely removed from": I am joking
08:37:19FromDiscord<ShalokShalom> But its not even that far from the truth 😅
08:37:32FromDiscord<Elegantbeef> Are the libraries really abbreviated?
08:38:13FromDiscord<Elegantbeef> `parseutils` is a sensible shortening of `parseutilities`
08:38:37FromDiscord<Elegantbeef> I guess they're, but it's in the least inane way
08:38:43FromDiscord<Elegantbeef> It's not like it's `import std/pu`
08:44:39*pro joined #nim
09:02:39*pro left #nim (#nim)
09:19:16FromDiscord<xoich (xoich)> anybody uses emacs with nim-mode? If so, how can you do without imenu?
09:37:07*krux02 joined #nim
09:39:21FromDiscord<xoich (xoich)> sent a code paste, see https://play.nim-lang.org/#ix=4iTI
09:41:05FromDiscord<xoich (xoich)> sent a code paste, see https://play.nim-lang.org/#ix=4iTJ
10:09:20FromDiscord<ShalokShalom> In reply to @Elegantbeef "Are the libraries really": Well, I mean the method names
10:09:32FromDiscord<ShalokShalom> StrLibSgedBags
10:09:44FromDiscord<ShalokShalom> That's how most stuff reads to me :nim2:
10:10:08FromDiscord<ShalokShalom> (edit) "method" => "method/function" | "method/functionnames ... " added "whatever"
10:26:29*ltriant joined #nim
10:31:18*ltriant quit (Ping timeout: 252 seconds)
10:34:48*ltriant joined #nim
10:36:07*v9fk quit (Remote host closed the connection)
10:38:35FromDiscord<xoich (xoich)> is there something like python's dict.update for Tables?
10:41:52*v9fk joined #nim
10:42:00*ltriant quit (Ping timeout: 272 seconds)
10:47:35*v9fk quit (Remote host closed the connection)
10:51:27*v9fk joined #nim
10:58:18*krux02 quit (Remote host closed the connection)
11:02:25*ltriant joined #nim
11:07:14*ltriant quit (Ping timeout: 252 seconds)
11:26:02*gshumway quit (Quit: .)
11:31:41*gshumway joined #nim
11:48:59FromDiscord<auxym> not tot my knowledge, but it's a 2 line proc to implement
11:51:49FromDiscord<jmgomez> In reply to @deech "Anyone know of a": I dont get why out only works on imported types
11:51:56FromDiscord<<She>Horizon</Her>> What would be the usecase for using a Golang library on Nim? Iirc Go has... Massive binaries which isn't exactly fun
11:52:15FromDiscord<<She>Horizon</Her>> The size doesn't matter nowadays but is annoying
11:52:21FromDiscord<jmgomez> In reply to @Event Horizon "What would be the": ecosystem without worrying for the mm?
11:52:24*ltriant joined #nim
11:53:24FromDiscord<<She>Horizon</Her>> Wdym? Why would you need to worry about memory management?
11:53:32FromDiscord<<She>Horizon</Her>> Because Go uses it's own GC to manage it?
11:56:27FromDiscord<jmgomez> Yup
11:56:50FromDiscord<<She>Horizon</Her>> Ah, alright then
11:57:23*ltriant quit (Ping timeout: 268 seconds)
12:00:07*v9fk quit (Remote host closed the connection)
12:01:08*v9fk joined #nim
12:02:48*v9fk quit (Remote host closed the connection)
12:03:38*v9fk joined #nim
12:13:23*ltriant joined #nim
12:20:48*ltriant quit (Ping timeout: 272 seconds)
13:15:07FromDiscord<0x454d505459> sent a code paste, see https://play.nim-lang.org/#ix=4iUy
13:15:30FromDiscord<0x454d505459> (edit) "https://play.nim-lang.org/#ix=4iUy" => "https://play.nim-lang.org/#ix=4iUz"
13:21:33FromDiscord<0x454d505459> sent a code paste, see https://play.nim-lang.org/#ix=4iUB
13:21:40FromDiscord<0x454d505459> (edit) "https://play.nim-lang.org/#ix=4iUB" => "https://play.nim-lang.org/#ix=4iUC"
13:24:34*ltriant joined #nim
13:29:22*ltriant quit (Ping timeout: 252 seconds)
14:10:26FromDiscord<Phil> In reply to @0x454d505459 "`execShellCmd` from the os": I was about to mention that one since its mentioned to be more terminal-like, do you want to avoid it?
14:10:48FromDiscord<0x454d505459> In reply to @Isofruit "I was about to": I would like to avoid it has it spawns a shell
14:11:18FromDiscord<Phil> sent a code paste, see https://paste.rs/Fa5
14:13:13FromDiscord<Phil> In reply to @0x454d505459 "I would like to": So you want a terminal without a shell? That's a tough one
14:13:19FromDiscord<0x454d505459> yes
14:13:38FromDiscord<0x454d505459> ig I can look into C's "system" definition
14:14:12FromDiscord<Phil> That's a smidge too low level for me sadly. Nim does have a posix wrapper though, if you're familiar with that you could look in there
14:14:52FromDiscord<0x454d505459> Its a too low level for me too, but I could still take a look at it
14:16:32FromDiscord<0x454d505459> sent a long message, see http://ix.io/4iUS
14:16:48FromDiscord<Phil> Why nano of all things btw? Since nano specifically seems to need a terminal
14:17:48FromDiscord<0x454d505459> just to test, but su doesn't work either and all programs requiring a terminal doesn't want to work, others works but outputs weirdly
14:20:25pbsdsHi, my brain is especially smooth today, how to i convert a string to a bitset of chars?
14:20:49pbsdsi can't seem to find any bitset constructors
14:30:46FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4iUW
14:34:41pbsdshuh, totally glossed over that module, thanks
14:46:49FromDiscord<albassort> is there a way to get the name of the the file in which code is being run from
14:48:05FromDiscord<Rika> https://nim-lang.org/docs/system.html#currentSourcePath.t
14:48:10FromDiscord<rakgew> os.getAppFileName.lastPathPart iirc
14:49:55FromDiscord<Rika> Oh, I misread
14:49:57FromDiscord<Rika> Yes
14:50:07FromDiscord<Rika> The other guy is correct
14:52:20FromDiscord<ajusa> Any way to parse exif in Nim? I don't see any native libraries, is binding to a C library my best option?
14:52:32FromDiscord<ajusa> (edit) "Any way to parse ... exif" added "jpeg "
14:53:57FromDiscord<albassort> exif?
14:54:03FromDiscord<albassort> theres a few jpg libraries
14:54:09FromDiscord<albassort> but idk what exif is
14:58:17FromDiscord<ajusa> In reply to @albassort "but idk what exif": It's the metadata headers in a JPEG, includes make and model of a camera, date/time, etc.
14:59:14FromDiscord<albassort> @ajusa https://github.com/flenniken/metar
15:00:11FromDiscord<4zv4l> how can I get a pointer/reference to a `const string` ?
15:00:18FromDiscord<ajusa> In reply to @albassort "<@102899813149855744> https://github.com/flenniken/": Oh perfect, thanks! Guess I was too specialized with my search query
15:00:23FromDiscord<4zv4l> or that's the point it should be `let string`
15:00:43FromDiscord<albassort> const is for compile time constants, probably not lol
15:00:54FromDiscord<albassort> let is for immutable variables, so the pointer will be immutable
15:01:02FromDiscord<4zv4l> sent a code paste, see https://paste.rs/ysl
15:01:31FromDiscord<albassort> better to cast it to a cstring if you're gonna use it as a pointer but what you should do instead is this
15:01:40FromDiscord<4zv4l> yeah my bad, it's because in C it passes the pointers anyway even with `define`
15:01:55FromDiscord<albassort> sent a code paste, see https://paste.rs/DyV
15:02:14FromDiscord<albassort> this is... if you NEED a pointer
15:02:18FromDiscord<4zv4l> In reply to @albassort "better to cast it": the compiler tells me it's bad
15:02:23FromDiscord<albassort> hmm
15:02:30FromDiscord<4zv4l> to cast string to cstring
15:02:43FromDiscord<4zv4l> except if I create it as cstring from the beginning obviously
15:02:45FromDiscord<4zv4l> I'll try that
15:02:48FromDiscord<albassort> yea...
15:03:02FromDiscord<4zv4l> but I don't get why it has no addresses
15:03:11FromDiscord<4zv4l> it's a string in memory, it must have an address
15:03:18FromDiscord<albassort> why are you using a string here anyway
15:03:27FromDiscord<4zv4l> because write take a pointer to a cstring
15:03:30FromDiscord<4zv4l> (edit) "take" => "takes"
15:03:35FromDiscord<albassort> oi m8
15:03:44FromDiscord<albassort> you tried to put a nim string as a cstring
15:03:57FromDiscord<albassort> and you ask why it doesn't have an address
15:04:00FromDiscord<4zv4l> I tried this too
15:04:03FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVc
15:04:04*ltriant joined #nim
15:04:26FromDiscord<albassort> try it as var
15:04:28FromDiscord<albassort> and if not
15:04:47FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iVd
15:04:51FromDiscord<albassort> would work fine
15:04:53FromDiscord<4zv4l> `Error: type expected`
15:05:02FromDiscord<albassort> uh what
15:05:02FromDiscord<Rika> What version is your compiler
15:05:06FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVe
15:05:15FromDiscord<4zv4l> Nim Compiler Version 1.6.6
15:05:18FromDiscord<Rika> If your compiler version is old, let variables need to use unsafe addr
15:05:28FromDiscord<Rika> In reply to @4zv4l "`Error: expression has no": Says here
15:05:48FromDiscord<albassort> listen to rika he smort and i dont wanna deal with this
15:05:51FromDiscord<albassort> :)
15:06:07FromDiscord<4zv4l> In reply to @Rika "If your compiler version": is 1.6.6 old ?
15:06:09FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iVg
15:06:14FromDiscord<4zv4l> well I just want to pass a pointer to my string
15:06:19FromDiscord<Rika> I don’t know if it changed but I assume it is
15:06:19FromDiscord<4zv4l> but it seems not to work
15:06:26FromDiscord<Rika> Devel I think doesn’t have that issue
15:06:28FromDiscord<albassort> devel is currently 1.7.3
15:06:29FromDiscord<Phil> You want to print to stdout from what I'm seeing
15:06:37FromDiscord<Phil> That doesn't need a cstring
15:06:39FromDiscord<<She>Horizon</Her>> In reply to @4zv4l "is 1.6.6 old ?": Yeah, 1.6.10 is the latest stable
15:06:51FromDiscord<Rika> In reply to @Isofruit "You want to print": It could be just an example
15:06:52FromDiscord<Phil> And 1.6.6 is not that old, only like a year or so
15:07:01FromDiscord<albassort> thats old as f
15:07:03FromDiscord<albassort> (edit) "as f" => "asf"
15:07:07FromDiscord<<She>Horizon</Her>> Yeah but still better to use the latest possible xD
15:07:11FromDiscord<Phil> I started with 1.6.6 so its fresh xP
15:07:28FromDiscord<albassort> bald people smfh
15:09:00FromDiscord<4zv4l> alright, I'm updating
15:09:16*ltriant quit (Ping timeout: 272 seconds)
15:09:40FromDiscord<4zv4l> just to explain a bit
15:10:03FromDiscord<4zv4l> I just made a small code in Zig which is really small and does really few syscall↵and since I love Nim I wanna check if I can achieve the same
15:10:10FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVj
15:10:11FromDiscord<4zv4l> but so in Nim
15:11:17FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVk
15:13:13FromDiscord<4zv4l> unsafeAddr works with string
15:13:18FromDiscord<4zv4l> now (not with the previous one)
15:19:13FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVl
15:21:02FromDiscord<4zv4l> Error: unhandled exception: index out of bounds, the container is empty [IndexDefect]
15:22:20FromDiscord<4zv4l> read from stdout lmao ok
15:24:12FromDiscord<4zv4l> still index out of bounds tho
15:24:44FromDiscord<4zv4l> oh because the string is empty at first
15:25:09*moonlit quit (Ping timeout: 265 seconds)
15:29:31FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVm
15:35:40FromDiscord<Rika> “Not well displayed” in what way?
15:36:46FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVo
15:36:48FromDiscord<4zv4l> the Simon is the name↵the 20 is the age
15:36:54FromDiscord<4zv4l> so the prompt before are weird
15:36:57FromDiscord<4zv4l> same goes for the greet
15:38:23FromDiscord<4zv4l> this is the current code
15:38:24FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVp
15:43:37FromDiscord<4zv4l> any idea ?
15:46:40FromDiscord<ringabout> In reply to @4zv4l "any idea ?": You can get the address of strings by `unsafeAddr s` because s is not a pointer, you should use `unsafeAddr s[0]`
15:47:00FromDiscord<Vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4iVr
15:47:12FromDiscord<4zv4l> In reply to @Vindaar "why so complicated in": yes but I try to make it using as few syscalls as possible
15:47:34FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVs
15:47:37FromDiscord<4zv4l> and I want to try achieving the same in nim
15:47:43FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4iVt
15:48:34FromDiscord<4zv4l> In reply to @ringabout "You can get the": thanks, that works indeed !
15:48:49FromDiscord<4zv4l> what's the difference between the address of the string and of s[0] ?
15:48:53FromDiscord<4zv4l> shouldn't it be the same ?
15:49:43FromDiscord<Vindaar> In reply to @4zv4l "what's the difference between": a string is not just a pointer to data. It's essentially a ptr + length pair. By accessing the address to `s[0]` you get the address to the start of the data (which is what you want). Address to the string itself points to the ptr + len pair object
15:50:19FromDiscord<ringabout> It is a struct, you can get the address of its length by `addr s`.
15:50:36FromDiscord<ringabout> sent a code paste, see https://play.nim-lang.org/#ix=4iVw
15:50:56FromDiscord<4zv4l> alright yes makes sense
15:51:42FromDiscord<Rika> I forgot that :InaTehe:
15:53:12FromDiscord<4zv4l> I don't know nim enough, how can I get rid of all those syscalls to prepare the runtime env ?
15:53:40FromDiscord<albassort> you are writing nim as if it were...
15:53:44FromDiscord<albassort> i dont even know
15:54:04FromDiscord<4zv4l> well you can disable the gc so why not ?
15:54:22FromDiscord<4zv4l> and some write Nim on freestanding right ?
15:54:30FromDiscord<albassort> so, you can do it
15:54:48FromDiscord<albassort> but how are you going to free all the variables called by the stdlib which was written without that in mind
15:54:49FromDiscord<albassort> you cant
15:55:03FromDiscord<albassort> not even /system/ is written without the gc in mind
15:55:12FromDiscord<4zv4l> I mean I don't say it's possible↵I just wanna know how easily (if that's possible) it is to achieve this but in Nim https://media.discordapp.net/attachments/371759389889003532/1054064294561599508/image.png
15:55:15FromDiscord<albassort> so you cant even write 2+2 without memoy being allocated and not fred
15:55:17FromDiscord<albassort> (edit) "fred" => "freed"
15:55:29FromDiscord<albassort> (you probably can but thats besides the point)
15:55:56FromDiscord<4zv4l> In reply to @albassort "so you cant even": really ?
15:56:10FromDiscord<albassort> that might be an over exaggeration
15:56:17FromDiscord<albassort> but its close to that effect
15:56:35FromDiscord<albassort> besides
15:56:39FromDiscord<albassort> modern nim doesn't even use a gc
15:56:49FromDiscord<albassort> we use ORC and ARC
15:56:58FromDiscord<4zv4l> orc technically is a gc isn't it ?
15:57:06FromDiscord<albassort> it is technically not
15:57:22FromDiscord<albassort> well
15:57:24FromDiscord<albassort> ehh
15:57:27FromDiscord<albassort> its kinda merky
15:57:28FromDiscord<4zv4l> I thought arc wasn't but orc was
15:57:43FromDiscord<albassort> im not sure...
15:57:45FromDiscord<albassort> they might both be
15:57:47FromDiscord<4zv4l> well I guess I'll keep Nim as my middle level language
15:57:48FromDiscord<albassort> or both not be
15:58:57FromDiscord<albassort> i don't know. It works pretty close to Rust, Zig and C
15:59:10FromDiscord<albassort> its high level as is all of them
15:59:30FromDiscord<4zv4l> well Zig is lower level than C sometimes↵so I keep Zig as my low level language↵really easy to do freestanding with it also, easier than C
15:59:33FromDiscord<albassort> relegating it to "midlde level" is pretty reductive, and i dont think it fills that niche
15:59:38FromDiscord<4zv4l> oh
15:59:40FromDiscord<4zv4l> not reductive
15:59:44FromDiscord<4zv4l> that's the most used level to me
16:00:03FromDiscord<4zv4l> I rarely need low level control
16:00:14FromDiscord<albassort> so, in the land of nim, we don't usually use pointers
16:00:14FromDiscord<4zv4l> I more need Perl/Nim of High and Middle level respectively
16:00:23FromDiscord<4zv4l> In reply to @albassort "so, in the land": yeah I start to get that
16:00:43FromDiscord<albassort> because of how unsafe they are, where you might use pointers, we use explicit references
16:00:50FromDiscord<albassort> ref string for example
16:01:07FromDiscord<albassort> its a reference to a piece of memory, that cant be cleared or taken away as long as it is preserved as a reference (unlike var)
16:01:45FromDiscord<4zv4l> yeah I heard about ref
16:06:09FromDiscord<albassort> generally speaking, pointers are used for 3 things↵1. interop↵2. manual gc, where you dont trust the gc for whatever reason↵3. storing data on the shared heap to communicate between threeads
16:06:16FromDiscord<albassort> (edit) "threeads" => "threads"
16:06:43FromDiscord<albassort> ref and var fulfills the other purposes you would use them in C
16:06:48FromDiscord<albassort> e.g
16:07:28FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iVB
16:07:43FromDiscord<albassort> this would set the incoming string to "example" and return the length of it
16:08:39FromDiscord<albassort> (edit) "length" => "max()"
16:09:12FromDiscord<albassort> additionally, strings in nim are pascal style and correspond to an integer value of their length, and are non-null terminated
16:10:17FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iVC
16:10:32FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iVC" => "https://play.nim-lang.org/#ix=4iVD"
16:10:39FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iVD" => "https://play.nim-lang.org/#ix=4iVE"
16:13:12FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iVG
16:13:20FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iVG" => "https://play.nim-lang.org/#ix=4iVH"
16:13:48FromDiscord<4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=4iVI
16:13:58FromDiscord<4zv4l> In reply to @4zv4l "I mean I don't": Again I wanted to do something similar to this
16:14:07FromDiscord<4zv4l> So that was the purpose to be low level
16:14:21FromDiscord<albassort> but.... why?
16:14:47FromDiscord<albassort> for what aim
16:15:13FromDiscord<albassort> it probably looks the same on the output, except your code has less room for the compiler to make optimal
16:23:07FromDiscord<auxym> In reply to @4zv4l "I mean I don't": I don't know enough rust to understand that. But basically if you want to write nim with `--mm:none`, you have to avoid all strings and seqs, and everything that uses them (eg tables hashsets deques all are implemented with seqs). And ref objects but that's sort of obvious. But really with ARC there is very little reason to do so.
16:24:18FromDiscord<auxym> The only exception is maybe embedded with small heap where you are worried about fragmentation. But even then you can still use ARC but be careful and mindful about allocation (reuse seq/strings like buffers instead of reallocating a new one, etc)
16:25:37FromDiscord<auxym> if you compile with mm:none and anything in your code uses ref/seq/string, you will get a compiler error btw (not a silent memory leak)
16:28:33FromDiscord<Rika> Makes me wonder if that context idea that Odin and I believe Zig also has is a good idea for embedded
16:36:54arkanoidTo generate a .dll from intended to be loaded from Nim and not C or whatever, do I need exportc?
16:37:10arkanoid*from nim
16:44:17FromDiscord<<She>Horizon</Her>> Yeah you would
16:44:32arkanoidOk
16:44:40FromDiscord<<She>Horizon</Her>> `exportc` and `cdecl`, since to load a method in a dll, you still need the exact name
16:45:13FromDiscord<<She>Horizon</Her>> And it'd be mangled in Nim compiled code, so
17:03:55FromDiscord<ShalokShalom> In reply to @4zv4l "orc technically is a": rc means reference counting
17:04:08FromDiscord<ShalokShalom> Technically, thats not GC
17:04:17FromDiscord<ShalokShalom> but has some properties of it
17:04:26FromDiscord<ShalokShalom> Actually, ORC is unique 😄
17:05:40*ltriant joined #nim
17:06:04arkanoidAnd what if I want to export a ref type to generated dll, such that users can use it at compile time to extend the type contained into the dll?
17:06:06FromDiscord<ringabout> How could ORC be unique, there is a mainstream language uses the rc + partial tracing.
17:08:44FromDiscord<4zv4l> In reply to @auxym "I don't know enough": It’s zig not rust, but thanks↵Yeah I tried none as gc
17:10:08FromDiscord<4zv4l> In reply to @albassort "but.... why?": Much less syscalls
17:10:39*ltriant quit (Ping timeout: 268 seconds)
17:15:51FromDiscord<auxym> In reply to @arkanoid "And what if I": you can't use a dll at compile time
17:17:05arkanoidauxym, I mean being able to import types from dll and extend them in my nim code
17:17:48arkanoidI'm just saying that I don't need this at runtime (plugin like) but just at link time
17:17:53FromDiscord<auxym> as in a inheritance? pretty sure you can't do that either
17:18:16arkanoidNo?
17:20:40arkanoidAnd what if I export/import only the non-ref types and then declare the OOP type hierarchy only in the Nim side?
17:21:34FromDiscord<auxym> not sure. you could use composition style instead of inheritance though
17:22:43arkanoidAuxym I've tried, but object variant is not flexible enough to cover the requirements. I have variants sharing field names with other variants, but not type
17:23:13arkanoidI managed to get it work only with inheritance
17:27:23FromDiscord<ShalokShalom> In reply to @arkanoid "Auxym I've tried, but": you mean you are limited by object variants limitation of all being in one namespace?
17:37:14*ltriant joined #nim
17:38:51FromDiscord<albassort> In reply to @auxym "you can't use a": cant you statically link it?
17:39:59FromDiscord<albassort> i tried to compile with musl today and i learned its annoying to statically link gtk
17:40:12FromDiscord<albassort> but for good reasons
17:41:22FromDiscord<ShalokShalom> gtk is annoying to use for good reasons
17:41:29FromDiscord<ShalokShalom> you could start to work for gnome 😛
17:41:51FromDiscord<ShalokShalom> statically linking is something that they culturally dont like
17:42:05FromDiscord<ShalokShalom> this is why lgpl doesnt allow it and mpl 2 does
17:42:11FromDiscord<ShalokShalom> different cultures
17:42:19*ltriant quit (Ping timeout: 256 seconds)
17:43:04FromDiscord<albassort> I would never work for gnome
17:43:25FromDiscord<albassort> i feel the smell of miasma from their rotting code would overwhelm their offices
17:44:56FromDiscord<albassort> I genuinely think GTK is the least evil framework tho
17:45:04FromDiscord<albassort> its fucked, super fucked
17:45:07FromDiscord<albassort> but QT is worse
17:53:28FromDiscord<ShalokShalom> https://medium.com/swlh/what-makes-godot-engine-great-for-advance-gui-applications-b1cfb941df3b
17:53:41FromDiscord<ShalokShalom> I would normally disagree, but ...
17:53:47FromDiscord<ShalokShalom> Ah, what the heck
17:54:00FromDiscord<ShalokShalom> https://www.youtube.com/watch?v=ON0A1dsQOV0
17:54:14FromDiscord<ShalokShalom> I disagree strongly
18:08:48*ltriant joined #nim
18:14:12*ltriant quit (Ping timeout: 272 seconds)
18:14:27FromDiscord<albassort> idk man
18:14:40FromDiscord<albassort> @ShalokShalom writing gtk was very very easy for me
18:14:52FromDiscord<albassort> i tried to write QT and just got annoyed
18:22:21FromDiscord<ShalokShalom> The Nim bindings of GTK seems very reasonable
18:22:34FromDiscord<ShalokShalom> At least subjectively, and on first sight
18:23:03FromDiscord<ShalokShalom> And I dont love Qt as a developer, neither do I think its the best in town.
18:25:00FromDiscord<arkanoid> Android/iOS/Windows/OSX platform specific GUI istuff is the best in town
18:31:24FromDiscord<ShalokShalom> you mean like, not only native looking widgets
18:31:31FromDiscord<ShalokShalom> but rewriting the app several times
18:31:40FromDiscord<ShalokShalom> and using actual native GUIs every time
18:33:33*arkurious joined #nim
18:47:47*moonlit joined #nim
18:49:22*xet7 joined #nim
19:15:33FromDiscord<albassort> In reply to @ShalokShalom "The Nim bindings of": they don't compile on my machine :)
19:16:47FromDiscord<albassort> In reply to @arkanoid "Android/iOS/Windows/OSX platform specific GUI": Yea because if you give anything challenging to a mobile developer they might freekout
19:16:58FromDiscord<albassort> they're scared of programming
19:17:59arkanoidafter a lot of fighting with vscode + nimsuggest/nimlsp/nimlangserv that ends in nimsuggest eating >10GB ram and crashing my machine, I've finally found an equilibrium: set "Nim: Provider" in vscode extension to "none"
19:18:59FromDiscord<albassort> In reply to @arkanoid "after a lot of": WAIT WHAT
19:19:13FromDiscord<albassort> does that fix the problems?
19:19:26arkanoidalbassort, in my case, yes
19:19:43FromDiscord<albassort> In reply to @arkanoid "after a lot of": ((btw setup swap and set swapiness low, so, if it starts to consume ram it'll be killed and wont crash your pc)
19:19:45FromDiscord<albassort> (edit) "pc)" => "pc))"
19:20:04FromDiscord<albassort> my pc is relatively stable like that
19:20:12FromDiscord<albassort> 8 gb ram 20 gb swap for me
19:20:35arkanoidalbassort, I do kinda scientific computing, I know how to handle swappiness, and also I know that I don't want my developing environment to be the elephant in the room while doing so
19:21:05FromDiscord<albassort> im sorry i wasn't trying to alba-splain ;-;
19:21:13arkanoidnp
19:22:02FromDiscord<albassort> For me it works because, when i do scientific-like computing, lately, it hasn't been long workloads
19:22:21FromDiscord<albassort> but if i was doing any computations that take a long time, yea... its bad
19:28:02arkanoidsetting "Nim: Provider" in vscode extension to "none" but enabling "lint on save" (nim check on save) gives me the best experience. I know what I've done wrong FASTER than before, because nimsuggest is no more clogging the editor
19:31:56arkanoidby watching htop filtering processes containing "nim" in executable, I see zero nim-related processes while editing, and as soon as I save the file I am editing I see ".nimble/bin/nim check" starting up, that calls "nim check --listFullPaths src/myproject.nim" from .choosenim folder, and within a second it completes and I see where the error is in vscode
19:33:23arkanoid100% better than having autocompletion or type info after 10 seconds, while clogging the ram of my pc and fighting with "project paths" to make vscode extension/nimlsp/nimlangserver able to control which nimsuggest processes went crazy
19:38:34arkanoidmoreover I still get most of autocompletion out of this for mysterious reasons
19:44:19*ltriant joined #nim
19:49:25*ltriant quit (Ping timeout: 260 seconds)
19:50:43FromDiscord<ShalokShalom> In reply to @albassort "they don't compile on": Well, they are early
19:50:55FromDiscord<ShalokShalom> Might still improve 🙂
19:51:00FromDiscord<ShalokShalom> Did you bug report?
19:57:59FromDiscord<ShalokShalom> @arkanoid Very interesting 😮
19:58:32FromDiscord<albassort> In reply to @ShalokShalom "Did you bug report?": the bug is known, they think they solved it, they didn't
19:58:38FromDiscord<albassort> its probably my machine
19:58:46FromDiscord<albassort> so it'll be fin
19:58:48FromDiscord<albassort> (edit) "fin" => "fine"
19:58:53FromDiscord<albassort> code was already written in C
20:14:30FromDiscord<ShalokShalom> You surely have updated to their newest version?
20:24:10*wallabra joined #nim
20:28:48*wallabra_ joined #nim
20:30:40*wallabra quit (Ping timeout: 252 seconds)
20:30:40*wallabra_ is now known as wallabra
20:32:54*ltriant joined #nim
21:08:46FromDiscord<fabricio> how can I pass a named closure iterator around as a value, because I think when I do that the compiler thinks that I'm trying to call it
21:14:34FromDiscord<Phil> Not that I can help you, I have during my year of nim not once had to define my own iterator, but a code-example for others that have the knowledge could be useful.↵Maybe Beef decends upon you with his wisdom
21:14:58FromDiscord<Phil> (edit) "decends" => "descends"
21:22:39FromDiscord<Elegantbeef> They're probably doing `myProc(myIterator())`
21:24:55FromDiscord<0x454d505459> Anyone ever use nimqml ? after compiling the examples I get module not founds,
21:24:56FromDiscord<0x454d505459> (edit) "founds," => "founds"
21:25:08FromDiscord<0x454d505459> is there anything extra to do ?
21:25:27FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iXp
21:27:52FromDiscord<Phil> In reply to @0x454d505459 "Anyone ever use nimqml": I have a couple mini examples and my next larger project I wanted to do with nimqml, what issue are you running into exactly?
21:28:05FromDiscord<Phil> As in, please copy paste the error 😛
21:29:25FromDiscord<0x454d505459> In reply to @Isofruit "I have a couple": Just trying it out↵`file:///tmp/nimqml/examples/helloworld/main.qml:2:1: module "QtQuick.Controls" version 1.2 is not installed`
21:30:33FromDiscord<0x454d505459> just compiling the examples after building them
21:30:58FromDiscord<Phil> Ahh you may need to install the necessary QT packages, let me check which ones those were on arch
21:31:16FromDiscord<0x454d505459> I have kirigami2 installed
21:31:35FromDiscord<Phil> In reply to @0x454d505459 "I have kirigami2 installed": You using arch or debian/ubuntu-based?
21:31:40FromDiscord<0x454d505459> arch based
21:32:58FromDiscord<Phil> sent a long message, see http://ix.io/4iXs
21:33:26FromDiscord<Phil> (pacman -q
21:33:27FromDiscord<Phil> (edit) "-q" => "-q)"
21:33:32FromDiscord<Phil> (edit) "-q)" => "-Q)"
21:34:00FromDiscord<0x454d505459> I have all of them
21:34:04*ltriant quit (Ping timeout: 260 seconds)
21:34:17FromDiscord<0x454d505459> I use kde plasma so I guess they came with it
21:34:21FromDiscord<0x454d505459> (edit) "I use kde plasma so I guess they came with it ... " added "as dependencies"
21:34:54FromDiscord<Phil> Ahhh check, I use gnome so I had to install those, I think another issue I ran into that because arch is arch you already don't have 1.2 anymore but a newer version, you should be able to just drop the version number from the qml files
21:35:16FromDiscord<Phil> If you want to figure out what version you're currently running I'm like 30% sure it's 2.2x something
21:35:38FromDiscord<0x454d505459> if I just remove the versions it will auto select right ?
21:35:55FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=4iXv
21:36:16FromDiscord<Phil> This compiles under arch with nimqml (if you pass the right context object for rendering)
21:36:38FromDiscord<0x454d505459> now it says gtk2 module isn't installed (but it isn't imported)
21:37:44FromDiscord<Phil> That also sounds familiar, could you say again which module its complaining about precisely?
21:38:05FromDiscord<Phil> Because I also had to install `gtk2 2.24.33-2`
21:38:32FromDiscord<0x454d505459> `file:///tmp/nimqml/examples/helloworld/main.qml: module "gtk2" is not installed`
21:38:47FromDiscord<0x454d505459> In reply to @Isofruit "Because I also had": I have it installed
21:40:08FromDiscord<Phil> It may need to be in the path, I'm currently looking where I put it
21:41:08FromDiscord<0x454d505459> is it looking for `/usr/lib/qt/plugins/styles/libqgtk2style.so` ?
21:42:00FromDiscord<Phil> pretty sure not under that path as at least I don't have that under there
21:42:11FromDiscord<0x454d505459> gonna link it in /lib ig
21:42:56FromDiscord<0x454d505459> didn't work
21:43:06FromDiscord<Phil> Well I have `/lib/gtk-2.0`, I don't recall that being the thing that did it
21:43:32FromDiscord<Phil> same for lib64
21:43:53FromDiscord<0x454d505459> lib64 is just a symlink to /lib I think
21:44:14FromDiscord<0x454d505459> In reply to @Isofruit "Well I have `/lib/gtk-2.0`,": I have that directory too
21:44:18FromDiscord<Phil> You have libdotherside somewhere in your path as well?
21:44:23FromDiscord<0x454d505459> yes
21:44:48FromDiscord<0x454d505459> `/usr/local/lib/libDOtherSide.so.0.9.0` here
21:45:01FromDiscord<0x454d505459> linked in `/usr/lib`
21:47:32FromDiscord<0x454d505459> can't find anything on google
21:48:45FromDiscord<Phil> Past me had some really damn good google fu, let me search a bit more
21:49:56FromDiscord<0x454d505459> sure
21:51:32FromDiscord<0x454d505459> someone had the same issue with "Viber" but didn't found anythign
21:51:35FromDiscord<0x454d505459> (edit) "anythign" => "anything"
21:51:48FromDiscord<auxym> In reply to @albassort "cant you statically link": statically link it with what? The nim compiler? compile-time code (nim vm) runs before linking...
21:54:36FromDiscord<0x454d505459> In reply to @0x454d505459 "someone had the same": Gonna take a sleep, maybe i'll found answers tomorrow, thanks for the help @Phil
21:54:55FromDiscord<Phil> In reply to @0x454d505459 "Gonna take a sleep,": For what little I could recall, sorry =/
21:56:41FromDiscord<Phil> sent a long message, see http://ix.io/4iXF
21:56:54FromDiscord<Phil> (edit) "http://ix.io/4iXF" => "http://ix.io/4iXG"
21:57:15FromDiscord<albassort> is there anyway to turn off const declarations on compile and make them let
21:57:21FromDiscord<albassort> or at least do this for nimsuggest
21:57:45FromDiscord<albassort> because const makes projects very slow to respond
22:05:56FromDiscord<Phil> In reply to @0x454d505459 "Gonna take a sleep,": May be of interest to you but I do also have this nimble package installed:↵https://github.com/nim-lang/gtk2↵↵I am uncertain as to whether that's the major difference
22:06:12*genpaku quit (Read error: Connection reset by peer)
22:08:42*genpaku joined #nim
22:33:47FromDiscord<ajusa> In reply to @Elegantbeef "https://play.nim-lang.org/#ix=4iIi <@10289981314985": Thanks once again for writing this down beef, I've updated my code to use something based off of it.↵fixing the few issues required me to understand macros, after nearly three years of avoiding them.
22:42:44*adium quit (Ping timeout: 272 seconds)
22:46:05*adium joined #nim
22:54:06FromDiscord<Elegantbeef> @ajusa\: macros really arent as scary as they let on 😄
22:59:23FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iXV
22:59:38FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iXV" => "https://play.nim-lang.org/#ix=4iXW"
22:59:47FromDiscord<albassort> (edit) "https://play.nim-lang.org/#ix=4iXW" => "https://play.nim-lang.org/#ix=4iXX"
23:00:04FromDiscord<albassort> @ElegantBeef do you like how i implemented a serialized bitfield
23:00:40FromDiscord<Elegantbeef> Message is invisible here sadly
23:01:05FromDiscord<albassort> sent a code paste, see https://play.nim-lang.org/#ix=4iXX
23:01:43FromDiscord<Elegantbeef> Was `cast[uint8](a)` too difficult?
23:02:04FromDiscord<albassort> how...
23:02:06FromDiscord<albassort> what
23:02:15FromDiscord<Elegantbeef> What?
23:02:20FromDiscord<albassort> how would that work
23:02:28FromDiscord<Elegantbeef> `set[Number]` with 4 entries is the size of 8 bits
23:02:45FromDiscord<Elegantbeef> `cast[uint8](mySet)` will give you the uint8 of that bitset
23:05:09FromDiscord<Elegantbeef> @guzba\: i couldnt help myself to make a less allocating version of your URI parser that works on devel only 😄
23:05:11FromDiscord<Elegantbeef> https://github.com/beef331/webby/blob/master/src/webby.nim
23:05:52FromDiscord<Elegantbeef> It
23:05:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4iY0
23:06:18FromDiscord<Elegantbeef> Ah nvm it is
23:06:28FromDiscord<Elegantbeef> Misread it earlier
23:07:17FromDiscord<albassort> i hate that your solution works
23:07:39FromDiscord<Elegantbeef> I mean that's what cast is for
23:08:48FromDiscord<albassort> deducing complex types to integers?
23:08:57FromDiscord<albassort> (edit) "deducing" => "reducing"
23:09:04FromDiscord<Elegantbeef> Reinterpreting a data into other data
23:09:33FromDiscord<albassort> I guess i never thought of it for this usecase because you are guaranteed to know the size
23:09:37FromDiscord<Elegantbeef> `set[Number]` is just a bitset which is a high level abstraction over `1 or 2 or 4 or 8 ...`
23:10:01FromDiscord<albassort> (edit) "I guess i never thought of it for this usecase because you are ... guaranteedusually" added "not" | "notguaranteed to know the size ... " added "usually"
23:10:20FromDiscord<albassort> i wonder if i can cast this massive sequence to an int
23:10:32FromDiscord<Elegantbeef> Internally it's just either a uint8 or a an `array[size, uint8]`
23:11:30FromDiscord<albassort> oh only certain types of fixed size can be cast to integers
23:11:58FromDiscord<Elegantbeef> I mean technically you can cast anything to anything if Nim says so
23:12:17FromDiscord<Elegantbeef> But it's an 'unsafe' operation that you should only do if you know what you're doing
23:18:21*ltriant joined #nim
23:53:33arkanoidis it possible to call fieldPairs on a "ptr Foo" ? I've tried with fieldPairs(foo) and fieldPairs(foo[]) but in both cases in wont compile
23:54:27FromDiscord<Elegantbeef> The latter should work if it's not an object variant
23:56:26FromDiscord<guzba> In reply to @Elegantbeef "<@318284269908918273>\: i couldnt help": ah works on on devel is a bummer. without having looked closely yet could the same ideas work without devel or is it critical?
23:56:47FromDiscord<guzba> less allocations is never a bad thing
23:56:53arkanoidmmm, if you say so, I'll dig deeper
23:57:26FromDiscord<Elegantbeef> Replace all `toOpenArray` with the string variants of `parseX` and yea it works with standard
23:59:40FromDiscord<Elegantbeef> The `openarray[char]` variants in devel are just nicer since they actually move the start of the `openarray[char]` up instead of make you think about the entire string