<< 20-03-2021 >>

00:01:26FromDiscord<ShadowElf37> `static[range[3..high(int)]]` this compiles
00:02:52FromDiscord<ShadowElf37> but
00:03:11FromDiscord<ShadowElf37> `Shape[2, 2]` doesnt crash
00:03:34FromDiscord<ElegantBeef> Yea i got a solution https://play.nim-lang.org/#ix=2Tts
00:03:52FromDiscord<ElegantBeef> not ideal, but it works
00:04:14FromDiscord<ShadowElf37> lol
00:04:33FromDiscord<ShadowElf37> i mean at that rate i might as well stick to a newShape()
00:05:05FromDiscord<ElegantBeef> You mean `initShape` πŸ˜›
00:05:14FromDiscord<ShadowElf37> `newShape` 😠
00:05:29FromDiscord<ElegantBeef> In nim conventions `new` indicates a heap allocated object
00:05:40FromDiscord<ElegantBeef> `init` is used to indicate a stack allocated object
00:05:40FromDiscord<ShadowElf37> mm fair enough
00:06:17FromDiscord<ShadowElf37> maybe i should go complain that this doesnt work on github
00:06:32FromDiscord<ElegantBeef> Possibly
00:06:41FromDiscord<ShadowElf37> the error message at the very least is
00:06:42FromDiscord<ShadowElf37> obtuse
00:06:42FromDiscord<ElegantBeef> Might be an issue already for it, either way go check and make one!
00:07:23FromDiscord<ShadowElf37> you know being a python dev, i didnt really understand what language maturity meant↡after spending 1 month with nim and opening 4 issues on github, i think i'm starting to get it
00:07:31FromDiscord<ShadowElf37> lol
00:07:36FromDiscord<ShadowElf37> still love the language
00:07:54FromDiscord<ElegantBeef> Well python makes it easy it's 30 years old and types dont exist πŸ˜›
00:08:40FromDiscord<ShadowElf37> downside is its flaws are also very mature and will never go away πŸ™‚
00:08:59FromDiscord<ElegantBeef> Pythons?
00:09:03FromDiscord<ShadowElf37> yeah
00:09:42FromDiscord<ElegantBeef> Well they have no intention in fixing the flaws in the language design, lack of static types, whitespace stupidity and no actual private/public
00:10:14FromDiscord<ElegantBeef> Having to do `\` on multi-line statements is just odd
00:10:32FromDiscord<ShadowElf37> have you done a lot of python before
00:10:34FromDiscord<ElegantBeef> Nope
00:10:38FromDiscord<ShadowElf37> yeah i figured
00:10:44FromDiscord<ShadowElf37> those are baby issues
00:10:45FromDiscord<ShadowElf37> lol
00:10:57FromDiscord<ElegantBeef> lack of static types is a massive issue to me
00:11:32FromDiscord<ShadowElf37> python was my first language and ive been using it forever so that never really bothered me
00:11:37timdorohinEven PHP finally has something akin to type checking
00:11:47FromDiscord<ShadowElf37> when they introduced type annotations it was enough for me to not mess up
00:12:23FromDiscord<ShadowElf37> and honestly duck typing is really nice if you have a lot of very similar objects floating around
00:13:27FromDiscord<ShadowElf37> my real problems were its speed and the global interpreter lock
00:13:42FromDiscord<ShadowElf37> and compared to nim its metaprogramming ability feels really archaic and useless
00:13:59FromDiscord<ShadowElf37> and it has a terrible ffi
00:14:40FromDiscord<ShadowElf37> and it's really hard to make executables
00:14:45FromDiscord<ShadowElf37> and when you do they're massive and eat ram
00:14:51FromDiscord<ShadowElf37> i could go on
00:15:08FromDiscord<ElegantBeef> Also it's limited to the hardware it can run on πŸ˜„
00:15:18FromDiscord<ShadowElf37> yep!
00:15:22FromDiscord<ElegantBeef> Looks at micro python being slow as all balls on embedded
00:15:35FromDiscord<ShadowElf37> you cant even control the memory at all
00:15:45FromDiscord<ShadowElf37> like even your arrays are managed for you
00:15:52FromDiscord<ShadowElf37> pissed me off sometimes
00:16:17FromDiscord<ShadowElf37> idk why you'd try to use it on embedded unless you were too lazy to learn something like nim
00:16:32FromDiscord<ElegantBeef> Rpi is pushing it for the pico πŸ˜„
00:17:09FromDiscord<ShadowElf37> get with the times rpi 😎 nim is the next python
00:17:47FromDiscord<ElegantBeef> Dont ever say that again
00:17:59FromDiscord<ElegantBeef> If nim is the next python i have to put my boots on and leave
00:18:25FromDiscord<ShadowElf37> fiiine but can the compiler at least not crash every other day 😭
00:18:31FromDiscord<ElegantBeef> Mine doesnt πŸ˜„
00:18:41FromDiscord<ShadowElf37> i guess i just have a talent for breaking things
00:18:46FromDiscord<ElegantBeef> Write better code πŸ˜›
00:18:59FromDiscord<ShadowElf37> writes new compiler
00:23:11FromDiscord<aryn> In reply to @ElegantBeef "Well they have no": > whitespace stupidity↡↡you mean: IndentationError: Inconsistent use of tabs and spaces :mmCat:
00:25:32FromDiscord<ElegantBeef> That and the `\`
00:25:59FromDiscord<aryn> i prefer nim's approach of spaces only
00:26:16FromDiscord<aryn> any good IDE can manage automatically jumping 4 spaces when you hit tab
00:26:31FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2Ttw
00:26:42FromDiscord<ElegantBeef> Well almost all editors default to 4 spaces for a tab
00:26:56FromDiscord<ElegantBeef> You have to opt-in to use tabs, and as such most people that are for tabs dont actually use tabs πŸ˜„
00:27:11FromDiscord<ElegantBeef> ~~I personally like tabs due to customizabillity~~
00:27:20FromDiscord<ShadowElf37> You wot?
00:27:37FromDiscord<aryn> all i need is the ability to have tab-esk behaviour
00:27:43FromDiscord<aryn> you hit tab is makes 4 spaces
00:27:47FromDiscord<aryn> or a tab char, either or
00:27:55FromDiscord<ElegantBeef> Well that's the default in most editors
00:28:17FromDiscord<ShadowElf37> No good reason not to use Pycharm
00:28:29FromDiscord<ElegantBeef> Tabs give the user customiziabillity for the indentation level without encoding it in the file, so they have control
00:28:38FromDiscord<aryn> sent a long message, see http://ix.io/2Tty
00:29:00FromDiscord<aryn> in order of most annoying
00:31:28FromDiscord<ShadowElf37> oh yeah its import resolution is horrendous
00:31:41FromDiscord<aryn> ../ just.. isnt a thing
00:31:53FromDiscord<aryn> for no reason whatsoever, although nim has it. which makes me sane
00:32:09FromDiscord<ShadowElf37> you have to do `from . import x.x`
00:32:14FromDiscord<ShadowElf37> no it does not make sense
00:32:20FromDiscord<ShadowElf37> no you cannot go further back than that
00:32:27FromDiscord<aryn> . is the current dir no?
00:32:31FromDiscord<ShadowElf37> yeah
00:32:33FromDiscord<aryn> yeah
00:32:48FromDiscord<aryn> iirc you can with some weird module hackery
00:33:04FromDiscord<aryn> but realistically just copying / simlinking the file is more appealing
00:33:56FromDiscord<ShadowElf37> best part is when your IDE automatically includes subdirectories in the python path, so when you try to run it anywhere else the imports break
00:35:43FromDiscord<ElegantBeef> Thought the best part was when you're using annotated functions so the global variables are inaccessible to your scope without doing `global varName`
00:35:53FromDiscord<aryn> also i did not know '$' was a standard proc to implement. https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html gives the impression its similar to the JVM toString method?
00:36:03FromDiscord<ElegantBeef> It's the stringification operator
00:36:07FromDiscord<aryn> ye
00:36:20FromDiscord<ElegantBeef> echo internally invokes it for all parameters
00:36:27FromDiscord<aryn> oh nice
00:36:35FromDiscord<ElegantBeef> So generally speaking if you want custom output you override it and it makes live better
00:36:46FromDiscord<ElegantBeef> Though Nim's default echo for types is very good
00:36:47FromDiscord<aryn> understandable
00:37:00FromDiscord<aryn> similar to the JVM langs then
00:37:25FromDiscord<aryn> its often advised to override it since you just get memory addresses through the default implementation
00:37:50FromDiscord<ElegantBeef> Well Nim's default on objects is very nice, it's `fieldname: value`
00:37:58FromDiscord<aryn> oh, nice
00:38:08FromDiscord<ElegantBeef> Though you cannot use it on ref objects
00:38:14FromDiscord<aryn> understandably so
00:38:15FromDiscord<ElegantBeef> Unless you manually dereference them
00:38:21FromDiscord<aryn> can you print memory locations?
00:38:29FromDiscord<ElegantBeef> `ptr.repr`
00:38:34FromDiscord<aryn> ah
00:38:40FromDiscord<aryn> i couldnt get it the other day
00:38:43FromDiscord<ElegantBeef> That shows the entire pointer indirection
00:38:51FromDiscord<aryn> lemme have a see
00:39:12FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2TtA
00:39:49FromDiscord<aryn> indeed https://media.discordapp.net/attachments/371759389889003532/822630474006003722/unknown.png
00:40:15FromDiscord<ShadowElf37> oh thats cool i didnt know that
00:40:22FromDiscord<ShadowElf37> i was doing `cast[int](ptr)`
00:40:38FromDiscord<aryn> oh lol
00:40:39FromDiscord<ElegantBeef> Well that's if you just want the highest pointer
00:40:45FromDiscord<ElegantBeef> If you have nested pointers this will resolve it for you
00:40:56FromDiscord<aryn> like fields to an object?
00:41:00FromDiscord<aryn> as a nested pointer
00:41:14FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2TtB
00:41:18FromDiscord<aryn> i came from java/kotlin we have no pointers
00:41:24FromDiscord<ElegantBeef> Well in java you have references
00:41:30FromDiscord<ElegantBeef> Pointers are just managed references
00:41:36FromDiscord<aryn> well yeah but its not exposed
00:41:52FromDiscord<aryn> ah so you make a pointer of a pointer of a pointer
00:41:52FromDiscord<ShadowElf37> imagine accessing memory↡this meme was made by python gang
00:42:08FromDiscord<ElegantBeef> Well you dont often need the lowlevel stuff in Nim
00:42:11FromDiscord<aryn> java doesnt allow any actual access to memory either lmao
00:42:23FromDiscord<ElegantBeef> It abstracts a lot of the low level very efficiently
00:42:38FromDiscord<aryn> i might try inject into some exes with nim, seems like it could do it fine
00:42:51FromDiscord<ElegantBeef> The rule is "If C can do it Nim can do it"
00:43:15FromDiscord<aryn> well c / cpp is the preferred lang for some stuff like
00:43:23FromDiscord<ShadowElf37> oh yeah? where is nim's `goto` 😠 ?
00:43:40FromDiscord<aryn> proc
00:43:41FromDiscord<aryn> :^)
00:44:01*kuon joined #nim
00:44:16FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=2TtC
00:44:26FromDiscord<ElegantBeef> Goto is just hard to reason about
00:45:22FromDiscord<ShadowElf37> ah but then it doesnt work in procs
00:45:30FromDiscord<ElegantBeef> That works in procs
00:45:38FromDiscord<ShadowElf37> no like a proc cant break out of hehe
00:45:44*krux02 quit (Ping timeout: 240 seconds)
00:45:46FromDiscord<ElegantBeef> What?>
00:45:47FromDiscord<ElegantBeef> (edit) "What?>" => "What?"
00:45:54FromDiscord<aryn> well.. it wouldnt be in it?
00:46:06FromDiscord<ShadowElf37> sorry i meant procs dont work in it
00:46:11FromDiscord<ShadowElf37> not it doesnt work in procs
00:46:13FromDiscord<ElegantBeef> Uhh
00:46:20FromDiscord<ElegantBeef> They should
00:46:48FromDiscord<ShadowElf37> you can break out of blocks in another scope with a proc?
00:46:55FromDiscord<aryn> sent a code paste, see https://play.nim-lang.org/#ix=2TtE
00:47:00FromDiscord<aryn> (edit) "https://play.nim-lang.org/#ix=2TtE" => "https://play.nim-lang.org/#ix=2TtF"
00:47:04FromDiscord<ElegantBeef> Ah you're right
00:47:07FromDiscord<ElegantBeef> I figured it'd work
00:47:20FromDiscord<aryn> you can break hoho tho
00:47:27FromDiscord<ShadowElf37> i tried to make a `goto` macro for fun and this was my one roadblock to making it work
00:47:45FromDiscord<ElegantBeef> Well it's a silly thing to make, so there's your first problem πŸ˜›
00:47:50FromDiscord<ElegantBeef> But let's see
00:47:54FromDiscord<ShadowElf37> but i want it 😒
00:47:57FromDiscord<ElegantBeef> Why?
00:48:01FromDiscord<ShadowElf37> for fun 😭
00:50:12FromDiscord<aryn> in other news: OVH almost went on fire agan
00:50:13FromDiscord<aryn> (edit) "agan" => "again"
00:50:35FromDiscord<aryn> sent a long message, see http://ix.io/2TtG
00:51:07FromDiscord<ShadowElf37> 😳
00:52:41FromDiscord<aryn> :iOSFlushed:
00:55:12FromDiscord<ElegantBeef> Seems like if you turned each scope into a anonymous procedure you could then make a procedure per scope then replace the `goto name` with a procedure call πŸ˜„
00:55:28*Gustavo6046 quit (Ping timeout: 245 seconds)
00:55:37*Gustavo6046_ joined #nim
00:56:36FromDiscord<ShadowElf37> yeah thats actually how i implemented it at first
00:56:41FromDiscord<ShadowElf37> two problems though
00:57:07FromDiscord<ShadowElf37> 1. if you goto within the proc, you end up getting nested, and then code after the goto will be executed eventually
00:57:28FromDiscord<ShadowElf37> 2. if you solve that by adding return, it wont work outside an anonymous procedure
00:57:59*Gustavo6046_ is now known as Gustavo6046
00:58:19FromDiscord<ShadowElf37> now this could be done if there was a way to detect the scope at compile time
00:58:56FromDiscord<ElegantBeef> There is though
00:59:07FromDiscord<ShadowElf37> what is it
00:59:12FromDiscord<ElegantBeef> give me a second
01:00:11FromDiscord<ShadowElf37> also even if you add the return, making a loop with goto will probably trigger the recursion limit
01:00:25FromDiscord<ShadowElf37> maybe there's a way around that though
01:00:36FromDiscord<ElegantBeef> Well recursion limit is a debug only thing
01:00:40FromDiscord<ShadowElf37> oh really
01:00:46FromDiscord<ElegantBeef> Well there is a stack limit
01:00:56FromDiscord<ElegantBeef> But the debug builds have a recursion limit of like 1000 i think
01:01:02FromDiscord<ShadowElf37> 2000 yeah
01:01:07FromDiscord<ShadowElf37> but i mean
01:01:12FromDiscord<ShadowElf37> is a stack limit any better lol
01:06:48FromDiscord<ShadowElf37> https://nim-lang.org/docs/manual.html#pragmas-asmnostackframe-pragma
01:06:49FromDiscord<ElegantBeef> @ShadowElf37 here is my silly solution https://play.nim-lang.org/#ix=2TtK
01:07:04FromDiscord<ShadowElf37> lmao this code
01:07:26FromDiscord<ShadowElf37> also look at that link it might fix the nesting
01:08:06FromDiscord<ElegantBeef> Seems like i might be wrong with the break outer but meh
01:08:12FromDiscord<ElegantBeef> Close enough πŸ˜›
01:10:22FromDiscord<ShadowElf37> i cant even test edge cases cause there's no macro but i have a feeling that changing this even slightly will break lmao
01:10:46FromDiscord<ElegantBeef> Hey you're the one that wanted to make goto
01:10:55FromDiscord<ElegantBeef> I fully believe it's doable with a macro
01:11:02FromDiscord<ShadowElf37> uh huh
01:11:06FromDiscord<ShadowElf37> make it then 😏
01:11:16FromDiscord<ElegantBeef> Sorry i only make macros for useful things
01:11:31FromDiscord<ShadowElf37> thats what i thought 😏
01:12:21FromDiscord<ElegantBeef> Well you havent provided evidence it's impossible to implement
01:12:27FromDiscord<ElegantBeef> So get back to me when you d
01:12:29FromDiscord<ElegantBeef> (edit) "d" => "do"
01:13:03FromDiscord<ShadowElf37> i'll make one that's so tantalizingly close to working that you cant help but fix it for me πŸ™‚
01:16:38FromDiscord<ElegantBeef> Bet you wont
01:20:13*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:20:32*njoseph joined #nim
01:24:59FromDiscord<ShadowElf37> sent a code paste, see https://play.nim-lang.org/#ix=2TtN
01:25:12FromDiscord<ShadowElf37> checkmate i win
01:25:24FromDiscord<ElegantBeef> Except you didnt prove anything
01:25:40FromDiscord<ShadowElf37> compiler will think its undefined no matter what
01:25:59FromDiscord<ElegantBeef> goto and section could subscribe the body into a macrocache that then requires openning with `impl(forward)`
01:26:43FromDiscord<ShadowElf37> ok that might actually be a better way to approach this ngl
01:27:49FromDiscord<ElegantBeef> Well my block statment does the same thing just without the impl step
01:28:15FromDiscord<ElegantBeef> `goto` would enable goto inside the code, then replace it with then entire generated procedures + goto logic
01:28:47FromDiscord<ShadowElf37> ok but having a macro at the top that just rewrites everything is cheating
01:28:59FromDiscord<ElegantBeef> Literally how you're supposed to use macros to solve problems
01:29:17FromDiscord<ShadowElf37> yeah but it's not really like goto if i have to do that
01:29:45FromDiscord<ElegantBeef> Well it's not apart of the language so you cannot get it 1:1
01:30:25FromDiscord<ShadowElf37> not with that attitude you cant πŸ˜„
02:14:18*Gustavo6046 quit (Ping timeout: 256 seconds)
02:54:24*wasted_youth2 quit (Quit: Leaving)
03:19:35FromDiscord<clyybber> In reply to @ElegantBeef "Pointers are just managed": heh, are you sure beef? ;p
03:19:50FromDiscord<ElegantBeef> I had that backwards
03:19:52FromDiscord<ElegantBeef> πŸ˜„
03:20:45FromDiscord<ElegantBeef> I think i meant "unmanaged" but didnt write it
03:21:03FromDiscord<exelotl> managed... by you :P
03:21:09FromDiscord<clyybber> haha
03:22:22FromDiscord<ElegantBeef> I wonder if prestige is farming the food for his meal himself πŸ˜„
03:23:16FromDiscord<ElegantBeef> Said he'd talk to me this evening, almost 10pm now πŸ˜„
03:43:51FromDiscord<Livingstone> is there any form of sequence or array in nim that can store different values
03:44:12FromDiscord<ElegantBeef> You mean like float/int?
03:44:27FromDiscord<Livingstone> I mean like a seqence and a float
03:44:35FromDiscord<Rika> Homogenous only
03:44:53FromDiscord<Rika> Wrap in an object variant if you need multiple kinds
03:46:53FromDiscord<ElegantBeef> Quite simple thing to do https://play.nim-lang.org/#ix=2Tuc
03:49:24FromDiscord<Livingstone> I'm just going to show my code and ask if it's possible
03:50:00FromDiscord<ElegantBeef> I mean i just showed it is πŸ˜„
03:50:41FromDiscord<Livingstone> no I mean what I want to do
03:50:43FromDiscord<Livingstone> https://play.nim-lang.org/#ix=2Tud
03:51:15FromDiscord<Livingstone> if you look at the get_neighbors proc
03:51:32FromDiscord<Livingstone> distances.add train_row, dist
03:51:48FromDiscord<Livingstone> and then I want to sort that data
03:53:09FromDiscord<ElegantBeef> You havent explained where the boxed values are needed, or why
03:53:51FromDiscord<Livingstone> because train_row and dist are a seq[float] and a float respectively
03:54:36FromDiscord<ElegantBeef> so add train row then add dist
03:54:42FromDiscord<ElegantBeef> then it'd just be floats
03:56:25FromDiscord<Livingstone> you think that would work?
03:56:40FromDiscord<ElegantBeef> Well i dont know what the underlying logic is, but if you just want them all together in a single list that'd work
03:57:02FromDiscord<ElegantBeef> there is a `seq.add(openArray[T])`
03:57:08FromDiscord<ElegantBeef> So i know it'd technically work
04:09:00*spiderstew_ joined #nim
04:09:37*spiderstew quit (Ping timeout: 260 seconds)
04:26:18PrestigeHey @ElegantBeef I'm hopping on discord now if you're available
04:26:30FromDiscord<ElegantBeef> ok
04:36:04FromDiscord<Livingstone> why does nim only have homogenous iterables
04:38:27leorize[m]homogenous iterables?
04:45:28FromDiscord<ElegantBeef> Wait until you see field or fieldPairs
05:22:53PrestigeBeef I added you to the repo if you wanted to use it for testing - it's the scriptloader branch we were on
05:23:39FromDiscord<ElegantBeef> Ok
05:26:17FromDiscord<ElegantBeef> Eh! My tests pass!
05:29:47FromDiscord<ElegantBeef> Well i ticked the version to 0.2.0 so if you wanna give that a whirl to save me a minute πŸ˜›
05:31:09Prestigesame error it seems
05:31:34FromDiscord<ElegantBeef> I cant even get it to compile
05:31:51Prestigedeps issue?
05:32:06FromDiscord<ElegantBeef> `prestigebot.nim(50, 12) Error: undeclared field: 'text' for type irc.IrcEvent [declared in /home/jason/.nimble/pkgs/irc-0.3.0/irc.nim(85, 3)]`
05:32:34Prestigeneed to update irc module
05:33:53FromDiscord<ElegantBeef> I have 0.3.0
05:34:05Prestigelooks like they didnt publish a new release
05:34:17PrestigeI installed it locally
05:35:06*lritter joined #nim
05:37:15Prestigeor you can just change it to raw instead of text if you want
05:37:24FromDiscord<ElegantBeef> Eh i just installed #head
05:45:00FromDiscord<ElegantBeef> So seems `createInterpreter` just doesnt respect the `std/` searching the system path
05:46:56FromDiscord<ElegantBeef> So now you can just `cp` the Nim stdlib to the project and just replace all `std/`, but that's not great
05:47:02FromDiscord<ElegantBeef> Have to investigate why it doesnt work further
06:02:52FromDiscord<ElegantBeef> Saem what're you working on?
06:03:08saemLearning about converters
06:03:23FromDiscord<ElegantBeef> Just remove them πŸ˜›
06:03:25saemAnd making sure I understand that and typerels
06:08:35FromDiscord<ElegantBeef> Ah i've found the issue with it prestige when you imported options it imported typetrait which then attempted to get a std import relative to itself for whatever reason which generated this import path `/stdlib/pure/stdlib/core/macros.nim`
06:08:58Prestigeoh, nice
06:09:01Prestigehmm
06:09:22FromDiscord<ElegantBeef> Nervously reasons about a solution in the compiler
06:16:03FromDiscord<ElegantBeef> Hey i think i have viable solution
06:16:10FromDiscord<ElegantBeef> Though idk if it'll be accepted πŸ˜›
06:16:18saemWhat ya thinking?
06:18:05FromDiscord<ElegantBeef> Actually this is easier than i thought, so it's just a single else
06:19:32saemIdeally it's less conditionals. :D
06:21:11FromDiscord<ElegantBeef> Well ideally we dont add the current path to a module path if it's prefixed with `std`
06:21:12FromDiscord<ElegantBeef> https://github.com/nim-lang/Nim/blob/devel/compiler/options.nim#L811
06:23:06FromDiscord<ElegantBeef> Hence the issue i had since typetraits is inside `pure` it appended `stdlib/pure/` to the start for the `std/macros` import statement which was found at `core/macros`
06:24:05FromDiscord<ElegantBeef> This version works for me but i'm uncertain if it breaks the actual compiler https://play.nim-lang.org/#ix=2TuE
06:25:19FromDiscord<ElegantBeef> So let's hope the compiler builds and tests pass πŸ˜„
06:28:36FromDiscord<ElegantBeef> Also saem good job again on fixing nimsuggest, was so much less tedious to go around after properly opening the compiler folder
06:29:48saemAww, thanks! But it's lots of other people's work.
06:30:15saemI'm noticing it becoming easier and easier too though, which is awesome.
06:30:30FromDiscord<ElegantBeef> Ah, thought the vscode spawning was the main issue πŸ˜„
06:32:44saemOh, that's another thing.
06:34:06FromDiscord<ElegantBeef> Tests are passing, and i'm nervously sweating
06:34:48saemI would look at the tests, you might be able to throw in a few more tests to cover the bases.
06:35:07FromDiscord<ElegantBeef> I'm testing all cause i touched the module find logic
06:35:11saemI'm doing that now for converters now.
06:45:30FromDiscord<Livingstone> anyone know of a np.zeroes like function for nim
06:46:03FromDiscord<ElegantBeef> Nim auto inits memory
06:46:10FromDiscord<ElegantBeef> So it's just `newSeq(size)`
06:46:31FromDiscord<Livingstone> doesnt np.zero only apply to arrays
06:46:49FromDiscord<ElegantBeef> Arrays have to be compile time constant size
06:46:53FromDiscord<InventorMatt> if you use arraymancer you can create a zeros tensor of arbitrary size
06:47:28*narimiran joined #nim
06:48:11FromDiscord<Livingstone> In reply to @InventorMatt "if you use arraymancer": does it also have a .shape like method?
06:48:39FromDiscord<InventorMatt> yes it does
07:00:16FromDiscord<ElegantBeef> Well prestige if that PR gets accepted you should be able to use the devel compiler and have it work πŸ˜„
07:41:44ForumUpdaterBotNew Nimble package! spacenimtraders - A new awesome nimble package, see https://github.com/ire4ever1190/SpaceNimTraders
07:42:22*krux02 joined #nim
07:43:29FromDiscord<hobbledehoy> nice
07:51:12*kenran joined #nim
08:07:58*superbia joined #nim
08:12:07*euantorano_ joined #nim
08:12:39*euantorano quit (Ping timeout: 240 seconds)
08:12:40*euantorano_ is now known as euantorano
08:20:15FromDiscord<be> Now i'm waiting for doom being as nimble package
08:46:08*narimiran quit (Ping timeout: 240 seconds)
08:46:26*JStoker quit (Ping timeout: 240 seconds)
08:46:55*JStoker joined #nim
08:47:51FromDiscord<Rika> REST API doom?
08:51:40FromDiscord<mischa_u> In reply to @ElegantBeef "Also saem good job": where can I get this fix?
08:51:47FromDiscord<mischa_u> (edit) "where" => "where/how"
08:55:20*krux02 quit (Remote host closed the connection)
08:55:27FromDiscord<ElegantBeef> I mean just use saems nimsuggest extension and a devel nimsuggest
08:55:55FromDiscord<ElegantBeef> Oh boy i've started with the "i mean" again
08:55:56FromDiscord<ElegantBeef> Shoot me
08:58:53FromGitter<bung87> /Users/bung/.nimble/pkgs/chronos-2.6.1/chronos/asyncsync.nim(301, 27) Error: type mismatch: got <WriteItem> but expected 'Future[asyncstream.WriteItem]' ⏎ /Users/bung/.nimble/pkgs/chronos-2.6.1/chronos/streams/chunkstream.nim(164, 20) Error: attempting to call routine: 'await'
08:59:20FromDiscord<Rika> youre awaiting a sync proc?
08:59:25FromGitter<bung87> why nim doc raise so much error ? I still dont know the reason after one year
09:00:29FromGitter<bung87> no, it report code in chronos, I dont modified it
09:02:04FromDiscord<Goel> How does it work the live "Nim in Action" by Manning? Is there a limit in how many pages i can view each day?
09:04:23Prestige@ElegantBeef sweet!
09:45:15ForumUpdaterBotNew thread by HJarausch: Gimp plugin? , see https://forum.nim-lang.org/t/7665
09:53:52*Zoom[m] joined #nim
10:21:19ForumUpdaterBotNew thread by Oyster: 'ord' cannot be passed to a procvar, see https://forum.nim-lang.org/t/7666
10:37:08FromDiscord<zidsal> I may have broken the nim forums, I made a user but the verification email never came so I deleted my user and tried to re-create it. Now I get an `unknwon error occured` 😦
10:53:10FromDiscord<jtiai> Hello. I recently found Nim language and wanted to jump right to deep water. I'm trying to make kernel with Nim. Found nimkernel and JackOS from Github. Can't get either of them to compile (and run). I've tried to play around with `--os:any` or `--os:standalone` and `--gc:arc` or `--gc:standalone` and end up errors like:↡`Error: system module needs: nimErrorFlag` or `fatal error: string.h No such file or directory` or `Error: Port memor
11:04:43FromDiscord<sealmove> probably faq but how do you generate `n` unique random numbers in some range?
11:05:18*teasea quit (Quit: teasea)
11:05:39FromDiscord<sealmove> In reply to @jtiai "Hello. I recently found": did you try `--gc:none`?
11:06:33FromDiscord<jtiai> In reply to @รєคɭ๓๏שє "did you try `--gc:none`?": Not yet.
11:07:23*teasea joined #nim
11:14:42FromDiscord<sealmove> In reply to @รєคɭ๓๏שє "probably faq but how": hmm, one solution is to make a set and use `random.sample`
11:14:44*vicfred quit (Quit: Leaving)
11:17:19FromDiscord<Solitude> In reply to @รєคɭ๓๏שє "probably faq but how": rand range and add that to set?
11:18:24FromDiscord<sealmove> In reply to @Solitude "rand range and add": this has serious effeciency problems
11:22:33FromDiscord<Rika> try it first
11:25:50FromDiscord<Goel> `A forward declaration contains no procedure body, just the procedure’s name, parameters, and return type.↡A future version of Nim will likely remove the need for forward declarations and allow procedures to be defined in any order.` Really?
11:26:10FromDiscord<Solitude> In reply to @รєคɭ๓๏שє "this has serious effeciency": you want them unique
11:27:29FromDiscord<sealmove> yes, but it's ineffective to add the same element to a set. it's smarter to generate the whole range and pop elements.
11:27:43FromDiscord<sealmove> another way I thought of is using `shuffle` on a seq
11:28:18FromDiscord<Rika> In reply to @Goel "`A forward declaration contains": what do you mean>
11:28:21FromDiscord<Rika> yeah really
11:39:27*haxscramper joined #nim
11:39:48liblq-dev@sealmove https://play.nim-lang.org/#ix=2Twq
11:39:51liblq-devthis is as efficient as it can get
11:40:32liblq-devmaybe you can make it even more efficient if you use an array instead of a seq but i wrote this for general-purpose use and sometimes `amount` isn't determined at compile time
11:56:03FromDiscord<sealmove> Um.. These are not unique :s
11:56:41FromDiscord<sealmove> Nice helper proc though
11:59:36FromDiscord<clyybber> @sealmove do your numbers fit into a bitset?
12:00:21*cornfeedhobo quit (Quit: ZNC - https://znc.in)
12:01:17FromDiscord<sealmove> they can exceed 1_000_000
12:01:22*cornfeedhobo joined #nim
12:02:05FromDiscord<clyybber> Then maybe use a perfect hash
12:02:27FromDiscord<sealmove> What's the limit for bitset?
12:03:06FromDiscord<clyybber> (u)int16 iirc
12:03:32FromDiscord<sealmove> In reply to @Clyybber "Then maybe use a": First time I hear this term
12:04:15m4r35n357I have asked half-jokingly about 128 bit floats before, but does anyone here know if this is on any roadmap?
12:05:41FromDiscord<sealmove> https://nim-lang.org/docs/compiler/bitsets.html#bitSetCard%2CTBitSet maybe it supports more than int16?
12:06:20FromDiscord<clyybber> I dont think so
12:07:11FromDiscord<clyybber> discard the perfect hash idea, I think they require too much storage
12:07:26FromDiscord<clyybber> maybe just iterate through the range
12:07:57FromDiscord<clyybber> and yield an element with a certain probability
12:08:40FromDiscord<clyybber> the probability should be 1 for the last element should it be reached
12:08:49FromDiscord<sealmove> For now I generate the range as a seq, then use shuffle, them iterate the seq and read first `n` elements.
12:09:01FromDiscord<clyybber> the issue is that floats are probably too imprecise
12:09:16FromDiscord<clyybber> but we have rationals
12:09:26FromDiscord<clyybber> tho theres a maximum
12:09:49FromDiscord<clyybber> In reply to @รєคɭ๓๏שє "For now I generate": heh then your range cant be that big
12:10:10FromDiscord<sealmove> Because of space inefficiency?
12:11:10FromDiscord<sealmove> The range is height width bytesPerPixel of a png image
12:11:42FromDiscord<clyybber> aah I see
12:12:06FromDiscord<clyybber> why not sample width and height seperately then?
12:12:38FromDiscord<sealmove> That's a good idea πŸ₯³
12:13:50FromDiscord<sealmove> Width, height, and byte of pixel can be sampled seperatly .
12:16:42FromDiscord<sealmove> But hmm, in this case 2 pixels of the same row or same column will never be picked?
12:20:03FromDiscord<sealmove> Nvm. Obviously if I sample separately, I won't use shuffle, but use a bitset of (x, y, z) tuple instead.
12:21:59FromDiscord<haxscramper> The only way to prevent assignment to a particular field is to write override procs in the form of ``proc `field=`(obj: var T) {.error: "Cannot assign to constnat field.}``?
12:22:43FromDiscord<sealmove> Or have it in a separate module and not provide the setter at all?
12:25:05FromDiscord<haxscramper> This would work too, though I think it is better to be more explicit. I'm thinking how I should handle `const T` fields when wrapping C/C++
12:30:01m4r35n357clybber was "the issue is that floats are probably too imprecise" aimed at me?
12:30:08m4r35n357hard to tell . . .
12:42:34FromDiscord<txtincome> Is there anything that can't be made in nim?
12:42:41FromDiscord<txtincome> Could a kernel be written in nim?
12:42:56FromDiscord<haxscramper> yes, https://github.com/dom96/nimkernel
12:43:25FromDiscord<txtincome> Even a game engine?
12:44:07FromDiscord<haxscramper> Yes. Basically anything you can do in any other general-purpose programming language
12:45:19FromDiscord<zidsal> who do I need to talk to, to fix my account on the nim forums is that only araq?
12:45:35FromDiscord<haxscramper> Also dom
12:46:03FromDiscord<zidsal> thanks hax πŸ˜›
12:50:34FromDiscord<txtincome> I used nimble to download fltk, but the nim compiler says there's an error when importing fltk.
12:52:14FromDiscord<zidsal> What's the error?
12:52:50FromDiscord<zidsal> And are you compiling with c++ as it says to do in the docs?
12:54:27FromDiscord<txtincome> sent a code paste, see https://play.nim-lang.org/#ix=2TwP
12:56:06FromDiscord<txtincome> sent a code paste, see https://play.nim-lang.org/#ix=2TwT
13:01:03FromDiscord<haxscramper> Have you installed nim via `choosenim`, or your distro's package manager?
13:01:28FromDiscord<haxscramper> And installed `fltk` with `nimble install fltk`, correct?
13:01:47FromDiscord<txtincome> I installed nim by downloading it directly from a tarball and setup the paths. I then did `nimble install fltk` as you said.
13:03:49*krux02 joined #nim
13:04:20FromDiscord<txtincome> Hang on. I think I could make a symlink from the /bin directory to the /pkg/bin directory
13:04:28FromDiscord<haxscramper> I'm not sure how things work when installing from tarball, but `nimble install` should download installed package in `~/.nimble/pkgs`, and then `nim cpp test.nim` should pick it up from there. So you should check if the package is downloaded correctly,
13:04:45FromDiscord<txtincome> because ~/.nimble/bin is in the path and fltk is in ~/.nimble/pkg/bin/
13:06:51FromDiscord<txtincome> Forget it. I'll just install via git.
13:06:59FromDiscord<Valdar> if you do "nimble list --installed", does fltk show up?
13:09:21FromDiscord<txtincome> For some reason, nimble ONLY installed the nimble file, but didn't install the nim files required for fltk. By downloading the nim files myself from github, it compiled successfully.
13:10:53FromDiscord<txtincome> Do you think this is a bug?
13:13:33FromDiscord<haxscramper> `nflt` package is broken actually - it has `srcDir = "src"`, but all files are placed on toplevel
13:14:16FromDiscord<haxscramper> So it works if you clone it directly, (because `test.nim` is located at toplevel, `import fltk` works resolves to relative path)
13:14:47*oprypin_ is now known as oprypin
13:15:21FromDiscord<haxscramper> But when you try to install it via package manager nimble puts source files form `srcDir` on toplevel, and because there are none you get ↡> "didn't install the nim files required for fltk"
13:17:13FromDiscord<txtincome> Can nim do bash like interpolation. ${} and that sort of thing.
13:17:40FromDiscord<zidsal> there are a coyuple of ways to do that in nim https://nim-lang.org/docs/strformat.html
13:22:28*Gustavo6046 joined #nim
13:26:26*superbia quit (Quit: WeeChat 3.1)
13:46:43FromDiscord<ttx> Can I have the compiler enforce styles such as how the variables are named or if a function is in camel case vs snake case?
13:49:50FromDiscord<haxscramper> `--styleCheck:off|hint|error`
13:50:04FromDiscord<Rika> will enforce camel only
13:50:08FromDiscord<haxscramper> Though it only checks for compliance with nep1 yes
13:50:17FromDiscord<haxscramper> (edit) removed "yes"
13:50:24FromDiscord<ttx> What if I want to make custom rules?
13:50:58FromDiscord<haxscramper> Not supported, though it takes about eight lines to resuse `compiler/parser`
13:51:30FromDiscord<haxscramper> So you can write your own linter
13:51:40FromDiscord<ttx> How would you recommend enforcing a style guide? By the compiler? A static checker?
13:52:25FromDiscord<haxscramper> I would recommend using `--styleCheck` if this is enough for you, otherwise you can start from https://play.nim-lang.org/#ix=2Tx9 and add your rules
13:52:56FromDiscord<haxscramper> `compiler` package is not available on playground so it doesn't compile
13:54:06FromDiscord<ttx> Since nim is written in nim, I could always make my own nim compiler with changes to the rules.
13:54:12FromDiscord<zidsal> sent a long message, see http://ix.io/2Txb
13:56:11FromDiscord<haxscramper> In reply to @zidsal "is there a way": I suppose not. Actually I haven't seen this feature used particularly often, so I doubt it will give a fine-grained control over different warnings
13:56:32FromDiscord<zidsal> boo, thats a shame I want to add it to my pre-commit hook
13:57:10FromDiscord<haxscramper> In reply to @ttx "Since nim is written": Exactly. Actually working with nim ast from compiler is just as simple as writing macros (I might argue it is even easier since you just have single program instead of compile/runtime separation)
14:10:22FromDiscord<jtiai> In reply to @รєคɭ๓๏שє "did you try `--gc:none`?": Tried `--gc: none` now and error changed to `fatal error: setjmp.h: No such file or directory`
14:10:51*arecaceae quit (Remote host closed the connection)
14:11:09*arecaceae joined #nim
14:28:44*Vladar joined #nim
14:30:09*qwr quit (Ping timeout: 244 seconds)
14:32:27*qwr joined #nim
14:55:49ForumUpdaterBotNew thread by Icedquinn: Found article on concurrency: "Go statement considered harmful", see https://forum.nim-lang.org/t/7667
15:07:06giaco__I'm trying to understand a bit more some nim internals, could you please help me understand why this iterator would not work if "if" to check value type at runtime, but would work by proc overloading? https://nim-lang.org/docs/iterators.html#fieldPairs.i%2CT
15:10:50FromDiscord<Yardanico> @giaco_ because value can be of different types, and in Nim a single value can't be of two possible types decided at runtime
15:10:50FromDiscord<Rika> because its a compile time thing
15:11:19FromDiscord<Yardanico> the same reason as to why you can't use `if` to switch on types in generic procedures
15:18:32giaco__but in that same example, if I replace the "when" block with a simple "echo value.type" I'm getting the correct output
15:18:52FromDiscord<Yardanico> because "value.type" is resolved at compile time
15:19:23FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/822851821961478214/unknown.png
15:19:36giaco__is this due to the fact that fieldPairs is unrolled?
15:22:06FromDiscord<Yardanico> no, it's due to the fact that there's no such thing as `typeof` (type is an alias for that) at runtime
15:22:23FromDiscord<Yardanico> you actually can get type info at runtime with https://nim-lang.org/docs/typeinfo.html , but this is RTTI and I would recommend against it
15:30:56*NimBot joined #nim
15:48:00ForumUpdaterBotNew thread by Dabod: Can application access to orc interface?, see https://forum.nim-lang.org/t/7668
16:00:02*vindaar[m] quit (Quit: Idle for 30+ days)
16:12:31giaco__Yardanico: thanks, I've got the problem by reading about RTTI and typeinfo, thanks
16:14:51FromDiscord<no name fits> Is ``rdstdin`` not supposed to be listed on the lib page? <https://nim-lang.org/docs/lib.html>
16:15:30*FromGitter quit (Read error: Connection reset by peer)
16:18:00*Perkol joined #nim
16:20:15liblq-devit's supposed to be there, but no one is bothered to update that page
16:22:25FromDiscord<konsumlamm> there are lots of modules that are supposed to be there, but aren't, see https://github.com/nim-lang/Nim/issues/16656
16:23:32FromDiscord<no name fits> Anything I can do to help?
16:24:24leorize[m]you can help us add the missing modules there :)
16:24:38FromDiscord<no name fits> How do I do that?
16:26:54FromDiscord<demotomohiro> I think this is source of standard library list page:↡https://github.com/nim-lang/Nim/blob/devel/doc/lib.rst
16:27:06leorize[m]that's correct
16:28:46FromDiscord<konsumlamm> In reply to @no name fits "How do I do": you can submit a PR to add the links, this is the relevant file: <https://github.com/nim-lang/Nim/blob/devel/doc/lib.rst>
16:29:51FromDiscord<no name fits> So I fork it, fix it and do a PR?
16:29:57FromDiscord<no name fits> Is it a generated file?
16:30:04FromDiscord<konsumlamm> yes and no
16:30:09FromDiscord<no name fits> Alright
16:30:17FromDiscord<konsumlamm> you can just edit the file
16:30:21FromDiscord<no name fits> Cool, cool
16:34:56*lritter quit (Ping timeout: 240 seconds)
16:35:51FromDiscord<zidsal> sent a code paste, see https://play.nim-lang.org/#ix=2TxY
16:36:33FromDiscord<haxscramper> To be honest it takes ~20 lines to write your own linter that would check for whatever style you want
16:36:49FromDiscord<zidsal> fair enough πŸ˜›
16:37:04FromDiscord<haxscramper> And just compile it to binary, wrap it in `cligen` and you get your post-commit hook
16:37:36FromDiscord<haxscramper> In reply to @zidsal "fair enough πŸ˜›": You want to check for snake case vs camel case style or something else?
16:37:45FromDiscord<zidsal> pretty much
16:37:55FromDiscord<zidsal> or that enums start with a Capital if they are pure e.t.c
16:39:12FromDiscord<zidsal> how exactly do you hook into you're code to lint it
16:39:53FromDiscord<aryn> so where should i report a scammer thats in this server
16:40:27FromDiscord<aryn> not sure if @ Moderator is for IRC or here
16:42:35FromDiscord<Cloudperry> do you mean @makel11?
16:42:38FromDiscord<aryn> yeah lol
16:42:57FromDiscord<aryn> unless its a troll, but i doubt it
16:43:03FromDiscord<aryn> new account aswell
16:43:15FromDiscord<aryn> why join here of all places :blobCatThink:
16:43:28FromDiscord<Cloudperry> he started with that classic "I don't want to sound weird but I made a mistake regarding your steam account"
16:43:32FromDiscord<aryn> yee
16:43:42FromDiscord<aryn> https://media.discordapp.net/attachments/371759389889003532/822873039624208425/unknown.png
16:43:47FromDiscord<Cloudperry> and then was about to say that he reported it for scamming and its about to get banned
16:44:31FromDiscord<aryn> i thought it was gonna be like, oh wow do you wanna play games sometime πŸ˜”
16:44:43FromDiscord<Cloudperry> πŸ˜„
16:44:47FromDiscord<zidsal> This all sounds plausible so far, why would someone lie on the internet
16:44:52FromDiscord<aryn> oh true
16:44:55FromDiscord<aryn> i really should be worried
16:45:10FromDiscord<Cloudperry> I just said nt fucking scammer rat and he blocked me instantly
16:45:29FromDiscord<Cloudperry> I once played along with those steam scammers to see what they will do
16:45:58FromDiscord<aryn> yea i do normally, i just cba today
16:46:00FromDiscord<Cloudperry> the scammer I tried that with sent me a "steam admin's" discord
16:46:12FromDiscord<Cloudperry> so obvious
16:46:22FromDiscord<Cloudperry> like at least make a fake steam supp website or something πŸ˜„
16:46:30FromDiscord<no name fits> So what category should these modules be under? @konsumlamm
16:46:46FromDiscord<no name fits> I'd hate to put something in the wrong place
16:46:47FromDiscord<aryn> so do we ping @ Moderator? or is that an IRC thing
16:47:20FromDiscord<Yardanico> @aryn check the description, yes
16:47:24FromDiscord<aryn> yeah i saw that
16:47:32FromDiscord<Yardanico> so who is it? can you PM me with the details?
16:47:39FromDiscord<haxscramper> In reply to @zidsal "or that enums start": https://play.nim-lang.org/#ix=2Ty6
16:47:39FromDiscord<aryn> <@&371760044473319454@makel11 lol
16:47:45FromDiscord<Yardanico> i might not look like one, but I'm a moderator as well :P
16:47:45FromDiscord<aryn> https://discord.com/channels/371759389889003530/371759389889003532/822873042182078474
16:47:50FromDiscord<aryn> oh lol
16:47:57FromDiscord<aryn> yeah everyone having white throws me off
16:48:00FromDiscord<aryn> i use compact mode aswell
16:48:51FromDiscord<haxscramper> In reply to @haxscramper "https://play.nim-lang.org/#ix=2Ty6": It might be very hard to actually start using compiler API for the first time (lack of examples is the biggest issue), but it could be used as a starting point
16:48:57FromDiscord<zidsal> @haxscramper it didn't even clock to me, that you could import the compiler I'm going to have fun with this
16:49:09FromDiscord<brainproxy> sent a code paste, see https://play.nim-lang.org/#ix=2Ty7
16:49:26FromDiscord<brainproxy> (edit) "https://play.nim-lang.org/#ix=2Ty7" => "https://play.nim-lang.org/#ix=2Ty8"
16:49:42FromDiscord<Yardanico> GC_fullCollect() shouldn't really be used unless you absolutely have to
16:49:52FromDiscord<Yardanico> it forces the GC to collect whatever garbage there
16:49:59FromDiscord<brainproxy> In reply to @Yardanico "GC_fullCollect() shouldn't really be": sure, but I mean at the end of the program, just before it exits
16:50:08FromDiscord<Yardanico> @brainproxy there's no need
16:50:12FromDiscord<Yardanico> the OS will free all the memory itself
16:50:31FromDiscord<konsumlamm> In reply to @no name fits "So what category should": whatever category you find appropriate, reviewers will correct you if they think it's wrong
16:50:34FromDiscord<brainproxy> was there an issue at some point with older Nim where not having it would cause a problem?
16:50:38FromDiscord<Yardanico> no?
16:51:05FromDiscord<Rika> How old are we talking about
16:51:13FromDiscord<no name fits> Cool, I'll try. It's probably all super wrong
16:51:18FromDiscord<Rika> Sounds like a really old version if so
16:52:48FromDiscord<Yardanico> I don't think that there ever was a thing like that
16:52:57FromDiscord<Yardanico> @brainproxy can you link to the example where that was written?
16:53:25FromDiscord<haxscramper> In reply to @zidsal "<@!608382355454951435> it didn't even": It is also possible to get typed AST, though it is comparatively more involved. See https://github.com/haxscramper/haxdoc/blob/4adb04e764af6606fcfdde11f02c03ee9e17ab90/src/haxdoc/compiler_aux.nim#L48 for example
16:54:00FromDiscord<brainproxy> in "Hello World" example here: https://filcuc.github.io/nimqml/↡↡and I've seen it some other places as well, can't think of exact ones at the moment
16:54:47FromDiscord<no name fits> @konsumlamm <https://nim-lang.github.io/Nim/assertions.html> says that system reexports it, so would that be an internal module?
16:54:57FromDiscord<no name fits> I'm just going by your list
16:55:14FromDiscord<konsumlamm> it's not internal, it's just imported by default
16:55:42FromDiscord<Yardanico> @brainproxy that's really weird
16:55:49FromDiscord<Yardanico> maybe it's related to nimqml?
16:55:55FromDiscord<konsumlamm> it's also linked in `system`
16:56:02FromDiscord<no name fits> so under automatic imports?
16:57:57FromDiscord<konsumlamm> ye
16:58:52FromDiscord<brainproxy> In reply to @Yardanico "maybe it's related to": not sure, I took it out of the codebase I'm working (which uses NimQml) and it doesn't seem to make a difference
16:58:57FromDiscord<Yardanico> In reply to @brainproxy "not sure, I took": exactly
16:59:03FromDiscord<Yardanico> the OS always frees memory of the app when it exists
16:59:04FromDiscord<Yardanico> (edit) "exists" => "exits"
16:59:08FromDiscord<Yardanico> no matter which language you write it in
16:59:36FromDiscord<brainproxy> yep, makes sense, I just wondered why some people do like that (and my team's project got it as a copy/pasta, I guess)
16:59:49FromDiscord<brainproxy> anyway, doesn't seem to be a point to it, so getting rid of it
16:59:56FromDiscord<no name fits> @konsumlamm Does it make sense to make a section for the unstable stuff, or should I fit it under the existing sections?
17:00:40FromDiscord<konsumlamm> i wouldn't put it in the existing sections, either a new one or don't add them
17:00:55FromDiscord<konsumlamm> again, just do what you think is right, people will correct you
17:01:20FromDiscord<no name fits> Sorry
17:04:48saemYay, it's the weekend. Time to do fun things in the compiler!
17:07:48*kuon quit (Remote host closed the connection)
17:08:08*kuon joined #nim
17:14:13*letto_ quit (Quit: Konversation terminated!)
17:15:10*ozzz joined #nim
17:16:12*letto joined #nim
17:22:08*leorize quit (Ping timeout: 268 seconds)
17:22:51FromDiscord<dom96> hmm, we don't have any way to access the capacity of a seq do we?
17:23:38FromDiscord<aryn> .len?
17:24:17jfondren[m]http://zevv.nl/nim-memory/ reverse-engineers it for illustrative purposes
17:24:43FromDiscord<dom96> https://github.com/nim-lang/RFCs/issues/97
17:24:57FromDiscord<dom96> In reply to @aryn ".len?": that's not the same as a seqs capacity
17:25:59FromDiscord<dom96> In reply to @jfondren "http://zevv.nl/nim-memory/ reverse-engineers it for": nice, thanks
17:26:43*acheam joined #nim
17:29:27FromDiscord<dom96> https://play.nim-lang.org/#ix=2Tyl
17:30:36*arecaceae quit (Remote host closed the connection)
17:30:55*arecaceae joined #nim
17:32:09FromDiscord<dom96> weirdly in my app the capacity and len are the same
17:34:24ForumUpdaterBotNew thread by Nealie: Norm & Functions, see https://forum.nim-lang.org/t/7670
17:34:59FromDiscord<aryn> In reply to @dom96 "that's not the same": oh misread the q ll
17:35:00FromDiscord<aryn> (edit) "ll" => "lol"
17:44:35FromDiscord<Yardanico> @dom96 wdym "weirdly"? how do you create the seq?
17:46:02FromDiscord<dom96> same as I do in the play link
17:46:07FromDiscord<dom96> dunno what's going on
17:46:12giaco__I am generating bindings starting from wsdl soap definitions. I can generate bot C and C++ from wsdl, but I don't know which one to pick to make my life easier with c2nim/nimterop. Any hint?
17:46:23giaco__s/bot/both
17:46:41*acheam left #nim ("WeeChat 2.8")
17:52:24saemcould go from wsdl straight to nim if you're up for writing the generator I suppose. I would use C, that's entirely based upon the C backend seems to get more traffic/love.
18:00:00FromDiscord<Ayy Lmao> I'm a noob so this is likely a stupid question. I am reading numbers from a data stream that I know to be big endian, and I am using https://github.com/treeform/flatty/blob/master/src/flatty/binny.nim to read them. I am finding I have to call `swap` after I read them to get the right numbers. Would needing to call `swap` be system dependent? If so, how do I account for that?
18:00:59FromDiscord<Yardanico> use maybeSwap
18:02:03FromDiscord<Ayy Lmao> What do I pass into the enable bool?
18:02:12FromDiscord<Yardanico> `maybeSwap(cpuEndian == littleEndian) # will only swap if you're on LE`
18:02:22FromDiscord<Ayy Lmao> Cool, I
18:02:25FromDiscord<Ayy Lmao> I'll try iit
18:02:33FromDiscord<Yardanico> https://nim-lang.org/docs/system.html#cpuEndian
18:04:10FromDiscord<Ayy Lmao> That seems to work, thanks!
18:05:08*narimiran joined #nim
18:26:55giaco__saem: no, I'm not writing a generator, I think it would be a huge effort
18:31:42giaco__I'm using gsoap to turn it into C/C++, then I work it out with nim
18:32:18giaco__but I don't have a lot of experience with bindings
18:52:22*zedeus quit (Ping timeout: 276 seconds)
18:53:19*zedeus joined #nim
18:56:45*superbia joined #nim
19:08:00FromDiscord<sealmove> how do you forward declare a variable, initialize its value later, but keep it immutable after the first assignment? :P
19:09:39FromDiscord<Yardanico> you don't since you said yourself "initialize it later" :P
19:09:48FromDiscord<Yardanico> i mean you technically can do it with `unsafeAddr`
19:10:15FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TyN
19:10:19FromDiscord<Yardanico> ah
19:10:24FromDiscord<Yardanico> yeah the nim compiler won't let you do this :)
19:10:29FromDiscord<sealmove> ^^
19:10:35FromDiscord<Yardanico> but why do you want this
19:11:44FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2TyO
19:12:22FromDiscord<sealmove> The reason I want it is complicated, which means there is probably a better solution :P
19:12:27FromDiscord<haxscramper> I sometimes do this when I need to fill `const` in a loop or something
19:12:27FromDiscord<Yardanico> x y problem maybe?
19:12:33ozzzguys how to check if file already opened by open(logfile, logfile_name, fmAppend)
19:12:36FromDiscord<sealmove> @DefinitelyNotYardanico yes
19:12:36FromDiscord<Yardanico> @haxscramper yeah, same, but I think in sealmove's case it's different
19:13:57ozzzwould it be ok if I declare var logfile: File = nil
19:14:50ozzzand befort open, do some verification - if logfile == nil then... etc
19:14:57ozzz?
19:15:06FromDiscord<Yardanico> yes
19:15:17FromDiscord<Yardanico> But it's only possible because `File` is actually a pointer to a c FILE
19:15:32FromDiscord<Yardanico> so you can do it your way, but I'd recommend doing it some other way to not rely on internal details :)
19:16:07FromDiscord<sealmove> but well, the fundamental problem in my code is that I am generating (potentially) recursive parsers, and each parser is actually a variable declared with `let` which holds 2 procs (get, put).
19:16:09*kenran quit (Ping timeout: 264 seconds)
19:16:18ozzzI just started discovering nim, so I still think as in C
19:16:34ozzzYardanico, thanks a lot
19:17:12FromDiscord<sealmove> type declaration has no problem since recursive types work in nim, but it errors when generating the return type of the field, which is the same type as the return type of the outer parser
19:17:32FromDiscord<sealmove> (edit) "type declaration has no problem since recursive types work in nim, but it errors when generating the return type of the ... field," added "parser of the"
19:17:56*kenran joined #nim
19:20:21FromDiscord<sealmove> sent a code paste, see https://play.nim-lang.org/#ix=2TyQ
19:28:55FromDiscord<Yardanico> why not have some kind of an interface object instead of a let?
19:29:03FromDiscord<Yardanico> well, you'd still need to have it as `var` but still
19:29:12FromDiscord<Yardanico> honestly I need more code to understand the problem :P
19:36:46FromDiscord<sealmove> oh wait, tuples do not support recursion, right?
19:36:52FromDiscord<sealmove> you need an object type for this
19:38:27FromDiscord<Yardanico> @sealmove tuples cannot be self-recursive of course, but if you have a tuple of two procs then it's just two proc pointers
19:39:47FromDiscord<sealmove> yes, problem is... the `get` proc always returns a tuple with the fields...
19:41:14FromDiscord<Yardanico> @sealmove btw, I tried binarylang and it fails for me
19:41:33FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2TyU
19:41:46FromDiscord<sealmove> there is a dependency, bitstreams
19:41:55FromDiscord<Yardanico> but it didn't install when I installed binarylang from nimble
19:42:04FromDiscord<sealmove> that's weird
19:42:06FromDiscord<Yardanico> ah it actually did
19:42:21FromDiscord<Yardanico> but readme doesn't specify that you have to import bitstreams anywhere ;)
19:42:35FromDiscord<Yardanico> any reason you don't just export bitstreams?
19:42:36FromDiscord<sealmove> yes, i fixed this. binarylang now export it
19:42:40FromDiscord<Yardanico> :D
19:42:50FromDiscord<sealmove> i think i fixed it yesterday
19:44:52FromDiscord<Yardanico> don't forget to bump nimble ver when you update stuff, or use github tags
19:45:28FromDiscord<sealmove> haven't learned how these work, but I plan to learn soon
19:45:59FromDiscord<Yardanico> normal "tag" in git is just a pointer to a commit
19:46:02FromDiscord<sealmove> binarylang is only now approaching some stability. right now it's changing too much
19:46:04FromDiscord<Yardanico> you just create a tag on some commit - that's a release
19:50:24*vicfred joined #nim
19:51:29FromDiscord<sealmove> never done it before, but it sounds very easy. i did the docs recently, soon there will be versioning too. slowly it turns into a real project ^^
19:51:40FromDiscord<Yardanico> or at least just bump the nimble ver, so that if you do "nimble install" or stuff it'll update
19:52:22FromDiscord<sealmove> yeah, doesn't `nimble install` always download the latest version?
19:52:50FromDiscord<sealmove> (edit) "yeah," => "wait,"
19:52:59FromDiscord<Yardanico> it does but it'll ask to overwrite because it's the same version
19:53:09FromDiscord<sealmove> oh I see
19:56:52*leorize joined #nim
20:03:51*narimiran quit (Ping timeout: 246 seconds)
20:16:32FromDiscord<zidsal> a `{.global.}` pragma makes a global variable per proc, if that proc has a static param will it make 1 global per constant?
20:18:28leorizeyep
20:19:18FromDiscord<zidsal> ok, and I am presuming that proc A cannot access proc B's {.global.} ?
20:22:33leorizeyep
20:24:28*haxscramper quit (Remote host closed the connection)
20:24:39*kuon quit (Quit: Leaving)
20:41:32*Perkol quit (Remote host closed the connection)
20:53:18FromDiscord<zidsal> is there a better way for multiple macro's to be able to access a shared tableRef then making a third proc that returns a {.global.} table?
20:55:21FromDiscord<ElegantBeef> Macro cache exists sorta for this goal
20:55:46FromDiscord<ElegantBeef> https://nim-lang.org/docs/macrocache.html though still need to have it stored in a single file
20:56:36FromDiscord<Yardanico> @ElegantBeef "still need to have it stored in a single file" not sure what you meant by tthis
20:56:37FromDiscord<Yardanico> (edit) "tthis" => "this"
20:57:22FromDiscord<ElegantBeef> Does it give a way to access the CacheTable across modules? If so i have 0 idea how
20:57:26FromDiscord<Yardanico> @zidsal you can have global compiletime values, but yeah, macrocache is better
20:57:27FromDiscord<zidsal> `Instead the API here needs to be used.` do you know what the docs mean by that πŸ˜›
20:57:39FromDiscord<Yardanico> @ElegantBeef you can just add to the same CacheTable in different modules
20:57:51FromDiscord<Yardanico> it's just a distinct string
20:57:54FromDiscord<Yardanico> because it's handled by the compiler
20:58:10FromDiscord<ElegantBeef> Yea but the table has to be in a specific file right?
20:58:14FromDiscord<ElegantBeef> It's not global
20:58:59FromDiscord<ElegantBeef> Like there isnt one global table/cacheseq?
21:11:55leorizewhy would you need a proc that returns a global table?
21:12:03*fputs quit (Quit: WeeChat 3.1)
21:13:24FromDiscord<zidsal> @leorize its to share between macros I'm making a macro that auto generates a model from castledb, I was also going to make 1 that can convert that model and the file into actual objects. I was hoping to share meta information about the file between them so that I don't need to parse the filw twice
21:15:49leorizeis this information only consumed at compile-time or?
21:15:55FromDiscord<zidsal> yu[p
21:16:39leorizeyea, sounds like macrocache is the way to go
21:16:55FromDiscord<zidsal> it looks like from the docs that it wont be supproted going forward thought?
21:17:09leorizeit's the other way around actually :P
21:17:33FromDiscord<zidsal> ah I've missunderstood the docs then
21:17:48leorizeit will be the only form of global compile-time variables supported in the future
21:18:03FromDiscord<Yardanico> yeah need to fix the docs
21:18:16FromDiscord<zidsal> thats a heck of a typo πŸ˜„
21:18:21leorizeI wouldn't say you're the first to misunderstood it :P
21:18:30FromDiscord<Yardanico> @zidsal it's not a typo
21:18:37FromDiscord<Yardanico> it's just that the wording is a bit bad
21:18:41leorizesomeone PR-ed a deprecation warning thinking the same idea as you did
21:18:56FromDiscord<Yardanico> "This module provides an API for macros that need to collect compile time information across module boundaries in global variables. Starting with version 0.19 of Nim this is not directly supported anymore as it breaks incremental compilations. Instead the API here needs to be used."
21:19:01FromDiscord<Yardanico> "0.19 of Nim this is" this is refers to global variables
21:19:02FromDiscord<Yardanico> not macrocache
21:19:15FromDiscord<Yardanico> but yes it's unclear
21:19:24FromDiscord<zidsal> ah right ya that makes sense
21:19:30FromDiscord<ElegantBeef> Macrocache is terribly documented and yard is presently making it better
21:33:22*sz0 quit (Quit: Connection closed for inactivity)
21:34:47FromDiscord<jtiai> I've been trying to make my own kernel by using nimkernel, jackos and nimkernel_ext but I usually end up compilation error: `Error: system module needs: appendString`. There are very little documentation I could find that I could check what to do next.
21:36:57leorizeyou'll have to ping Araq for this one, --os:standalone is one of the thing that's not tested/documented very well I'm afraid
21:37:08leorizethere's also --os:any too
21:37:18leorizemaybe the compiler doc will give you something
21:38:40FromDiscord<jtiai> Funny thing is that people reported successfully done compiled with older versions of nim.
21:39:09leorizebeing untested makes it easy to have regression introduced :P
21:39:24FromDiscord<jtiai> And there is https://github.com/nim-lang/Nim/issues/14011 which can't say if it is relevant....
21:39:59leorizeseems to be the one
21:42:30FromDiscord<dom96> Best way to get answers for these more niche things is to submit issues and/or write forum threads
21:42:51FromDiscord<dom96> I recall running into similar things, IIRC I just did my best to avoid procs that trigger it
21:43:37FromDiscord<jtiai> I have only stuff that some dom96 did... πŸ™‚
21:45:37leorizedom's code being unmaintained isn't anything too new :P
21:45:51FromDiscord<zidsal> zing
21:47:53FromDiscord<Yardanico> ecksdee
21:50:30*kenran quit (Quit: leaving)
21:53:21FromDiscord<jtiai> I go to a sleep and meanwhile one of you smart people figures out my problem. πŸ™‚
21:54:55FromDiscord<zidsal> is that how it works? can someone here solve Np hard for me, we'll split the credit 50/50
21:55:14FromDiscord<ElegantBeef> 60/50 and deal!
21:55:47FromDiscord<zidsal> well I mean if you're proof manages to break ratios so they add up to 1 sure
21:58:40FromDiscord<dom96> In reply to @leorize "dom's code being unmaintained": I challenge you to find a Nim repo from 2013 that is still maintained πŸ˜›
21:59:07FromDiscord<ElegantBeef> ~~Wait until dom learns about the compiler~~
21:59:09leorizenim-lang/Nim?
21:59:15Yardanicooprypin: hello, is there an issue with the FromGitter bridge? it's been down for the last 6 hours
21:59:24leorizeif you ask me about your code then I give up :)
22:00:36FromDiscord<dom96> Hah, the Nim repo doesn't really count
22:00:44FromDiscord<_ssmaxx> Hello everyone. does anyone know how to run selfbot discord nim?
22:00:44FromDiscord<dom96> but you know that
22:01:27FromDiscord<_ssmaxx> In Python it was clear how to do it, but in Nim Dimscord it was not entirely clear ...
22:01:47*FromGitter joined #nim
22:01:47oprypinYardanico, uh first there was some instability of the services themselves, then looks like it went down, yeah :/
22:01:48FromGitter<Yardanico> I'm adding docs to https://nim-lang.org/docs/macrocache.html and wondered if runnableExamples should actually use assert/doAssert to check for correctness even if the example will look a bit convoluted then - https://nim-lang.org/docs/macrocache.html#items.i%2CCacheSeq
22:02:04Yardanicooprypin: no problem, thanks for restarting it :)
22:02:12FromDiscord<ElegantBeef> Well it's against discords TOS so i doubt many people will help
22:02:58FromDiscord<Yardanico> @timotheecour also most of the procs in that module are implemented with compiler magics, so runnableExamples can't be used for them, right?
22:04:34leorizedom96: https://github.com/search?q=created%3A%3C2014-01-01+language%3ANim&type=Repositories&l=Nim&l=
22:04:49FromDiscord<_ssmaxx> In reply to @ElegantBeef "Well it's against discords": And if in direct messages?
22:04:49leorizelooks like your jester got in the list, congrats
22:05:01FromDiscord<ElegantBeef> If you want selfbots use a better chat client
22:05:28FromDiscord<dom96> leorize: why are you being sarcastic?
22:06:22FromDiscord<dom96> amazing, 6 of those repos are actually ones I created
22:06:30leorizedom96's software not being maintained is kind of a trope in nim :p
22:06:41FromDiscord<dom96> (on the first page)
22:06:57FromDiscord<ElegantBeef> Well when this pissing contest is over i got a tape measure if you need one, just wash it off after
22:07:45*wasted_youth2 joined #nim
22:08:02leorizetook me by surprise that nake is still being developed
22:08:29FromDiscord<ElegantBeef> Probably the same feeling the nake devs have πŸ˜›
22:08:50FromDiscord<_ssmaxx> In reply to @ElegantBeef "If you want selfbots": Yes, I need a selfbot in order to receive messages from one server channel, to which I cannot add a bot, since I do not have the appropriate rights. I'm not going to do anything bad, why)
22:09:15FromDiscord<ElegantBeef> Well go make one, i dont think we can actually help you without breaking the TOS
22:10:20FromDiscord<_ssmaxx> In reply to @ElegantBeef "Well go make one,": I understood you, thank you very much for your help, I wish you success.
22:10:32FromDiscord<ElegantBeef> See leorize that's how you do sarcasm
22:11:19leorize:P
22:11:48FromDiscord<dom96> leorize: if you're just playing around then please stop, what you're saying just comes off as you trying to ridicule me
22:13:31leorizesorry, I didn't mean that
22:13:53FromDiscord<dom96> it's all good πŸ™‚
22:16:58ForumUpdaterBotNew thread by R3c: Nimble download/install sequence improvement, see https://forum.nim-lang.org/t/7671
22:17:18FromDiscord<aryn> In reply to @_ssmaxx "In Python it was": i dont think dpy even supports it anymore
22:17:29FromDiscord<aryn> as it was made against TOS
22:20:48FromDiscord<Yardanico> @_ssmaxx I think this discussion is more suitable for the Dimscord discord server - https://discord.gg/bw4mHUV, and even then, discussing stuff that is against TOS is not usually allowed.
22:21:11FromDiscord<_ssmaxx> In reply to @aryn "i dont think dpy": But it works on dpy
22:21:20FromDiscord<aryn> i dont think it does ima be honest
22:21:41FromDiscord<_ssmaxx> In reply to @Yardanico "<@!764452254816141313> I think this": Thank you
22:29:28*superbia quit (Ping timeout: 276 seconds)
22:29:38giaco__Before trying with higher lever approaches like nimterop, I'm giving c2nim a try over a quite complex .h. I'm getting "soapStub.h(9808, 30) Error: token expected: ;" and I'm expecting that there must be a line that is confusing the parser, do you have any experience with it to help me find out what's wrong? C code is generated from wdsl and compiles correctly with gcc
22:30:21FromDiscord<ElegantBeef> Preprocessors tend to cause c2nim to have a bad time afaik
22:30:33FromDiscord<_ssmaxx> In reply to @Yardanico "<@!764452254816141313> I think this": Are you ru?
22:31:08FromDiscord<Yardanico> there's a #русский channel for discussion in russian, but it's better to use english so you get more people who can help you
22:31:32FromDiscord<_ssmaxx> Yes, I understand
22:32:12giaco__ElegantBeef, any idea here? http://ix.io/2TAq
22:32:20FromDiscord<Yardanico> and yes, I'm russian if you were asking that
22:33:22FromDiscord<ElegantBeef> Well i assume by the name soapfmac is a macro
22:33:49FromDiscord<ElegantBeef> C2nim doesnt play with them afaik
22:37:35giaco__yeah, but I think they should be empty ones
22:38:18giaco__like stated here: https://www.genivia.com/doc/guide/html/group__group__soap.html#gaf9c67beaa852bbda509579313b9ca11b
22:41:17FromGitter<timotheecour> @Yardanico ⏎ ⏎ > wondered if runnableExamples should actually use assert/doAssert to check for correctness even if the example will look a bit convoluted then ⏎ ⏎ yes, please use assert (not doAssert, see contributing.html) for those examples, it can always be written in a non-convoluted way; we can discuss more in your WIP PR if you have one [https://gitter.im/nim-lang/Nim?at=60567a0d3a9448256c1c5499]
22:41:33FromDiscord<Yardanico> ok, sure
22:41:38FromDiscord<Yardanico> and what do you think about magic procs?
22:42:05FromDiscord<Yardanico> using them with runnableExamples is not possible afaik
22:45:45FromGitter<timotheecour> @Yardanico ⏎ ⏎ > also most of the procs in that module are implemented with compiler magics, so runnableExamples can't be used for them, right? ⏎ ⏎ No, this works fine: ... [https://gitter.im/nim-lang/Nim?at=60567b19ad83ec3d7d429a15]
22:46:10FromGitter<timotheecour> (don’t forget the trailining `=`)
22:46:40FromDiscord<Yardanico> oh I thought that it would do something bad, thanks
22:47:23FromGitter<timotheecour> np
23:07:31FromDiscord<zidsal> amazing, turns out jester has all the documentation I need for how the macrocache works
23:09:41FromDiscord<Yardanico> @timotheecour https://github.com/nim-lang/Nim/pull/17431
23:10:07FromDiscord<zidsal> damnit yard you where 6 minutes too late πŸ˜›
23:10:22FromDiscord<Yardanico> @zidsal I mean the module is really simple to use if you get the main idea :)
23:10:28FromDiscord<zidsal> πŸ˜›
23:40:11ForumUpdaterBotNew question by cain a: How do I get input from the console in Nim?, see https://stackoverflow.com/questions/66727513/how-do-i-get-input-from-the-console-in-nim