<< 28-04-2022 >>

00:34:42FromDiscord<Alea> Why does the div throw an error that size is immutable, but not the mult? https://media.discordapp.net/attachments/371759389889003532/969033885616832602/unknown.png
00:43:22FromDiscord<demotomohiro> !eval echo typeof( 7 / 3)
00:43:25NimBotfloat
00:44:02FromDiscord<demotomohiro> !eval echo typeof(7 div 3)
00:44:05NimBotint
00:46:18FromDiscord<Alea> no idea why this is ok but the other way isn't https://media.discordapp.net/attachments/371759389889003532/969036805150236702/unknown.png
00:48:14FromDiscord<demotomohiro> In Nim, operator / always return float type like python.
00:49:47FromDiscord<demotomohiro> If font.size and scale are `int` type and you want int division, you need to use `div` binary operator.
00:50:09FromDiscord<Alea> font.size is a float
00:50:13FromDiscord<Alea> so is scale
00:53:06FromDiscord<huantian> could you try to reproduce it?
00:54:51FromDiscord<Alea> what was the nim playground beef used? the official one is broken
00:56:36FromDiscord<demotomohiro> Is this beef used one?↵https://wandbox.org/
00:56:42FromDiscord<Alea> yeah
00:59:11*noeontheend joined #nim
01:03:24FromDiscord<Alea> can't get that compiler to not throw an "expression expected" error↵too tired ig, so I'll come back to it tomorrow
01:08:59FromDiscord<huantian> In reply to @Alea "what was the nim": huh it's fine for me
01:12:08FromDiscord<ElegantBeef> I swear i'm going to kill the matrix bridge myself if i have to
01:12:21FromDiscord<ElegantBeef> Anyway yes i use wandbox when the playground dies
01:13:17FromDiscord<ElegantBeef> Post the full error if you havent gone yet 😄
01:23:03*arkurious quit (Quit: Leaving)
01:29:39*noeontheend quit (Ping timeout: 276 seconds)
01:30:51FromDiscord<!Patitotective> In reply to @ElegantBeef "I swear i'm going": its nice to see another dog pfp time to time
01:31:46FromDiscord<Elegantbeef> Except that's the more annoying one 😛
01:38:01FromDiscord<spoon> In reply to @Alea "what was the nim": what's wrong with the official one?
01:40:06FromDiscord<Elegantbeef> It occasionally goes down and you need to get pmunch to reboot it, but other than that it only accepts a single file
01:40:39FromDiscord<spoon> ah
01:40:56FromDiscord<spoon> i did `echo NimVersion` on wandbox and it is using 1.6.4
01:41:00FromDiscord<spoon> even replit doesn't have that
01:42:47FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3Wr2
01:42:50FromDiscord<spoon> oh that did not format very good at all
01:43:05FromDiscord<Elegantbeef> TIHI
01:43:23FromDiscord<spoon> but there has to be a better way to do that, doing wave function collapse and need to specify each adjacent tile
01:44:34FromDiscord<Elegantbeef> I'd personally make an iterator that yields the neighbour tiles
01:44:56FromDiscord<spoon> yea, keep forgetting about iterators and my mind went to templates
01:44:59FromDiscord<Elegantbeef> Dont really know why the tile stores it's neighbours
01:45:18FromDiscord<Elegantbeef> Well it'd be `toSeq(myTile.neighbours)` or w/e
01:45:54FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Wr4
01:46:46*irfanns joined #nim
01:46:53FromDiscord<spoon> ye, reference passing into an iterator, didn't know if that would be best practice or not
01:47:11FromDiscord<spoon> haven't used iterators at all, how would that work?
01:47:12FromDiscord<Elegantbeef> Eh the best practice is the simples code
01:47:22FromDiscord<demotomohiro> When you find wandbox doesn't provde latest Nim version, you can send Pull request like this: https://github.com/melpon/wandbox-builder/pull/113↵Just add new version number to `.github/workflows/build.yml`.
01:47:40FromDiscord<spoon> ah
01:47:54FromDiscord<spoon> where can i do that to replit :\
01:47:54FromDiscord<Elegantbeef> ` for (lastIndex, nextIndex) in world.tilesInDir(start, direction):`
01:48:09FromDiscord<Elegantbeef> Iterators are used just like procedure calls
01:48:14FromDiscord<Elegantbeef> There isnt anything special
01:49:03FromDiscord<Elegantbeef> Iterators are actually preferred in `for` loops and as such you do slices cheaper if you use `[]` for instance
01:50:18FromDiscord<Elegantbeef> Well you can do slices cheaper if you make a `[]` iterator 😄
01:50:47FromDiscord<huantian> In reply to @spoon "where can i do": you can probably spin up a NixOS instance on replit, add unstable nixpkgs and get nim 1.6.4 from there
01:50:52FromDiscord<huantian> since they use nixos in the backend
01:51:31FromDiscord<spoon> hm, my issue is i need to clarify each possible neighbor manually
01:51:52FromDiscord<Elegantbeef> This is a square grid no?
01:52:00FromDiscord<Elegantbeef> If so there is no reason to store this information on the object
01:52:27FromDiscord<Elegantbeef> Just iterate the surrounding tiles either in a cross or all around
01:53:13FromDiscord<spoon> well, wave function collapse takes possible neighbors, once one is "collapsed" it communicates it to the neighbors so they can reduce their possible tiles, repeat etc
01:53:28FromDiscord<Elegantbeef> It doesnt need to communicate to them though
01:53:40FromDiscord<spoon> wdym?
01:54:02FromDiscord<Elegantbeef> Afaik the way it works is a random pick of the tile then a random paint of the tile with the valid tiles
01:55:27FromDiscord<spoon> yeah, you can pick a random tile and then give it a random sprite, but then it needs to remove the tiles that don't align from its neighbors, then its neighbors need to remove non-aligning tiles from their neighbors, etc
01:56:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Wr5
01:56:05FromDiscord<Elegantbeef> It doesnt need to remove any neighbours
01:56:09*noeontheend joined #nim
01:56:16FromDiscord<Elegantbeef> You're thinking of the problem wrong
01:56:34FromDiscord<Elegantbeef> The valid tile is the overlap of all neighbours, this can be reasoned when attempting to paint a tile
01:56:48FromDiscord<Elegantbeef> You do not need to propagate this as you go
01:57:59FromDiscord<spoon> well, currently i'm just assigning possible neighbors to each sprite
01:58:15FromDiscord<spoon> are you familiar with wfc?
01:58:33FromDiscord<Elegantbeef> I've briefly watched a video about it so i'm an expert
01:58:52FromDiscord<spoon> was it by the guy who implemented it in godot?
02:02:01FromDiscord<spoon> sent a code paste, see https://paste.rs/St5
02:03:11FromDiscord<spoon> sent a code paste, see https://play.nim-lang.org/#ix=3Wr8
02:05:30FromDiscord<spoon> what's the colon syntax for procedures with multiple arguments?
02:05:59FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Wr9
02:07:10FromDiscord<spoon> guess i'll just get sidetracked reading dsl source code
02:12:59FromDiscord<Elegantbeef> WFC done in 63 loc
02:13:06FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Wra
02:13:51FromDiscord<Elegantbeef> Shit never mind i fucked something up
02:14:31FromDiscord<spoon> https://media.discordapp.net/attachments/371759389889003532/969059006087852052/unknown.png
02:14:43FromDiscord<Elegantbeef> Like i said i fucked something up
02:15:36FromDiscord<spoon> how heck you make things so fast
02:19:38FromDiscord<spoon> what i am currently working on was something similar to <https://bolddunkley.itch.io/wfc-mixed> where you're capable of selecting a tile and clicking the option you want to collapse, and it will automatically collapse single possibilities
02:19:40FromDiscord<Elegantbeef> Guess the proper way to do this is to propagate from the first place tile instead of random darting every time
02:22:47*termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in)
02:24:51*termer joined #nim
02:30:06FromDiscord<Elegantbeef> https://play.nim-lang.org/#ix=3Wrd here we go
02:36:25FromDiscord<spoon> havent used sets before
02:36:36FromDiscord<spoon> and what does multiplying a set on line 64 do?
02:36:42FromDiscord<Elegantbeef> It's a union
02:36:59FromDiscord<Elegantbeef> `` is the union between two sets so only overlap survives
02:37:53FromDiscord<spoon> ah
02:38:02*oisota quit (Quit: The Lounge - https://thelounge.chat)
02:38:05FromDiscord<spoon> that's useful
02:39:37*noeontheend quit (Ping timeout: 272 seconds)
02:39:56FromDiscord<Elegantbeef> In the case of the `set[0..WorldArea]` that will only work if the area is sub uint16, but really it's not ideal if it gets relatively large
02:40:13FromDiscord<spoon> what's going on on line 49?
02:40:29FromDiscord<spoon> should probably read about sets
02:40:39*oisota joined #nim
02:40:47FromDiscord<Elegantbeef> Integer sets are limited to a range of 65k
02:40:53FromDiscord<Elegantbeef> AS such you need to make a set of a range
02:41:01FromDiscord<Elegantbeef> In this case we only need 0..WorldSize
02:41:56FromDiscord<spoon> not very familiar with the curly braces or the start keyword either
02:42:04FromDiscord<Elegantbeef> start isnt a keyword
02:42:07FromDiscord<Elegantbeef> It's a variable
02:42:14FromDiscord<Elegantbeef> Curly braces is the nim set constructorr
02:42:47FromDiscord<spoon> oh, start is the argument for generate gotcha
02:43:10FromDiscord<Elegantbeef> Yea it really should've been done internally but i was being lazy 😄
02:45:12FromDiscord<spoon> so how does start impact range? still a bit unclear on how that works
02:45:41FromDiscord<Elegantbeef> It's a type conversion
02:46:03FromDiscord<Elegantbeef> `range[0..WorldArea] start` converts `start` to a checked `range[0..WorldArea]`
02:46:45FromDiscord<spoon> oh right, since range is a type
02:46:48FromDiscord<Elegantbeef> It's needed for the set construction cause like i said it doesnt have a range
02:47:51FromDiscord<Elegantbeef> You can drop the type annotation i just forgot
02:48:05FromDiscord<Elegantbeef> This was after all hastily written to showcase how to more eloquently solve this
02:52:16FromDiscord<spoon> this collapses by checking each space in order, right?
02:52:46FromDiscord<Elegantbeef> Yes
02:53:09FromDiscord<Elegantbeef> You could use random indices and it'd also work
02:53:25FromDiscord<spoon> ah alright
02:53:39FromDiscord<spoon> thanks
03:18:55*irfanns quit (Ping timeout: 256 seconds)
03:23:19*irfanns joined #nim
03:28:07ZectbumoI'm reading up on nim and it seems nim has been the language I've been wishing for for about 14 years ago and I just saw nim was made 14 years ago :P
03:29:03Zectbumo2008 because I remember it being right after the first iPhone was released
03:29:45Zectbumobut what a bummer that I just now heard about this. maybe for the better since I'm presuming it's more stable and usable now and the community has grown
03:32:07FromDiscord<Elegantbeef> Welcome, hope you have fun here 😄
03:34:28Zectbumothx, I come from python 2, loved it, and I went into python 3 recently, I'm hating it. so now I'm looking for that dream language I wanted and found this nice looking language with lots of promises. thx, so what are the typical gotchas here?
03:34:56Zectbumooh, and I looked at Rust, but I don't think it's going to be my cup of tea
03:35:41Zectbumoand I had a requirement that the language must have await and supported on openbsd. nim checks both
03:35:59FromDiscord<Elegantbeef> Nim's await is done in macros 😛
03:36:14Zectbumono prob there. as long as it works as expected
03:36:28Zectbumovery cool, btw
03:37:27FromDiscord<Alea> In reply to @ElegantBeef "Post the full error": Made a note to myself to do it tomorrow <:meow_sleep:817830639700017182>
03:37:31ZectbumoI'm used to await in javascript and I didn't really get it in python
03:38:43FromDiscord<huantian> I thought python async/await was pretty decent imo
03:38:58FromDiscord<Elegantbeef> For the gotchas it's going to be about tagged unions and static types are static types 😄
03:39:43FromDiscord<deadmeme77> Is there a way to refer to another nim source code in a different dictionary without compiling or using nimble install on it?
03:40:42FromDiscord<Elegantbeef> different dictionary?
03:44:08FromDiscord<deadmeme77> sorry, I meant directory
03:45:33FromDiscord<Elegantbeef> You mean aside from `--nimblePath:path/to/my/code`?
03:45:42FromDiscord<Elegantbeef> Dont really get the question
03:45:47FromDiscord<Elegantbeef> If you want to use Nim code you import it
03:52:24FromDiscord<deadmeme77> I see import /dir1/dir2/othercode.nim works?
03:52:32FromDiscord<Elegantbeef> Yes
03:52:43FromDiscord<deadmeme77> ok, thank you!
03:52:46FromDiscord<Elegantbeef> well it's relative
03:52:54FromDiscord<Rika> ./
03:52:57FromDiscord<Rika> Must start with dot
03:53:02FromDiscord<Rika> Or no leading slash
03:53:04FromDiscord<deadmeme77> Thanks
03:53:05FromDiscord<Rika> One or the other
03:53:35FromDiscord<Elegantbeef> I would suggest using `nimble develop` but that's between you and your god
03:53:48FromDiscord<deadmeme77> wait, if the main .nim file is in, say, dir1↵and the library is in dir2/dir3↵should I write ./dir2/dir3/library.nim↵or dir1/dir2/dir3/library.nim?
03:54:29FromDiscord<Elegantbeef> the latter is more idiomatic
03:54:34FromDiscord<Elegantbeef> Assuming `dir1` is a subdir next to `main.nim`
03:54:39FromDiscord<Elegantbeef> nim's modules use file paths for importing logic
03:54:56FromDiscord<Zectbumo> @ElegantBeef why does it say BOT on your name?
03:54:57FromDiscord<Elegantbeef> A module in a subdir has that subdir's name in it's import path
03:55:12FromDiscord<Elegantbeef> I'm using the matrix protocol which is bridged to discord
03:55:19FromDiscord<deadmeme77> In reply to @Zectbumo "<@145405730571288577> why does it": he's talking to us through a bridge, either matrix, gitter, or IRC
03:55:39FromDiscord<Zectbumo> hmm matrix, never heard of it
03:55:50FromDiscord<Elegantbeef> Or i'm a sophisticated bot programmed with the turing test beating Nim AI library 😛
03:56:10FromDiscord<Zectbumo> that's what I hoping 😄
03:56:21FromDiscord<Zectbumo> one day...
03:56:23FromDiscord<Elegantbeef> It's a modern multimedia messaging protocol
03:56:27FromDiscord<deadmeme77> GPT-nim-j
03:56:35FromDiscord<Zectbumo> do you recommend it?
03:56:48FromDiscord<Elegantbeef> I prefer FOSS to proprietary software so yes
03:56:56FromDiscord<deadmeme77> btw just saw that the topic in IRC is still saying "Latest version 1.6.0", just saying
03:58:06FromDiscord<Zectbumo> hey how come nim isn't on the language list 😛 https://matrix.org/docs/projects/try-matrix-now/
03:58:29FromDiscord<Elegantbeef> Cause the matrix sdk isnt sufficiently developped
03:58:34FromDiscord<Elegantbeef> Consider contributing to see it there 😛
03:58:50FromDiscord<Elegantbeef> https://github.com/dylhack/matrix-nim-sdk 😉
03:59:05FromDiscord<Elegantbeef> Though https://github.com/tandy-1000/simple-matrix-client is made using that
03:59:15FromDiscord<Zectbumo> really? they sure have a lot of languages for not having a decent sdx
03:59:44FromDiscord<Elegantbeef> I dont know I dont touch the sdk
03:59:57FromDiscord<deadmeme77> Well, early adopters of Matrix are mostly programmer-adjacent...
04:00:03FromDiscord<Zectbumo> lol tandy 1000. that was actually my first computer
04:10:03FromDiscord<Elegantbeef> How dare you insult me↵(@deadmeme77)
04:11:48FromDiscord<Josef> I have read↵ https://lilybon.medium.com/binary-function-hooking-via-dll-injection-nim-ghidra-b90a53570718
04:12:13FromDiscord<Josef> Is it actually a good idea to use Nim for api hooking?
04:12:48FromDiscord<Elegantbeef> I mean you can, given the malicious usage of this idea, i have to say no 😛
04:13:57FromDiscord<Josef> I had the idea that it's important to use the same language and compiler as the source, in order to have ABI compatibility.
04:14:39FromDiscord<Elegantbeef> Eh you can declare everything compatible
04:14:48*duuude quit (Ping timeout: 248 seconds)
04:15:10FromDiscord<Josef> Sure, but question is how much pain you will suffer in the process.
04:15:23FromDiscord<Elegantbeef> No clue I dont do malicious things 😛
04:16:22FromDiscord<Josef> I don't do either. My usecase is modding of an ancient game.
04:16:48FromDiscord<Elegantbeef> Ah well you just write everything with `cdecl` and c types instead of Nim tyles
04:16:51FromDiscord<Elegantbeef> Atleast afaik
04:16:55FromDiscord<Elegantbeef> types\
04:19:13FromDiscord<deadmeme77> In reply to @Elegantbeef "How dare you insult": I was describing myself to be fair but haha sorry I just realise it could be taken as a hostile joke as well
04:19:32FromDiscord<Josef> Hm, but what if I want to use more complex types from C++ stdlib like string or vector?
04:19:51FromDiscord<Elegantbeef> You can include them 😄
04:20:05FromDiscord<Elegantbeef> Nim has C++ interop
04:21:20FromDiscord<Josef> Hm, that sounds simple.
04:22:33FromDiscord<Josef> Doesn't it require something like rust unsafe blocks?
04:22:45FromDiscord<Elegantbeef> Nim doesnt have unsafe blocks
04:22:52FromDiscord<Elegantbeef> It's unsafe logic is a like 6 keywords
04:23:49FromDiscord<Elegantbeef> https://scripter.co/binding-nim-to-c-plus-plus-std-list/ will interest you
04:24:19FromDiscord<Josef> Finally, the author mentions api patching at the end, as a potentially simpler solution.
04:24:37FromDiscord<Josef> I feel like it also fits better my usecase.
04:25:11FromDiscord<Josef> As I can distribute self-contained executable.
04:25:30FromDiscord<Elegantbeef> Clearly the solution is to reimplement the old game 😄
04:25:33FromDiscord<Elegantbeef> What's the game anywho?
04:26:09FromDiscord<Josef> But there was no followup post, and I was not able to google it. Api patching returns garbage.
04:26:27FromDiscord<Josef> Any idea what's the correct term?
04:28:04FromDiscord<Josef> In reply to @Elegantbeef "What's the game anywho?": HeroesV (might&magic).
04:28:30FromDiscord<Elegantbeef> Time to reimplement it 😜
04:28:56FromDiscord<Josef> In reply to @Elegantbeef "Clearly the solution is": Fortunately, the scope of the modifications is small :D
04:29:44FromDiscord<spoon> lol actually saw a nim repo that was literally a gui for dll injections before
04:30:15FromDiscord<Josef> But I know projects which aim to reimplement games by API hooking one method at a time.
04:31:51FromDiscord<morgan> In reply to @Zectbumo "I'm reading up on": oh wow i had no clue nim had been around so long
04:33:14FromDiscord<Josef> In reply to @spoon "lol actually saw a": Link?
04:33:40FromDiscord<spoon> In reply to @Josef "Link?": <https://github.com/srozb/parasite>↵not i have not used it at all
04:33:44FromDiscord<spoon> (edit) "<https://github.com/srozb/parasite>↵not" => "<https://github.com/srozb/parasite>↵note"
04:35:10FromDiscord<Josef> Ah, that's not very useful for me, but cool project nevertheless.
04:35:42FromDiscord<spoon> yeah, it might still be useful to see its implementation
04:43:48FromDiscord<impbox [ftsf]> is there a way to convert TimeInterval to a Duration?
04:46:17FromDiscord<impbox [ftsf]> or specifically, I want to get the number of nanoseconds between now and a specific DateTime
04:47:32FromDiscord<Elegantbeef> `myTime + myInterval - myType`?
04:47:37FromDiscord<Elegantbeef> `- myTime` 😄
04:47:51*slowButPresent quit (Quit: leaving)
04:49:42FromDiscord<Elegantbeef> Also where did you get the time interval?
04:50:07FromDiscord<impbox [ftsf]> DateTime (target) - DateTime (now) -> TimeInterval
04:50:29FromDiscord<impbox [ftsf]> oh wait...
04:50:49FromDiscord<impbox [ftsf]> I guess I misread
04:52:27*irfanns quit (Ping timeout: 276 seconds)
04:52:37FromDiscord<impbox [ftsf]> awesome, thanks!
05:15:28FromDiscord<narimiran> A new 1.6.6 RC is available, please give it a try:↵https://forum.nim-lang.org/t/9100#59572
05:23:07rockcaveranarimiran, why was the commit 8bfc396a4dfa722239818f399a119452a53fe07f not added to this release candidate?
05:24:36FromDiscord<narimiran> In reply to @rockcavera "<@719992187890434069>, why was the": it wasn't marked as `[backport]`. i'll check with araq if it should be part of the final release
05:25:45rockcaveraI understand and thanks for the answer
05:32:08FromDiscord<-|-> In reply to @Elegantbeef "I mean you can,": I've done API hooking for "legit" reasons—usually enabling game modding
05:32:26FromDiscord<-|-> or debugging proprietary software that hates debuggers
05:33:50FromDiscord<Rika> We’re just wary of malware writers because they’ve been more common lately
05:34:25FromDiscord<-|-> Do malware writers really come here and ask "how can I write this malware"?
05:35:13FromDiscord<Josef> In reply to @-|- "I've done API hooking": Have you done it in Nim or C++?
05:35:13FromDiscord<Elegantbeef> They ask questions that relate to writing malicious code yes
05:35:23FromDiscord<-|-> In reply to @Josef "Have you done it": Only in C
05:36:33*duuude joined #nim
05:37:46FromDiscord<-|-> In reply to @Elegantbeef "They ask questions that": ... I'm not sure why they'd think that'd work
05:43:53FromDiscord<Rika> In reply to @-|- "Only in C": Let me guess, it’s related to visual novels
05:56:19FromDiscord<-|-> In reply to @Rika "Let me guess, it’s": Sorry, it wasn't a texthooker.
06:03:21*duuude quit (Quit: Konversation terminated!)
06:03:28FromDiscord<Rika> In reply to @-|- "Sorry, it wasn't a": :KannaKMS:
06:03:36*duuude joined #nim
06:04:45*jjido joined #nim
06:19:18FromDiscord<2F42BBA1> In reply to @Rika "Let me guess, it’s": I know a guy who reimplements RenPy on Zig
06:19:20FromDiscord<2F42BBA1> lol
06:33:19*rockcavera quit (Remote host closed the connection)
06:42:36FromDiscord<konsumlamm> In reply to @Elegantbeef "It's unsafe logic is": may i introduce you to the shift operators?
06:42:58FromDiscord<Elegantbeef> How are they unsafe?
06:43:08FromDiscord<Elegantbeef> I guess there is possible UB
06:49:36*PMunch joined #nim
06:51:06FromDiscord<konsumlamm> ye, they just use the C shift operators under the hood, which have UB when the shift is bigger than the bit size
06:53:09FromDiscord<Rika> Sounds fun
06:53:18FromDiscord<Rika> I remember dealing with that UB before
06:53:28FromDiscord<Rika> Though it wasn’t with Nim
06:53:33FromDiscord<morgan> huh interesting
07:02:07PMunchHmm, I see in the logs that the playground was apparently down tonight
07:02:22PMunchBut it's up now and I didn't touch it..
07:26:01FromDiscord<2F42BBA1> Can I use readline on playground?
07:26:49FromDiscord<Rika> No
07:26:55FromDiscord<Rika> Use wandbox for such
07:27:08FromDiscord<⎝⪩﹏⪨⎠> ? https://media.discordapp.net/attachments/371759389889003532/969137678610202634/unknown.png
07:27:20FromDiscord<Rika> In reply to @2F42BBA1 "Can I use readline": https://wandbox.org
07:28:03FromDiscord<⎝⪩﹏⪨⎠> In reply to @⎝⪩﹏⪨⎠ "?": Last time worked at first attempt.
07:28:34FromDiscord<⎝⪩﹏⪨⎠> It seems my system is really fucked up.
07:28:48FromDiscord<⎝⪩﹏⪨⎠> And is freshly install.
07:29:01PMunch@Rika, you can use readLine, just not stdin.readLine
07:29:34FromDiscord<Rika> What would you read a line out of
07:30:20FromDiscord<⎝⪩﹏⪨⎠> Why can't I install choosenim?
07:31:13PMunch@Rika, a file?
07:34:32FromDiscord<Rika> And how would you get that file on the playground
07:35:34FromDiscord<⎝⪩﹏⪨⎠> Ok seems nobody is gonna help me again.
07:35:42FromDiscord<⎝⪩﹏⪨⎠> I hate being a programming noob.
07:36:29FromDiscord<2F42BBA1> In reply to @Rika "https://wandbox.org": thanks
07:36:46*duuude quit (Read error: Connection reset by peer)
07:38:08FromDiscord<enthus1ast> @⎝⪩﹏⪨⎠\: maybe update ssl
07:38:17FromDiscord<enthus1ast> no idea sorry
07:38:43FromDiscord<enthus1ast> or update the whole system
07:38:52FromDiscord<⎝⪩﹏⪨⎠> In reply to @enthus1ast "<@438504181876129803>\: maybe update ssl": https://media.discordapp.net/attachments/371759389889003532/969140629332439040/unknown.png
07:39:09FromDiscord<⎝⪩﹏⪨⎠> Everybody is telling me to re-install again the whole OS.
07:39:50FromDiscord<enthus1ast> and updateing your whole system?
07:41:26FromDiscord<⎝⪩﹏⪨⎠> Nothing to update. https://media.discordapp.net/attachments/371759389889003532/969141276366753792/unknown.png
07:53:46*duuude joined #nim
07:58:31*Arrrrrrr joined #nim
08:01:54FromDiscord<2F42BBA1> `k:=((2a+b(c-1))/2)c;`↵↵how this pascal formula will look like in nim?
08:02:16FromDiscord<Elegantbeef> The same
08:02:28FromDiscord<Rika> The same except for the := ?
08:02:43FromDiscord<Phil> All of them forgetting the semicolon at the end !
08:02:46FromDiscord<2F42BBA1> like i just set var = and here goes formula?
08:02:46PMunchAnd with a couple extra *'s
08:02:53FromDiscord<Rika> The semicolon is valid in Nim
08:02:55FromDiscord<Elegantbeef> `var k = ((2 a + b (c - 1)) / 2) c`
08:02:59FromDiscord<Phil> Heresy!
08:03:08FromDiscord<2F42BBA1> thx
08:03:14FromDiscord<Rika> In reply to @PMunch "And with a couple": Bridge ate them for you
08:03:15FromDiscord<Elegantbeef> Pmunch is on irc he gets bad asterixs
08:03:26FromDiscord<Rika> Asterisk, it’s spelled
08:03:27PMunchOh..
08:03:32PMunchSilly bridge..
08:03:37FromDiscord<Phil> It's Asterix
08:03:41FromDiscord<Phil> For sure
08:03:45FromDiscord<Phil> Definitely
08:03:49FromDiscord<Elegantbeef> Yea I ruined my spelling due to asterix
08:03:50FromDiscord<Rika> Lmao
08:03:59FromDiscord<Rika> I don’t know where that comes from
08:04:06FromDiscord<Phil> Ohhhh
08:04:14FromDiscord<Elegantbeef> It's a comic book series
08:04:22FromDiscord<Phil> I think it's decently famous at least in europe, not sure about the US
08:04:37FromDiscord<Phil> In germany and france basically everyone has at least heard of it once
08:05:10FromDiscord<Rika> I don’t live in either of those continents
08:05:25FromDiscord<enthus1ast> I have Asterix "Babbelt Hessisch", Asterix with terrible Hessisch accent
08:05:26FromDiscord<Phil> It's ancient though, like 1960's ancient, though stuff is still being published I think
08:05:41FromDiscord<Elegantbeef> hell there are games 😄
08:05:54FromDiscord<enthus1ast> and Movies \:)
08:06:04FromDiscord<Phil> Basically an IP that is strong in Europe and not sure about anywhere else
08:06:24FromDiscord<Elegantbeef> I've seen some books in Canada afterall it's what ruined my spelling 😄
08:08:19FromDiscord<Elegantbeef> Anyway it's relatively similar in Nim
08:14:36*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
08:16:33FromDiscord<deadmeme77> @⎝⪩﹏⪨⎠ hey I'm using popOS too and I could install choosenim from the sh 🤔
08:16:57FromDiscord<⎝⪩﹏⪨⎠> In reply to @deadmeme77 "<@438504181876129803> hey I'm using": As I said:
08:17:07FromDiscord<⎝⪩﹏⪨⎠> In reply to @⎝⪩﹏⪨⎠ "It seems my system": .
08:17:10FromDiscord<deadmeme77> Just updated to 22.04 yesterday, R went bork but everything else is fine
08:17:13FromDiscord<Elegantbeef> have you tried `sudo apt reinstall openssl`?
08:17:14FromDiscord<deadmeme77> Ah yeah, that can happen
08:17:23FromDiscord<deadmeme77> Go refresh your Pop OS installation
08:17:37FromDiscord<deadmeme77> It's in settings > software update and upgrade > refresh
08:18:04FromDiscord<deadmeme77> Basically reinstall but they maintain your files. No need to copy off /home/ to a NAS disk again
08:18:38FromDiscord<deadmeme77> In reply to @Isofruit "Basically an IP that": It's also famous here↵Asterix↵Tintin↵And uh that's it I think
08:22:07FromDiscord<⎝⪩﹏⪨⎠> In reply to @deadmeme77 "It's in settings >": What settings.
08:22:44FromDiscord<⎝⪩﹏⪨⎠> I entered to the Settings and there's no "software and upgrade".
08:26:51FromDiscord<⎝⪩﹏⪨⎠> I'll go to sleep.
08:26:58FromDiscord<⎝⪩﹏⪨⎠> Ping me before is too late.
08:27:09FromDiscord<deadmeme77> I'm napping as well. Siesta time. But uh
08:31:46FromDiscord<dom96> In reply to @⎝⪩﹏⪨⎠ "Why can't I install": See latest choosenim issue on GitHub. I think you have too new an OpenSSL.
08:32:15FromDiscord<Elegantbeef> choosenim appimage when?
08:32:48*jmdaemon quit (Ping timeout: 276 seconds)
08:32:50FromDiscord<dom96> Choosenim needs to have even lesssss dependencies
08:33:06FromDiscord<Elegantbeef> Eh appimage would solve it for the most part
08:33:58*Gustavo6046 quit (Quit: Goodbye! Leave messages at my XMPP @ [email protected] or my Discord Gustavo6046#9009 or possibly my Mastodon [email protected] – I don't check my email often since it's full of crap, but in any case, [email protected])
08:38:33FromDiscord<dom96> What even is appimage?
08:39:20FromDiscord<Elegantbeef> It's a portable linux binary format equvilent to windows portable executables
08:41:33FromDiscord<Elegantbeef> It's ideal for shipping binaries not on a package manager or with a runtime
08:41:51FromDiscord<Elegantbeef> May want to consider it and flatpak/snapcraft
08:42:03FromDiscord<Elegantbeef> But i'm just a silly person
08:42:41FromDiscord<deadmeme77> flatpak and snap has the issue of sandboxing
08:43:21FromDiscord<fbpyr> which could be disabled in flatpak
08:43:28FromDiscord<Elegantbeef> Yea
08:43:47FromDiscord<Elegantbeef> flatpak/appimage are clearly the best distribution method here
08:45:51FromDiscord<Elegantbeef> The main thing is getting a repeatable environment, the main thing with appimage is that the image was made with the earliest libc you want support since you ship all the other deps with it
08:46:08FromDiscord<Elegantbeef> So i'd say consider looking at that for a solution to your choosenim woes
08:46:19*xet7 quit (Ping timeout: 240 seconds)
08:47:02FromDiscord<dom96> Is appimage supported only by recent distros though?
08:47:26FromDiscord<dom96> Honestly the easy fix here is to just have choosenim use curl on Linux
08:47:42FromDiscord<dom96> Most users should have that installed
08:47:48FromDiscord<Elegantbeef> What do you mean by recent?
08:47:51FromDiscord<dom96> And choosenim already supports that
08:47:56FromDiscord<2F42BBA1> Already installed relax
08:48:20FromDiscord<2F42BBA1> There's should be no issue
08:48:26FromDiscord<Elegantbeef> Appimages ship a runtime so the only thing that matters is the libc version on the OS
08:48:39FromDiscord<Elegantbeef> If your libc is newer or equal to the compiled version you should mostly be fine
08:48:43FromDiscord<2F42BBA1> so better to build against something like debian xd
08:48:44FromDiscord<dom96> In reply to @Elegantbeef "Appimages ship a runtime": I see. Interesting.
08:49:08PMunchOr, and hear me out here, we add choosenim to package managers
08:49:19PMunchYou know, like Linux is supposed to work..
08:49:33FromDiscord<Elegantbeef> Flatpak might be the sanest though
08:49:48FromDiscord<Elegantbeef> It allows the easiest support to every platform
08:49:55PMunchTechnically I guess we should add Nim to package managers, but some of them are sooo slow at updating
08:50:13PMunchSo throwing choosenim in there is a good compromise
08:50:24PMunchInstead of trying to install programs on Linux the Windows way
08:50:42FromDiscord<Elegantbeef> Yea in an ideal world it'd be on a package manager but i think the best thing is to use flatpak to make it so it's 1 deployment to all users
08:51:29FromDiscord<Elegantbeef> I mean does it even solve the issue though pmunch in this case the openssl is too recent
08:52:06PMunchWell, kinda
08:52:17PMunchWe could require a certain version of SSL
08:52:32PMunchThen depending on the package manager we might be able to get the old version
08:52:38FromDiscord<2F42BBA1> Uh... What's alternative to real numbers in Nim?
08:52:39FromDiscord<Elegantbeef> Yea
08:52:47PMunchOf course the actual fix to that problem is updating the SSL version..
08:52:48FromDiscord<Elegantbeef> That's the issue it depends on the package manager allowing it
08:52:52FromDiscord<Elegantbeef> If it doesnt you're yet again SOL
08:53:06FromDiscord<2F42BBA1> It would be cool to have something like rustls
08:53:10FromDiscord<2F42BBA1> but nimtls
08:53:25FromDiscord<Elegantbeef> Eh i'm firmly in flatpak/appimage being the best solution here
08:53:26FromDiscord<Elegantbeef> Also pmunch what about my solution didnt work?
08:53:44PMunchI hate flatpak/appimage..
08:53:55FromDiscord<Elegantbeef> I did say you'd have to do `proc doGet(_: typedesc[User]): User`
08:54:08PMunchYeah, that works
08:54:15PMunchI'm working on integrating it now
08:54:23FromDiscord<Elegantbeef> Ah ok
08:54:28FromDiscord<Elegantbeef> Thought there was a big missing issue here
08:54:33PMunchIt requires me to make the type I'm trying to get available as a parameter
08:54:58FromDiscord<Elegantbeef> I guess in your case you could also just do `_: var T`
08:55:00PMunchBut the sym != sym issue is still bugging me
08:55:15FromDiscord<Elegantbeef> well not `_` but yea
08:55:20PMunchI feel like I'm doing something wrong that will fail in subtle ways, but I'm not entirely sure what..
08:55:43FromDiscord<Elegantbeef> Well i can take a glance if you want more eyes 😄
08:55:48PMunch@Elegantbeef, instead of having a return type pass in a var argument of the kind I want?
08:55:55FromDiscord<Elegantbeef> Yes
08:55:57PMunchThat's nifty but not very "royale"
08:56:24FromDiscord<Elegantbeef> Hey it was a idea for not needing the typedesc passed! 😛
08:56:49FromDiscord<Elegantbeef> also werent you comparing types?
08:56:54FromDiscord<Elegantbeef> `sameType` exists
08:56:55PMunchThis is what I have currently: http://ix.io/3Wsw
08:57:14PMunchsameType wasn't working correctly..
08:57:27FromDiscord<Elegantbeef> Yea it doesnt always
08:57:40FromDiscord<Elegantbeef> typed ast is always fucky
08:57:52PMunchIf you send me a public key I can give you access to my private Git repo
08:58:31FromDiscord<Elegantbeef> What too fancy for the manual invite?
08:59:17PMunchManual invite?
08:59:41FromDiscord<Elegantbeef> Ostensibly it's a github repo
08:59:55PMunchNah, private server
09:00:03FromDiscord<Elegantbeef> Ah
09:02:13FromDiscord<Elegantbeef> http://ix.io/3Wsy there you go mister
09:02:38madpropsElegantBeef and Rika are always here
09:02:48madpropshow much expert can you get in a language
09:02:48FromDiscord<Elegantbeef> Hey i'm soon to sleep
09:02:50FromDiscord<Rika> Not really
09:03:09FromDiscord<Elegantbeef> Always being he is a side effect of being perpetually unemployed for me
09:03:11FromDiscord<Rika> I haven’t delved into the compiler, beef has
09:03:11madprops:)
09:04:22madpropswhat did you see in the compiler?
09:04:37FromDiscord<Elegantbeef> Lots of things people forgot to implement
09:08:50madpropslots of ToDo's
09:09:00madpropsdid you push contributions to it?
09:09:25FromDiscord<Elegantbeef> There are fixes by me yes
09:09:40FromDiscord<Elegantbeef> Most of what i fix is 'X should work but doesnt'
09:10:16PMunchThere you go @Elegantbeef
09:10:28PMunchNow you should be able to clone [email protected]:deriveabletypes.git
09:10:58PMunchYou can read every branch (currently only master branch), and you can do whatever you want to branches starting with the name elegantbeef/
09:11:57PMunchOh hi madprops, been a while since I've seen you in here
09:12:02madpropshi
09:12:17madpropsdoing more talks?
09:12:21madpropsi remember you had a video up there
09:12:33madpropsyou looked younger than i imagined
09:12:45FromDiscord<Elegantbeef> Wait until madprops sees me.... wait he never will
09:12:55PMunchHaha, haven't gotten any talks planned
09:13:01madpropsthe beef podcast
09:13:14FromDiscord<Elegantbeef> When i shave i look around 12
09:13:20PMunchMy girlfriend moved in with me so streaming in the living room isn't as easy as it once was
09:13:31FromDiscord<Elegantbeef> And when i dont shave i look homeless
09:14:10madpropsmy bears get too long sometimes
09:14:14madpropsbeard even
09:14:18PMunch@Elegantbeef, I still want to give the podcast idea a try though..
09:14:51madpropsi've never done that
09:15:09FromDiscord<Elegantbeef> Yea but we're too far apart time wise
09:15:38FromDiscord<Elegantbeef> Well mostly cause i have a silly sleep schedule
09:15:45FromDiscord<Rika> It would be just as bad if you asked me either so lmao
09:16:03FromDiscord<Rika> TFW Asia-Europe-America group
09:16:09FromDiscord<Elegantbeef> Pmunch is 8 hours ahead of me, you're fewer ahead of him no?
09:16:23FromDiscord<Rika> I’m at +9, you tell me
09:16:34FromDiscord<Elegantbeef> I'm -7
09:16:37FromDiscord<Elegantbeef> He's +1 iirc
09:16:45FromDiscord<Elegantbeef> So exactly same
09:16:49FromDiscord<Rika> Lmao so we’re equally distant
09:17:28FromDiscord<Rika> We’re all equally distant from each other how delightful
09:18:11FromDiscord<Elegantbeef> To be fair it's ideal no way in hell i'd want to be closer to either of you
09:18:23madpropsif not a podcast then a book by both of you could be a nice alternative
09:18:31madpropsabout nim
09:18:36FromDiscord<Elegantbeef> Ehh the podcast would be related to tmwn
09:18:49FromDiscord<Elegantbeef> Also who wants a book by someone that's never wrote code professionally 😛
09:19:04madpropsprobably lots of people
09:20:04FromDiscord<Elegantbeef> Anyway pmunch i'll probably take a look tomorrow,
09:23:13FromDiscord<Elegantbeef> Also using assert for macros.... that's a paddling
09:25:07FromDiscord<Elegantbeef> With that i'm out of here
09:30:42*lumo_e joined #nim
09:33:34PMunch@Elegantbeef, wait, what am I supposed to use?
09:34:33PMunchI write code for a living
09:35:07PMunchAnd @Elegantbeef I think you just insulted everyone who bought Nim in Action, I don't think Dominik had started working yet by the time he wrote that book :P
09:35:20*ozzz joined #nim
09:37:21*ozzz is now known as om3ga
10:15:25FromDiscord<dom96> hah, sorry to disappoint but I was on my fourth internship by the time the book was finished. Dunno, maybe that doesn't count as writing code professionally still :P
10:59:43PMunchI mean it depends on the internship
11:00:36PMunchI got my first programming job when I was 18, didn't really count myself as a professional programmer though
11:09:41FromDiscord<Andreas> hi, i fail on zipping slices - sequtils/zip wants two openArrays ? howto make a openArray from a Slice ?
11:10:47FromDiscord<Solitude> write your own zip for slices
11:11:09FromDiscord<Solitude> Slice is just two number, openArray is a collection
11:11:17FromDiscord<Solitude> (edit) "number," => "numbers,"
11:11:41FromDiscord<Andreas> In reply to @Solitude "write your own zip": ok, nice, i'll try that - would you recommend a macro or a template ?
11:11:50FromDiscord<Solitude> a function or iterator
11:12:03FromDiscord<Solitude> the hell you need templates for
11:13:11FromDiscord<Andreas> thx `toSeq( 0..list.high() )` does is
11:13:20FromDiscord<Andreas> (edit) "is" => "it for me"
11:13:29FromDiscord<Solitude> ...
11:18:51ArrrrrrrDo you mean you want to convert 1 .. 5 into @[1, 2, 3, 4, 5] ?
11:25:48FromDiscord<Josef> Who came up with `when, elif, else`.
11:26:45PMunch@Josef, just reusing the same keywords to not have to introduce too many new one
11:27:56ArrrrrrrProbably Araq, he is the architect of Nim. Before him there was only darkness.
11:30:30FromDiscord<Solitude> amazing performance from irc bridge
11:39:37PMunch@Solitude, huh?
11:41:08FromDiscord<Solitude> https://media.discordapp.net/attachments/371759389889003532/969201595504013372/unknown.png
11:43:44PMunchHmm, messages out of order? Or did you lose a message?
11:45:41Arrrrrrrlol
11:45:53ArrrrrrrReally confusing.
11:50:54FromDiscord<eyecon> Quick question: I have a string with a length of at least 8. The following is OK, right?↵↵`cast[uint32](frameContents[4..7])`
11:51:31FromDiscord<Solitude> no
11:52:14FromDiscord<Solitude> string[a..b] returns new string
11:52:59FromDiscord<Solitude> just write a function that copymems the contents into uint32
11:53:27FromDiscord<eyecon> In reply to @Solitude "string[a..b] returns new string": But even so, wouldn't it work?
11:53:31FromDiscord<Solitude> no
11:53:32PMunchOr you could do `cast[ptr uint32](frameContents[4].addr)[]`
11:53:50FromDiscord<Solitude> In reply to @PMunch "Or you could do": this is the closest to your code
11:53:58PMunch@eyecon, casting a string like that won't work, strings in Nim are not like strings in C
11:54:11FromDiscord<eyecon> In reply to @PMunch "Or you could do": Thanks! Any downsides I should be aware of?
11:54:14PMunchThey have a size and a capacity field, which is all you would get if you cast it
11:55:00PMunch@eyecon, well it's unsafe, if the string is deallocated the pointer won't be valid any longer. But since you're creating a uint32 that should be fine since it's a value
11:55:55FromDiscord<eyecon> But I cannot assign this cast pointer to an uint32 field, right? I should dereference that?
11:56:26FromDiscord<eyecon> I have a new object with a field I'll be assigning this to.
11:56:32FromDiscord<Solitude> if you look carefully at the snippet, it already dereferences
11:57:02FromDiscord<eyecon> In reply to @Solitude "if you look carefully": Ah, I'm on mobile and didn't see the last two characters, my bad
11:57:11FromDiscord<eyecon> Thanks a lot, both of you
11:57:48PMunchNo problem
11:59:09FromDiscord<eyecon> In reply to @Solitude "if you look carefully": I thought there was a character which is not supported on mobile (a box) https://media.discordapp.net/attachments/371759389889003532/969206128854593536/Screenshot_2022-04-28-14-57-59-796_com.discord.png
11:59:18FromDiscord<eyecon> 😬
11:59:38FromDiscord<Rika> Cursed, your phone shows what is supposed to be in monospace in sans serif
11:59:52FromDiscord<eyecon> In reply to @Rika "Cursed, your phone shows": Yes! That annoys me to no end
12:00:59FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3Wte
12:03:30*acidsys left #nim (One channel less.)
12:04:33FromDiscord<jmgomez> I guess I can make a var or something and do tree.add() but would be nice to know if there is a way to do it inline
12:06:04PMunch@eyecon, haha well that's a dumb font
12:07:01PMunch@jmgomez, not quite sure what you mena
12:07:03PMunchmean*
12:09:40FromDiscord<jmgomez> In reply to @PMunch "<@726017160115126333>, not quite sure": if there somehow a way to expand a seq[NimNode] righ there, like i.e. if they were just strings you could reduce/fold via concatenate them with "," not sure if there is a concatenate operation for NimNodes where you can join them together (aka treat them as monoids)
12:10:11PMunchYou can create a new statement list
12:10:17PMunchThose can go in a lot of places
12:11:09FromDiscord<jmgomez> okay, will look into those, thanks!
12:18:32*derfflinger joined #nim
12:30:24*slowButPresent joined #nim
12:50:48*derfflinger left #nim (Leaving)
12:52:01*Zectbumo quit (Remote host closed the connection)
12:58:56FromDiscord<narimiran> In reply to @rockcavera "I understand and thanks": it will most likely be a part of a future release (1.6.8)
13:05:06FromDiscord<Zodey> how can i add -d:ssl compiler flag to "nimble run"?
13:05:57PMunchIf you program requires -d:ssl you should put in in a mymodule.nims file
13:07:09FromDiscord<Zodey> In reply to @PMunch "If you program requires": i dont have that
13:07:14FromDiscord<Zodey> i used nimble init
13:07:38FromDiscord<Zodey> and i only have a .nimble with a src dir
13:09:37FromDiscord<Yardanico> In reply to @Zodey "i dont have that": you can just create that
13:09:43FromDiscord<Solitude> Create it near souce file
13:09:46FromDiscord<Yardanico> nimble doesn't create it by default because it's not needed by default
13:09:49FromDiscord<Solitude> Source
13:09:52FromDiscord<Yardanico> In reply to @Solitude "Source": source?
13:09:59FromDiscord<Solitude> Surs
13:10:07FromDiscord<Zodey> i should create it in the src dir?
13:10:12FromDiscord<Yardanico> In reply to @Zodey "i should create it": yes
13:10:17FromDiscord<Yardanico> with the name `mymainname.nims`
13:10:25FromDiscord<Yardanico> so if you have `myapp.nim` you create `myapp.nims`
13:11:02FromDiscord<Zodey> "undeclared identifier: 'd'"
13:11:20FromDiscord<Solitude> --d:ssl
13:11:34FromDiscord<Zodey> "expression '--' cannot be called" XD
13:11:41FromDiscord<Solitude> Its over
13:11:43FromDiscord<Yardanico> In reply to @Zodey ""expression '--' cannot be": check the actual compilation
13:11:47FromDiscord<Yardanico> don't care about syntax errors in the vscode
13:12:10FromDiscord<Yardanico> nim check support for nims has been fixed in devel, not in stable
13:12:16FromDiscord<Zodey> its the same
13:12:23FromDiscord<Yardanico> can you show the exact contents of your .nims file?
13:12:28FromDiscord<Yardanico> and how you build the program
13:12:45FromDiscord<Zodey> In reply to @Yardanico "can you show the": https://media.discordapp.net/attachments/371759389889003532/969224650565484544/unknown.png
13:12:50FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/969224673533517884/unknown.png
13:12:53FromDiscord<Yardanico> two dashes
13:12:53FromDiscord<Zodey> In reply to @Yardanico "and how you build": nimble run
13:13:24FromDiscord<Zodey> In reply to @Yardanico "two dashes": works now, thank you very much, sorry for being noob 😅
13:13:55FromDiscord<Zodey> can i somehow remove syntax check for that file?
13:14:07FromDiscord<Yardanico> no, just ignore it or install latest nim 1.6 rc
13:14:10FromDiscord<Yardanico> (or devel)
13:14:21FromDiscord<Yardanico> https://forum.nim-lang.org/t/9100#59572
13:14:23FromDiscord<Zodey> okay, np
13:14:26FromDiscord<Zodey> i will ignore it
13:14:31FromDiscord<Zodey> thank you
13:18:36*oprypin quit (Remote host closed the connection)
13:19:46*oprypin joined #nim
13:20:31*rockcavera joined #nim
13:20:31*rockcavera quit (Changing host)
13:20:32*rockcavera joined #nim
13:30:21*arkurious joined #nim
13:31:27FromDiscord<System64 ~ Flandre Scarlet> Do I need OpenGL knowledge if I want to use the ImGUI library?
13:31:42FromDiscord<Rika> Beginner level, I believe
13:36:03FromDiscord<System64 ~ Flandre Scarlet> so I need OpenGL?
13:36:46FromDiscord<Rika> I think so but you can always opt for GLFW
13:42:13FromDiscord<System64 ~ Flandre Scarlet> what is GLFW?
13:43:37FromDiscord<Rika> Search it up, it’s a helper for OpenGL
13:43:53FromDiscord<2F42BBA1> Is there a way on Nim to create a temp file?
13:44:05FromDiscord<Solitude> std/tempfiles
13:44:09FromDiscord<2F42BBA1> gotcha
13:44:11FromDiscord<2F42BBA1> thanks
14:04:35FromDiscord<dom96> In reply to @Zodey "": use myapp.nim.cfg to avoid dealing with .nims, your `-d:ssl` will then work :)
14:05:23*rockcavera quit (Remote host closed the connection)
14:05:50FromDiscord<theduke> Hey there.↵Is there any effort to compile Nim to webassembly? More specifically with `wasi` syscall support in the standard library?
14:07:25FromDiscord<Rika> Emscripten?
14:11:54FromDiscord<theduke> No, not emscripten.
14:12:31FromDiscord<theduke> Emscripten targets the browser, I'm asking about a generic target (what clang calls `wasm32-wasi`)
14:12:55FromDiscord<theduke> wasi is a Wasm syscall interface for IO etc
14:13:09FromDiscord<Rika> Then I do not know
14:13:16FromDiscord<dom96> not familiar with anything like that for Nim
14:13:31FromDiscord<dom96> I have done some experiments to compile Nim directly to wasm
14:13:44FromDiscord<dom96> It's likely I will pursue this further soon
14:14:02FromDiscord<dom96> but I am more interested in the browser target
14:17:41FromDiscord<theduke> I guess the `nlvm` backend could also compile to wasm, but one would need to extend the standard library to support wasi.↵Even not considering `wasi`, there'd need to be a way to specify imports and exports.↵wasm imports and exports have a module name and a name.↵Wasm also supports multi-value returns, basically tuples of the primitive values (i32,i64,f32,f64), so that would probably also need some ABI compatibility work
14:19:31FromDiscord<dom96> out of curiosity, what is your use case for this?
14:20:14FromDiscord<Zodey> sent a code paste, see https://play.nim-lang.org/#ix=3Wtz
14:20:50FromDiscord<aph> yep
14:21:30FromDiscord<Zodey> cool, thanks, i came from java and i really didnt know which to use
14:21:59FromDiscord<Zodey> damm, these "mixed" languages are hard
14:22:04FromDiscord<aph> im not sure if there are standards on this, id say choose what you're comfortable with lol
14:22:33FromDiscord<Zodey> i mean, in java you cant use the second one i think
14:22:42FromDiscord<Rika> Choose whichever most appropriate. Usually the first
14:23:00FromDiscord<Rika> In reply to @Zodey "i mean, in java": In pretty much all languages you can’t use either. It’s one or the other
14:23:05FromDiscord<theduke> I'm working on a distributed Webassembly runtime, somewhat similar to a blend of Erlang and Kubernetes, and I'd love to support Nim as a language.↵Server-side Wasm is getting a lot of attention anyway (see the WasmCloud / Spin / Lunatic / WAVM, etc) projects↵(@dom96)
14:23:07FromDiscord<Rika> There are some few exceptions
14:23:19FromDiscord<aph> In reply to @Rika "In pretty much all": i think d lang have it probably
14:23:28FromDiscord<Rika> That is one exception as I’ve said
14:23:40FromDiscord<Zodey> i see, thanks guys
14:24:20FromDiscord<Zodey> btw, the code isnt working up there, so dont try to use lol
14:37:56*genpaku joined #nim
14:38:16FromDiscord<SnowNeo> people use nim?
14:39:13PMunchYup
14:39:19FromDiscord<SnowNeo> what for?
14:39:37FromDiscord<huantian> Programming
14:39:48FromDiscord<SnowNeo> Very cool
14:39:50FromDiscord<Zodey> you can use it for anything you want
14:39:54FromDiscord<Solitude> for rustards to seethe
14:40:10FromDiscord<SnowNeo> In reply to @Solitude "for rustards to seethe": Is that like an insult for people who use rust lmfao
14:40:27FromDiscord<Solitude> In reply to @SnowNeo "Is that like an": why are you here
14:40:51FromDiscord<SnowNeo> To learn about what people mainly use nim for
14:41:11FromDiscord<Solitude> nothing, its a psyop, run along
14:41:26FromDiscord<SnowNeo> no no
14:41:28FromDiscord<SnowNeo> i want to know
14:41:52FromDiscord<Zodey> well, some people makes games with it, look at #gamedev
14:42:09FromDiscord<huantian> People make websites, applications, games, other programming langs, whatever you want in your life
14:42:15FromDiscord<Solitude> https://media.discordapp.net/attachments/371759389889003532/969247175039139840/unknown.png
14:42:19FromDiscord<SnowNeo> cool cool
14:42:31FromDiscord<SnowNeo> alright well have a good day :D
14:42:51FromDiscord<Solitude> :DD
14:47:31FromDiscord<Zodey> In reply to @Zodey "well, some people makes": @SnowNeo basically, you can make anything you want, its easy to read, and its very fast (for speed: <https://plummerssoftwarellc.github.io/PrimeView/report?id=davepl-1650624419.json&hi=False&hf=False&hp=False&fi=&fp=mt&fa=wh~ot&ff=uf&fb=uk~ot&tp=True&sc=pp&sd=True>)↵libraries arent a big problem, because you can use c libraries as well
14:48:25FromDiscord<SnowNeo> Ah
14:48:30FromDiscord<SnowNeo> Oh nim's faster than go
14:48:48FromDiscord<Zodey> with 2 cores its even faster than rust
14:48:50FromDiscord<Zodey> <https://plummerssoftwarellc.github.io/PrimeView/report?id=davepl-1651136147.json&hi=False&hf=False&hp=False&fi=&fp=mt&fa=wh~ot&ff=uf&fb=uk~ot&tp=True&sc=pp&sd=True>
14:49:14FromDiscord<SnowNeo> Cool
14:49:22FromDiscord<SnowNeo> Any big companies using it?
14:49:47FromDiscord<Yardanico> In reply to @SnowNeo "Any big companies using": status is probably the biggest if you mean "publicly" and "a lot"
14:49:58FromDiscord<Zodey> sadly not
14:49:59FromDiscord<Yardanico> there are probably other big companies that have some employees using them somewhere for something
14:50:08FromDiscord<SnowNeo> In reply to @Zodey "sadly not": Ah
14:50:24FromDiscord<Yardanico> In reply to @Zodey "<https://plummerssoftwarellc.github.io/PrimeView/re": this is not representative of a language performance at all
14:50:50FromDiscord<Yardanico> there you can optimize code for your language as far as you want, so the only limit is how much effort you spend on optimizing that specific benchmark
14:51:35FromDiscord<Zodey> Well, I think every fan wants his language to win, so in this benchmark everybody tried his best↵<https://github.com/PlummersSoftwareLLC/Primes>
14:51:43FromDiscord<Yardanico> again, no
14:51:47FromDiscord<Yardanico> "everybody tried his best"
14:52:17FromDiscord<Yardanico> those benchmarks are really not good for comparing languages
14:52:21FromDiscord<SnowNeo> Someone made one in brainfuck
14:52:23FromDiscord<Yardanico> they're only good for comparing people who wrote them
14:52:24FromDiscord<SnowNeo> Very cool
14:53:42*vicfred quit (Quit: Leaving)
14:54:24FromDiscord<Zodey> okay, im sure you are more experienced than me, so i will believe in you↵but still, Nim isnt "slow" :DD
14:54:30FromDiscord<Yardanico> that is true
14:54:54FromDiscord<Yardanico> nim is one of the best languages (not just my opinion, but of a lot of others) by performance/effort ratio
14:55:10FromDiscord<Zodey> In reply to @Yardanico "nim is one of": yeah, thats what i wanted to say before
14:55:21FromDiscord<Zodey> In reply to @Zodey "<@772794463789252659> basically, you can": with this xD
14:55:25FromDiscord<SnowNeo> Y
14:56:00FromDiscord<SnowNeo> (edit) "Y" => "You guys probably use nim more than me so tell me this, is there any other reason for me to move to nim from rust other than just raw speed"
14:56:14FromDiscord<Zodey> In reply to @SnowNeo "You guys probably use": effort radio
14:56:21FromDiscord<Zodey> its way more easier to read and write
14:56:23FromDiscord<Yardanico> if you already use rust, you don't need to move to nim for speed
14:56:33FromDiscord<Yardanico> but yes, the syntax is usually much nicer and less verbose
14:56:43FromDiscord<larroteeno> hello everyone, I am doing some exercises and I stumbled upon one that requires me to define an object constructor. I ve seen examples but none works. can someone share one?↵↵say the class is called Deck and when you say Deck(cards:10) on object creation I want to get a seq of 10 cards as a side effect.
14:56:44FromDiscord<Yardanico> also AST macros allow to have some really nice DSLs
14:56:51FromDiscord<SnowNeo> Alright, I've made my choice, enjoy your day! :D
14:57:07FromDiscord<Yardanico> In reply to @larroteeno "hello everyone, I am": nim doesn't have overridable "object constructors" as a language feature
14:57:17FromDiscord<Yardanico> the idiom is to just create something like `initFoo` for value types or `newFoo` for ref types
14:57:34FromDiscord<Yardanico> Deck(cards: 10) is the built-in object construction syntax, it only works if you have cards literally as that field in an object
14:57:49FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3WtL
14:58:38FromDiscord<Zodey> did snow has just leave? XDDD
15:12:45FromDiscord<larroteeno> how can i make that do a side effect, so instead of int that cards is an array of object of type card, that newFoo or initFoo is not too clear, and dont seem to work when I tried, is there any example so say, in your example when you do Deck(card:10) you also print a "creating cards" or something?
15:13:56FromDiscord<Yardanico> In reply to @larroteeno "how can i make": no, it's not possible if the type itself is Deck
15:14:05FromDiscord<Yardanico> as I said, the nim idiom is to just create a separate proc called `initFoo` or `newFoo`
15:20:44FromDiscord<larroteeno> weird that this website suggests that you could init part of an object without specifying it, thanks
15:21:46FromDiscord<larroteeno> sent a code paste, see https://paste.rs/Iae
15:22:04FromDiscord<larroteeno> this is what they suggest, you create this allergies object and magically that lst becomes something, a subset of a full list
15:22:18FromDiscord<larroteeno> is there any way of doing this or is this exercise wrong?
15:22:20FromDiscord<Rika> That will not work ever
15:22:23FromDiscord<Rika> It is wrong
15:23:41FromDiscord<Yardanico> In reply to @larroteeno "this is what they": this is invalid then, I assume this is exercism
15:23:47FromDiscord<Yardanico> they probably translated the code from another language the wrong way
15:26:04FromDiscord<larroteeno> yeah that is hat I thought, thanks for confirming it, I was going nuts
15:31:29FromDiscord<huantian> Maybe lst is a proc and not a field?
15:32:25FromDiscord<Rika> That would be crazy of them but it would work
15:32:26FromDiscord<Rika> As a workaround
15:35:07FromDiscord<tandy> can i import from the root of my project? rather than using ../
15:36:03FromDiscord<Yardanico> In reply to @huantian "Maybe lst is a": i did say that it'll work, but it's not idiomatic at all
15:36:08FromDiscord<Yardanico> and exercism tries to be idiomatic
15:39:14*duuude quit (Read error: Connection reset by peer)
15:39:26*duuude joined #nim
15:43:18FromDiscord<Rika> In reply to @tandy "can i import from": Probably with adding path to your Nim config but I’m not sure about how well it works
15:44:27FromDiscord<tandy> ok figured it
15:49:13Amun-Rawhat would be a proper way to have a pointer of value of 1?
15:49:30FromDiscord<Yardanico> do you mean a pointer to an int with value of 1?
15:49:39FromDiscord<Yardanico> or literally a pointer that's equal to 1 ?
15:49:57FromDiscord<Yardanico> if the former, then `var myptr = create(int); myptr[] = 1`
15:50:03FromDiscord<Yardanico> of course replace ; with a new line
15:50:08Amun-RaI need something like (void *) 1
15:50:18FromDiscord<Yardanico> `cast[pointer](1)`
15:50:32FromDiscord<Yardanico> `pointer` in Nim is what `void ` is in C
15:50:59Amun-Rahmm, right, I've tested it before, but the problem was elsewhere
15:51:01Amun-Rathanks
15:51:03FromDiscord<Yardanico> but again, this is only useful for C FFI, I hope you're not using this for pure Nim code :)
15:51:49Amun-Rayes, I'm writing an interface :>
15:53:16*xet7 joined #nim
15:53:52Amun-RaYardanico: what's the cause of the error? https://play.nim-lang.org/#ix=3Wuf
15:54:15FromDiscord<Rika> Const
15:54:20FromDiscord<Yardanico> VM generally doesn't support pointers, make it a `let`
15:54:30Amun-Raoh
15:54:37Amun-Rathank you
15:55:15Amun-Rathat error wasn't clear tbh
15:55:25FromDiscord<Rika> It wasn’t
15:56:17Amun-RaI mean at least for me
15:56:28FromDiscord<Yardanico> Rika agreed with you
16:01:35NimEventerNew Nimble package! periapsisEngine - A 2D game engine made by Periapsis Studios, see https://github.com/Periapsis-Studios/Periapsis-Engine
16:18:07*xet7 quit (Ping timeout: 240 seconds)
16:18:36*duuude quit (Ping timeout: 240 seconds)
16:24:04*vicfred joined #nim
16:31:29*xet7 joined #nim
16:32:00*xet7 quit (Remote host closed the connection)
16:32:21*xet7 joined #nim
16:40:57FromDiscord<larroteeno> In reply to @huantian "Maybe lst is a": can you use a proc without parentheses?
16:43:08FromDiscord<Rika> Yes
16:43:10*duuude joined #nim
16:51:25FromDiscord<Tyrone Wiggums> can you write asm in nim
16:52:50FromDiscord<Yardanico> yes
16:53:10FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement
17:02:44*duuude quit (Quit: Konversation terminated!)
17:02:56*duuude joined #nim
17:06:19Amun-RaI can never remember when parentheses are mandatory and when they're not
17:06:48FromDiscord<Yardanico> they're not mandatory most of the time
17:06:54FromDiscord<Yardanico> when you do procedure/method/etc calls
17:07:31FromDiscord<Yardanico> https://nim-lang.org/docs/manual.html#procedures-command-invocation-syntax works in most cases
17:17:00FromDiscord<Phil> Erm... can you not make a table that uses an object variant as key?
17:17:21FromDiscord<Phil> No wait, you can, you just have to define your own `[]=`, don't you?
17:20:24FromDiscord<Phil> No wait... how the hell do you define a `[]=` that inserts into a table?
17:21:08FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3WuL
17:21:35FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3WuL" => "https://play.nim-lang.org/#ix=3WuM"
17:22:11FromDiscord<Phil> Explodes at the `[]=` access in the last line:↵`/home/philipp/.choosenim/toolchains/nim-1.6.4/lib/system.nim(1877, 7) Error: parallel 'fields' iterator does not work for 'case' objects`
17:24:01FromDiscord<vindaar> @Phil\: the error is a bit confusing. The problem is that to have an object as a key, it needs a comparison operator `==`. The compiler tries to generate the operator automatically for your object by using the `fields` iterator. However, that doesn't work for case objects
17:24:39FromDiscord<Phil> Ohhhh so I can just write an ==, that I can do
17:25:17FromDiscord<vindaar> yup!
17:29:10*xet7 quit (Quit: Leaving)
17:32:47*xet7 joined #nim
17:42:03FromDiscord<Phil> Hmmmm
17:42:11FromDiscord<Phil> Same thing as above, wanted to write a convenience method
17:43:42FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3WuT
17:45:00FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3WuT" => "https://play.nim-lang.org/#ix=3WuU"
17:46:07FromDiscord<vindaar> will check, give me a few min
17:46:29FromDiscord<Yardanico> @Phil that's because you're passing a copy of the table
17:46:33FromDiscord<Yardanico> which is non-mutable
17:46:41FromDiscord<Yardanico> `Table` is a value type while `TableRef` is a ref type
17:46:55FromDiscord<Yardanico> so you either add `var` to `table: var CampaignMemberships` in []= proc or change your Table to TableRef
17:46:59FromDiscord<Phil> Oh damnit, the classic of forgetting to var your params
17:47:37FromDiscord<Phil> Actually, that likely should be a tablerefe
17:47:38FromDiscord<Phil> (edit) "tablerefe" => "tableref"
17:48:18FromDiscord<vindaar> yup, was just about to write that
17:48:19FromDiscord<vindaar> 😅
17:50:32FromDiscord<Yardanico> In reply to @Isofruit "Actually, that likely should": if you want to share it between different objects (shared ownership), then yeah
17:50:36FromDiscord<Yardanico> but generally a Table is enough
17:53:36FromDiscord<Arathanis> Are there any docs for how to define nimble tasks?
17:53:39FromDiscord<Arathanis> I've been looking
17:53:56FromDiscord<Arathanis> (edit) "looking" => "looking, but haven't been able to find anything concrete."
17:57:26*irfanns joined #nim
18:18:53FromDiscord<Phil> Scanning over the strutils stdlib, do we not have a proc to check whether a string like "451" is a number?↵I mean, we can parse, I just don't see an "isNumber" proc, only isDigit for chars
18:21:34FromDiscord<Arathanis> sent a code paste, see https://play.nim-lang.org/#ix=3Wv6
18:22:05FromDiscord<Solitude> In reply to @Arathanis "You can use `parseInt`": thats an overkill when you can just iterate over characters and check if they are digits
18:22:27FromDiscord<Arathanis> Is it overkill? I don't think I agree.
18:22:52FromDiscord<Phil> I mean, I just now implemented both approaches and have since then been contemplating which is more expensive
18:22:52FromDiscord<Arathanis> Though maybe their intention is not to convert it to an actual integer, just check if its a integer.
18:23:09FromDiscord<Arathanis> That might be my mistake. I was under the assumption the end goal was converting a string to an integer.
18:23:10FromDiscord<Solitude> In reply to @Arathanis "Though maybe their intention": its literally what he wrote
18:24:40FromDiscord<d4rckh> i couldnt find much info on google about custom compiler flags, could anyone link me to a small guide or something similar?
18:24:51FromDiscord<mratsim> In reply to @Sway.rb "can you write asm": I wrote a compile-time assembler in Nim: https://github.com/mratsim/constantine/blob/master/constantine/math/arithmetic/assembly/limbs_asm_x86.nim#L81-L86=
18:24:58FromDiscord<mratsim> and a JIT as well
18:25:01FromDiscord<d4rckh> In reply to @d4rckh "i couldnt find much": i want to compile my programs with specific values and access them in my code
18:25:17FromDiscord<Arathanis> In reply to @Solitude "its literally what he": Sure. And that was my mistake. I assumed the intention was checking before parsing.
18:25:25FromDiscord<mratsim> In reply to @d4rckh "i want to compile": const foo {.intdefine.} = 1
18:25:35FromDiscord<d4rckh> In reply to @mratsim "const foo {.intdefine.} =": and how do i pass it?
18:25:36FromDiscord<mratsim> you have booldefine and strdefine as well
18:25:44FromDiscord<Yardanico> In reply to @d4rckh "i want to compile": docs - https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
18:25:47FromDiscord<mratsim> -d:foo=3
18:25:49FromDiscord<d4rckh> ah, thanks!
18:26:16FromDiscord<Phil> In reply to @Arathanis "Sure. And that was": I do some of the time in this case... it's a bit of a mess
18:26:39FromDiscord<d4rckh> how can i use the flags to compile only specific parts of a file e.g. using `when defined(flag)`
18:26:45FromDiscord<Arathanis> In reply to @Isofruit "I do *some* of": I do think that is a good approach for the times when you are going to ultimately parse it into an int.
18:27:16FromDiscord<mratsim> In reply to @d4rckh "how can i use": -d:flag
18:27:34FromDiscord<Yardanico> In reply to @Arathanis "I *do* think that": it depends, like what if he wants to check if the number is too big to fit?
18:27:35FromDiscord<d4rckh> amazing
18:27:44FromDiscord<Yardanico> yes you can catch ValueError but it's a bit unclean
18:28:20FromDiscord<Arathanis> In reply to @Yardanico "it depends, like what": I don't know if I think there is a cleaner way to check if the number is too big to fit.
18:28:31FromDiscord<Arathanis> I'd love to see one.
18:30:04FromDiscord<Phil> Question, where does it come from that we add stuff to sets by using "incl"?
18:30:12FromDiscord<Arathanis> looks like it raises `integerOutOfRangeError` rather than `ValueError` in that case.
18:30:15*rockcavera joined #nim
18:30:15*rockcavera quit (Changing host)
18:30:15*rockcavera joined #nim
18:30:23FromDiscord<Phil> First time I've seen "include" as the keyword to add something to a set
18:30:28FromDiscord<Phil> (edit) "First time I've seen "include" as the keyword to add something to a set ... " added "in any language"
18:30:45FromDiscord<Yardanico> In reply to @Isofruit "First time I've seen": from math terminology
18:31:39FromDiscord<Yardanico> In reply to @Arathanis "looks like it raises": nonono
18:31:45FromDiscord<Yardanico> `integerOutOfRangeError` is a proc that raises ValueError
18:31:53FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/969304967229882388/unknown.png
18:32:06FromDiscord<Arathanis> ah got it
18:32:10FromDiscord<Arathanis> the output is confusing
18:32:23FromDiscord<Yardanico> actually you can just check the pragmas in the docs
18:32:31FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/969305124579209296/unknown.png
18:32:34FromDiscord<Yardanico> just click on the dots to expand them
18:32:48FromDiscord<Yardanico> nim has automatic effect tracking so it knows that exceptions a proc can raise
18:33:16FromDiscord<Yardanico> of course sometimes it will just show a generic "Exception", usually this is when a proc calls a callback either directly or indirectly, or something like that
18:54:32*irfanns quit (Remote host closed the connection)
18:54:52*irfanns joined #nim
18:55:14*xet7 quit (Remote host closed the connection)
19:04:06*Arrrrrrr quit (Quit: Arrrrrrr)
19:09:28*pro joined #nim
19:20:36FromDiscord<Phil> gnaaa, why is extending std/json always such a pain to get working, which kind of goat do you need to sacrifice for it
19:21:37FromDiscord<Solitude> what are you trying to do?
19:33:14FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3Wvz
19:33:58FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3Wvz" => "https://play.nim-lang.org/#ix=3WvA"
19:34:03FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3WvA" => "https://paste.rs/So3"
19:34:08FromDiscord<Phil> sent a code paste, see https://paste.rs/jVu
19:34:22FromDiscord<Phil> (edit) "https://play.nim-lang.org/#ix=3WvD" => "https://play.nim-lang.org/#ix=3WvC"
19:35:27FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3WvE
19:35:58FromDiscord<Phil> Given I imported jsonutils I should have the necessary procs available to serialize a damn table
19:36:00FromDiscord<Solitude> haha, yeah
19:36:45FromDiscord<Solitude> so, why arent you using jsony?
19:37:00FromDiscord<Phil> Because jsony does object --> String, not object --> JsonNode
19:37:23FromDiscord<Solitude> think it does both, but the hell you need JsonNode for
19:37:39FromDiscord<Phil> And I need `JsonNode` for a proc from a jwt library, that builds a token out of a JsonNode
19:38:04FromDiscord<Phil> ... Which they then turn into a string again, making it super painful
19:38:28FromDiscord<huantian> In reply to @Solitude "think it does both,": It does do both
19:38:28FromDiscord<Solitude> yeah, i would just sidestep JsonNode there and patch library if it doesnt allow that
19:38:30FromDiscord<Solitude> but you do you
19:39:16FromDiscord<Phil> If it does both I'm jumping ship because fuck me is extending std/json painful
19:40:50FromDiscord<Phil> Which hook in jsony allows you to convert object --> JsonNode?
19:40:56FromDiscord<huantian> It’s at the bottom of the readme
19:41:00FromDiscord<Phil> dumpHook is object --> String
19:41:01FromDiscord<Solitude> also, im just shilling for jsony, dont blame me if you're gonna do even more work
19:41:29FromDiscord<Phil> from Json is string (in json format) --> object
19:41:34FromDiscord<Phil> (edit) "from Json" => "fromJson"
19:42:14FromDiscord<huantian> You can just do to(JsonNode)
19:42:17FromDiscord<Phil> parseHook is also string --> object
19:42:54FromDiscord<Phil> Is that jsony? or do you mean the `to` method of std/json?
19:43:22FromDiscord<huantian> Wait it’s not to I can’t remember the name
19:43:29FromDiscord<Solitude> fromJson
19:43:49FromDiscord<huantian> Just scroll down to the bottom of the readme
19:44:59FromDiscord<Phil> What I found there is parsing string --> object (which could be JsonNode object sure).↵I'm looking for object --> JsonNode, the only way I'd get there would be object --> string --> JsonNode
19:45:13*Gustavo6046 joined #nim
19:45:29FromDiscord<huantian> I see
19:45:31FromDiscord<Phil> That's why I originally wanted to just use std/json for that single step
19:45:31FromDiscord<Solitude> In reply to @Isofruit "What I found there": forget everything we told you, its doomed
19:45:58FromDiscord<Phil> touching std/json is just a cursed experience every time I had to
19:46:04FromDiscord<huantian> Yeah I don’t think jsony does object to JsonNode
19:46:14FromDiscord<Solitude> why would anything do that
19:46:24FromDiscord<Solitude> ugh
19:47:44FromDiscord<Phil> sent a code paste, see https://play.nim-lang.org/#ix=3WvJ
19:47:54FromDiscord<Solitude> holy...
19:49:34*duuude quit (Ping timeout: 250 seconds)
19:50:13*duuude joined #nim
19:50:19FromDiscord<Phil> I'm writing my own fucking proc to parse that damn table, hooks be damned
19:50:25FromDiscord<Phil> (edit) removed "fucking"
20:03:42FromDiscord<treeform> In reply to @Isofruit "Because the JWT data": I hate JWT so much...
20:03:49FromDiscord<treeform> just want that to be known
20:04:05FromDiscord<Phil> The general idea or that particular data-type?
20:04:19FromDiscord<Phil> (edit) "data-type?" => "data-type/lib?"
20:10:08*Zectbumo joined #nim
20:13:29*gsalazar quit (Ping timeout: 272 seconds)
20:17:33FromDiscord<treeform> general idea
20:19:08FromDiscord<treeform> i have my own jwt lib though https://github.com/treeform/quickjwt/blob/master/src/quickjwt.nim
20:19:19FromDiscord<treeform> and I guess I kind of hate that it has to exist
20:29:44FromDiscord<Yardanico> mimalloc is fast
20:30:15FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/18146 with mimalloc the bench i tested is actually _faster_ than with default nim's allocator (both with orc)
20:30:49FromDiscord<Yardanico> i made a small project template (nims + two patched files + mimalloc distribution) so you can easily add it to your project
20:31:00FromDiscord<Yardanico> need to publish as a separate repo and make a forum post I guess
20:42:52*pro quit (Quit: pro)
20:52:33*rez joined #nim
21:07:21*PMunch quit (Quit: leaving)
21:24:23FromDiscord<Phil> Somehow the conversion of string into JWT encoding fucks up unicode characters
21:24:26FromDiscord<Phil> God dangit
21:29:18FromDiscord<Phil> In reply to @treeform "i have my own": Before I invest another 2 hours, do you perhaps know if quickjwt handles unicode characters well?↵Currently battling with it turning " Jōzai Corp " into "JÅ\u008dzai Corp"
21:29:56FromDiscord<Phil> (edit) "it" => "my current jwt lib" | "my current jwt libturning " Jōzai Corp " into "JÅ\u008dzai Corp" ... " added " during conversion of JsonNode to JWT"
22:00:54*adium quit (Quit: Stable ZNC by #bnc4you)
22:01:28*duuude quit (Ping timeout: 248 seconds)
22:07:53FromDiscord<Ruby fan.rb> is nim fast, like jvm fast
22:08:07FromDiscord<Yardanico> In reply to @Ruby fan.rb "is nim fast, like": its usually like "jvm faster"
22:08:13FromDiscord<Ruby fan.rb> In reply to @Yardanico "its usually like "jvm": what!
22:08:17FromDiscord<Yardanico> that!
22:08:20rbdepends on the backend i suppose
22:08:21FromDiscord<Ruby fan.rb> i thought that java was the fastest programming language ever
22:08:31FromDiscord<Yardanico> In reply to @Ruby fan.rb "i thought that java": for jokes go to #memes or #offtopic
22:08:39FromDiscord<Ruby fan.rb> im definetly learning this!
22:08:59FromDiscord<Ruby fan.rb> In reply to @Yardanico "for jokes go to": dont know how thats relevant to what i was saying but ok
22:09:12FromDiscord<Yardanico> because it very much looks like you were joking
22:09:39FromDiscord<Ruby fan.rb> In reply to @Yardanico "because it very much": Why would I joke about that
22:09:50FromDiscord<Ruby fan.rb> my teacher told me that java was the fastest programming language ever
22:11:37FromDiscord<konsumlamm> your teacher lied
22:13:32FromDiscord<Ruby fan.rb> In reply to @konsumlamm "your teacher lied": why would he do that
22:14:14FromDiscord<Yardanico> still experimenting with mimalloc, and I'm baffled that for some reason _statically_ linked mimalloc is like 10x slower
22:14:22FromDiscord<Yardanico> than with dynamic linking
22:14:32FromDiscord<Recruit_main707> so that you didnt go on a year long search for the fastest programming language and just settled with java
22:14:46FromDiscord<konsumlamm> idk why anyone would say that java is the fastestlanguage ever
22:14:55FromDiscord<konsumlamm> but it's definitely not true
22:16:06FromDiscord<Ruby fan.rb> In reply to @Recruit_main707 "so that you didnt": well if java isnt the fastest programming language, then what is
22:16:26FromDiscord<Yardanico> i still think that @Ruby fan.rb is just joking around
22:16:27FromDiscord<Recruit_main707> fastest is a very hard title to defend, but generally c is considered the fastest high level programming language, some people defend assembly is faster, but its low level, and others directly say optimizing compilers are better than humans optimizng code
22:17:15FromDiscord<Ruby fan.rb> In reply to @Recruit_main707 "fastest is a very": oh ok
22:17:20FromDiscord<Recruit_main707> so, the usual answer is c, but its not always true for all cases
22:18:06FromDiscord<Ruby fan.rb> In reply to @Recruit_main707 "so, the usual answer": wait so what could possibly be faster than the fastest programming language
22:19:32FromDiscord<dom96> Holy C obviously
22:19:45FromDiscord<Recruit_main707> aka based C
22:19:48FromDiscord<Ruby fan.rb> In reply to @dom96 "Holy C obviously": but he just said thats the fastest language
22:19:54FromDiscord<Ruby fan.rb> c cant be faster than c
22:20:43FromDiscord<Recruit_main707> holy c is not c
22:20:48FromDiscord<-|-> Holy C is holier than normal C
22:21:20FromDiscord<treeform> In reply to @Isofruit "Before I invest another": Sounds like a json issue not a jwt, create a minimum example. I have not run into this.
22:23:28FromDiscord<Recruit_main707> @Ruby fan.rb for instance, check this benchmark of different languages implementing the same algorithm, any decent language without much or any runtime bloat will be capable of performing as good as possible, the rest is about how you implement stuff↵https://plummerssoftwarellc.github.io/PrimeView/report?id=rbergen-1650948878.json&hi=False&hf=False&hp=False&fi=&fp=mt&fa=wh~ot&ff=uf&fb=uk~ot&tp=False&sc=pp&sd=True
22:25:51*ehmry quit (Ping timeout: 256 seconds)
22:27:17FromDiscord<treeform> In reply to @Ruby fan.rb "wait so what could": Obviously hand-rolled-assembly done by a very good assembly programmer using the best algorithm would the theoretically fastest. But it just take so much to do assembly well its almost never worth it.
22:27:29*rez quit (Quit: l8r)
22:27:38*lumo_e quit (Quit: Quit)
22:29:17FromDiscord<treeform> normal JAVA can't be the fastest because it has compacting GC which had double indirection!
22:30:22FromDiscord<treeform> Java also does not allow you to have use fully stack based data structures, it loves stuff on the heap.
22:30:45FromDiscord<treeform> (edit) "had" => "has"
22:30:54FromDiscord<treeform> (edit) removed "have"
22:30:56FromDiscord<Sway.rb> speaking of java
22:31:04FromDiscord<Sway.rb> java implementation of OO in #offtopic
22:31:12FromDiscord<Sway.rb> but for ruby
22:35:00FromDiscord<morgan> 😬 kekistani flag
22:40:48FromDiscord<morgan> (basically 4chan's edit of nazi symbolism replacing the swastika with ks and adding a 4chan logo)
22:40:58FromDiscord<morgan> https://media.discordapp.net/attachments/371759389889003532/969367647152136252/unknown.png
22:43:11FromDiscord<exelotl> that's a yikes from me
22:43:22FromDiscord<morgan> yeppppp
22:43:59*firq quit (Ping timeout: 240 seconds)
22:44:23FromDiscord<morgan> and iirc 14 (in his bio) is a dogwhistle referring to 14 words i think, from some old bit of nazi stuff
22:45:36FromDiscord<morgan> often followed by 88 which means replace with the 8th letter of the alphabet and remember back to when you learned about ww2 and stuff nazis said that was two words starting with the same letter
22:46:16FromDiscord<Yardanico> In reply to @MorganAlyssa "and iirc 14 (in": can you stop trying to find nazi stuff everywhere?
22:46:20FromDiscord<Yardanico> and it's just 14 in his bio without the 88
22:46:33FromDiscord<Yardanico> i don't think you should judge the person based on that they used a flag of a fictional country
22:46:39FromDiscord<Yardanico> would you judge them if they had pepe as their profile picture?
22:46:46FromDiscord<Yardanico> because some people think it's "nazi" too
22:48:07FromDiscord<morgan> https://www.splcenter.org/hatewatch/2017/08/12/flags-and-other-symbols-used-far-right-groups-charlottesville literally the second image on their list https://media.discordapp.net/attachments/371759389889003532/969369449935298610/unknown.png
22:48:35FromDiscord<Yardanico> I still don't see why you brought that up
22:48:56FromDiscord<Yardanico> also discussions like these are much more suitable for #offtopic rather than #main
22:49:01FromDiscord<Recruit_main707> lol the 14 is because of Fernando Alonso but ok bro
22:49:21FromDiscord<morgan> sent a long message, see http://ix.io/3WwF
22:49:59FromDiscord<Yardanico> again, can you stop copy-pasting random text and explain the actual problem?
22:51:01FromDiscord<morgan> that text literally explains it
22:51:16FromDiscord<Yardanico> it doesn't explain to me why did you mention that in this server
22:52:02FromDiscord<morgan> the point is that if you allow nazis in a space, it will push out lots of reasonable people, and the nazis will bring their friends, and by the time you realize it's a problem it's too late, the space has become a nazi space
22:52:36FromDiscord<-|-> but there's no definitive proof he's a nazi
22:52:41FromDiscord<Yardanico> Sorry, from my standpoint this flag is just a meme flag of a fictional country and doesn't show that the person is a "nazi"
22:52:55FromDiscord<-|-> the flag isn't a literal swastika
22:53:00FromDiscord<Recruit_main707> i wish i had time to debate why im not a nazi but i have better things to do
22:53:11FromDiscord<-|-> and i see no triple parentheses or "heil hitler" calls
22:53:54FromDiscord<Yardanico> In reply to @MorganAlyssa "the point is that": Also, Recruit has been around on this server for far much than you were, and they didn't bring any "nazi friends"
22:54:26*ehmry joined #nim
22:56:24FromDiscord<Recruit_main707> but as a simple point, i guess everyone using this as a pfp, or an stalin one for the matter is a dangerous person that wants homosexuals to be put into gulags, i wont ellaborate more, i have a lot to study, but yeah, its just a meme flag of a fictional country https://media.discordapp.net/attachments/371759389889003532/969371531396399165/unknown.png
22:57:13FromDiscord<hmmm> In reply to @Recruit_main707 "i wish i had": rm707 is a bro and not a nazi
22:57:39FromDiscord<⎝⪩﹏⪨⎠> Well, I guess I'll install choosenim until the issue with OpenSSL is fixed.
23:08:01*adium joined #nim
23:14:17FromDiscord<Alea> person with pronoun website in bio joins server, immediately starts calling long-time user nazis, elaborates way too much↵seems on brand :EmotiCool:
23:14:46FromDiscord<ElegantBeef> Yall need jesus
23:15:03FromDiscord<Yardanico> ok at least I found out why mimalloc was slow when statically compiled
23:15:10FromDiscord<Yardanico> that's because it has default asserts so you need to pass -DNDEBUG
23:15:12FromDiscord<Recruit_main707> In reply to @ElegantBeef "Yall need jesus": trust me i need him very hard right now
23:15:37FromDiscord<ElegantBeef> Like everyone can everyone fuck off with all the accusations for 1 minute 😄
23:15:44FromDiscord<ElegantBeef> (edit) removed "everyone"
23:16:02FromDiscord<Alea> and please use the programming server for programming discussions
23:16:16FromDiscord<ElegantBeef> Hey you dog piled so you dont get to comment
23:16:27FromDiscord<Alea> fair :pepenod:
23:17:07FromDiscord<Alea> anyway I'm gonna try and recreate the dividing issue again
23:18:56FromDiscord<Alea> ok I must be doing something wrong https://media.discordapp.net/attachments/371759389889003532/969377205727674368/unknown.png https://media.discordapp.net/attachments/371759389889003532/969377205991931964/unknown.png
23:19:16FromDiscord<Recruit_main707> `type`missing
23:19:16FromDiscord<ElegantBeef> No type
23:19:26FromDiscord<ElegantBeef> Shut up you fucking nazi! 😛
23:19:43FromDiscord<Recruit_main707> cant argue with such an structed argument
23:20:09FromDiscord<Alea> ah shit that's it, treeform declared a ton of types at once so the thing was way up above
23:22:01FromDiscord<Alea> there we go: https://play.nim-lang.org/#ix=3WwH
23:22:43FromDiscord<Alea> It seems to be an issue between mixing float32 and float64, but a) why does that throw an error about mutability on on div, b) why aren't they similar enough types?
23:24:11FromDiscord<Alea> ig I'll just have to type cast it, but weird that = doesn't need it
23:25:06FromDiscord<ElegantBeef> Odd that the implicit type conversion is not mutable for float64
23:25:48FromDiscord<Alea> I see that it's because = mixes all 3 types, but /= has 2 different variants not mixing types https://media.discordapp.net/attachments/371759389889003532/969378930979127346/unknown.png
23:26:02FromDiscord<ElegantBeef> Yea the difference is it lacks the `float64` it seems
23:26:15FromDiscord<Alea> weird choice why
23:26:32FromDiscord<Recruit_main707> wasnt float the same as float64 now anyways?
23:26:42FromDiscord<ElegantBeef> Yea it is
23:27:12FromDiscord<Alea> maybe I'll make a forum post about it
23:27:40FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3WwI
23:27:55FromDiscord<Alea> :hmmNoted:
23:28:08FromDiscord<Alea> nim once again being a willy beast
23:51:54FromDiscord<Yardanico> yeah, mimalloc is fast
23:51:54FromDiscord<Yardanico> like fast fast
23:52:14FromDiscord<Yardanico> for `--threads:on` with ARC/ORC it's the best solution if you want to retain non-`threads:on` performance
23:52:32FromDiscord<Yardanico> by speed it goes like this:
23:53:18FromDiscord<Yardanico> `--mm:orc --threads:on` < `--mm:orc --threads:on -d:useMalloc` (so it uses glibc's malloc in my case) < `--mm:orc --threads:on -d:useMalloc` with mimalloc - from worst to best performance
23:53:32FromDiscord<Yardanico> funny thing is that `--mm:orc` is slower than useMalloc with mimalloc