<< 28-12-2021 >>

00:00:10FromDiscord<Elegantbeef> I have a xeon1231v3 my IPC isnt supremely high but it's decent
00:00:27FromDiscord<Shiba> (edit) "pentium" => "pentium, 2.13ghz"
00:04:18FromDiscord<Shiba> I choosed freedom over speed, and learned nim while i had lua, i have to face the consequences
00:04:34FromDiscord<Elegantbeef> What?
00:04:43FromDiscord<Yardanico> In reply to @Shiba "I choosed freedom over": what
00:04:53FromDiscord<Yardanico> compilation is a one time thing
00:05:00FromDiscord<Yardanico> then your nim programs will RUN faster than your lua programs
00:05:01FromDiscord<Yardanico> much faster
00:07:26FromDiscord<Shiba> Don't take what i said seriously, it's 2 am here and my brain hurts, i should stop saying dump things and perhaps go sleep
00:08:47*kayabaNerve joined #nim
00:11:03FromDiscord<sOkam!> What's the correct syntax to just declare the type of this object element?↵If relevant: Tileset is also a ref object, but of RootObj https://media.discordapp.net/attachments/371759389889003532/925178998974193664/unknown.png
00:11:14FromDiscord<Yardanico> Table[string, seq[int]]
00:11:19FromDiscord<Elegantbeef> `Table[string, seq[int]]`
00:11:21FromDiscord<Yardanico> generic parameters in nim use bracket syntax
00:11:28FromDiscord<sOkam!> oh square brackets, tyty
00:11:33FromDiscord<Yardanico> also better write anim: Table
00:11:42FromDiscord<Yardanico> just a but more idiomatic :P
00:11:48FromDiscord<sOkam!> no components?
00:12:04FromDiscord<sOkam!> does it not make the table flexible, or is it flexible anyway?
00:12:05FromDiscord<Yardanico> ?
00:12:09FromDiscord<Yardanico> In reply to @sOkam! "does it not make": as in?
00:12:25FromDiscord<sOkam!> I just want two columns in the table
00:12:50FromDiscord<sOkam!> Thought that if I don't define the two, it might interpret the table as expandable
00:12:59FromDiscord<Yardanico> not sure what you mean
00:13:05FromDiscord<Yardanico> Table is a mapping from one type to another
00:13:16FromDiscord<Yardanico> in your case it maps different strings to their corresponding seq[int] values
00:13:36FromDiscord<Yardanico> it's like dict in python if you know that
00:13:45FromDiscord<Yardanico> but type limited
00:13:48FromDiscord<sOkam!> exactly. how does it know what to map if not declared on the type?
00:13:59FromDiscord<Yardanico> ??? it's declared in your type
00:14:03FromDiscord<Yardanico> Table[string, seq[int]]
00:14:08FromDiscord<Yardanico> says that you want to map from strings to seq[int]
00:14:14FromDiscord<sOkam!> In reply to @Yardanico "also better write anim*:": ☝️
00:14:21FromDiscord<Yardanico> i meant for :
00:14:28FromDiscord<Yardanico> i didn't write the full definition of table to save time
00:14:31FromDiscord<sOkam!> ah for the asterisk, kk
00:14:31FromDiscord<Yardanico> I meant spacing around :
00:14:47FromDiscord<Elegantbeef> in nim you do `field: type`
00:14:59FromDiscord<Elegantbeef> Conventionally atleast
00:17:16FromDiscord<sOkam!> what's the issue on this one? 🤔 https://media.discordapp.net/attachments/371759389889003532/925180565907451924/unknown.png
00:17:29*kayabaNerve quit (Ping timeout: 256 seconds)
00:17:29FromDiscord<sOkam!> I have another one like that with 2 definitions, and it works well
00:17:37FromDiscord<Yardanico> tuple
00:17:52FromDiscord<impbox [ftsf]> Tuples don't use on fields
00:18:00FromDiscord<Yardanico> you don't export fields in a tuple, they're always exported
00:18:01FromDiscord<sOkam!> oh
00:18:07FromDiscord<impbox [ftsf]> Only on objects
00:18:17FromDiscord<Elegantbeef> Well more accurately tuple fields are shorthand for indexing
00:18:27FromDiscord<Elegantbeef> The fields dont actually exist!
00:19:04FromDiscord<sOkam!> does that apply to regular types too?
00:19:10FromDiscord<Elegantbeef> Nope
00:19:14FromDiscord<sOkam!> or just for tuples explicitly
00:19:23FromDiscord<sOkam!> kk
00:19:33FromDiscord<Elegantbeef> Named fields on tuples are just expanded as `yourTuple[indexOfField]`
00:36:07FromDiscord<sOkam!> https://media.discordapp.net/attachments/371759389889003532/925185310923575376/unknown.png
00:36:37FromDiscord<Yardanico> ?
00:36:39FromDiscord<sOkam!> https://media.discordapp.net/attachments/371759389889003532/925185445355192370/unknown.png
00:37:10FromDiscord<sOkam!> https://media.discordapp.net/attachments/371759389889003532/925185569334644756/unknown.png
00:37:34FromDiscord<sOkam!> If I hover over it... it recognizes it. But the compiler says nope 😦
00:37:43FromDiscord<Yardanico> maybe you import in the wrong order?
00:37:47FromDiscord<Yardanico> or something, idk
00:37:53FromDiscord<Yardanico> maybe it's related to nico
00:38:11FromDiscord<Yardanico> it's better if you ask nico stuff in #gamedev maybe
00:38:45FromDiscord<sOkam!> I thought it was more syntax-related than gamedev per se, since the issue seems to be the relationship
00:38:46FromDiscord<fenrave> In reply to @Elegantbeef "https://github.com/abisxir/alasgar is interesting, ": Lol https://media.discordapp.net/attachments/371759389889003532/925185975456522250/unknown.png
00:39:28FromDiscord<fenrave> Tried the example out because i have nothing better to do
00:39:32FromDiscord<fenrave> Weird type safety issue
00:41:28FromDiscord<fenrave> It is a float32..? https://media.discordapp.net/attachments/371759389889003532/925186655676153886/unknown.png
00:41:34FromDiscord<fenrave> huh
00:42:09FromDiscord<Yardanico> float32 isn't compatible with float64
00:42:15FromDiscord<Yardanico> you need to convert
00:42:20FromDiscord<fenrave> yeah
00:42:35FromDiscord<fenrave> i think the example was made after the guy whose writing it was converting it for some reason
00:42:40FromDiscord<fenrave> or before
00:42:53FromDiscord<fenrave> i'm sure he would have ran his own example from time to time
00:42:59*neceve quit (Ping timeout: 256 seconds)
00:43:12FromDiscord<fenrave> oh
00:43:19FromDiscord<fenrave> no its my own system libraries
00:47:58FromDiscord<sOkam!> Oh, I just noticed this↵Is there an intended way to do imports with circular dependencies? https://media.discordapp.net/attachments/371759389889003532/925188289575673886/unknown.png
00:50:28FromDiscord<Elegantbeef> Layout your code so you import just before you need
00:50:28FromDiscord<Elegantbeef> If there is a tight cyclical dependency you're SOL
00:53:07*xet7 quit (Ping timeout: 250 seconds)
00:55:19FromDiscord<sOkam!> whats sol?
00:55:36FromDiscord<Elegantbeef> Shit outta luck
00:56:06FromDiscord<Elegantbeef> Or "sweet" if 4 swears scare you
00:56:12FromDiscord<Elegantbeef> if swears\
01:01:04FromDiscord<sOkam!> How come this works... https://media.discordapp.net/attachments/371759389889003532/925191587535917116/unknown.png
01:01:57FromDiscord<sOkam!> But this doesn't? https://media.discordapp.net/attachments/371759389889003532/925191811557896222/unknown.png
01:02:15FromDiscord<sOkam!> Is it not the exact same thing, or am I really blind? 😔
01:02:48FromDiscord<Elegantbeef> Where does `uiDir`/`envDir` come from in that example they're both 1 line
01:03:41FromDiscord<sOkam!> In reply to @Elegantbeef "Where does `uiDir`/`envDir` come": not sure I understand
01:03:58FromDiscord<Elegantbeef> The code on the left side of the above examples are both 1 line module
01:04:07FromDiscord<Elegantbeef> So where does `uiDir` and `envDir` come from
01:04:25FromDiscord<sOkam!> The right side file is the same, the left side is included in both cases
01:05:11FromDiscord<sOkam!> uiDir and envDir are defined in the right file, the cfg one
01:05:31FromDiscord<Elegantbeef> Oh your're including
01:05:53FromDiscord<sOkam!> yeah, to avoid importing since it breaks dependencies
01:06:06FromDiscord<sOkam!> and they are just asset lists anyway, so its fine
01:06:52FromDiscord<sOkam!> Both included, both defined in the exact same way... but one breaks and the other seems fine? 🥴
01:07:54FromDiscord<Elegantbeef> I could be wrong but this should be doable with imports
01:08:52FromDiscord<sOkam!> I got the cyclic dependancy issue before with imports
01:11:06FromDiscord<Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/925194111793909770/image.png
01:11:07FromDiscord<Elegantbeef> Works just fine for me
01:12:19FromDiscord<Shiba> Can tables store functions
01:12:42FromDiscord<Elegantbeef> Yes
01:12:57FromDiscord<Shiba> Oh so i can make objects
01:12:57FromDiscord<Elegantbeef> They have to be the homogenous so you may need an object variant
01:13:30FromDiscord<fenrave> How are functions in tables done exactly? In lua its pretty easy to add a function to table
01:13:34FromDiscord<Yardanico> In reply to @Shiba "Oh so i can": you don't need tables with functions for that
01:13:39FromDiscord<Yardanico> In reply to @fenrave "How are functions in": procedures are first-class in nim
01:13:43FromDiscord<Yardanico> you can pass them around and store them'
01:13:45FromDiscord<Yardanico> (edit) "them'" => "them"
01:13:46FromDiscord<fenrave> I mean procedures
01:13:51FromDiscord<Yardanico> so what I said
01:13:54FromDiscord<fenrave> oh
01:13:56FromDiscord<Yardanico> you just store them as any other type
01:13:58FromDiscord<fenrave> misinterpreted that
01:13:59FromDiscord<fenrave> i see
01:14:07FromDiscord<Elegantbeef> The only issue is they need to be homogenous
01:14:18FromDiscord<Elegantbeef> If they're not homogenous you need to box them using an object variant
01:14:47FromDiscord<Elegantbeef> Like you cannot store `proc(a: int)` and `proc()` in the same table without a box
01:14:57FromDiscord<Shiba> In reply to @Yardanico "you don't need tables": Why isn't easy to call every table's update function
01:15:13FromDiscord<Elegantbeef> Nim has objects
01:15:14FromDiscord<Shiba> (edit) "In reply to @Yardanico "you don't need tables": Why isn't ... easy" added "it"
01:15:18FromDiscord<Elegantbeef> We dont use tables to emulate actual logic
01:15:44FromDiscord<Yardanico> exactly
01:15:50FromDiscord<Yardanico> lua needs that because it doesn't have actual objects :)
01:15:52FromDiscord<fenrave> sent a code paste, see https://play.nim-lang.org/#ix=3JIt
01:15:55FromDiscord<fenrave> yeah
01:16:06FromDiscord<fenrave> mimicking objects is fun though
01:16:18FromDiscord<fenrave> (edit) "https://play.nim-lang.org/#ix=3JIt" => "https://play.nim-lang.org/#ix=3JIu"
01:16:29FromDiscord<fenrave> mimicry is the best kind of flattery
01:16:38FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JIv
01:16:58FromDiscord<Elegantbeef> Or you use the OOP mechanism
01:17:38FromDiscord<Shiba> Iam trying to delete the concep of oop in my mind after 2 years of c#
01:18:00FromDiscord<Yardanico> in nim you can do most of traditional oop without methods
01:18:03FromDiscord<Yardanico> because we have UFCS (MCS)
01:19:38FromDiscord<Shiba> And can you like self.accesOtherVariables
01:19:38FromDiscord<fenrave> In reply to @Shiba "Iam trying to delete": Coming from lua its pretty easy to not think about them
01:20:04FromDiscord<sOkam!> In reply to @Elegantbeef "image.png": i tried the imports before, but they were at the beginning of the files↵when switching the words in those sshots to import, instead of include, they worked fine 🤷‍♂️
01:20:12FromDiscord<Elegantbeef> Exactly
01:20:39*noeontheend joined #nim
01:20:40FromDiscord<sOkam!> sounds like magic, if you ask me
01:21:51FromDiscord<Elegantbeef> Nope just import order
01:22:24FromDiscord<Elegantbeef> you can order your imports to prevent cyclical imports
01:23:06FromDiscord<sOkam!> i see. definitely fancy, need to get a better grasp on it
01:23:07FromDiscord<Elegantbeef> When you do the import at the top the module importing it attempts to import itself so errors
01:23:40FromDiscord<sOkam!> how are files accessed? how's the order layed out?
01:24:11FromDiscord<Elegantbeef> First in first imported 😀
01:24:14FromDiscord<sOkam!> In c/cpp I understood the compiler gets all imported files layed out all at once, to be read at once
01:25:10FromDiscord<sOkam!> In reply to @Elegantbeef "First in first imported": I see. Whats the difference between importing and including?
01:25:19FromDiscord<Elegantbeef> Include copies the contents
01:25:23FromDiscord<Elegantbeef> Import doesnt
01:25:48FromDiscord<sOkam!> Yeah, but like... what does import mean if the contents are not copied?
01:26:06FromDiscord<Elegantbeef> Only exported symbols are avaliable
01:26:17FromDiscord<fenrave> if i recall correctly, nim just imports what you actually use and strips out unused stuff for smaller binary sizes
01:26:28FromDiscord<Elegantbeef> Well it imports it all
01:26:33FromDiscord<Elegantbeef> But it doesnt compile it out
01:26:39FromDiscord<fenrave> yeah
01:26:47FromDiscord<sOkam!> ic
01:27:05FromDiscord<sOkam!> so its similar to including, but the code is selectively filtered?
01:27:22FromDiscord<Elegantbeef> Well include pastes the file at the call site
01:27:32FromDiscord<Elegantbeef> Import adds exported symbols to the symbol table for this module
01:28:02FromDiscord<Elegantbeef> So in the import example `someDir` isnt exported so you'll want to either `export modA` or `export someDir`
01:28:28FromDiscord<sOkam!> oh, so they are actually not added to the sequence
01:28:49FromDiscord<Elegantbeef> In the include method they're added to the symbol table of this module since they're declared there now
01:28:50FromDiscord<sOkam!> just referenced for when the code is called?
01:28:54FromDiscord<Elegantbeef> Include works like C's include
01:29:00FromDiscord<Elegantbeef> It pastes the file there
01:29:21FromDiscord<Elegantbeef> Import is a properly thought out way to make up code
01:29:38FromDiscord<Elegantbeef> Default to `import` and use `include` only when you need to
01:29:43FromDiscord<Elegantbeef> There isnt much reason to use include imo
01:29:57FromDiscord<sOkam!> kk
01:39:04FromDiscord<tandy> is nim suitable for real time programming?↵people seem to see garbage collector and run away..↵https://old.reddit.com/r/nim/comments/jc7zxk/hard_real_time_resource/
01:39:08FromDiscord<Yardanico> it is
01:39:16FromDiscord<Yardanico> with --gc:arc
01:41:31FromDiscord<Yardanico> even refc has soft realtime capabilities
02:12:43*noeontheend quit (Quit: noeontheend)
02:14:02*noeontheend joined #nim
02:16:26*kayabaNerve joined #nim
02:16:34FromDiscord<sOkam!> Is this syntax wrong? 🤔 https://media.discordapp.net/attachments/371759389889003532/925210588504813648/unknown.png
02:18:09FromDiscord<Elegantbeef> Yes
02:18:45FromDiscord<Elegantbeef> Or i think so
02:19:16FromDiscord<Elegantbeef> Never mind that's right
02:19:35FromDiscord<sOkam!> Compiler not likey
02:20:02FromDiscord<Elegantbeef> Well the compiler has an error message which is helpful
02:20:23FromDiscord<sOkam!> Not much, tbh 😦 https://media.discordapp.net/attachments/371759389889003532/925211548761354260/unknown.png
02:20:32FromDiscord<Elegantbeef> That's very helpful
02:20:38FromDiscord<Elegantbeef> go to line 14 what do you do
02:21:09FromDiscord<sOkam!> https://media.discordapp.net/attachments/371759389889003532/925211737605681163/unknown.png
02:21:44FromDiscord<Elegantbeef> Ok so you dont export tiles from `envData`
02:21:46FromDiscord<Elegantbeef> We did it
02:22:24FromDiscord<sOkam!> oh nvm im dumb
02:22:27FromDiscord<Elegantbeef> so now go to `../env/data` and `export tiles` or throw `` on `tiles`
02:22:39FromDiscord<sOkam!> its not exporting, i just didnt add the tiles variable 🙈
02:22:43FromDiscord<Elegantbeef> See error messages are helpful
02:23:43FromDiscord<sOkam!> Would be more helpful if it said: Hey! You totally forgot to add this variable, you dummy with goldfish memory who actually thought about doing it... and didnt↵🤷‍♂️
02:23:45FromDiscord<sOkam!> 😄
02:24:07FromDiscord<Elegantbeef> Eh Nim's semantic error messages are generally helpful
02:24:22FromDiscord<Elegantbeef> Nim's parsing error messages are a hit or a miss
02:24:36FromDiscord<sOkam!> whats the latter?
02:24:47FromDiscord<Elegantbeef> "Indentation error"
02:26:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JIB
04:11:10*arkurious quit (Quit: Leaving)
04:29:54*rockcavera quit (Remote host closed the connection)
05:27:17*noeontheend quit (Ping timeout: 240 seconds)
05:29:13*drewr joined #nim
07:42:00*cheer joined #nim
07:44:57*drewr quit (Ping timeout: 240 seconds)
08:29:24*Lord_Nightmare quit (Quit: ZNC - http://znc.in)
08:32:20*Lord_Nightmare joined #nim
09:01:06FromDiscord<Esther> Heya - I'm using vscode with the Nim extension and a nimble library that has some declarations hidden behind a 'when x:' thingo. How do I tell the autocomplete whatsit to define that 'x'?
09:10:06FromDiscord<Rika> You do that on the compile command, not in code
09:14:39FromDiscord<Elegantbeef> You make a config file and have `--define:yourDefine`
09:14:52FromDiscord<Elegantbeef> Sorry for rika's lying to you
09:15:21FromDiscord<Elegantbeef> @Esther\: ^ 😀
09:15:39FromDiscord<Elegantbeef> `config.nims`in the root of your current file
09:15:45FromDiscord<Elegantbeef> current project\
09:17:11FromDiscord<Esther> That seems to have done it, thank you!
09:17:52FromDiscord<Elegantbeef> No problem
09:19:10FromDiscord<Esther> Also, is there a language keyword index in the docs anywhere? I was trying to find what the 'when' keyword actually does in the docs but had a lot of trouble
09:19:37FromDiscord<Rika> In reply to @Elegantbeef "Sorry for rika's lying": It's still not in code, it's in configuration
09:20:07FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement
09:23:45FromDiscord<evoalg> In reply to @Esther "Also, is there a": If you know the word you're looking for, but you're having trouble finding it in the docs (and "nim keyword" isn't helping), then go to https://nim-lang.org/docs/theindex.html and search the page for your key word
09:24:03FromDiscord<Elegantbeef> That index doesnt have keywords
09:24:07FromDiscord<Elegantbeef> The manual has keywords
09:24:11FromDiscord<evoalg> ahhh
09:24:25FromDiscord<evoalg> in that case you've been lied to again Esther
09:25:00FromDiscord<Elegantbeef> the index does have a list of all builtin types
09:25:16FromDiscord<evoalg> gotcha ok
09:25:42FromDiscord<evoalg> beef is the fountain of truth 😉
09:25:45FromDiscord<Elegantbeef> only cause all builtin types are implemented in system.nim
09:26:05FromDiscord<Elegantbeef> Nah i'm just an dumb asshole that's almost always active 😛
09:26:46FromDiscord<evoalg> I like how you have exactly the same waking hours as me, even though I'm in New Zealand 🙂
09:27:28FromDiscord<Rika> In reply to @evoalg "beef is the fountain": I mean he twists the truth very often as well
09:27:31FromDiscord<Elegantbeef> That says more about me than it should
09:28:18FromDiscord<Elegantbeef> Do i twist the truth or am i ignorant?
09:28:37FromDiscord<Rika> I never said it was intentional
09:28:55FromDiscord<Elegantbeef> Twisting the truth means i'd know i'm lying!
09:29:31FromDiscord<Rika> Sometimes you do you just forgot
09:29:53FromDiscord<Elegantbeef> Rika knows my mind better than I apparently
09:30:07*xet7 joined #nim
09:30:22FromDiscord<Rika> Of course I do I'm just a figment of your imagination after all
09:30:35FromDiscord<evoalg> Neal Asher (scifi writer) wrote of an ancient life form that humans called "dragon" who knew a lot but spoke in riddles ... maybe it's the same with beef
09:30:37FromDiscord<Elegantbeef> Would be cooler if you were just a pigment
09:31:55FromDiscord<Rika> Sorry, I'm colourblind
09:32:53FromDiscord<evoalg> figment or pigment, Rika would still be part of you beef?
09:33:02FromDiscord<Rika> Lewd
09:34:02FromDiscord<evoalg> if that part was a big part ... I meant really big, like 100%, then Rika would actually be beef
09:34:17FromDiscord<TryAngle> 😳
09:34:51FromDiscord<evoalg> ok, ok ... I'll shut up
09:35:13FromDiscord<Rika> I didn't know you were this perverted evo
09:35:35FromDiscord<evoalg> When you're my age, you've seen it all
09:36:03FromDiscord<Elegantbeef> He's also a kiwi
09:36:07FromDiscord<Elegantbeef> So that doesnt help
09:36:42FromDiscord<evoalg> kiwi means I've not only seen it all
09:39:36FromDiscord<Solitude> NICE nim discussion
09:39:47FromDiscord<Elegantbeef> Thanks
09:39:54*xet7 quit (Remote host closed the connection)
09:40:55*xet7 joined #nim
09:42:00FromDiscord<Rika> You're welcome
09:45:20FromDiscord<Elegantbeef> So evo i do wonder are you working on any main project with Nim or still just learning stuffs?
09:47:48FromDiscord<Rika> Can't keep on just learning forever, to progress you should make something
09:48:05FromDiscord<valerga> i want to make something in nim called animal(s)
09:48:12FromDiscord<valerga> but no idea what yet lol
09:48:23FromDiscord<valerga> (it probably already exists)
09:48:50FromDiscord<Elegantbeef> I feel like `animals` is a good name of a rust like trait package
09:49:04FromDiscord<Rika> I can't believe you know things about rust beef
09:49:08FromDiscord<Rika> You've betrayed us
09:49:23FromDiscord<Elegantbeef> Hey i learn things about all the other system languages
09:49:24FromDiscord<evoalg> he was lying to us the whole time
09:49:26FromDiscord<Elegantbeef> They have interesting things
09:49:52FromDiscord<Rika> I'm joking, I kinda like the idea of traits
09:50:15FromDiscord<Elegantbeef> Yea i seen the cone language today and it has them
09:50:19FromDiscord<Rika> It sounds like a good extension for Nim's types
09:50:58FromDiscord<Elegantbeef> They're a bit like concepts plus
09:51:11FromDiscord<Rika> I often think Nim APIs need some (but not a lot of) standardisation
09:52:00FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JJB
09:52:06FromDiscord<Elegantbeef> It's a bit ehh about a 1\:1 API
09:52:06FromDiscord<evoalg> but yea I should start a project, as it's the best way to learn ... I'll start one. BTW does `nim secret` still work in 1.6.2?
09:52:24FromDiscord<Elegantbeef> Yea i totally agree there needs to be standardization
09:52:33FromDiscord<Elegantbeef> Concepts should be used
09:52:43FromDiscord<Rika> In reply to @evoalg "but yea I should": Probably
09:52:52FromDiscord<Elegantbeef> It seems it works
09:52:55FromDiscord<Rika> In reply to @Elegantbeef "Concepts should be used": Concepts need to be improved
09:52:58FromDiscord<Rika> Then it can be used
09:53:11FromDiscord<Rika> Can y'all in matrix see replies now
09:53:12FromDiscord<Rika> Btw
09:53:15FromDiscord<evoalg> but it's my brew installation that broke nim secret
09:53:17FromDiscord<Elegantbeef> Yea
09:53:24FromDiscord<Rika> Ok
09:53:32FromDiscord<Elegantbeef> what needs to be done to concepts?
09:53:36FromDiscord<Rika> In reply to @evoalg "but it's my brew": Imagine using macOS smh
09:53:37FromDiscord<Elegantbeef> There are a few bugs ofc
09:53:38FromDiscord<Rika> I'm joking
09:53:49FromDiscord<Rika> In reply to @Elegantbeef "There are a few": Well yeah its pretty much just bugs
09:53:52FromDiscord<Rika> Then the field thing
09:53:58FromDiscord<Rika> Though AFAIK it's possible
09:54:07FromDiscord<Elegantbeef> the field thing?
09:54:12FromDiscord<Elegantbeef> Are we talking about the newconcepts?
09:54:19FromDiscord<Rika> Ah yeah
09:54:21FromDiscord<Rika> I thought we were
09:54:37FromDiscord<valerga> I've been wondering. Would this proposal make nim harder to learn, remove some of the flexibility people seem to like? https://github.com/nim-lang/RFCs/issues/380
09:54:43FromDiscord<Elegantbeef> I was talking in general
09:54:51FromDiscord<Elegantbeef> Both have their benefits and their detriments
09:55:00FromDiscord<Elegantbeef> It'd make it easier
09:55:22FromDiscord<Elegantbeef> The issue with that is one it's not done at the type scope imo
09:55:25FromDiscord<Elegantbeef> Just like destructors and stuff
09:55:37FromDiscord<Elegantbeef> They're done presently in an unintuitive way
09:56:08FromDiscord<Elegantbeef> Regardless of the concept bugs there are many things in the stdlib and other libraries that should use them
09:56:25FromDiscord<Rika> In reply to @Elegantbeef "Regardless of the concept": Yeah
09:56:38FromDiscord<Elegantbeef> There's also an issue with not being able to extend modules after definition
09:57:14FromDiscord<Rika> In reply to @valerga "I've been wondering. Would": More thought would need to be put into it
09:57:18FromDiscord<Rika> Hard to tell
09:57:39FromDiscord<Elegantbeef> I do not like the idea of having types operations outside of the type definition
09:57:43FromDiscord<Elegantbeef> But regardless
09:58:02FromDiscord<Elegantbeef> Type bound operations arent really a bad thing, they just need to be made clear imo
09:58:28FromDiscord<valerga> would it introduce new keywords to learn about or would most of it be automatic?
09:58:40FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JJC
09:58:58FromDiscord<Rika> In reply to @Elegantbeef "for instance a destructor": Cursed
09:59:08FromDiscord<Elegantbeef> I think araq's idea is to bind the functions declared in a module with the type by the first parameter
09:59:54FromDiscord<Elegantbeef> More cursed than manually declaring a proc in the same definition as the type is declared with a specific definition?
10:00:00FromDiscord<Rika> In reply to @Elegantbeef "I think araq's idea": I think it's good, but I cannot tell without actually trying it tbh
10:00:02FromDiscord<Elegantbeef> same module definition\
10:00:12FromDiscord<Rika> In reply to @Elegantbeef "More cursed than manually": No just the syntax
10:00:13FromDiscord<Rika> Lol
10:00:30FromDiscord<Elegantbeef> Well it could be `destroy:` but that interferes with a field named destroy
10:00:49FromDiscord<Elegantbeef> so i guess we could make it so accquoted `destroy` is field and otherwise is a destructor
10:00:51FromDiscord<Rika> The more I think about it the more I think it is a good idea tbh
10:01:17FromDiscord<Elegantbeef> I do also think this post is something else that is needed https://forum.nim-lang.org/t/8658#56393
10:05:57FromDiscord<Elegantbeef> That feature mixed with concepts makes life so much simpler
10:06:30FromDiscord<Elegantbeef> You want to use code but dont want to use a specific type you just replace it with your own that fits all the required procs
10:12:17FromDiscord<hmmm> yo what can I use that is similar to .lines but works with variables and not files
10:12:43FromDiscord<evoalg> variables like a seq ?
10:12:49FromDiscord<evoalg> you mean?
10:12:56FromDiscord<hmmm> more like a blob of text
10:13:05FromDiscord<hmmm> like what you get after you do readfile
10:13:11FromDiscord<evoalg> ahh
10:13:21FromDiscord<evoalg> then it's already in memory
10:13:25FromDiscord<hmmm> yep
10:13:33FromDiscord<hmmm> I want each line
10:13:37FromDiscord<Solitude> splitLines
10:13:44FromDiscord<hmmm> oh
10:13:52FromDiscord<hmmm> I'll try
10:13:59FromDiscord<Solitude> be careful
10:14:03FromDiscord<hmmm> what
10:14:04FromDiscord<hmmm> why
10:17:06FromDiscord<evoalg> but ... but this wont iterate line by line like `.lines` does for a file ... it will create a whole new seq right? ... https://play.nim-lang.org/#ix=3JJH
10:17:29FromDiscord<Elegantbeef> Look at evo pointing out the issue
10:17:43FromDiscord<hmmm> well splitlines worked lol
10:17:57FromDiscord<Elegantbeef> It'll work but if it's a big file you're make your ram unhappy
10:18:32FromDiscord<hmmm> oh no it's for a micro sub nano service utility that will get used on like 4/5 lines of text
10:19:00FromDiscord<evoalg> ahhh ... cos you said like .lines (which doesn't copy all of the file into mem)
10:19:36FromDiscord<evoalg> In reply to @Elegantbeef "Look at evo pointing": proud of me? 😄 😄 ... but I'm not sure how I'd create on iterator to solve the problem 😦
10:19:51FromDiscord<Elegantbeef> A while loop
10:20:42FromDiscord<evoalg> and go through each char until I get a '\n' where I'd yield?
10:21:29FromDiscord<Rika> Pretty much
10:21:54FromDiscord<Elegantbeef> There you go
10:21:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JJK
10:22:10FromDiscord<Elegantbeef> Can do a `for x in y`
10:22:17FromDiscord<Elegantbeef> rather `for x in s`
10:22:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3JJL
10:23:34FromDiscord<Elegantbeef> There is also a no alloc method that doesnt play as nice using `openArray`
10:24:43FromDiscord<Elegantbeef> Ah doesnt work without views i take it back
10:24:47FromDiscord<evoalg> I was half way though typing something up when you did two versions already!
10:25:11FromDiscord<evoalg> ... I lie ... quarter of the way through...
10:25:13FromDiscord<Elegantbeef> shit i spoiled the fun
10:26:23FromDiscord<evoalg> it's fun watched you go at bot speeds
10:27:23FromDiscord<evoalg> preallocates 64 bytes ... to get a head start?
10:28:42FromDiscord<Elegantbeef> Well moreso to prevent allocations if possible
10:28:59FromDiscord<evoalg> why did you chose 64 though?
10:29:35FromDiscord<hmmm> woah beefy it worked
10:29:38FromDiscord<Elegantbeef> A relatively large base 2 number
10:30:01FromDiscord<hmmm> respect4beefy = respect4beefy 2
10:30:07FromDiscord<evoalg> base 2 numbers ... so allocations are more efficient in base 2 chunks?
10:30:43FromDiscord<Elegantbeef> Well if we did 65 bytes we'd take up a whole cacheline and an extra byte \:d
10:30:55FromDiscord<Elegantbeef> I dont think they're more efficient
10:30:57FromDiscord<Elegantbeef> I could be wrong
10:31:09FromDiscord<Elegantbeef> Any size works there i just chose 64
10:31:11FromDiscord<hmmm> make a beefytools repo, I wouldn't want to miss something
10:31:32FromDiscord<Elegantbeef> I already have one https://github.com/beef331/slicerator 😛
10:32:01FromDiscord<Elegantbeef> should i make a `chunkUntil` iterator 😀
10:32:02FromDiscord<evoalg> maybe iterating over text should be part of slicerator?
10:32:14FromDiscord<evoalg> oh ... what you said 😉
10:32:36FromDiscord<Solitude> In reply to @evoalg "but ... but this": https://nim-lang.org/docs/strutils.html#splitLines.i,string
10:32:59FromDiscord<Elegantbeef> Oh right that exists
10:33:04FromDiscord<Solitude> you dumbass
10:33:05FromDiscord<evoalg> ohhhh!
10:33:25FromDiscord<Elegantbeef> Now now you love me↵(@Solitude)
10:33:28FromDiscord<evoalg> In reply to @Solitude "https://nim-lang.org/docs/strutils.html#splitLines.": you know the docs so well!
10:34:32FromDiscord<Elegantbeef> Though this doesnt reuse the string so probably is less memory friendly
10:34:57FromDiscord<evoalg> still, slicerator should contain everything that someone want's to iterator over?
10:35:18FromDiscord<Elegantbeef> Yea like iterators.... 😛
10:35:38FromDiscord<Elegantbeef> I really hate that we cant chain iterators
10:36:09FromDiscord<evoalg> that's because you haven't released chain in slicerator yet?
10:36:23FromDiscord<Elegantbeef> No cause you cannot chain iterators
10:37:20FromDiscord<Elegantbeef> chain in slicerator is really just hack
10:37:33FromDiscord<Elegantbeef> All operations are defined by yours truly and require being written in there
10:38:04FromDiscord<Elegantbeef> Though i think map/filter are all one really needs, but i could be wrong
10:39:03FromDiscord<Elegantbeef> Are there any other operations that one would want to apply to the output of an iterator is my question
10:40:42FromDiscord<evoalg> in one my the aoc's I did:↵ `var grid = readFile("inputs/11.txt").strip.splitlines.mapIt(toSeq(it).mapIt(ord(it) - ord('0')))` ↵... not proud of it, but it worked
10:41:17FromDiscord<evoalg> nested mapIt's
10:42:34FromDiscord<Elegantbeef> Yea i mean it'd be turned into a collect wrapping an odd statement
10:43:12FromDiscord<Elegantbeef> would be like `for x in chain lines("inputs/11.txt").map(toSeq(x)` followed by another iteration
10:43:57FromDiscord<Elegantbeef> Afterall the syntax is like ` for i, x in chain a.map(parseInt(x)).filter(x > 5e4.int).map(x 100):`
10:44:33FromDiscord<Elegantbeef> This only really makes sense for when you''re using the output in a for loop i guess
10:44:56FromDiscord<evoalg> true it's a bad eg
10:45:11FromDiscord<Elegantbeef> I mean it's a real example
10:45:31FromDiscord<evoalg> but still ... does strip allocate?
10:45:37FromDiscord<Elegantbeef> Yes
10:46:24FromDiscord<Elegantbeef> My version shouldnt allocate unless you tell it using `map`
10:46:32FromDiscord<Elegantbeef> But anyway i need to sleep getting really late here
10:47:09FromDiscord<evoalg> nites!
11:25:17*neurocyte0132889 joined #nim
11:25:17*neurocyte0132889 quit (Changing host)
11:25:17*neurocyte0132889 joined #nim
11:42:47FromDiscord<sOkam!> Why is the `JsonNode` acyclic?↵Or, more broadly, what's the practical use of making something acyclic?
11:46:20FromDiscord<Rika> You can use ARC instead of ORC
11:47:03FromDiscord<haxscramper> I think even ORC does codegen a little differently for acyclic types
11:59:09FromDiscord<fumamatar> sent a code paste, see https://play.nim-lang.org/#ix=3JK8
11:59:28FromDiscord<fumamatar> (edit) "https://play.nim-lang.org/#ix=3JK8" => "https://play.nim-lang.org/#ix=3JK9"
12:00:00FromDiscord<Rika> You can dereference a ref with [{
12:00:01FromDiscord<Rika> Ugh
12:00:03FromDiscord<Rika> []
12:01:52FromDiscord<fumamatar> Yes, but memcpy needs a ref or a ptr so I can not just dereference it when i safe the byte buffer
12:02:18FromDiscord<fumamatar> ` copyMem(buf, addr packet.header, sizeof(UDP_Header))`
12:04:27FromDiscord<fumamatar> maybe i need to serialize the header itself into bytes as well ..
12:15:10FromDiscord<fumamatar> so apparently i want to turn a ref into a ptr..?
12:15:32FromDiscord<Rika> You don’t need to
12:15:41FromDiscord<Rika> The ref is a “ptr”
12:17:14FromDiscord<fumamatar> I thought so. But then I dont understand how the payload (which is a ptr) is resolved to the actual bytes, while the header (which is a ref) is not and writes the address instead of the bytes to my buffer
12:19:27FromDiscord<sOkam!> I'm trying to understand the structure of what `parseJson( .. )` is doing↵How can I output the `JsonNode` data that from that function into a text file for reading?↵I tried writeFile, but it didn't like it not being a string https://media.discordapp.net/attachments/371759389889003532/925362306521657344/unknown.png
12:22:21FromDiscord<sOkam!> ~deleted~↵nvm, I solved it with bash `>` 🙂
12:22:32FromDiscord<Rika> You’re getting the address of the ref, think about what getting the address of a pointer is 😛
12:22:32FromDiscord<sOkam!> (edit) "~deleted~↵nvm," => "~~deleted~~↵nvm,"
12:22:42FromDiscord<Rika> A pointer to a pointer, so not what you want
12:23:12FromDiscord<fumamatar> oh yea right
12:24:17NimEventerNew Nimble package! py2nim - Py2Nim is a tool to translate Python code to Nim. The output is human-readable Nim code, meant to be tweaked by hand after the translation process., see https://github.com/Niminem/Py2Nim
12:24:26FromDiscord<fumamatar> sent a code paste, see https://play.nim-lang.org/#ix=3JKh
12:32:01FromDiscord<Rika> You could probably cast to a `pointer` “safely” in this case
12:32:43*beshr joined #nim
12:32:47*neceve joined #nim
12:36:33FromDiscord<fumamatar> That is possible, but leads to the same output as using addr
12:36:43FromDiscord<fumamatar> somehow
12:37:04FromDiscord<sOkam!> sent a code paste, see https://play.nim-lang.org/#ix=3JKi
12:38:33FromDiscord<fumamatar> I think A is an array, and B is a set?
12:39:58FromDiscord<Rika> Yes
12:40:48FromDiscord<sOkam!> is it the same if the contents of 1 and 2 are strings?
12:44:45FromDiscord<fumamatar> Not really, they are different types with different characteristics
12:45:04*rockcavera joined #nim
12:45:04*rockcavera quit (Changing host)
12:45:04*rockcavera joined #nim
12:45:26FromDiscord<sOkam!> Yeah, thingB is an error if 1or2 are strings https://media.discordapp.net/attachments/371759389889003532/925368846347554836/unknown.png
12:46:52FromDiscord<sOkam!> In that case, what's the difference between `[]` and `{}` in the context of a `JsonNode`?
12:48:10FromDiscord<sOkam!> Is {} just a hierarchy separator, and [] an array syntax? 🤔
12:51:56FromDiscord<fumamatar> im not familiar with the Json library, can you share some code?
12:57:06FromDiscord<Rika> {} is afaik like many []
12:57:23FromDiscord<Rika> So [][][] -> {,,}
13:00:03*neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat)
13:01:42*neurocyte0132889 joined #nim
13:01:42*neurocyte0132889 quit (Changing host)
13:01:42*neurocyte0132889 joined #nim
13:02:22FromDiscord<sOkam!> In reply to @fumamatar "im not familiar with": about what exactly? a json file, or do you mean something else?
13:02:52FromDiscord<fumamatar> i mean nim's JsonNode class
13:04:47FromDiscord<sOkam!> In reply to @fumamatar "i mean nim's JsonNode": https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/json.nim#L185
13:08:04FromDiscord<sOkam!> Found this, which I think explains it https://media.discordapp.net/attachments/371759389889003532/925374540345929759/unknown.png
13:09:48FromDiscord<Rika> Not that
13:10:10FromDiscord<Rika> https://nim-lang.org/docs/json.html#overview-handling-optional-keys
13:10:13FromDiscord<Rika> Seems to be this
13:10:46*neceve quit (Read error: Connection reset by peer)
13:11:32FromDiscord<Rika> Additionally there is a var arg version of {} but none for [] (because {} is get or default and the latter is just get)
13:14:31FromDiscord<sOkam!> Oh, I should definitely start by reading that page 🙈 ↵Me dummy 🌱
13:16:49FromDiscord<Rika> Lol you’ll get the habit of it soon
13:47:02FromDiscord<retkid> how does -d:danger deal with pointers?
13:47:41FromDiscord<retkid> i keep getting out of memory even though i calculate the size of the pointers correctly
13:48:05FromDiscord<retkid> unless every entry in an ordered list is greater than 16 bytes per entry
13:48:06FromDiscord<Solitude> it doesnt do anything with pointers
13:48:18FromDiscord<retkid> so what does -d:release do with pointers?
13:48:26FromDiscord<Solitude> nothing
13:48:30FromDiscord<retkid> that is untru
13:48:31FromDiscord<retkid> (edit) "untru" => "untrue"
13:48:35FromDiscord<Solitude> okay
13:49:26FromDiscord<retkid> unless you're on the technicality "Well it doesn't TECHNICALLY do anything to pointers but actually it just changes thew way garbage collection is done which affects pointers"
13:49:57FromDiscord<retkid> but, whenever i compile with -d:danger it does the out of memory defect eventually
13:50:50FromDiscord<retkid> it has something to do with the size of the pointer, however, it shouldn't
13:51:16FromDiscord<retkid> it doesnt matter what size i enter when i dont compile with -d:danger but when i do, it does
13:51:45FromDiscord<retkid> so i assume performance and takes cycles to save me and change the size, when danger does not
13:58:25*rockcavera quit (Remote host closed the connection)
14:05:15*badsektor joined #nim
14:38:02*arkurious joined #nim
14:45:22FromDiscord<planetis> does status have any library for string manipulation ?
14:45:29FromDiscord<planetis> a better strutils for example
15:05:22FromDiscord<Shiba> so how do i tell nim to noy use stdlib_system.nim
15:05:29FromDiscord<Shiba> (edit) "noy" => "not"
15:05:47*xet7 quit (Quit: Leaving)
15:23:38*xet7 joined #nim
15:34:39FromDiscord<Solitude> In reply to @retkid "unless you're on the": sorry, telepathy machine broke
15:40:03FromDiscord<konsumlamm> In reply to @Shiba "so how do i": `import pkg/system`?
15:40:25FromDiscord<konsumlamm> or just don't call your module `system`
15:48:26FromDiscord<Shiba> In reply to @konsumlamm "or just don't call": i didn't
15:48:51FromDiscord<Yardanico> In reply to @Shiba "so how do i": You don't
15:49:02FromDiscord<Yardanico> system is always explicitly imported by all Nim modules
15:49:12FromDiscord<Yardanico> Also you probably meant stdlib_system.c
15:49:22FromDiscord<Yardanico> because there's no .nim with that name
15:53:54FromDiscord<sOkam!> If I want to store something in an object like `classSizes.size.NAME`, expecting that call to output a value... is there a better way to do it than Tables?
16:00:48FromDiscord<Shiba> why it's says 10719 lines of code compiled , that aloot ,even my .nim fille is empty
16:01:09*vicecea joined #nim
16:01:36FromDiscord<Shiba> like i know there are necessary libaries for compiling but 10k is ...
16:01:53FromDiscord<Shiba> (edit) "fille" => "file"
16:02:53FromDiscord<Solitude> because it processed 10k lines of code. is that a problem?
16:03:37FromDiscord<Solitude> its nim runtime thats going to be included in every program
16:04:28viceceahi, I'm wondering what would be the simplest way to do the following: I'm looking for a template/macro, e.g. with an identifier of `vecho`, which can be called passing another identifier, e.g. `vecho(my_variable)` and which will effectively do `echo "my_variable: " & my_variable` - can this be done with a template or would I need a macro for that? - thanks for pointers
16:05:40FromDiscord<Solitude> you would need a macro to extract identifier's name, pretty sure
16:06:15viceceaSolitude: thanks! I'll look into macros then
16:08:30FromDiscord<geekrelief> In reply to @vicecea "<@104136074569211904>: thanks! I'll look": https://play.nim-lang.org/#ix=3JMw
16:09:35viceceageekrelief: beautiful! thank you!
16:09:45FromDiscord<Patitotective> I'm new to _Nim_ and I'm looking for a page with all `array` procedures. Is there an API Reference for _Nim_?↵Thanks 🙃
16:10:26FromDiscord<Solitude> In reply to @Patitotective "I'm new to _Nim_": https://nim-lang.org/docs/theindex.html
16:10:37FromDiscord<Solitude> search for array and openArray
16:13:10FromDiscord<Patitotective> is there a `count` procedure for arrays?
16:16:21FromDiscord<Patitotective> nvm
16:20:32*xet7 quit (Ping timeout: 240 seconds)
16:22:26FromDiscord<Hamid_Bluri> In reply to @Patitotective "is there a `count`": there is a count `proc` and a `countIt` template in `std/sequtils`↵https://nim-lang.org/docs/sequtils.html#countIt.t%2Cuntyped%2Cuntyped↵↵but I don't know what you want exacly
16:27:11FromDiscord<Patitotective> In reply to @hamidb80 "there is a count": `count` works 🙃 thanks
16:35:17FromDiscord<Patitotective> can i delete a char at a specific index in a string?
16:38:48*jjido joined #nim
16:42:25*xet7 joined #nim
16:45:04FromDiscord<Solitude> In reply to @Patitotective "can i delete a": https://nim-lang.org/docs/strutils.html#delete%2Cstring%2CSlice%5Bint%5D we have this
16:45:33*noeontheend joined #nim
16:45:48*xet7 quit (Client Quit)
16:46:53*xet7 joined #nim
16:49:22*rockcavera joined #nim
16:49:22*rockcavera quit (Changing host)
16:49:22*rockcavera joined #nim
16:55:34FromDiscord<Shiba> In reply to @Yardanico "Also you probably meant": https://media.discordapp.net/attachments/371759389889003532/925431796462673990/Capture.PNG
16:56:06FromDiscord<Yardanico> it changes the name, in reality it's named system.nim
16:56:25FromDiscord<Yardanico> And again, this is required, it's just that Nim explicitly lists it
16:57:18FromDiscord<Shiba> i saw that it's doesnt show in other nim tetorals when they compile
16:57:38FromDiscord<Shiba> (edit) "doesnt" => "does not"
16:57:46FromDiscord<Shiba> (edit) "tetorals" => "tetorials"
16:57:56FromDiscord<Yardanico> maybe because they're older
16:58:04FromDiscord<Shiba> and there compile line is under 8000
16:58:07FromDiscord<Yardanico> this is completely normal, why are you so concerned about it?
16:58:11FromDiscord<Shiba> (edit) "line" => "lines"
16:58:25FromDiscord<Yardanico> In reply to @Shiba "and there compile lines": Nim grows with time, again, why are you so concerned with this?
16:58:32FromDiscord<Shiba> trying iam trying to find the speed the process
16:58:37FromDiscord<Solitude> In reply to @Shiba "i saw that it's": it doesnt show because it doesnt get recompiled
16:58:47FromDiscord<Shiba> (edit) removed "find the"
16:59:12FromDiscord<Yardanico> In reply to @Shiba "trying iam trying to": That won't help much
16:59:24FromDiscord<Yardanico> We already explained all possible ways to speed up compilation to you
17:01:02NimEventerNew thread by Vitreo12: Bug with peekableOutputStream?, see https://forum.nim-lang.org/t/8749
17:03:38FromDiscord<Yardanico> You just have to accept the fact that with most compiled languages you have compilation and runtime as separate parts, and compile time is important, but less important than runtime performance
17:04:23FromDiscord<Yardanico> In interpreted languages there's no full separate compilation process - the interpreter might parse code into bytecode, but that's about it, then the interpreter just runs the bytecode
17:05:08FromDiscord<Rika> An empty C program also has a runtime that it links to
17:06:30FromDiscord<Yardanico> Also, with compiled languages you don't need to recompile as often because most compiled languages are statically typed, so that already prevents a lot of time spent debugging interpreted programs (I know that some interpreted languages are statically typed, but most of them aren't)
17:06:44FromDiscord<Yardanico> For basic error checking most editors already have Nim plugins that do that for you
17:07:21FromDiscord<Yardanico> You can also use "nim check" from the command line manually to check if you Nim file has any errors
17:07:37FromDiscord<Shiba> how i disbale the embedded debuger
17:08:02FromDiscord<Yardanico> it's not enabled
17:08:41FromDiscord<Yardanico> are you just reading random articles about Nim trying to disable everything? As I said, we already recommended a lot of ways you can improve compile times, but there's still a limit to what you can so to speed up compilation
17:09:26FromDiscord<Shiba> 😢
17:09:40FromDiscord<sOkam!> Is Niminem, the creator of Py2nim, in here?
17:10:52FromDiscord<Shiba> In reply to @Yardanico "are you just reading": No? https://media.discordapp.net/attachments/371759389889003532/925435645617381446/Capture.PNG
17:11:07FromDiscord<Yardanico> it's disabled by default
17:11:12FromDiscord<Shiba> ah ok
17:11:18FromDiscord<Yardanico> Stop reading outdated info PLEASE
17:11:34FromDiscord<Shiba> it's not me the guide is outdated
17:11:42FromDiscord<Yardanico> there's no magical switch that'll make your code compile 10x faster
17:12:26FromDiscord<Shiba> i will try to be patient
17:14:38FromDiscord<Yardanico> really your best bet is to buy an SSD, it can lead to a faster compilation speed without you needing to change the CPU/mobo
17:15:02FromDiscord<Yardanico> HDDs are slow, that's a fact, especially for development because there's a lot of files being read and written
17:15:15nrds<Prestige99> Where was that image from btw @Shiba?
17:15:30FromDiscord<Yardanico> If you have enough RAM you can try compiling in /tmp assuming it's tmpfs
17:15:51FromDiscord<Shiba> In reply to @nrds "<Prestige> Where was that": the official nim compile guide
17:15:54FromDiscord<Yardanico> In reply to @Shiba "No?": Also yeah, forgot to mention
17:16:04FromDiscord<Shiba> (edit) "compile" => "compiler"
17:16:10FromDiscord<Yardanico> As I've said before most compiled languages have two separate stages
17:16:18FromDiscord<Shiba> In reply to @Yardanico "If you have enough": HOW
17:16:21FromDiscord<Yardanico> When you compile the program, and when you run it
17:16:39FromDiscord<Yardanico> In reply to @Shiba "No?": This advice was for reducing runtime of the program
17:16:44FromDiscord<Yardanico> Not compilation time
17:17:23nrds<Prestige99> https://nim-lang.org/docs/nimc.html#optimizing-for-nim interesting
17:17:54FromDiscord<Yardanico> In reply to @Shiba "HOW": copy your code to some folder in /tmp, set the nimcache so it's also some folder in tmp, and maybe even copy the nim distribution to tmp and use it from there if you have enough RAM
17:18:08FromDiscord<Yardanico> But an easier way is to just buy an ssd
17:18:49FromDiscord<Yardanico> small capacity SSDs are really really cheap nowadays, and 60GB will be more than enough for typical programming tasks
17:19:10nrds<Prestige99> Going from HHD -> SSD was such a big difference in general for me. Should've done it much earlier
17:19:15nrds<Prestige99> HDD*
17:19:48FromDiscord<Shiba> In reply to @Yardanico "copy your code to": does it's get erased after i turn off my laptop
17:19:53FromDiscord<Yardanico> yes
17:20:16FromDiscord<Yardanico> that's why this is a big hack and you'll constantly need to copy your work back to the hdd to save it
17:28:13FromDiscord<0ffh> sent a long message, see http://ix.io/3JNX
17:28:24FromDiscord<0ffh> (edit) "http://ix.io/3JNX" => "http://ix.io/3JNY"
17:28:42FromDiscord<0ffh> (edit) "long message," => "code paste," | "https://paste.rs/lFu" => "https://play.nim-lang.org/#ix=3JNZ"
17:29:52FromDiscord<haxscramper> It fails with `hash()` error?
17:29:58FromDiscord<haxscramper> Missing overload for `hash` or `==`?
17:30:20FromDiscord<haxscramper> For custom types you need to implement a hash and equality compare function so you can use them in tables
17:32:27FromDiscord<0ffh> Good idea, but that's not it.↵I get hints about .sideEffect [] and raiseKeyError but I can't interpret them.
17:34:00FromDiscord<0ffh> Maybe table access on custom type have any side effects that are not present for string tables?
17:34:08FromDiscord<0ffh> (edit) "have" => "has"
17:34:17FromDiscord<0ffh> (edit) "type" => "types"
17:35:22FromDiscord<Rika> Can you give the full error in a paste
17:36:02FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=3JO9
17:42:50FromDiscord<Yardanico> In reply to @0ffh "Why does this work": That's because you define an anonymous func for sorting, and [] has a side effect
17:42:57FromDiscord<Yardanico> Try to rename func to proc here
17:43:17FromDiscord<Yardanico> func in Nim is a proc with {.noSideEffect.}
17:44:11FromDiscord<0ffh> In reply to @Yardanico "That's because you define": That's it, how stupid of me, it works now!
17:44:15FromDiscord<0ffh> Thank you!
17:44:28FromDiscord<Solitude> In reply to @Yardanico "That's because you define": what
17:44:43FromDiscord<Yardanico> In reply to @0ffh "Yeah, but it's loooong": @Solitude
17:45:05FromDiscord<Yardanico> His [] calls raiseKeyError that accesses a global variable
17:45:11FromDiscord<Yardanico> (might call)
17:45:23FromDiscord<Yardanico> (edit) "(might" => "(might"
17:45:35FromDiscord<Solitude> i grepped the stdlib and i dont see that variable
17:45:55FromDiscord<Yardanico> it's in his code
17:45:57FromDiscord<Yardanico> Not stdlib
17:46:38FromDiscord<Solitude> your `$` is not pure i guess
17:46:53FromDiscord<Rika> In reply to @0ffh "Why does this work": Here says func
17:47:26FromDiscord<Rika> I'm telling solitude btw
17:47:45FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=3JOh
17:47:57FromDiscord<Solitude> yuck
17:48:01FromDiscord<Rika> Is it not a cost?
17:48:04FromDiscord<Rika> Const
17:48:12FromDiscord<0ffh> (edit) "https://play.nim-lang.org/#ix=3JOh" => "https://paste.rs/G0l"
17:50:44FromDiscord<Yardanico> In reply to @Solitude "your `$` is not": Yeah my mistake, misread the trace
17:50:51FromDiscord<Yardanico> It's good that we have it now at least :)
17:50:52FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=3JOl
17:51:12FromDiscord<Yardanico> In the past the compiler didn't tell you why your code isn't pure
17:51:18FromDiscord<0ffh> (edit) "https://play.nim-lang.org/#ix=3JOl" => "https://play.nim-lang.org/#ix=3JOm"
17:51:18*badsektor quit (Remote host closed the connection)
17:51:42FromDiscord<Yardanico> In reply to @0ffh "What can I do,": well it's not a big deal as you can just continue using proc
17:51:47FromDiscord<no name fits> In reply to @Yardanico "If you have enough": wait how does that work?
17:52:02FromDiscord<Yardanico> In reply to @no name fits "wait how does that": he has an HDD and wants faster compile times
17:52:08FromDiscord<0ffh> In reply to @Yardanico "well it's not a": Yeah, I totally overlooked that was a func
17:52:11FromDiscord<no name fits> because I have plenty of RAM
17:52:20FromDiscord<Yardanico> So one big hack is to compile everything in the ram
17:52:27FromDiscord<Yardanico> if you have an SSD it won't change much
17:53:30FromDiscord<no name fits> I didn't know that was an option
17:53:35FromDiscord<no name fits> Also I have SSD so...
17:54:11FromDiscord<Rika> There's very minimal benefit if you already use an ssd
17:54:32FromDiscord<Yardanico> yeah exactly
17:54:48FromDiscord<no name fits> I don't have any issues with compile times using Nim though
17:55:05FromDiscord<Yardanico> Shiba is just searching for every way he can speed up the compilation somewhat, so I thought about tmpfs
18:32:41FromDiscord<geekrelief> is @Shiba using tcc? That's been the biggest speed up for me.
18:34:17FromDiscord<Shiba> Error: command missing
18:34:19FromDiscord<Shiba> sent a code paste, see https://play.nim-lang.org/#ix=3JPb
18:34:30FromDiscord<geekrelief> you need to have the Tiny C Compiler installed
18:34:43FromDiscord<Shiba> (edit) "https://play.nim-lang.org/#ix=3JPb" => "https://play.nim-lang.org/#ix=3JPc"
18:34:52FromDiscord<Shiba> do i need to also provide a path to tcc
18:34:55FromDiscord<geekrelief> https://github.com/TinyCC/tinycc
18:35:04FromDiscord<geekrelief> it should be in your path
18:35:10FromDiscord<geekrelief> once you install it
18:35:27FromDiscord<Shiba> i did
18:36:35FromDiscord<geekrelief> I don't have enough on to help you debug that. If tcc is in your PATH, nim should be able to find it
18:39:57*Gustavo6046 joined #nim
18:42:52FromDiscord<Shiba> so
18:52:02*xet7 quit (Ping timeout: 240 seconds)
19:08:59FromDiscord<Shiba> so i created a ram disck naand i put nim , my projects on it and nothing changed still 4s
19:09:08FromDiscord<Shiba> (edit) "disck" => "disk"
19:09:13FromDiscord<Shiba> (edit) "naand" => "and"
19:09:21FromDiscord<Shiba> (edit) "," => " and"
19:09:42*FromDiscord quit (Remote host closed the connection)
19:09:55*FromDiscord joined #nim
19:10:51FromDiscord<Solitude> reading/writing files takes tiny fraction of entire compilation, ofc it doesnt yield any meaningful speedups
19:26:51FromDiscord<hmmm> shouldn't nim compile speed be something like in the upper 5% of compiled langs already? How much speed do you need more my gud man, are you trying to compile skynet or smth
19:27:52FromDiscord<Shiba> do you think 5 seconds is fast for testing
19:27:57FromDiscord<hmmm> I mean when I press F7 I get dot dot dot bam finished
19:28:05FromDiscord<hmmm> its like 2 secs
19:30:29FromDiscord<geekrelief> In reply to @Shiba "do you think 5": you should really figure out why tcc isn't working for you
19:31:12FromDiscord<geekrelief> it's must faster for iteration
19:31:16FromDiscord<geekrelief> (edit) "must" => "much"
19:31:52FromDiscord<Shiba> In reply to @Elegantbeef "On windows i think": a guide?
19:32:20FromDiscord<Shiba> (edit) "In reply to @Elegantbeef "On windows i think": a guide? ... " added "(instrunction to install and setup)"
19:32:33FromDiscord<geekrelief> @Shiba Are you on windows?
19:32:38FromDiscord<Shiba> yes
19:32:45FromDiscord<geekrelief> there's a windows folder for tcc
19:32:51FromDiscord<geekrelief> the instructions are in there
19:33:17FromDiscord<geekrelief> https://github.com/TinyCC/tinycc/tree/mob/win32
19:33:49*cheer left #nim (WeeChat 3.4)
19:34:05FromDiscord<Shiba> do you mean to build it
19:36:34FromDiscord<hmmm> today I needed to call one line of a python lib for a test and I was staring at my screen for a good 10 seconds, thought I hit some weird while true loop but no it was working as intended lol. I'd say 5 secs is not so bad. What langs do consistently better than that?
19:36:54FromDiscord<geekrelief> If you downloaded the binary I guess that would work too. I'm don't know why nim can find tcc if it's in your path. I have tcc built from the repo
19:37:50FromDiscord<geekrelief> In reply to @hmmm "today I needed to": 5 secs is ok if you have a big project, but for something under 100K lines I expect faster for iteration
19:38:04FromDiscord<geekrelief> I get subsecond compile times with tcc
19:38:20FromDiscord<hmmm> woa thats fast
19:38:31FromDiscord<hmmm> shiba get tcc my man
19:38:47FromDiscord<geekrelief> tm-nim https://media.discordapp.net/attachments/371759389889003532/925472868962287667/Umtezvizeu-1.mp4
19:42:06FromDiscord<geekrelief> if this was gcc it'd be about 4 seconds, vcc is way longer. I heard about mold recently and I wonder if I should give clang a try
19:42:21FromDiscord<geekrelief> oh I forgot mold doesn't support windows yet
19:43:16FromDiscord<geekrelief> maybe it's time for me to upgrade to windows 11 and install wsl 😄
19:44:03FromDiscord<Shiba> so ican compile c code with tcc but nim still can't find it
19:45:05FromDiscord<hmmm> people can actually install w11? I have like a big banner saying "dude get ready we preparin w11 as we speak" since 6 months
19:45:25FromDiscord<Yardanico> In reply to @geekrelief "if this was gcc": mold won't help you
19:45:35FromDiscord<Yardanico> It's aimed at bigger applications that take long to link
19:45:37FromDiscord<Yardanico> Like chromium
19:45:40FromDiscord<hmmm> I actually look forward to w11 because apparently you can get the new terminal as default
19:45:55FromDiscord<Yardanico> I've tested it and the difference was negligible
19:45:57FromDiscord<geekrelief> In reply to @Yardanico "It's aimed at bigger": oh yeah good point. those are huge 🙂
19:46:20FromDiscord<Yardanico> In reply to @hmmm "people can actually install": ??? yes, it's already out
19:47:32FromDiscord<geekrelief> I've been holding off on installing. Got a fresh ssd for it, but I hate having to reinstall everything.
19:50:25FromDiscord<geekrelief> In reply to @Shiba "so ican compile c": Do you have Visual Studio installed? Can you compile with `--cc:vcc`?
20:13:23FromDiscord<Shiba> In reply to @geekrelief "Do you have Visual": no , and i cant think of an ide running on a pentium
20:14:02FromDiscord<Shiba> the error is the same whatever i put as an argument
20:15:03FromDiscord<Shiba> (edit) "the error is the same whatever i put as an argument" => "sent a code paste, see https://play.nim-lang.org/#ix=3JPR"
21:25:49FromDiscord<Shiba> ok yes it's found but now it's screaming errors
21:25:55FromDiscord<Shiba> (edit) "ok yes it's found ... but" added "it"
21:34:08FromDiscord<Shiba> i think i should change it's to 32 bit since it's the only supported architecteur
21:52:44FromDiscord<Shiba> https://media.discordapp.net/attachments/371759389889003532/925506580026368000/Capture.PNG
22:03:16FromDiscord<hmmm> I just tried tcc for kicks, it's faster no doubt, but the runtime will be slower right?
22:04:09FromDiscord<Shiba> In reply to @hmmm "I just tried tcc": yes , some libaries wont work tho since it's 32 bit only , and you will need to modify the pointers in the c filles
22:04:32FromDiscord<hmmm> I thought I downloaded tcc 64
22:04:46FromDiscord<hmmm> or that's what my man fabrice said on his website
22:05:15FromDiscord<Shiba> maybe the installer is for 64 bit cpus
22:08:05FromDiscord<Shiba> In reply to @hmmm "I thought I downloaded": oh wait you use linux ?, ok you're good to go
22:08:16FromDiscord<hmmm> nu I'm on w10
22:18:34*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:19:12FromDiscord<Elegantbeef> Indeed↵(@hmmm)
22:19:27FromDiscord<Elegantbeef> TCC's speed is all "let's get the fastest to binary" not "let's get the fastest binary"
22:27:07*Gustavo6046 quit (Quit: Leaving)
22:30:07FromDiscord<Shiba> now i need to find those libaries that my nim package use and fix the pointers
22:32:54FromDiscord<Shiba> nevermind it's works
22:33:55FromDiscord<Yardanico> In reply to @Shiba "yes , some libaries": What? You don't need to modify any pointers
22:34:16FromDiscord<Yardanico> If your Nim compiler is 64-bit and the C compiler is 32-bit then just compile with --cpu:i386
22:34:23FromDiscord<Yardanico> If you want 32-bit binaries
22:35:15FromDiscord<Shiba> okay okay🥺
22:35:27*Gustavo6046 joined #nim
22:36:15FromDiscord<Yardanico> In reply to @Shiba "": There's an easy workaround for that too
22:36:17FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/19041#issuecomment-962548645
22:36:52FromDiscord<Shiba> i should dig deeper before i ask here
22:38:24*vicfred joined #nim
22:39:57FromDiscord<Yardanico> But again, tcc will only help with C compilation speed, Nim compilation speed will be the same
22:44:41FromDiscord<Shiba> yes the c compiling part is now faster
23:06:26*noeontheend quit (Read error: Connection reset by peer)
23:07:16*noeontheend joined #nim
23:41:35FromDiscord<evoalg> In reply to @Solitude "i grepped the stdlib": did you download docs so yo can use grep on the command line? I love grep, but how do I download docs in a nice format? ... or do you use html files?
23:46:48FromDiscord<Yardanico> he probably just grepped the src
23:47:07FromDiscord<evoalg> is that downloaded by default?
23:47:14FromDiscord<Yardanico> of course?
23:47:19FromDiscord<Yardanico> nim has to compile your code somehow
23:47:24FromDiscord<evoalg> ahhh true
23:47:26FromDiscord<Yardanico> if you import the stdlib it needs to get the stdlib from somewhere
23:47:36FromDiscord<evoalg> gotcha - thank you!