<< 22-04-2021 >>

00:03:48FromDiscord<retkid> not nemo
00:04:00FromDiscord<retkid> nano
00:04:02FromDiscord<retkid> my brain went ded
00:04:31FromDiscord<ElegantBeef> Well it's more like vim than nano, but yea
00:04:57FromDiscord<retkid> its vim but emacs
00:05:15FromDiscord<retkid> In reply to @ElegantBeef "Advertising Nim programs in": gotta keep it in the family
00:05:49FromDiscord<retkid> Advertising Nim written programs in a Nim discord to Nim programmers
00:05:51FromDiscord<retkid> #not-a-cult
00:06:30FromDiscord<ElegantBeef> Hey we dont have a rewrite it in Nim initiative so clearly arent culty
00:07:32PrestigeWe could start one
00:07:54*Prestige rewrites coreutils in Nim
00:08:11FromDiscord<retkid> rewrite python
00:08:12FromDiscord<retkid> in nim
00:08:41FromDiscord<ElegantBeef> So instead of cpython it'd be nimpython
00:09:12FromDiscord<retkid> better threading and garbage collecting!
00:09:46Prestigewhy not just use nim at that point
00:09:59FromDiscord<ElegantBeef> Cause you want python for pythony things like making me cry
00:10:53FromDiscord<retkid> why does python make you sad
00:11:40FromDiscord<ElegantBeef> Cause it's got the language design of a person that likes to test a circuit by licking an outlet
00:11:57FromDiscord<ElegantBeef> "Yea jim it's still on, my tongue is frying!"
00:12:36Prestigehahaha
00:13:30FromDiscord<retkid> lemme find some disgusting python i wrote yesterday
00:13:39FromDiscord<retkid> i didn't comment any my code because i was kinda in the zone
00:13:42FromDiscord<retkid> and reallly regret it
00:14:15FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/834582837150875658/unknown.png
00:14:16FromDiscord<ElegantBeef> it also relies a lot on programmer contracts like dont touch `_name` and `name`
00:14:42FromDiscord<retkid> i had to convert it back to a list because dicts aren't ordered....
00:14:46FromDiscord<retkid> for really no reason
00:14:58FromDiscord<ElegantBeef> Now rewrite it in Nim
00:15:12FromDiscord<retkid> its already been written
00:15:21FromDiscord<retkid> i wish i went back and wrote some stuff in nim
00:15:29FromDiscord<retkid> but im not rewriting a lot of this lol
00:15:44FromDiscord<retkid> though i might rewrite my write functions in nim
00:16:03FromDiscord<retkid> https://media.discordapp.net/attachments/371759389889003532/834583287582294056/unknown.png
00:16:10FromDiscord<retkid> i need to replace os.system(0 with pathlib
00:16:13FromDiscord<retkid> (edit) "pathlib" => "pathlib, ignore that"
00:16:20FromDiscord<retkid> (edit) "os.system(0" => "os.system()"
00:16:29FromDiscord<ElegantBeef> I mean i'm ignoring most of it
00:16:36FromDiscord<retkid> its disgusting
00:16:42FromDiscord<retkid> and i hope its better in nim
00:17:17FromDiscord<ElegantBeef> It can be if you believe in yourself
00:18:05FromDiscord<retkid> but i dont :(
00:18:13FromDiscord<ElegantBeef> Not with that attitude
00:18:31FromDiscord<zetashift> In reply to @uuuu "Is <@!77574388035100672> here? I": sup
00:19:40FromDiscord<retkid> @ElegantBeef do you know how to turn on syntax highlighting in moe
00:19:52FromDiscord<ElegantBeef> Should be on by default if the language is supported
00:20:00FromDiscord<retkid> using it on python and nope
00:20:13FromDiscord<ElegantBeef> Should be `:syntaxhighlighting on`
00:41:44*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
00:42:02*njoseph joined #nim
00:53:00*thomasross joined #nim
01:11:18*Tanger joined #nim
02:05:33*krux02 quit (Remote host closed the connection)
02:09:05FromDiscord<exelotl> is this normal? https://play.nim-lang.org/#ix=2WV1
02:12:02FromDiscord<ElegantBeef> Seems it only invokes destructors for if any field is assigned https://play.nim-lang.org/#ix=2WV3
02:12:24FromDiscord<ElegantBeef> Odd, but might make sense to someone
02:18:17FromDiscord<exelotl> it also invokes it if you do `a = Foo()`
02:29:21FromDiscord<exelotl> man I've really been missing a trick with this move semantics stuff :P
02:33:03FromDiscord<demotomohiro> Maybe, `b` is assumed to be not initialized and compiler think it does not need to be destoried?
02:34:31FromDiscord<demotomohiro> Or b is not modified and doesn't need to be destroyed.
02:35:19FromDiscord<exelotl> yeah, makes sense I guess
02:44:53FromGitter<gogolxdong> How is weave going? https://github.com/mratsim/weave
02:47:52*thomasross quit (Ping timeout: 240 seconds)
03:27:07*tefter_ joined #nim
03:29:06*tefter quit (Ping timeout: 245 seconds)
03:35:11*tefter joined #nim
03:35:16*tefter_ quit (Ping timeout: 252 seconds)
03:59:50*spiderstew joined #nim
04:00:46*spiderstew_ quit (Ping timeout: 245 seconds)
04:45:11*rockcavera quit (Ping timeout: 240 seconds)
05:26:10*narimiran joined #nim
05:44:43*tefter_ joined #nim
05:45:28*tefter quit (Ping timeout: 252 seconds)
06:21:16*filcuc_ joined #nim
06:31:26*tefter_ is now known as tefter
06:33:42*ecs quit (Remote host closed the connection)
06:42:06ForumUpdaterBotNew question by Alex Craft: How to make pragma to work like a standalone macro?, see https://stackoverflow.com/questions/67208008/how-to-make-pragma-to-work-like-a-standalone-macro
06:50:29*Vladar joined #nim
06:52:11FromDiscord<lantos> toolchains/nim-1.4.4/lib/pure/unittest.nim(654, 43) Error: type mismatch: got <int literal(5), int literal(5)>↵👀
06:59:46*PMunch joined #nim
07:02:46ForumUpdaterBotNew thread by Araq: On term rewriting macros, see https://forum.nim-lang.org/t/7837
07:23:54FromDiscord<no name fits> How do I go through an array by pointer? Something like: https://play.nim-lang.org/#ix=2WW3
07:27:40FromDiscord<ElegantBeef> @no name fits https://play.nim-lang.org/#ix=2WW4 should work for you
07:28:03FromDiscord<no name fits> Thanks
07:39:10FromDiscord<Ricky Spanish> whats the use-case? im kind of curious to know the benefits of doing it that way
07:41:16FromDiscord<ElegantBeef> There really isnt much of a usecase since it makes more sense to use a proc that takes the array, we'll just hope they're working on their own collection type and wanted to learn for that
07:42:13FromDiscord<Ricky Spanish> ah, i assumed it was for wrapping a raw array or something from c since still learning nim so seemed unusual to use a c like way to iterate an array
07:42:22FromDiscord<no name fits> Oh I was just looking for different ways to iterate collections
07:43:18FromDiscord<no name fits> When I figure out how to do performance testing reliably I wanted to set up some different test cases
07:43:42FromDiscord<ElegantBeef> I'm scared what you're testing
07:44:02FromDiscord<ElegantBeef> Nims iterators are templates so they're 0 cost
07:44:02FromDiscord<Ricky Spanish> ahaha, regardless if you do it tag me please im curious
07:44:13FromDiscord<no name fits> I'm just drawing a hex grid currently so nothing fancy
07:45:24FromDiscord<no name fits> I'm most likely just going to use a seq doe
07:45:25FromDiscord<no name fits> so
07:46:09FromDiscord<ElegantBeef> I'm slightly scared your alternative iteration methods
07:47:32FromDiscord<Rika> Do whatever in the name of performance?
07:51:25FromDiscord<sealmove> hi folks!
07:51:37FromDiscord<sealmove> noob question but how to make a 2d array?
07:51:42FromDiscord<sealmove> (not seq)
07:51:50FromDiscord<ElegantBeef> `array[w h, T]`
07:52:00FromDiscord<no name fits> I was more just curious if there actually was a difference 😛
07:52:10FromDiscord<ElegantBeef> There isn it's just a indexing difference
07:52:14*vicfred quit (Quit: Leaving)
07:52:15FromDiscord<no name fits> yeah
07:52:18FromDiscord<ElegantBeef> I can write a small example
07:52:41FromDiscord<no name fits> I'm just weird and like to test it for myself
07:52:42FromDiscord<sealmove> In reply to @ElegantBeef "`array[w * h, T]`": no thanks, I'll use seqs then :P
07:55:45FromDiscord<haxscramper> you can also use `array[w, array[h, T]]`
07:56:04FromDiscord<sealmove> In reply to @haxscramper "you can also use": oh that's what I want
07:56:29FromDiscord<sealmove> right, my brain stuck and I couldn't figure out the syntax lol
07:56:58FromDiscord<Rika> And in this case there is no down side over the w h one
07:57:08FromDiscord<ElegantBeef> Cmon this is wonderful! https://play.nim-lang.org/#ix=2WW7
07:57:35FromDiscord<sealmove> true, it's nice
07:58:25FromDiscord<sealmove> I am trying to reconstruct 2d image from dissected data channel of an 128x64 oled :D
08:00:55FromDiscord<no name fits> why is it there's no collisions even though multiplication is commutative?
08:01:32*liblq-devel joined #nim
08:01:33FromDiscord<ElegantBeef> What do you mean?
08:01:42FromDiscord<no name fits> 2 1 = 1 2
08:02:00FromDiscord<ElegantBeef> w
08:02:09FromDiscord<Rika> In reply to @no name fits "why is it there's": What do you mean
08:02:20FromDiscord<ElegantBeef> Assume they mean with the array indexing
08:02:27FromDiscord<no name fits> Isn't it a flat array? Am I missing something?
08:02:40FromDiscord<ElegantBeef> 2 5 + 0 = 10
08:02:48FromDiscord<ElegantBeef> You cannot get 10 with any other combination
08:03:37FromDiscord<no name fits> oooooh
08:03:42FromDiscord<ElegantBeef> in a 5x5 array 0-4 are the first 5 elements and 5 is the 6th
08:03:48FromDiscord<no name fits> That took me longer to get than I'd like
08:04:19FromDiscord<no name fits> I'm not very smart
08:04:25FromDiscord<ElegantBeef> i know it took me a while to solve it myself forever ago
08:04:36FromDiscord<ElegantBeef> I refused to use any documentation to figure out the 3D mapping for a 1D array
08:05:10FromDiscord<ElegantBeef> and now it makes a ton of sense and is simple expressed as "For each dimension you first calculate the area of a slice of a lower dimension"
08:05:55FromDiscord<ElegantBeef> So in a 2D array you calculate the area of a single dimension which is just either the width or height depending on your array layout
08:06:23FromDiscord<ElegantBeef> in 3D you use width and height, the very odd thing is the last dimension actually isnt a concern for indexing
08:07:08FromDiscord<sealmove> guys do you think a monochrome 128x64 oled will be use 1-bit per pixel?
08:07:21FromDiscord<ElegantBeef> I'd hope so
08:07:33FromDiscord<ElegantBeef> Might even do less
08:07:34FromDiscord<sealmove> ok, I'll make this assumption
08:07:54FromDiscord<ElegantBeef> could do the more efficient "how many of this state"
08:08:21FromDiscord<ElegantBeef> Though that's only more efficient if there is a lot of contiguous blocks
08:09:29FromDiscord<ElegantBeef> first bit being "this state" remaining being "how many"
08:09:29FromDiscord<no name fits> Also last time I asked, the answer were a little all over the place, but what do I do for automated performance testing in Nim?
08:10:17FromDiscord<ElegantBeef> As i dont know what that really classifies as, i say use benchy 😄
08:10:31FromDiscord<ElegantBeef> I'm a terrible developer
08:11:07FromDiscord<haxscramper> Benchy is good & simple to use, so I would also recommend it
08:11:26FromDiscord<ElegantBeef> Hey you only agreed with 1 of my sentences!
08:12:04FromDiscord<haxscramper> Give me a break, I can only process that much text at one time
08:12:09FromDiscord<ElegantBeef> lol
08:12:10FromDiscord<no name fits> this one? https://github.com/treeform/benchy
08:12:13FromDiscord<haxscramper> yes
08:12:15FromDiscord<ElegantBeef> Yes
08:12:17FromDiscord<no name fits> tyty
08:13:33FromDiscord<no name fits> does it give me a warning if I forget to run in something not debug?
08:13:43FromDiscord<no name fits> because I know I'll forget that
08:14:10FromDiscord<ElegantBeef> Just make a nimble task
08:14:18FromDiscord<no name fits> oh yeah that's thing
08:14:23FromDiscord<no name fits> (edit) "" => "a"
08:14:48FromDiscord<no name fits> you guys are really helpful btw
08:17:32FromDiscord<ElegantBeef> Dont say that it'll go right to my head and no one wants that
08:19:55FromDiscord<Nisha's alt> How would i use this C++ library in Nim? https://github.com/adepierre/Botcraft
08:19:56FromDiscord<Nisha's alt> :p
08:20:05FromDiscord<ElegantBeef> By wrapping it
08:20:42FromDiscord<ElegantBeef> Go to https://github.com/adepierre/Botcraft/blob/master/Examples/0_HelloWorld/src/main.cpp and replicate it in Nim, wrapping all the types you need
08:21:19FromDiscord<Nisha's alt> Ah okay!
08:21:55FromDiscord<ElegantBeef> Atleast that's what i've done for the Rpi Pico, remade the examples and wrote bindings for the code as i needed it so it could be idiomatic
08:35:19*krux02 joined #nim
08:40:10*jess joined #nim
08:48:47FromDiscord<Rika> In reply to @รєคɭ๓๏שє "guys do you think": Refer to the data sheet
08:48:52FromDiscord<Rika> It will be mentioned there
08:54:47FromDiscord<sealmove> why doesn't `\b` work? stdout.write "\b".repeat((h+1)w)
08:54:53FromDiscord<sealmove> (edit) removed " stdout.write "\b".repeat((h+1)w)"
08:55:06FromDiscord<sealmove> (edit) "why doesn't `\b` work? ... " added "https://play.nim-lang.org/#ix=2WWm"
08:55:37FromDiscord<ElegantBeef> It's an escaped character
08:55:45FromDiscord<ElegantBeef> !eval echo echo r"a\bb"
08:55:46NimBotCompile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <void>
08:55:47FromDiscord<ElegantBeef> Shit
08:55:50FromDiscord<ElegantBeef> !eval echo r"a\bb"
08:55:51NimBota\bb
08:56:13FromDiscord<sealmove> it is supposed to print `b`, but it prints `ab`, ignoring `\b`
08:57:13FromDiscord<haxscramper> terminal has to have support for this control code
08:57:59FromDiscord<haxscramper> I doubt playground implements a full ANSI terminal specification. Most likely it only supports color codes
08:58:23FromDiscord<sealmove> then my konsole doesn't either?
08:58:54FromDiscord<sealmove> i doupt it
08:58:54FromDiscord<haxscramper> `kitty` works as expected https://media.discordapp.net/attachments/371759389889003532/834714869965389825/unknown.png
08:59:05FromDiscord<sealmove> (edit) "doupt" => "doupb"
09:00:05*watzon quit (Quit: Idle for 30+ days)
09:00:29FromDiscord<sealmove> Ok thanks. Konsole not supporting this is so surprising
09:05:08FromDiscord<sealmove> ohhh
09:05:28FromDiscord<sealmove> it just doesn't delete new lines
09:05:55FromDiscord<sealmove> is it possible to go back lines?
09:06:50*liblq-devel quit (Quit: WeeChat 3.1)
09:10:39FromDiscord<sealmove> ok apparently the opposite of `\n` is `\e[F`
09:30:54FromDiscord<sealmove> ok, I need the simplest library to write an image, even bitmap, since printing to terminal doesn't do the trick
09:32:12*wasted_youth2 quit (Quit: Leaving)
09:41:23ForumUpdaterBotNew thread by Drkameleon: Capturing external variables in closure, see https://forum.nim-lang.org/t/7838
09:41:24*m4r35n357 quit (Quit: Ex-Chat)
09:42:05*mwbrown quit (Ping timeout: 246 seconds)
09:44:10*mwbrown joined #nim
09:46:28*tefter_ joined #nim
09:48:10*tefter quit (Ping timeout: 252 seconds)
09:50:21*tefter_ is now known as tefter
10:18:04*wasted_youth2 joined #nim
10:34:55*NimBot joined #nim
11:04:41*Gustavo6046 quit (Ping timeout: 240 seconds)
12:05:07PMunchHmm, is there a way to get the position of an item in an ordered set
12:06:42*Vladar quit (Remote host closed the connection)
12:10:43FromDiscord<uuuu> @zetashift Sorry for the late reply. What did you mean by "bleeding edge" in your nim tetris game repo? How is it bleeding edge when the stable releases of godot and nim are being used?
12:21:54FromDiscord<zetashift> In reply to @uuuu "<@!77574388035100672> Sorry for the": because it uses ARC/ORC and gdnim itself isn't stable
12:22:47FromDiscord<uuuu> When will gdnim be stable?
12:23:34FromDiscord<zetashift> If you set the `build.ini` to not use ARC/ORC or other experimental features you can just have godot-nim functionality
12:23:42FromDiscord<zetashift> and thus have it act "stable"
12:24:06*sagax quit (Ping timeout: 245 seconds)
12:24:56*d10n-work quit (Ping timeout: 245 seconds)
12:27:45*d10n-work joined #nim
12:30:05*Vladar joined #nim
12:30:29FromDiscord<zetashift> fwiw I had 0 problems with it until now @uuuu
12:34:21*wasted_youth2 quit (Read error: Connection reset by peer)
12:35:19FromDiscord<exelotl> If you have a custom container with a delete operation, do you have to call `=destroy` manually on the item to be deleted?
12:35:46*wasted_youth2 joined #nim
12:35:46*wasted_youth2 quit (Remote host closed the connection)
12:36:17*wasted_youth2 joined #nim
12:37:23*letto_ joined #nim
12:37:51*letto quit (Ping timeout: 245 seconds)
12:42:34*rockcavera joined #nim
12:47:26*wasted_youth2 quit (Ping timeout: 245 seconds)
12:48:15*wasted_youth2 joined #nim
12:54:16FromDiscord<clyybber> In reply to @exelotl "is this normal? https://play.nim-lang.org/#ix=2WV1": It's because of cursorInference; if you turn that off via --cursorInference:off then you get both destroy calls
12:54:35*NimBot joined #nim
12:54:55FromDiscord<clyybber> In reply to @exelotl "If you have a": Yeah; depends on what your container builds though; if it builds on a seq for example; seq's already do that
12:55:02FromDiscord<clyybber> (edit) "seq's" => "seqs"
13:01:23*natrys joined #nim
13:04:06*wasted_youth2 quit (*.net *.split)
13:04:07*jess quit (*.net *.split)
13:04:09*ckafi[m] quit (*.net *.split)
13:04:11*crem quit (*.net *.split)
13:05:33*wasted_youth2 joined #nim
13:05:33*jess joined #nim
13:05:33*ckafi[m] joined #nim
13:05:33*crem joined #nim
13:07:01*wasted_youth2 quit (Ping timeout: 245 seconds)
13:07:38*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
13:11:08*johnnynitwits joined #nim
13:12:47FromDiscord<exelotl> ah cool, thanks :)
13:14:51*jess quit (Quit: Reconnecting)
13:15:19*jess joined #nim
13:17:40*filcuc_ quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/)
13:20:28*Gustavo6046 joined #nim
13:21:34FromDiscord<pietroppeter> In reply to @PMunch "Hmm, is there a": @PMunch: looking at implementation I think it is not possible to have it O(1), you can of course have it in O(n) by traversing the set: https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/collections/sets.nim#L72
13:26:39PMunchYeah that is what I ended up doing
13:27:14PMunchI only have 24 values in the set max
13:38:14*johnnynitwits quit (Quit: Bridge terminating on SIGTERM)
13:38:46*johnnynitwits joined #nim
13:41:16*johnnynitwits quit (Client Quit)
13:53:27*tefter quit (Remote host closed the connection)
13:56:21*johnnynitwits joined #nim
13:56:21*johnnynitwits quit (Excess Flood)
13:56:48*NimBot joined #nim
14:04:46FromDiscord<jtiai> Is there map/dict datatype nim or way to do that relatively easily?
14:08:40ForumUpdaterBotNew Nimble package! xgboost.nim - Nim wrapper of libxgboost, see https://github.com/jackhftang/xgboost.nim
14:20:29FromDiscord<zetashift> You could use `tables` https://nim-lang.org/docs/tables.html or one of it's variants
14:20:55FromDiscord<zetashift> (edit)
14:41:09*casaca quit (Ping timeout: 260 seconds)
15:00:34FromDiscord<Ricky Spanish> where does the forumupdaterbot get its information from? its querying githubs api for nim repo's? or people submit their work urls to some central repo?
15:02:00FromDiscord<Rika> Querying
15:02:06FromDiscord<Rika> Ah wait no
15:02:25FromDiscord<Rika> The central repo is Nim-Lang/packages I believe
15:04:10FromDiscord<Ricky Spanish> ah right 👍 thanks for the info
15:04:32FromDiscord<Rika> I might have that wrong but it’s a similar name
15:05:21FromDiscord<Ricky Spanish> yeh just wondered how it was being handled, thought there was gonna be some crazy nim magic going on again that was worth asking about
15:06:43FromDiscord<Rika> Yeah actually all the messages listed here as from bots are actually from bots, a super intelligent AI coded in Nim
15:09:51FromDiscord<Ricky Spanish> mratsim....? it feels like something he'd do
15:21:09FromDiscord<Rika> lmao
15:23:49*fredrikhr joined #nim
15:31:28reversem3Has anyone does any p2p programming using nim?
15:32:09reversem3I am interested how to create an app that uses a decentralized database so I don't have to rely on a server.
15:34:02reversem3 * Has anyone here created a p2p program ?
15:34:32reversem3I know there is libp2p but the only examples are a chat application
15:38:44*xet7 quit (Quit: Leaving)
15:39:15*vicfred joined #nim
15:45:31*xet7 joined #nim
15:46:12*teasea quit (Quit: teasea)
15:48:11*teasea joined #nim
15:59:50FromDiscord<mlokis> where do i find assembly output when i use --asm
16:05:11reversem3Just use xxd or radare2 on the binary or exe
16:34:37*Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in)
16:34:42FromDiscord<carpal> if nim's compiler uses c as main IR, then why is it considered a compiler and not a transpiler?
16:36:23PrestigeProbably because it does more than just translated to c
16:36:41PrestigeTranslate*
16:38:28PrestigeBut I don't think the terminology really matters in this case
16:39:37*casaca joined #nim
16:41:23PrestigeIf it were called a transpiler, I would assume that I would end up with C code and not a binary in the end
16:42:55FromDiscord<haxscramper> In reply to @carpal "if nim's compiler uses": it does not use `C` as "main IR"
16:43:05FromDiscord<haxscramper> It uses C as backed language
16:44:16FromDiscord<haxscramper> Just as Js/C++. For IR nim uses it's AST
16:49:32FromDiscord<carpal> In reply to @Prestige "Probably because it does": but the definition of transpiler is literaly a high level to another one
16:50:12PrestigeAt a high level, the nim compiler compiles nim code to a binary
16:50:19Prestige(when using c or c++ backends)
16:50:43FromDiscord<carpal> In reply to @haxscramper "It uses C as": this means that generates c
16:50:48FromDiscord<carpal> (edit) "this" => "that"
16:51:26Prestigethe compiler's function/use is not to generate c code
16:53:36Prestigejust how the purpose of walking isn't to put my feet on the ground
16:55:45FromDiscord<carpal> good point
17:02:25FromDiscord<WSECU> How can I have nim show what gcc commands its doing when I compile?
17:03:08FromDiscord<Solitude> look at json file in nimcache
17:04:00giaco__how would you go from "let foo={"a":1,"b":2}" to string "a=1,b=2" (I need to urlencode a table-like thingy)
17:05:01FromDiscord<haxscramper> https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped collect for pairs
17:05:15FromDiscord<haxscramper> Or just iterate and add to result
17:05:25FromDiscord<WSECU> What if I want nim to just compile to C and then stop?
17:05:30FromDiscord<haxscramper> The best solution. IIRC there is no `mapIt` for pairs
17:06:01FromDiscord<haxscramper> In reply to @WSECU "What if I want": See `--fullhelp` for options, I we have something like `--noLink`
17:07:00*Gustavo6046 joined #nim
17:07:23FromDiscord<demotomohiro> In reply to @WSECU "How can I have": --listCmd option prints gcc commands Nim compiler calls
17:09:09giaco__haxscramper, last time I tried collect, it failed with strings
17:09:59giaco__haxscramper: https://github.com/nim-lang/Nim/issues/16078
17:11:12FromDiscord<haxscramper> https://play.nim-lang.org/#ix=2WZ0
17:12:09FromDiscord<haxscramper> Good old loop will get you almost anywhere with not too much syntactic noise
17:12:59FromDiscord<haxscramper> And I forgot that `collect` uses it's body to infer the generic parameters for result type, so it does not work for strings
17:19:30*dsrw joined #nim
17:22:21dsrwIs there any way to tell if a macro is being called as a statement, or as an expression without nesting it inside another macro?
17:22:56dsrwI guess I want the NimNode for the macro itself. I'm not sure if that's a thing.
17:23:14*Prestige quit (Quit: Prestige)
17:23:39*Prestige joined #nim
17:23:59FromDiscord<haxscramper> No, macro cannot access it's surrounding context
17:24:39dsrwThanks @hexscramper
17:25:04FromDiscord<haxscramper> With some exceptions like TRM macros, but this is usually the wrong solution to the problem
17:26:37*vicfred quit (Remote host closed the connection)
17:27:09*vicfred joined #nim
17:27:24dsrwYeah, I don't think I want a TRM. This is just for a bit of sugar. Having two different macros with different names will do the job fine.
17:27:58*vicfred quit (Max SendQ exceeded)
17:29:02*vicfred joined #nim
17:29:43*vicfred quit (Max SendQ exceeded)
17:30:23*vicfred joined #nim
17:36:01FromDiscord<jtiai> I am using OrderedTable. I couldn't find how to get range of entries, like entry of key 31173 and next 9 (10 in total).
17:36:39FromDiscord<haxscramper> Ordered table only remembers insertion order, you need to use fusion/btreetables in order to query for ranges.
17:37:01FromDiscord<haxscramper> Though I don't exactly remember if it has this API or not
17:37:23FromDiscord<haxscramper> https://nim-lang.github.io/fusion/src/fusion/btreetables.html#keysBetween.i%2CTable%5BA%2CB%5D%2CA%2CA
17:40:58*def-- joined #nim
17:41:00*blackpawn joined #nim
17:42:18FromDiscord<jtiai> Too bad that I don't know ending key.
17:42:29FromDiscord<jtiai> Only start.
17:43:13FromDiscord<jtiai> Though I could start iterating and breakout upon reached count.
17:43:28*WilhelmV1nWeiner joined #nim
17:48:34*def- quit (*.net *.split)
17:48:34*WilhelmVonWeiner quit (*.net *.split)
17:48:35*blackpawn_ quit (*.net *.split)
17:48:44*def-- is now known as def-
18:04:53FromDiscord<ellliottt> can i set nim to compile with TCC rather than clang when im not in release mode?
18:08:25FromDiscord<Hi02Hi> `nim c --cc:tcc file.nim`
18:09:06FromDiscord<ellliottt> is there a way to set that flag as default for debug builds?
18:09:27FromDiscord<ellliottt> unless im compiling a release build i dont care about the performance of the binary, id rather have a quicker compiler
18:13:54FromDiscord<Recruit_main707> you can use .nims configuration files
18:15:56FromDiscord<Recruit_main707> pretty sure this works https://media.discordapp.net/attachments/371759389889003532/834855055801974824/your_main_file_name.nims
18:16:12FromDiscord<Recruit_main707> why no preview :(
18:16:45FromDiscord<Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2X0M
18:16:49FromDiscord<zetashift> needs a `not` right?
18:16:51FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2X0N
18:16:52FromDiscord<haxscramper> in `nim.cfg`
18:17:09FromDiscord<zetashift> what is more idiomatic `nim.cfg` or `config.nims`?
18:17:10FromDiscord<Recruit_main707> ah yeah
18:17:15FromDiscord<haxscramper> `cc:"gcc"`
18:17:17FromDiscord<Recruit_main707> .nims
18:17:39reversem3p2p apps are no joke
18:18:03reversem3wish there was bindings for ipfs though for nim
18:19:01FromDiscord<ellliottt> oh neat. can you do that system wide rather than per project?
18:19:10ForumUpdaterBotNew thread by Gekkonier: Csfml, and the warning that it's not used and where to put that..., see https://forum.nim-lang.org/t/7839
18:20:01FromDiscord<zetashift> In reply to @ellliottt "oh neat. can you": you can I think: https://nim-lang.org/docs/nims.html (section 1)
18:20:27FromDiscord<haxscramper> tldr `~/.config/nims/nim.cfg`
18:20:46FromDiscord<haxscramper> (edit) "`~/.config/nims/nim.cfg`" => "`~/.config/nim/nim.cfg`"
18:21:42FromDiscord<zetashift> ^ yes, sorry, or `%APPDATA%/nim/config.nims` if you're on Windows
18:22:06FromDiscord<ellliottt> ah perfect, tysm :)
18:33:11*natrys quit (Ping timeout: 240 seconds)
18:33:35*natrys joined #nim
18:36:16reversem3!search importjs
18:44:43reversem3Does anyone have some good example of importing a javascript library ?
18:50:52PMunchThe playground imports the parts it needs to interface with the code editor
19:10:05*vicfred_ joined #nim
19:12:45*vicfred quit (Ping timeout: 268 seconds)
19:14:02*tane joined #nim
19:23:40FromDiscord<zidsal> @haxscramper thanks for the help yesturday, I've come to the conclusion that the macro based approach has too many draw backs, so I guess I'll use a object variant 😦
19:32:09reversem3The CType int64 is only for arch right (so if I'm compiling for a 64 bit I use 64 or 32 )?
19:32:12reversem3type
19:32:12reversem3CTime = int64
19:32:12reversem3proc time(arg: ptr CTime): CTime {.importc, header: "<time.h>".}
19:32:38reversem3 * The CTime int64 is only for arch right (so if I'm compiling for a 64 bit I use 64 or 32 )?
19:37:23ForumUpdaterBotNew thread by Alexeypetrushin: Do I need to publish with `nimble publish` or just submit my repo name to `package.json`?, see https://forum.nim-lang.org/t/7840
19:37:57*Kaivo quit (Ping timeout: 260 seconds)
19:51:46FromDiscord<WSECU> Is it possible to run into a project that only works with C or C++?
19:51:49FromDiscord<WSECU> for nim
19:52:02FromDiscord<jtiai> sent a code paste, see https://paste.rs/uMJ
19:52:23*fowl quit (Ping timeout: 260 seconds)
19:52:25FromDiscord<haxscramper> In reply to @WSECU "Is it possible to": By "only works with" you mean supporting only one backend?
19:52:35FromDiscord<WSECU> yeah
19:52:43*robertmeta quit (Read error: Connection reset by peer)
19:52:46FromDiscord<haxscramper> sent a code paste, see https://paste.rs/Zb4
19:52:51FromDiscord<haxscramper> In reply to @WSECU "yeah": sure, why not
19:52:51*sz0 quit (Read error: Connection reset by peer)
19:53:07FromDiscord<jtiai> I've seen a few. Usually bindings.
19:53:14FromDiscord<Recruit_main707> i think he is asking if there is some kind of limit
19:53:22FromDiscord<Recruit_main707> pretty sure not with c and c++
19:53:45FromDiscord<haxscramper> If you write pure nim it automatically supports all targets. For the most part
19:53:57FromDiscord<WSECU> If I made a project and normally compile with C, if another user decided to compile with C++ instead, would it break it?
19:54:06FromDiscord<haxscramper> no, most likely not
19:54:16FromDiscord<ElegantBeef> The otherway around might if you rely on compiling C++ code
19:54:31FromDiscord<Recruit_main707> why
19:54:36FromDiscord<jtiai> I would be useful that docs would indicate which import it needs. Quite frustrating as an enduser to make guesses and see weird errors.
19:54:43*kwilczynski quit (Ping timeout: 260 seconds)
19:54:56FromDiscord<haxscramper> In reply to @jtiai "I would be useful": https://media.discordapp.net/attachments/371759389889003532/834879964502556672/unknown.png
19:55:16FromDiscord<haxscramper> `src/` part is not needed of course,
19:55:18FromDiscord<Recruit_main707> afaik the only limitation of a backend is the js one about something, it was either manual allocations or something low level related
19:55:26FromDiscord<Recruit_main707> i dont remember now
19:55:36FromDiscord<ElegantBeef> When using non stdlibs your kinda expected to know how to import stuff 😄
19:56:04FromDiscord<jtiai> I know how. But question is what.
19:57:27FromDiscord<ElegantBeef> It says right there `fusion/btreetables`
19:58:02FromDiscord<ElegantBeef> nim 1.6 will have the import path as the title as that does so all modules will have the import path in the docs
19:58:15*robertmeta joined #nim
19:58:19*kwilczynski joined #nim
19:58:48FromDiscord<jtiai> Apparently devs have more important things to do than docs as the usual story is.
19:58:53*fowl joined #nim
19:59:03FromDiscord<ElegantBeef> i mean `nim doc` takes all of 3 seconds to run
19:59:08*sz0 joined #nim
19:59:51FromDiscord<jtiai> yea. "command expects filename".
20:00:00FromDiscord<jtiai> That was really helpful.
20:00:17FromDiscord<ElegantBeef> Why are you being so snide
20:00:20FromDiscord<zidsal> gah @ElegantBeef sorry I thanked @haxscramper for you helping me yesturday! thanks again for the help
20:01:30FromDiscord<jtiai> In reply to @ElegantBeef "Why are you being": Because I'm one of those people that care about the docs (I'm documentarian partly)
20:01:46FromDiscord<ElegantBeef> Ah so you mean you're a developer
20:01:57FromDiscord<ElegantBeef> I dont see what you're bitching at
20:01:58FromDiscord<jtiai> No, i write the docs.
20:02:50FromDiscord<ElegantBeef> Lol zidsal it's fine i didnt do much
20:02:53FromDiscord<haxscramper> In reply to @jtiai "Because I'm one of": nim documentation story is not as stellar as it could've been, that is true
20:03:08FromDiscord<haxscramper> to put it lightly
20:03:22FromDiscord<haxscramper> Well, the core part is documented well enough
20:03:29FromDiscord<jtiai> And I know it's one of the hard parts. Speciall put all common 4 parts together.
20:04:02FromDiscord<ElegantBeef> The wonderful part is it's all OSS, so whenever you find docs that are subpar or wrong you can update them
20:04:17FromDiscord<haxscramper> when you know what to write in docs
20:04:28FromDiscord<haxscramper> that is - when you already got the info
20:04:34FromDiscord<ElegantBeef> Well yea
20:04:43FromDiscord<jtiai> I probably will since I got somewhat fond of Nim.
20:05:28FromDiscord<jtiai> what this "nim doc" is really supposed to do? I couldn't get any output from it even trying to type some libs I use...
20:05:30FromDiscord<haxscramper> I think it also has a lot to do with `nim doc` tool being somewhat limited
20:05:45FromDiscord<haxscramper> In reply to @jtiai "what this "nim doc"": `nim doc file.nim` generates documentation for `file.nim`
20:05:47FromDiscord<ElegantBeef> nim doc will generate html documents from doc comments and the rst in contained
20:06:06FromDiscord<ElegantBeef> It's what drives the entire stdlib docs
20:06:30FromDiscord<jtiai> Ah, since I write more comprehensive docs I've been using sphinx mainly. and asciidoc a bit.
20:06:34FromDiscord<ElegantBeef> Also runs the tests which are contained inside the `runableExample:`
20:07:02FromDiscord<ElegantBeef> Dont get what you mean by that, you can write entire tutorials in the RST as many modules have
20:07:06FromDiscord<haxscramper> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html↵https://nim-lang.org/docs/docgen.html
20:07:24FromDiscord<haxscramper> https://nim-lang.org/docs/docstyle.html
20:07:34FromDiscord<jtiai> Well sphinx is rst too. + ability to parse some reference docs from python if wanted to.
20:08:20FromDiscord<haxscramper> Though to be completely honest something on the doxygen level is needed to properly support all nim features
20:08:29FromDiscord<haxscramper> There is just so much things
20:08:43FromDiscord<haxscramper> That demand careful separate handling
20:08:46FromDiscord<ElegantBeef> Well nim doc does a fair bit. Tests, code highlighting, index, and so on
20:08:53FromDiscord<ElegantBeef> But yea
20:09:07FromDiscord<haxscramper> And I'm only talking about machinery of code generation, not people writing text
20:09:20FromDiscord<haxscramper> (edit) "code" => "documentation"
20:09:25FromDiscord<haxscramper> For example documenting macros
20:09:32FromDiscord<haxscramper> OR specifically macro transforms
20:09:35FromDiscord<haxscramper> Injected variables
20:09:45FromDiscord<haxscramper> expected AST patterns
20:09:55FromDiscord<zidsal> what is this documentation you guys speak of!, understanding code I have written should be a right of passage... an honor if you will
20:09:56FromDiscord<haxscramper> surrounding scope expectations
20:10:12FromDiscord<haxscramper> like what you need to import in order for macro to work
20:10:15FromDiscord<ElegantBeef> lol zid
20:10:24FromDiscord<jtiai> tutorials, how-tos and discussions. + reference.
20:10:38FromDiscord<jtiai> that's the commmon 4 blocks of documentation.
20:11:21FromDiscord<haxscramper> tooling is also important, it is possible to have stellar documentation using only text files, but still
20:11:34FromDiscord<ElegantBeef> Discussions?
20:11:46FromDiscord<haxscramper> as a part of the documentation?
20:11:49FromDiscord<ElegantBeef> Yea
20:11:52FromDiscord<jtiai> tutorials do take user by hand and walks through an example. how-tos are like recipes to get things done and discussion is more like explanations about design decisions etc.
20:11:54FromDiscord<ElegantBeef> That's what i dont get
20:12:06FromDiscord<haxscramper> I though about running text miner on IRC logs
20:12:09FromDiscord<haxscramper> and forum posts
20:12:12FromDiscord<ElegantBeef> That's not discussion, that's "explanation" 😄
20:12:15FromDiscord<haxscramper> But the information is very fuzzy
20:12:29FromDiscord<jtiai> In documentarian vocabulary it's discussion.
20:12:32FromDiscord<ElegantBeef> Plus you'd have to filter all my messages and there is a lot of them
20:12:41FromDiscord<haxscramper> So you need somewhat good NLP skills to have something useful out of it, which I don't have yet
20:13:06FromDiscord<haxscramper> but we have 10+ years of discussions here, so it has to worth somehting
20:13:21FromDiscord<haxscramper> (edit) "somehting" => "something in terms of documentation source"
20:13:36FromDiscord<dk> I like how most of the manual and most of the system.nim doc is on one page
20:13:42FromDiscord<haxscramper> actually no, IRC logs date back to 2013 so it ls less than ten years. Still a lot
20:13:56FromDiscord<dk> much easier to keep track of what you've already read than when it's on multiple pages
20:14:14FromDiscord<haxscramper> one-page-per-proc documentation sounds
20:14:14FromDiscord<ElegantBeef> Ah you heard dk make all the stdlib on a single page with header seperating it 😛
20:15:38FromDiscord<ElegantBeef> And jtiai can you do me a favour and change that dot operators issue title to "Dot operators with type mismatch, shows assertion instead of compiler error"?
20:16:05FromDiscord<jtiai> Definitely. Just a sec.
20:16:14FromDiscord<ElegantBeef> Thanks
20:16:57FromDiscord<jtiai> Done.
20:17:32FromDiscord<ElegantBeef> And yea like i mentioned that'll never compile in Nim withough a int to bool `converter`
20:17:38FromDiscord<ElegantBeef> (edit) "withough" => "without"
20:18:27*jess quit ()
20:18:42*jess joined #nim
20:19:27FromDiscord<jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2Xc4
20:19:54FromDiscord<ElegantBeef> `TableRef` != `Table`
20:20:08FromDiscord<jtiai> and play.nim-lang.org went down.
20:20:42FromDiscord<ElegantBeef> The error consicely says the issue, the `valuesFrom` only works on a `Table` not a `TableRef`
20:21:08FromDiscord<ElegantBeef> you can do `t[]` instead of `t` and it should work but i dont know the implications if any
20:22:34FromDiscord<jtiai> But as Table it would be copied all over when using it?
20:23:09FromDiscord<ElegantBeef> Iterators are just fancy templates really so it shouldnt change much afaik
20:23:52FromDiscord<dk> Even in procs the compiler can pass a pointer if it can infer it's ok
20:24:00FromDiscord<dk> Even if it's value type
20:24:03FromDiscord<jtiai> Well it's 0xFFFF 10 to 15 char strings at max
20:25:05FromDiscord<jtiai> Scary. My CPU emulator compiled.
20:26:54*Vladar quit (Quit: Leaving)
20:27:10*xet7 quit (Quit: Leaving)
20:29:13*xet7 joined #nim
20:33:17FromDiscord<Phytolizer> sent a code paste, see https://paste.rs/Mv4
20:33:46FromDiscord<ElegantBeef> There is no running code there
20:33:50FromDiscord<ElegantBeef> That compiles fine
20:34:25FromDiscord<Phytolizer> it doesn't compile when I call toString on an Identifier
20:34:39FromDiscord<Phytolizer> i have this split across many files so didn't get a complete example
20:35:15FromDiscord<ElegantBeef> do you do `Identifier(token: "Something")`?
20:35:22FromDiscord<haxscramper> wandbox support multi-file nim examples
20:35:54FromDiscord<ElegantBeef> You probably forgot to import both the node and identifier in the file calling `toString` or didnt create the object
20:36:22FromDiscord<Phytolizer> i definitely import both Node and Identifier
20:36:28FromDiscord<Phytolizer> the object is created in the parser
20:36:38FromDiscord<Phytolizer> and this error occurs in my tests
20:36:42FromDiscord<ElegantBeef> I notice `toString` isnt exported
20:37:30*vicfred__ joined #nim
20:37:33FromDiscord<Phytolizer> you're right, i forgot to export them. after doing so, the error persists
20:38:21FromDiscord<dk> the errors suggests your variable is a nil
20:38:28*narimiran quit (Ping timeout: 265 seconds)
20:38:52FromDiscord<dk> https://nim-lang.org/docs/system.html#NilAccessDefect
20:39:48FromDiscord<Phytolizer> so the "dispatcher" is a variable?
20:40:19*vicfred_ quit (Ping timeout: 252 seconds)
20:41:44FromDiscord<Phytolizer> https://github.com/onContentStop/monkey here is the full context
20:41:48FromDiscord<dk> I dunno, I don't use methods, but the exception type is ducumented in system
20:42:04FromDiscord<Phytolizer> i know what a nilaccessdefect is, but my variables are not nil
20:42:43FromDiscord<dk> Is there no stack trace?
20:42:50FromDiscord<Phytolizer> it's in the toString call
20:43:15FromDiscord<Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=2Xgi
20:48:18FromDiscord<Phytolizer> using `tokenLiteral` instead of `toString` works fine
20:48:45FromDiscord<Phytolizer> wait i found it
20:48:46FromDiscord<Phytolizer> hang on
20:50:24FromDiscord<Phytolizer> yeah im real dumb
20:50:28FromDiscord<Phytolizer> here's what happened:
20:50:53FromDiscord<Phytolizer> LetStatement contains an optional Expression (a ref object).
20:51:01FromDiscord<Phytolizer> I hadn't yet implemented expression parsing.
20:51:12FromDiscord<Phytolizer> So it tried to call toString on the Expression and did that thing above.
20:51:26FromDiscord<Phytolizer> thanks for y'all's patience
20:51:56FromDiscord<dk> May that discourage you from using methods 😐
20:52:10FromDiscord<Phytolizer> i can't think of a better way to represent an AST
20:52:22FromDiscord<dk> Nim has an AST and it doesn't use methods
20:52:33FromDiscord<Phytolizer> oh i totally believe it's possible
20:52:55FromDiscord<dk> I was never as much confused by an error in Nim
20:52:58FromDiscord<dk> so there's that
20:53:24FromDiscord<Phytolizer> i come for Rust/C# so there's that
20:53:26FromDiscord<Phytolizer> from
20:54:13FromDiscord<haxscramper> In reply to @Phytolizer "i can't think of": the way to write AST in nim https://nim-lang.org/docs/macros.html#the-ast-in-nim
20:54:47FromDiscord<haxscramper> I've done 20+ different AST-like data structures at this point for various projects - never seen this approach fail
20:54:54FromDiscord<haxscramper> Works with pattern matching
20:55:18FromDiscord<haxscramper> Node type matching is checked for completeness when using `case`
20:55:41FromDiscord<haxscramper> Can put all implementation logic in a single procedure instead of spreading it over 20+ method overloads
20:55:58FromDiscord<haxscramper> Zero `ref` up/down-casting
20:56:11FromDiscord<Phytolizer> so just a tagged union
20:56:17FromDiscord<haxscramper> yep
20:56:19FromDiscord<Phytolizer> ok
20:56:25FromDiscord<Phytolizer> ill try both and see where im at
20:56:35FromDiscord<Phytolizer> i do like Rust enums
20:59:11*natrys quit (Ping timeout: 240 seconds)
21:01:17FromDiscord<jtiai> Showoff: https://media.discordapp.net/attachments/371759389889003532/834896666947223602/unknown.png
21:05:27FromDiscord<jtiai> <https://github.com/jtiai/nimoric> and there you can see the sources if interested in. Messy stuff because I've been learning.
21:19:40*PMunch quit (Quit: leaving)
21:23:00*natrys joined #nim
21:23:59*natrys quit (Client Quit)
21:38:24*tane quit (Quit: Leaving)
21:42:24FromDiscord<Recruit_main707> it looks nice :)
21:49:45*rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services)))
21:49:46*rockcavera joined #nim
21:53:52*rockcavera is now known as Guest83940
21:53:52*Guest83940 quit (Killed (verne.freenode.net (Nickname regained by services)))
21:53:53*rockcavera joined #nim
22:15:46*thomasross joined #nim
22:32:51*couven92 joined #nim
22:33:10*fredrikhr quit (Disconnected by services)
22:33:16*couven92 is now known as fredrikhr
22:34:23ForumUpdaterBotNew Nimble package! nodem - Call remote Nim functions as if it's local, see https://github.com/al6x/nim/tree/main/nodem
22:36:04*vicfred__ quit (Quit: Leaving)
23:09:53*dsrw quit (Ping timeout: 246 seconds)
23:22:35*fredrikhr quit (Quit: Client Disconnecting)
23:37:08*dsrw joined #nim
23:47:20FromDiscord<uuuu> Can I force a nim program to be compiled only as C or C++, throw an error if compiled any other way?
23:50:09FromDiscord<ElegantBeef> !eval when defined(c): {.error: "Only supports C backend".}
23:50:10NimBotCompile failed: /usercode/in.nim(1, 25) Error: Only supports C backend
23:50:33FromDiscord<ElegantBeef> Well probably `C++ backend` but there you go
23:51:06FromDiscord<uuuu> What was the code to force compile as C?
23:51:34FromDiscord<ElegantBeef> `nim cc`
23:51:45FromDiscord<ElegantBeef> or `compileToC`
23:52:09FromDiscord<uuuu> No I meant the code to give an error if a program expected to be compiled as C and got C++
23:52:20FromDiscord<ElegantBeef> I showed you in the !eval message
23:52:30FromDiscord<ElegantBeef> `when defined(cpp)`
23:53:02FromDiscord<uuuu> What about `when not defined(c)`?
23:53:12FromDiscord<ElegantBeef> works aswell
23:53:38FromDiscord<ElegantBeef> But i cannot think of a reason C cannot be compiled with C++
23:56:23krux02@ElegantBeef, C++ has more keywords than C.
23:56:48krux02therefore, some C++ keywords are valid variable names in C, but invalid in C++
23:57:14krux02and C has implicit forward declaration.