<< 20-02-2021 >>

00:02:59FromDiscord<ElegantBeef> `.cfg`
00:03:11FromDiscord<ElegantBeef> I'd personally say just use a toml library πŸ˜„
00:03:16FromDiscord<LITeralLANGuage9> How do I export to XML or JSON?
00:04:06FromDiscord<ElegantBeef> `import json; writeFile("myJson.json", % your object)`
00:04:11FromDiscord<ElegantBeef> (edit) "your object)`" => "yourObject)`"
00:05:21FromDiscord<PizzaFox> wait does `parsecfg` not support arrays
00:05:30FromDiscord<ElegantBeef> Dont think nim's stdlib has a xml exporter
00:05:59FromDiscord<ElegantBeef> not a clue, toml can though
00:07:49FromDiscord<PizzaFox> sent a code paste, see https://play.nim-lang.org/#ix=2Q1f
00:09:28*actuallybatman joined #nim
00:09:37FromDiscord<ElegantBeef> Yea just get one of these https://nimble.directory/search?query=toml
00:09:52FromDiscord<ElegantBeef> It's a similar format but it's widely used and standardized
00:10:55FromDiscord<ElegantBeef> TomlSerialization can deserialize files directly into objects so it's pretty nifty
00:11:59FromDiscord<PizzaFox> hm
00:12:04FromDiscord<PizzaFox> will use the status im one
00:48:16*Vladar quit (Quit: Leaving)
01:24:21*krux02 quit (Remote host closed the connection)
01:38:11FromDiscord<exelotl> sent a code paste, see https://play.nim-lang.org/#ix=2Q1w
01:41:03FromDiscord<exelotl> I'm currently doing the latter for my own project, but at compile time instead of via nimscript...
01:41:53FromDiscord<exelotl> which is a bit dumb, means I have to recompile the project tool every time i change an asset
01:51:41*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:52:01FromDiscord<ElegantBeef> @exelotl uncertain what you mean but checkout https://github.com/JimmyCushnie/SUCC
01:52:03*njoseph joined #nim
01:53:53FromDiscord<exelotl> succ πŸ€”
01:59:33FromDiscord<exelotl> it's pretty close I guess
01:59:56FromDiscord<exelotl> I really want to use something built in to Nim
02:00:00*abm quit (Read error: Connection reset by peer)
02:00:26FromDiscord<exelotl> that pretty much gives me json, xml, cfg or embedded nimscript
02:00:40FromDiscord<ElegantBeef> or toml πŸ˜„
02:00:51FromDiscord<ElegantBeef> Oh nvm you said `built in`
02:00:57FromDiscord<exelotl> yeah xD
02:01:22FromDiscord<ElegantBeef> The first three are all meh
02:02:40FromDiscord<exelotl> yep. JSON and XML are not human friendly, cfg doesn't have any concept of blocks that can be closed
02:03:28FromDiscord<ElegantBeef> Embedded nimscript is probably the best then since it also ensures values that match the source
02:03:28*Tanger quit (Quit: Leaving)
02:03:45FromDiscord<ElegantBeef> But embedding nimscript isnt really "builtin"
02:04:29FromDiscord<ElegantBeef> You need the compiler package
02:04:30FromDiscord<exelotl> oh :x
02:04:53FromDiscord<exelotl> does that not come with a standard Nim installation?
02:05:04FromDiscord<ElegantBeef> Dont think so
02:05:14FromDiscord<ElegantBeef> Could be wrong
02:05:30FromDiscord<ElegantBeef> Why are you so interested in builtin anywho?
02:06:13FromDiscord<exelotl> just want less dependencies
02:07:26FromDiscord<ElegantBeef> For serialization that dependency is pretty much par for the course
02:08:39FromDiscord<exelotl> this config file is just a list of all the graphics in the game, to be processed by a conversion tool
02:08:49FromDiscord<exelotl> I'd consider depending on toml but... it won't let me do this right? https://media.discordapp.net/attachments/371759389889003532/812506008378540082/Screenshot_from_2021-02-20_02-07-13.png
02:09:03FromDiscord<ElegantBeef> I believe it does
02:09:31FromDiscord<exelotl> I'm looking at the docs and it sounds like it would complain if I tried to make more than 1 key called sharePalette
02:09:45FromDiscord<ElegantBeef> If you made it an array i dont thinkso
02:09:47FromDiscord<ElegantBeef> (edit) "thinkso" => "think so"
02:10:00FromDiscord<ElegantBeef> Is this for the gba?
02:10:40FromDiscord<exelotl> Yeh, I'm trying to adapt my tools so they can be used in other people's projects x)
02:11:10FromDiscord<ElegantBeef> Just wondering due to how nimscript requires a minimal stdlib for the evaluation and adds around 1-2MB to the project
02:11:42FromDiscord<ElegantBeef> Yea idk make a SUCC nimplementation πŸ˜›
02:12:01FromDiscord<exelotl> it's not code to actually run on the GBA xD Just for the conversion tools
02:12:08FromDiscord<ElegantBeef> Ah
02:12:20FromDiscord<exelotl> (edit) "it's not code to actually run on the GBA xD Just for the ... conversion" added "asset"
02:12:33FromDiscord<exelotl> but yeah that does sound pretty heavy
02:13:31FromDiscord<ElegantBeef> Yea just checked the stdlib i ship on nimscripter's repo is 1.2MB which is like the smallest lib with 0 unrequired modules
02:14:21FromDiscord<ElegantBeef> Could always make a nim inspired format that's indent sensitive
02:14:43FromDiscord<ElegantBeef> Call it NON for Nim Object Notation πŸ˜„
02:19:11FromDiscord<exelotl> I also use nimscript tasks to build... so maybe I could handle the configuration at that point, and forward the results onwards to the conversion tool?
02:20:13FromDiscord<exelotl> the most frustrating thing is that nimscript doesn't any time functions at all :(
02:20:35FromDiscord<ElegantBeef> libffi cannot get here soon enough πŸ˜›
02:20:52FromDiscord<exelotl> ooh is that a thing?
02:21:08FromDiscord<ElegantBeef> You can build the compiler with a libffi flag which gives you C interop capaballities
02:22:03FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q1K
02:22:37FromDiscord<ElegantBeef> I know typed means it's semantically checked but i dont know the difference πŸ˜„
02:23:15FromDiscord<exelotl> @Yjuq I don't understand this either x)
02:23:19FromDiscord<Yjuq> (edit) "https://play.nim-lang.org/#ix=2Q1K" => "https://play.nim-lang.org/#ix=2Q1L"
02:23:28FromDiscord<ElegantBeef> I'd like to say it doesnt matter since i've never ran into it
02:23:41FromDiscord<exelotl> yeah I'm not sure if there's even a difference
02:23:57FromDiscord<tinygiant> Finally back at it. I need to build a file parser to pull function prototypes out of plain-text program files. Can anyone point me at a project or package that may use pegs (or maybe npeg) to parse something like this so I have a good example to start/learn from?
02:24:57FromDiscord<ElegantBeef> https://github.com/zevv/aoc2020/blob/master/07/main.nim one example
02:25:06FromDiscord<ElegantBeef> I really cannot read it, but it does something πŸ˜„
02:27:48FromDiscord<tinygiant> @ElegantBeef That's my problem, not yours. Thanks for the pointer!
02:41:42FromDiscord<exelotl> this is getting somewhere πŸ‘€ https://media.discordapp.net/attachments/371759389889003532/812514283497193472/Screenshot_from_2021-02-20_02-41-16.png
02:50:33*lritter quit (Ping timeout: 256 seconds)
02:50:47*asdflkj_1 joined #nim
02:50:52*lritter joined #nim
02:51:26FromDiscord<exelotl> soo it works like - The conversion tool invokes `nim e runner.nims config.nims`. The runner executes config.nim with the necessary API available, and echo's out the config in a machine-friendly format which the conversion tool can parse
02:51:58FromDiscord<exelotl> (edit) "config.nims`." => "graphics.nims`." | "config.nim" => "graphics.nims"
02:52:01FromDiscord<ElegantBeef> Nice
02:52:12FromDiscord<ElegantBeef> My silly .obj parser works πŸ˜„
02:52:25FromDiscord<exelotl> oh cool
02:52:49FromDiscord<ElegantBeef> Surprising that you can parse a majority that shitty format in like 41 lines of code
02:52:53FromDiscord<ElegantBeef> (edit) "Surprising that you can parse a majority ... that" added "of"
03:15:46*Tanger joined #nim
03:30:31FromDiscord<Yjuq> Uh... Could it be that I can change the whole syntax from nim if i want to with templates and macros?
03:31:22FromDiscord<Yjuq> To let it look like Go code for example. Sounds stupid - I know. And I probably don't do this, just curious
03:33:03FromDiscord<exelotl> templates and macros operate on the AST after the code has been parsed, so no you can't change Nim's syntax
03:33:22FromDiscord<exelotl> but Nim's syntax is very flexible so you can still do a lot
03:34:12FromDiscord<Yjuq> Yea... I probably can cheat a bunch of different stuff in it. But I would not get rid of the indention for example huh
03:34:26FromDiscord<ElegantBeef> Macros have to be parsable nim code, so yea you're forced into the nim style, but not implement your own unless you use strings
03:34:51*FromDiscord quit (Remote host closed the connection)
03:35:05*FromDiscord joined #nim
03:35:40FromDiscord<ElegantBeef> For instance you could make a parser which takes the code as a string and emits Nim code
03:36:25FromDiscord<Yjuq> Don't need to rofl - I have no intention of designing a programming language
03:36:43FromDiscord<ElegantBeef> Yea but it's a nice cheaty way to get a compiled language πŸ˜›
03:36:47FromDiscord<Yjuq> but maybe something for lua. Lua -> Nim converter or something
03:37:14FromDiscord<ElegantBeef> Dont know if you read my macro article, but it does show some of the capabillities
03:37:32FromDiscord<Yjuq> What is your macro article?
03:37:47FromDiscord<ElegantBeef> I linked it earlier but here again https://dev.to/beef331/demystification-of-macros-in-nim-13n8
03:38:12FromDiscord<Yjuq> Ah yea, that one... I try to understand it?
03:38:50FromDiscord<Yjuq> that first example can be done with simple templates as well
03:38:58FromDiscord<ElegantBeef> Yea, but i was just showing macros
03:39:12FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q20
03:40:07FromDiscord<Yjuq> Why did you set the `value` as `untyped`?
03:40:19FromDiscord<ElegantBeef> Cause i dont care if it's semantically checked
03:40:33FromDiscord<ElegantBeef> Regardless it'll complain in the end
03:41:09FromDiscord<ElegantBeef> I only used typed values in macros when i need introspection since they allow you to look up values
03:41:26FromDiscord<ElegantBeef> For most cases just identifiers/literals is enough
03:43:03FromDiscord<Yjuq> And I thought I already understood the difference between `typed` and `untyped` - I'm lost again
03:43:09FromDiscord<Yjuq> x)
03:44:02FromDiscord<ElegantBeef> Typed values in macros allow you to get their instantiation and extract information
03:44:54FromDiscord<ElegantBeef> In that last example the `T` is a typed value which is why i can use `getImpl` and iterate over the reclist
03:45:26FromDiscord<ElegantBeef> `typed` means they're semantically checked and are symbols with origins, untyped means they're just valid nim code with 0 logic attached
03:45:47FromDiscord<ElegantBeef> So since it's a symbol you can actually look at things like it's fields and use that for whatever you wish
03:46:34FromDiscord<ElegantBeef> Here is another example of using a typed value `https://github.com/nim-lang/Nim/blob/devel/lib/std/setutils.nim#L39`
03:46:39FromDiscord<ElegantBeef> I'm dumb
03:46:43FromDiscord<ElegantBeef> (edit) "`https://github.com/nim-lang/Nim/blob/devel/lib/std/setutils.nim#L39`" => "https://github.com/nim-lang/Nim/blob/devel/lib/std/setutils.nim#L39"
03:47:16FromDiscord<ElegantBeef> because it's typed i'm capable of extracting all the enum values, if it wasnt typed i'd just get `ident "T"`
03:47:26FromDiscord<ElegantBeef> Also exelotl it's in devel now πŸ˜›
03:49:10FromDiscord<ElegantBeef> Hopefully that's helpful and not as redundant as sounds to me
03:50:12FromDiscord<Yjuq> I'm just completely lost in this topic. x)
03:50:50FromDiscord<ElegantBeef> Well ask questions and i'll attempt to provide a map
03:51:25FromDiscord<ElegantBeef> I came from C# so yea i understand being completely confused/scared of macros
03:52:01FromDiscord<Yjuq> Nah, the standard stuff is pretty straight forward. But manipulating the AST is what confuses me
03:52:12FromDiscord<Yjuq> I still didn't understand how things are structured there
03:52:38FromDiscord<ElegantBeef> Ah, play around with `macros.dumptree` and valid nim code
03:52:55FromDiscord<ElegantBeef> You'll get pretty familiar with it
03:55:31FromDiscord<Yjuq> https://discord.com/channels/371759389889003530/371759389889003532/812385368161910824↡It's about this one here - He forget to put the into it. And as soon I do that the macro doesn't work. I try to fix it that's why i'm so engaged with macros atm x)
03:56:01FromDiscord<Yjuq> line 20: `func Example() {.mylib.}` should be `func Example() {.mylib.}`
03:56:30FromDiscord<ElegantBeef> line 15 should be `("prefix_" & toLowerAscii(procdef[0].baseName))`
03:56:58FromDiscord<Yjuq> Where does the [4] come from by the way?
03:57:19FromDiscord<ElegantBeef> when you use `name` it turns into `nnkPostfix(nnkIdent(name), nnkident()`
03:57:24FromDiscord<Yjuq> Is the index 4 all pragma definitions for func declarations?
03:58:37FromDiscord<ElegantBeef> Yes
03:59:16FromDiscord<ElegantBeef> Easy to see now https://media.discordapp.net/attachments/371759389889003532/812533802903142410/unknown.png
04:01:35FromDiscord<Yjuq> this stuff is black magic
04:01:40FromDiscord<Yjuq> x)
04:02:09FromDiscord<ElegantBeef> Well Nim's got parts of it to reduce that magic
04:03:11FromDiscord<ElegantBeef> `lispRepr`, `repr`, `dumpTree`, `treeRepr` and the like
04:05:36*vicfred quit (Quit: Leaving)
04:06:17FromDiscord<ElegantBeef> `dumpTree` and `treeRepr` imo are the most important, here is an example usage for your previous issue https://play.nim-lang.org/#ix=2Q26
04:06:35FromDiscord<ElegantBeef> But i do kinda feel like i'm not helping any and just repeating myself πŸ˜„
04:08:42FromDiscord<Yjuq> I'm sorry - I'm kinda slow with learning ^.^
04:08:45*asdflkj_1 quit (Ping timeout: 240 seconds)
04:09:09FromDiscord<Yjuq> I never mastered one programming language - I just jump between them for my needs
04:09:33FromDiscord<Yjuq> The only exception would be assembler i guess
04:10:18*vicfred joined #nim
04:11:16FromDiscord<ElegantBeef> The big take away is that the AST is static empty is just in place of "nil"
04:11:55FromDiscord<ElegantBeef> (edit) "static" => "static,"
04:12:50FromDiscord<ElegantBeef> Like regardless of what you do a proper `proc`'s `[0]` will always be either `postfix` if it's exported or `ident` if it's not
04:20:40*wasted_youth2 quit (Quit: Leaving)
04:23:49*Jjp137 quit (Quit: Leaving)
04:24:48FromDiscord<Yjuq> can i give this pragma macro some parameter to make it more generic?
04:24:59FromDiscord<Yjuq> I tried to add a "prefix" parameter
04:25:39FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q28
04:25:40FromDiscord<Yjuq> something like this
04:25:52FromDiscord<Yjuq> ah wait
04:27:11FromDiscord<Yjuq> nvm i dont get it rofl
04:27:18FromDiscord<ElegantBeef> You're on the right path
04:30:22FromDiscord<ElegantBeef> the issue is that using the pragma method it does `myLib(funcDef): prefix`
04:30:29FromDiscord<ElegantBeef> Pragmas are evaluated as above
04:30:59FromDiscord<ElegantBeef> so if you do `func example{.myLib: a.}` prefix is `func example` and funcDef is `a`
04:31:12FromDiscord<ElegantBeef> https://play.nim-lang.org/#ix=2Q2b
04:31:27FromDiscord<ElegantBeef> That was just a gotcha due to how pragmas are evaluated, you were right
04:33:03FromDiscord<Yjuq> Okey... I guess I only need a default value now if I don't add something in right?
04:33:04FromDiscord<Yjuq> sigh
04:33:16FromDiscord<Yjuq> or switch the parameter
04:33:19FromDiscord<Yjuq> this could work
04:33:36FromDiscord<ElegantBeef> Or make two macros that call an internal proc that returns a nim node
04:34:51FromDiscord<Yjuq> surprised pikachu face
04:36:00FromDiscord<Yjuq> I appreciate the help - that are some nice things you told me here.
04:36:09FromDiscord<ElegantBeef> Example of that two macro solution https://play.nim-lang.org/#ix=2Q2d
04:36:39FromDiscord<ElegantBeef> Dont know if there is a better way for default values for macros seems they require this type of logic, but i could be wrong
04:37:38FromDiscord<Yjuq> I would just check in the macro if one of them where nil and just swap the parameter x)
04:37:44FromDiscord<Yjuq> This was my first though
04:37:49FromDiscord<Yjuq> (edit) "though" => "thought"
04:37:50*spiderstew quit (Ping timeout: 264 seconds)
04:37:51*Jjp137 joined #nim
04:38:06*spiderstew joined #nim
04:45:05FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q2f
04:45:47FromDiscord<Yjuq> (edit) "https://play.nim-lang.org/#ix=2Q2f" => "https://play.nim-lang.org/#ix=2Q2g"
04:45:59FromDiscord<Yjuq> (edit) "https://play.nim-lang.org/#ix=2Q2g" => "https://play.nim-lang.org/#ix=2Q2h"
04:51:01FromDiscord<Yjuq> Uh, can you have in a pragma more than one argument? Something like: `{.example: a, b}` ? | probably not right? since the comma is used to separate different pragmas.
04:51:32FromDiscord<ElegantBeef> I dont believe so, you could use a string and split it at a `comma`
04:51:46FromDiscord<ElegantBeef> Havent passed many arguements through pragma macros
04:52:15FromDiscord<Yjuq> Would be better I guess. If I like to generalize that more I need at least the header file as well
04:52:18FromDiscord<Yjuq> rofl
05:35:42FromDiscord<Seedofarson> Yo
05:35:55FromDiscord<Seedofarson> I’m going to start learning more real nim tommorow
05:36:06FromDiscord<Seedofarson> I really like the langauge \:)
05:47:30FromDiscord<apollo> noice
06:02:01*a_chou joined #nim
06:04:10*a_chou quit (Client Quit)
06:28:09*narimiran joined #nim
06:36:28*muffindrake joined #nim
06:40:31FromDiscord<hamidb80> i'm stuck↡↡whenever i enter `nimble test`, it forces `--noNimblePath` flag to nim compiler
06:42:44FromDiscord<hamidb80> i tried `nimble test --NimblePath:~/.nimble/` but it didn't word
06:42:49FromDiscord<hamidb80> (edit) "word" => "work"
07:00:48*vsantana quit (Ping timeout: 272 seconds)
07:13:30FromDiscord<ElegantBeef> Why do you need the nimble path in testing?@hamidb80
07:26:44FromDiscord<hamidb80> In reply to @ElegantBeef "Why do you need": i use a third-party package called `ws` (websocket)
07:29:20FromDiscord<hamidb80> the problem is that i use the package `ws` in my code↡↡if i want to test the nim file that imported `ws` module, nimble says `cannot open file: ws`
07:29:31FromDiscord<ElegantBeef> Yea i figured that
07:32:21ForumUpdaterBotNew thread by Treeform: Check out my new lib Spacy: Spatial data structures for Nim., see https://forum.nim-lang.org/t/7536
07:32:31FromDiscord<ElegantBeef> Did you add `ws` to your nimble required list?
07:35:26FromDiscord<treeform> In reply to @hamidb80 "i use a third-party": You need to add `ws` to your nimble require list, because during `nimble test` it ignores normal installed packages and only allows imports of packages on the require list (or their require lists).
07:35:43FromDiscord<ElegantBeef> It's completely sandboxed for good reason
07:35:43FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q2K
07:35:52FromDiscord<treeform> ... and thank you for using `ws`!
07:36:00FromDiscord<hamidb80> In reply to @ElegantBeef "Did you add `ws`": no it's global
07:36:11FromDiscord<ElegantBeef> Like we said it needs to be required by nimble
07:36:17*krux02 joined #nim
07:37:12FromDiscord<ElegantBeef> No problem yjuq, though weird to see `lib` and `Lib` not very conventional πŸ˜„
07:37:41FromDiscord<Yjuq> Well - The only difference is the invoked callback
07:38:09FromDiscord<Yjuq> could name it "LIB" instead but it doesn't make a difference at all
07:38:20FromDiscord<Yjuq> since you can still write "LIB" in the pragma definition
07:38:34FromDiscord<ElegantBeef> Well Nim is case insensitive after the first letter πŸ˜„
07:38:40FromDiscord<Yjuq> yes, exactly
07:39:54FromDiscord<ElegantBeef> Treeform has returned to the "package-y" naming scheme! πŸ˜„
07:40:17FromDiscord<treeform> just to make you happy
07:40:35FromDiscord<ElegantBeef> Aw i didnt know you cared
07:42:07FromDiscord<Yjuq> So, if I see this right nim doesn't have "real member methods" for object in context of OOP right? You can attach the OOP syntax `.doSomething()` to everything as long the first parameter matches the type?
07:42:26FromDiscord<ElegantBeef> We do have dynamic dispatch but yes "member methods"
07:42:29FromDiscord<ElegantBeef> (edit) "We do have dynamic dispatch but yes ... "member" added "no"
07:42:56FromDiscord<ElegantBeef> You can use a method the same way as a proc `a(b)` or `b.a`
07:43:29FromDiscord<Yjuq> It's kind of funny. This allows you to attack this stuff to literals.
07:43:32FromDiscord<ElegantBeef> `method` being the overrideable dynamically dispatched "proc"
07:43:41FromDiscord<treeform> even `a(b)` or `b.a` or even just `a b`
07:44:02FromDiscord<Yjuq> Is there a way to make namespaces?
07:44:05FromDiscord<treeform> I have yest to use a `method` I don't think OOP fits into nim.
07:44:07FromDiscord<ElegantBeef> It makes the language feel great to use, cause everything but `iterators` can be used in any method that makes it feel great
07:44:25FromDiscord<ElegantBeef> No we just use modules and selective exports
07:44:48FromDiscord<treeform> In reply to @Yjuq "Is there a way": yeah `namesspace.function(args)` but then you can't use the other forms.
07:44:58FromDiscord<ElegantBeef> Well that's qualified imports
07:45:21FromDiscord<treeform> I guess you are right, they feel like namespaces...
07:45:52FromDiscord<Yjuq> I guess you can kinda do this with a typedef that you just use as first parameter for every proc / func in your module?
07:45:53FromDiscord<Yjuq> rofl
07:46:04FromDiscord<Yjuq> would be strange
07:46:14FromDiscord<Solitude> In reply to @Yjuq "I guess you can": i've seen at least one person do that
07:46:25FromDiscord<ElegantBeef> you can use qualified imports `from strutils import nil` which enforces `strutils.procName`
07:46:48FromDiscord<ElegantBeef> But it breaks the ufcs, so it's garbage
07:46:56FromDiscord<ElegantBeef> Sorry, i mean mcs πŸ˜„
07:47:32FromDiscord<ElegantBeef> A lot of people coming from python use qualified imports, and it makes me sad
07:48:24FromDiscord<ElegantBeef> Such a fantastic feature of a language being throw aside cause of what they're used to
07:48:37*vicfred quit (Quit: Leaving)
07:48:41FromDiscord<treeform> yeah its kind justified in python because everything so dynamic... its easy to get one thing as the other thing and be confused.
07:48:41FromDiscord<Yjuq> In the end code must be readable
07:49:52FromDiscord<ElegantBeef> I dont see how c style function calling achieves readabillity, but to each their own
07:50:39FromDiscord<ElegantBeef> To go with my shitty example `3.14.floor.int.mod(2)` vs. `mod((int)floor(3.14), 2)`
07:51:01FromDiscord<Yjuq> i honestly prefer the second one more
07:51:09FromDiscord<ElegantBeef> I can barely read the second one
07:51:19FromDiscord<Yjuq> I'm just used to that
07:51:23FromDiscord<treeform> I prefer the 1st one
07:51:36FromDiscord<treeform> I was used to the second one, but after I got used to the first 1 i prefer it now.
07:51:39FromDiscord<ElegantBeef> It removes a ton of noise, which i just like
07:51:46FromDiscord<treeform> its linear
07:52:23FromDiscord<ElegantBeef> Not to say you can't abuse parts of the mcs and make it unreadable
07:54:41FromDiscord<Yjuq> Dunno - I think this is not really a practical example. But there are surely cases where I would prefer the first one
07:54:52FromDiscord<Yjuq> Maybe more a mix of both in the right situations
07:55:32FromDiscord<ElegantBeef> `isX` i think is a perfect example where `a.isNil` is just more linear and sensible to `isNil(a)`
07:56:39FromDiscord<ElegantBeef> Ooh also `contains` if a type has a `contains` proc you can do `a in b` instead of `b.contains(a)`
07:57:04FromDiscord<treeform> here is an example of from my code: `textureAtlas.image.width.GLsizei` vs what you would do in C? `(GLsizei)width(textureAtlas->image)`
07:57:50FromDiscord<ElegantBeef> no fair you have auto dereference πŸ˜›
08:10:55FromDiscord<Yjuq> sent a code paste, see https://paste.rs/IZu
08:12:04FromDiscord<ElegantBeef> There is a way to capture values passed into the compiler
08:12:13FromDiscord<ElegantBeef> I have to look for it, since i never remember how
08:12:20FromDiscord<Yjuq> I know about the compiler
08:12:29FromDiscord<Yjuq> but I kinda want just declare it in the source code
08:12:37FromDiscord<ElegantBeef> Then idk what you're talking about
08:12:40FromDiscord<Yjuq> It was `defined` by the way
08:13:00FromDiscord<Yjuq> file a contains the code above. I import this file into file b.
08:13:19FromDiscord<Yjuq> can i declare it in file b so that this doesn't trigger?
08:13:23FromDiscord<ElegantBeef> ok so then put the export marker on `path` and import it
08:13:32FromDiscord<ElegantBeef> Oh
08:13:46FromDiscord<ElegantBeef> Why couldnt you declare it in file b?
08:14:00FromDiscord<Yjuq> I want to declare it in file b
08:14:04FromDiscord<Yjuq> but it still triggers
08:14:06FromDiscord<Yjuq> xD
08:14:38FromDiscord<ElegantBeef> Did you export it in file b?
08:14:54FromDiscord<Yjuq> ... Uh
08:15:10FromDiscord<Yjuq> yes
08:15:15FromDiscord<Yjuq> but still doesnt work xD
08:15:19FromDiscord<Yjuq> okey, one moment
08:16:05FromDiscord<Yjuq> sent a code paste, see https://paste.rs/nHK
08:16:08FromDiscord<Yjuq> dunno
08:16:12FromDiscord<Yjuq> something like this
08:16:14FromDiscord<ElegantBeef> Possibly if not try `declaredInScope`
08:16:52FromDiscord<ElegantBeef> the example for `declared` shows it taking `strutils.toUpper` so it seems it's looking for module symbols
08:17:12*krux02 quit (Remote host closed the connection)
08:18:18FromDiscord<Yjuq> I could use include probably
08:18:31FromDiscord<Yjuq> but don't know if this is a good idea
08:19:13FromDiscord<ElegantBeef> also btw you said it was `defined` but that doesnt capture the value it just returns a bool, there is a way to get a value from the compilers cli from the `--define:thingy=100`
08:20:39FromDiscord<Yjuq> does this have something to do with what i'm asking? :o - I actually don't want to pass this on the compiler via cli
08:21:05FromDiscord<ElegantBeef> Well it was about what you said previously, and now i'm searching for it cause i cannot remember the name of it myself
08:21:27FromDiscord<ElegantBeef> So nope not one bit πŸ˜„
08:22:51FromDiscord<ElegantBeef> Ah i found it it's a pragma, there i can rest easy! https://docs.unity3d.com/Manual/CustomPackages.html
08:22:58FromDiscord<ElegantBeef> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-compileminustime-define-pragmas
08:23:20FromDiscord<ElegantBeef> Still unrelated but posting for my own sanity
08:28:54FromDiscord<Yjuq> fine... i do it over the cli <.< SIGH
08:29:11FromDiscord<ElegantBeef> I wasnt saying to do that
08:29:42FromDiscord<Yjuq> Yea, but I can't find a solution for such a trivial thing. I mean, you have this stuff all over c / c++ with the pre processor
08:30:11FromDiscord<Yjuq> okey, but you kinda use `include` there to be fair
08:30:26FromDiscord<ElegantBeef> Wait. you're importing a from b
08:30:29FromDiscord<Yjuq> (edit) "`include`" => "`#include`"
08:30:38FromDiscord<Yjuq> yes
08:30:44FromDiscord<Yjuq> i'm importing a from b
08:31:03FromDiscord<Yjuq> wait
08:31:07*haxscramper joined #nim
08:31:09FromDiscord<Yjuq> do i just need to switch both
08:31:12FromDiscord<Yjuq> wait
08:31:20FromDiscord<ElegantBeef> A should import b and it might work
08:31:54FromDiscord<ElegantBeef> Yea it does work
08:32:20FromDiscord<Yjuq> Nono,... it is required that b imports a
08:32:45FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q2Z
08:32:47FromDiscord<Yjuq> I was thinking about switching it like this
08:32:51FromDiscord<Yjuq> but still no profit
08:33:10FromDiscord<ElegantBeef> You have to include a for that
08:33:20FromDiscord<Yjuq> yea, that's what i'm scared of
08:33:48FromDiscord<Yjuq> if you have 2 same procedure names you are screwed with include
08:33:58FromDiscord<Yjuq> in c / c++ you have namespaces
08:34:02FromDiscord<ElegantBeef> Only if all parameter names match
08:34:35FromDiscord<ElegantBeef> Though you can have recursive imports
08:34:37FromDiscord<ElegantBeef> and in this case it's fine
08:34:55FromDiscord<Yjuq> but i have x dependencies on a
08:35:04FromDiscord<Yjuq> and i can't list them all in a
08:35:06FromDiscord<Yjuq> x)
08:35:37FromDiscord<ElegantBeef> Depending on what you end up with this does work https://media.discordapp.net/attachments/371759389889003532/812603347873693736/unknown.png
08:36:15FromDiscord<Yjuq> Sure, but then everytime I use this module in a different project i need to change the import there
08:36:28FromDiscord<Yjuq> I was hoping I could just declare it outside of it
08:37:40FromDiscord<Yjuq> I could solve this with a runtime check but why do i should put unnecessary overhead in the release binary?
08:37:53*FromDiscord quit (Remote host closed the connection)
08:38:07*FromDiscord joined #nim
08:40:48FromDiscord<ElegantBeef> You could abuse `macrocache` here adding a path to a cache variable, which then you fetch in the sub module
08:41:21FromDiscord<ElegantBeef> so in your main module it'd be something like `setPath("./lib/mylib")`
08:41:45FromDiscord<ElegantBeef> I guess it'd be "something" in this case
08:43:26FromDiscord<ElegantBeef> Though i think i misunderstand how that works
08:43:33FromDiscord<ElegantBeef> I probably should just shutup again
08:44:20FromDiscord<Yjuq> Sorry, I'm a hypocrite if it's about how I structure my projects :D
08:45:03FromDiscord<Yjuq> I have very specific needs and no programming language could actually deliver what I wanted from it. But nim is pretty close to it so far I see
08:59:23*synthmeat quit (Quit: WeeChat 3.0.1)
09:00:35*synthmeat joined #nim
09:00:44*synthmeat quit (Client Quit)
09:01:34*synthmeat joined #nim
09:07:36*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
09:07:56*kitech1 joined #nim
09:16:31ForumUpdaterBotNew thread by Hugogranstrom: Any way to avoid nested case statements for proc taking two variant objects?, see https://forum.nim-lang.org/t/7537
10:06:42*Vladar joined #nim
10:18:26*jjido joined #nim
10:22:27*natrys joined #nim
10:38:57*teasea quit (Quit: teasea)
10:39:24*teasea joined #nim
11:04:42*NimBot joined #nim
11:12:35*wasted_youth2 joined #nim
11:30:49FromDiscord<whisperdev> What is the best way for long running tasks to run them in parallel? Communication between threads is not required just orchestration (pause,cancel,re-start).
11:42:34*idf left #nim ("ERC (IRC client for Emacs 27.1)")
11:53:29FromDiscord<Rika> do they need to be in parallel
11:54:47FromDiscord<Rika> anyway theres threadpool and (3rd party) weave i guess, if mratsim were here he'd be able to explain better
12:08:15FromDiscord<mratsim> long running services should run on createThread
12:09:47FromDiscord<mratsim> a threadpool or Weave makes sense for small tasks that are fired and then finished.
12:10:08FromDiscord<mratsim> in that case the overhead of thread creatin is high
12:10:34FromDiscord<mratsim> but if you want say a logging service that is up throughout the lifetime of your application, create a dedicated thread for it
12:11:13*Vladar quit (Quit: Leaving)
12:15:08FromDiscord<KnorrFG> I have a nim program that works just fine on linux, but on windows the following line does not return: ` let file = "antenna.jpg".open()` it does not crash, it does not throw an exception, it simply does not return. Does anyone have an Idea what could cause this?
12:15:44FromDiscord<mratsim> It took some vacation maybe
12:16:22FromDiscord<mratsim> is your file already opened somewhere? Because Windows require to lock files for access.
12:16:57FromDiscord<KnorrFG> not as far as im aware, but ill quickly reboot to rule out the possibility
12:20:12FromDiscord<KnorrFG> nope, that was not the reason
12:26:13FromDiscord<Rika> I feel like something went wrong with your C compiler to cause this
12:26:17FromDiscord<Rika> But that’s just a hunch
12:31:06FromDiscord<KnorrFG> any idea how i could investigate this?
12:33:19FromDiscord<Rika> I would say GDB but I hear it’s a pain to set up for Nim
12:35:28FromDiscord<KnorrFG> hmm. i have msvc installed on windows, ill try with mingw
12:35:49FromDiscord<Rika> Report back if it was the issue
12:51:25FromDiscord<KnorrFG> i installed mingw added the bin folder to my path and compiled my program with `nimble build --cc:gcc`
12:51:58FromDiscord<KnorrFG> which now results in a compilation failure because of mutliple `NIM_STATIC_ASSERT`s
12:52:40FromDiscord<KnorrFG> Do I have to do anything else to change the compiler? Do you want me to post the error output?
12:53:11ForumUpdaterBotNew thread by Kcvinu: Question about using "include", see https://forum.nim-lang.org/t/7538
12:55:58FromDiscord<konsumlamm> ok, why on earth does `math.gamma` always return 0.0 in the vm?
12:58:44FromDiscord<flywind> It is not implemented for VM I think
12:59:06*FromDiscord quit (Remote host closed the connection)
12:59:22*FromDiscord joined #nim
13:00:37FromDiscord<konsumlamm> shouldn't it be an error then?
13:01:01FromDiscord<mratsim> In reply to @Rika "I would say GDB": gdb just needs --debugger:native
13:02:03FromDiscord<flywind> yeah, may de due to the hack of vmops, easy to fix them.
13:02:20FromDiscord<konsumlamm> i'll open an issue
13:03:32FromDiscord<mratsim> you're the first user of the Gamma function I met :p
13:05:10FromDiscord<konsumlamm> i actually just went over the math tests again and tested if gamma works at compile time
13:05:39FromDiscord<konsumlamm> for erf and erfc it just complains that it can't importc at compile time
13:05:39FromDiscord<flywind> https://github.com/nim-lang/Nim/blob/a1a18cfe66c94a634525f28775f170ad01c84344/lib/pure/math.nim#L36
13:05:47FromDiscord<flywind> why using echo?
13:06:20FromDiscord<konsumlamm> because i didn't think adding an assert makes much sense there
13:12:32FromDiscord<konsumlamm> does something classify as a regression if it didn't compile in previous version and compiles now, but is buggy?
13:23:55FromDiscord<konsumlamm> https://github.com/nim-lang/Nim/issues/17118
13:27:22FromDiscord<Solitude> how does it even compile for you, errors for me on pretty recent devel.
13:28:01FromDiscord<konsumlamm> Β―\_(ツ)_/Β―
13:30:16FromDiscord<Solitude> errors with fresh devel, you sure its not something in your global config?
13:30:32FromDiscord<konsumlamm> hmm, errors with latest devel for me too
13:30:44FromDiscord<konsumlamm> so it must have been fixed in the last 24 hours or so?
13:30:54FromDiscord<konsumlamm> cuz the devel i used was fromy esterday
13:30:54FromDiscord<flywind> it doesn't error for me with devel on windows
13:31:01FromDiscord<konsumlamm> (edit) "fromy esterday" => "from yesterday"
13:31:09FromDiscord<flywind> Compiled at 2021-02-16
13:31:17FromDiscord<konsumlamm> wait, i'm running the wrong program
13:31:31FromDiscord<Solitude> In reply to @flywind "it doesn't error for": what does it do?
13:31:44FromDiscord<konsumlamm> compiles and returns what i described in the issue with latest devel for me
13:31:54FromDiscord<IndianGoldSmith> Hi all, what's the correct syntax for "=destroy" ?
13:31:55FromDiscord<flywind> sent a code paste, see https://play.nim-lang.org/#ix=2Q4g
13:32:06FromDiscord<flywind> prints 0 with 2021-02-16 devel on windows
13:32:24FromDiscord<IndianGoldSmith> proc `=destroy`[Person]( p : var Person) is not working
13:32:46FromDiscord<Solitude> remove [Person]
13:32:51FromDiscord<konsumlamm> `[Person]` makes Person a generic parameter
13:32:56FromDiscord<IndianGoldSmith> Okay
13:33:28FromDiscord<IndianGoldSmith> Error - signature for '=destroy' must be proc[T: object](x: var T)
13:34:12FromDiscord<Solitude> is Person an object or ref object?
13:34:17FromDiscord<IndianGoldSmith> ref
13:34:29FromDiscord<Solitude> destructors take non ref objects
13:34:31FromDiscord<Solitude> as you can see
13:34:38FromDiscord<IndianGoldSmith> Oh i see.
13:34:49FromDiscord<IndianGoldSmith> Then how do we destroy ref objects
13:34:54FromDiscord<Solitude> make PersonObj for destructor and Person = ref Person
13:34:58FromDiscord<Solitude> (edit) "Person" => "PersonObj"
13:35:18FromDiscord<IndianGoldSmith> Sorry, i don't get you
13:36:07FromDiscord<konsumlamm> sent a code paste, see https://paste.rs/cgv
13:36:08FromDiscord<IndianGoldSmith> @konsumlamm Thanks. ow got it
13:36:13FromDiscord<konsumlamm> and then define the destructor for `PersonObj`
13:36:46FromDiscord<IndianGoldSmith> @konsumlamm Okay. Let me check
13:36:47FromDiscord<Solitude> or you could do whacky things like typeof Person()[]
13:37:05FromDiscord<IndianGoldSmith> @Solitude Oh !
13:47:09FromDiscord<IndianGoldSmith> @konsumlamm How do i explicitly call the destructor ?
13:48:59FromDiscord<konsumlamm> \`=destroy\`(test)
13:49:07FromDiscord<konsumlamm> but why would you want that?
13:50:18FromDiscord<IndianGoldSmith> I am subclassing some windows controls like buttons and labels. So when the user closes a window, i need to destroy my button class and remove subclass hook.
13:50:56FromDiscord<IndianGoldSmith> After all, i need complete control over my classes
13:53:45FromDiscord<IndianGoldSmith> type↡ Person = ref PersonObj↡ PersonObj = object
13:54:11FromDiscord<IndianGoldSmith> (edit) "type↡ Person = ref PersonObj↡ PersonObj = object ... " added "↡In this example, destructor only works for non-ref objects."
13:56:16FromDiscord<hamidb80> seems like karax has problems with windows... https://media.discordapp.net/attachments/371759389889003532/812684046509277224/unknown.png
13:59:09FromDiscord<dom96> that looks like a Nim problem
13:59:28*jjido quit (Quit: Connection closed for inactivity)
14:00:42FromDiscord<hamidb80> In reply to @dom96 "that looks like a": should i open an issue?
14:01:22FromDiscord<hamidb80> it tries to build `karax` but it cant https://media.discordapp.net/attachments/371759389889003532/812685327315632158/unknown.png
14:03:50FromDiscord<KnorrFG> In reply to @Rika "Report back if it": after installing the latest nim for windows, and letting it install the mingw it wants via the finish.exe I can compile again, but the problem that open() does not return persists
14:19:11FromDiscord<Rika> Where’s the document listing compatible modules for JS again?
14:23:25FromDiscord<flywind> nowhere, or you can see tests
14:23:42FromDiscord<flywind> maybe see wiki
14:24:21FromDiscord<Rika> I distinctly remember a non comprehensive list
14:24:33FromDiscord<flywind> I recorded some modules which support JS backend before(but not complete)
14:24:34FromDiscord<flywind> https://github.com/xflywind/Nim/issues/1
14:24:55FromDiscord<Rika> Unicode doesn’t support JS right now?
14:24:56FromDiscord<flywind> > see tests/js/tstdlib_imports.nim which is the module that should be kept up to date to at least list the things that can be imported (a weaker but useful notion)
14:25:10FromDiscord<hamidb80> In reply to @flywind "https://github.com/xflywind/Nim/issues/1": what about `diff` module?
14:25:46*muffindrake quit (Quit: muffindrake)
14:26:46FromDiscord<Rika> Oh wow TIL reserved mem
14:26:50FromDiscord<flywind> see https://github.com/nim-lang/Nim/wiki/Standard-library-and-the-JavaScript-backend
14:27:13FromDiscord<Rika> That’s the list I remember
14:27:14FromDiscord<Rika> Thanks
14:27:24*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
14:27:41*kitech1 joined #nim
14:28:23FromDiscord<flywind> np
14:31:20ForumUpdaterBotNew thread by KnorrFG: Open() does not return, see https://forum.nim-lang.org/t/7539
14:34:08FromDiscord<flywind> @konsumlamm I find the reason, `func gamma(x: float64): float64 {.importc: "tgamma", header: "<math.h>".} =`
14:34:43FromDiscord<konsumlamm> ye, i saw your comment
14:35:34FromDiscord<konsumlamm> seems to be a bug in `importc` handling for VM
14:35:38FromDiscord<flywind> introduced by this PR https://github.com/nim-lang/Nim/commit/afa87f223cdb9fd10e8b6f70aad51c44da7303a7
14:35:45FromDiscord<brainproxy> anyone had problems in GitHub Actions where a Nim program with threads:on will hang on linux/mac?
14:35:47FromDiscord<konsumlamm> i know, i made that PR
14:36:10FromDiscord<konsumlamm> though that's not the expected behaviour, is it?
14:36:43FromDiscord<konsumlamm> In reply to @brainproxy "anyone had problems in": does your program run normally on linux/mac?
14:37:25FromDiscord<flywind> Yeah, the proper fix is to register vmops.
14:37:27*Vladar joined #nim
14:37:53FromDiscord<brainproxy> In reply to @konsumlamm "does your program run": yes, though can hit some problems with ulimit because some file descriptors aren't getting cleaned up (I think it's the fault of some code I borrowed); however, when that happens there is an exception `Too many open files` and I don't see that in GitHub Actions logs
14:40:37FromDiscord<brainproxy> it's possible, though, that I'm swallowing an exception somewhere in such a way that the program can't make further progress and I've not hit that scenario locally, but in GHA it manifests more readily because the program is running more slowly in resource constrained environment.
14:54:17*vicfred joined #nim
15:05:38*tane joined #nim
15:12:43FromDiscord<Rika> zevv: do you know if npeg is JS compatible? wanted to ask before i commit a few hours of my time making a parser...
15:58:14*D_ quit (Ping timeout: 264 seconds)
15:58:45*a_chou joined #nim
16:18:02*theelous3 joined #nim
16:36:33*vegai1 joined #nim
17:02:57FromDiscord<queersorceress> is the `nimssl` package supposed to be a complete interface for openssl? i see lots of C headers but not the nim interfaces for them.
17:12:34FromDiscord<mratsim> Those are autogenerated on Install, there is a doc generated as well but I've complained to @shashlick many times that not seeing the Nim APi in the repo is misleading.
17:13:21FromDiscord<mratsim> basically everything exported by OpenSSL is available
17:14:06FromDiscord<mratsim> @queersorceress ^
17:14:59FromDiscord<queersorceress> then how do i access the x509 apis?
17:16:53FromDiscord<mratsim> basically you find the name of the proc in OpenSSL and you get the same name in Nim: https://www.openssl.org/docs/man1.0.2/man3/d2i_X509.html
17:17:33FromDiscord<queersorceress> right, but what is the import? is it just `import nimssl/crypt`?
17:17:38FromDiscord<queersorceress> (edit) "nimssl/crypt`?" => "nimssl/crypto`?"
17:18:00FromDiscord<Rika> is it not the same file nimssl?
17:19:03FromDiscord<queersorceress> that's what i don't get, there are basically no nim files in nimssl package, how does that work
17:19:04FromDiscord<mratsim> I think it's nimssl/ssl
17:19:15FromDiscord<mratsim> They are generated on install.
17:19:40FromDiscord<mratsim> on install, nimssl downloads OpenSSL, scans the header and generates the .nim files.
17:19:53FromDiscord<mratsim> so you will see them on your local install but not on GIthub
17:22:18FromDiscord<queersorceress> sent a code paste, see https://play.nim-lang.org/#ix=2Q6a
17:24:33FromDiscord<mratsim> https://github.com/genotrance/nimssl/blob/master/nimssl/ssl.nim#L60-L73
17:26:04FromDiscord<queersorceress> and it isn't part of my install of the package locally
17:26:59FromDiscord<queersorceress> and building from latest isn't working
17:30:34*a_chou quit (Remote host closed the connection)
17:32:50*Tanger quit (Remote host closed the connection)
17:34:21FromDiscord<mratsim> mmmh, better ping @genotrance / @shashlick if he is available
17:35:52FromDiscord<queersorceress> reinstalling from head doesn't work either, i'm running into an error on trying to build nimterop because of building treesitter.
17:40:44*al1ranger joined #nim
17:49:30FromDiscord<hamidb80> Who are the core members of nim foundation?
17:54:32FromDiscord<konsumlamm> there is a nim foundation?
17:57:00FromDiscord<hamidb80> In reply to @konsumlamm "there is a nim": No, nim programming language, my bad
17:57:43FromDiscord<konsumlamm> https://github.com/orgs/nim-lang/people
17:57:46FromDiscord<konsumlamm> these i guess?
17:58:07FromDiscord<hamidb80> In reply to @konsumlamm "these i guess?": Yes. Tnx
18:04:04FromDiscord<queersorceress> hmmm, okay well i was able to work out how to properly do this using the gnutls library instead of the openssl wrappers.
18:05:10FromDiscord<mratsim> ugh, hopefully your app isn't security sensitive because I would flee anything GNU for crypto
18:05:21*Jesin quit (Quit: Leaving)
18:05:53FromDiscord<queersorceress> no, the purpose for this is just parsing a certificate file and extracting information about the expiry time.
18:06:24FromDiscord<mratsim> sounds good then
18:06:25FromDiscord<queersorceress> then it creates an ics file i can put into my calendar so i know when to update my ssl certs for my website
18:06:51leorize[m]isn't it better to perform automatic updates nowadays?
18:07:12*Jesin joined #nim
18:07:31*Jesin quit (Remote host closed the connection)
18:08:13FromDiscord<queersorceress> oh, for sure, but it's just for my own use. there is obviously a cron job setup to do that for me, but this is to keep it on my radar.
18:08:39*Jesin joined #nim
18:16:07*smlckz[m] joined #nim
18:29:31*teasea quit (Quit: teasea)
18:31:34*teasea joined #nim
18:35:33*al1ranger quit (Quit: Leaving)
18:38:25*Jesin quit (Quit: Leaving)
18:38:47PrestigeIs the only way to create a thread for a proc with multiple params, to pack the params in a tuple?
18:39:02liblq-devyes
18:39:10Prestigeokay, ty
18:39:45liblq-devtbh it kinda sucks that nim doesn't have proc parameter unpacking like rust does. gives some nice ergonomics
18:40:14PrestigeYeah, would be cool to see that added
18:40:17*Jesin joined #nim
18:43:03FromDiscord<Rika> proc parameter unpacking is?
18:43:46liblq-dev`proc ((a, b): (int, int))`
18:46:24FromDiscord<hamidb80> sent a long message, see http://ix.io/2Q6M
18:47:55FromDiscord<hamidb80> files/folders: examples package.nimble readme.md src tests
18:48:19FromDiscord<hamidb80> (edit) "examples" => "`examples/`" | "package.nimble" => "`package.nimble`" | "readme.md" => "`readme.md` `src/`" | "src tests" => "`tests/`"
18:48:56FromDiscord<hamidb80> is there any flag to specify local nimble config file path?
18:51:03FromDiscord<queersorceress> you mean a config file for use when building the package?
18:51:59FromDiscord<hamidb80> In reply to @queersorceress "you mean a config": yes
18:53:04FromDiscord<hamidb80> i wish there was a article about getting start with nimble
18:53:09FromDiscord<hamidb80> (edit) "a" => "an"
18:53:29FromDiscord<queersorceress> placing a `nim.cfg` file in your `srcDir` will apply to all binaries built, if you have multiple binaries then you should make `x.cfg` files where `x` is the name of the nim file that the binary is built from. so if you have a binary built from `foo.nim` and `baz.nim` then you can make `foo.nim.cfg` and `baz.nim.cfg` and those would only apply to building that particular binary target.
18:54:16FromDiscord<queersorceress> and that can be either `.nim.cfg` or `.nims` depending on the style of config file you want to use.
18:54:57FromDiscord<queersorceress> i believe this is covered in the nimble readme, if not then a PR should be made to include this information, because you are correct it is important.
18:55:16FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q6N
18:56:06FromDiscord<Yjuq> (edit) "https://play.nim-lang.org/#ix=2Q6N" => "https://play.nim-lang.org/#ix=2Q6O"
18:56:35FromDiscord<queersorceress> that seems counter to what the code is supposed to do.
18:56:51FromDiscord<queersorceress> unless you are trying to emulate a pre-processor.
18:57:27FromDiscord<Yjuq> In reply to @queersorceress "unless you are trying": yea... kind of - you can do that in c++ / c with `#define`
18:58:15FromDiscord<queersorceress> or, you want to be using the `include` keyword instead of the `import` keyword.
18:59:04FromDiscord<Yjuq> I was thinking about include but this could get some issues if I have 2 procs in different files with the same name for example. In C / C++ you have namespaces for that
18:59:15FromDiscord<Yjuq> But nim seems to lack this kind of construct
18:59:32FromDiscord<queersorceress> @Yjuq you do understand the difference between a C preprocessor and regular nim code, right? i can understand wanting the ability to access preprocessors as a language feature but you do realize that you shouldn't expect them to behave even remotely the same in this case.
19:00:14FromDiscord<Yjuq> I understand the difference - I'm just looking for a solution
19:00:30FromDiscord<Yjuq> One would be using CLI Parameter to declare the path
19:00:38FromDiscord<Yjuq> But I try to avoid it
19:00:45FromDiscord<Yjuq> If I can't find something else
19:00:55FromDiscord<Yjuq> The other one would be a runtime check
19:01:21FromDiscord<queersorceress> so meta-programming is done in C using the preprocessor, in nim it is done using templates and macros.
19:04:45FromDiscord<queersorceress> writing code like the example you gave could be classified as unsafe, as it leaves the definition of variables left up to run-time checks vs compile-time checks. this is a language feature, as it prevents you doing things that would cause undefined behavior.
19:06:04FromDiscord<Yjuq> i really don't care if it's unsafe x) - like i said: I'm looking for a solution
19:08:41FromDiscord<queersorceress> to my knowledge you are asking the language to do something it was designed not to do so idk what to say. i'm sure one of the primary devs or compiler contributers could answer you in more detail or possibly give you a native work-around, but you can always fall back into C and do interop between the two to support what you are attempting to do.
19:09:53FromDiscord<Yjuq> does the c pre processor run over the code? Otherwise I don't see a way to do this at compile time even in c
19:10:13FromDiscord<queersorceress> i mean, many of us use nim specifically because it doesn't allow these sorts of things.
19:13:16FromDiscord<queersorceress> if it is just if something is a compile-time defined symbol, then there is `defined` in the system module.
19:13:47FromDiscord<Yjuq> I know about defined. But in this case I need to pass the paths over in the cli
19:14:20FromDiscord<Yjuq> I already have a solution for that with the CLI but I was wondering if it can be done otherwise
19:15:36FromDiscord<queersorceress> you cannot compile a check of an undefined symbol, because there would be no way for it to resolve and perform the check
19:15:51FromDiscord<queersorceress> it's logically invalid
19:17:59FromDiscord<queersorceress> it has to be defined somewhere, even if that definition exists to say "this gets defined by a compiler flag at compile-time"
19:18:29FromDiscord<XeroOl> super quick question is there a way to `echo` without a newline
19:18:39FromDiscord<ElegantBeef> `stdout.write`
19:18:45FromDiscord<XeroOl> awesome! thank you
19:19:58FromDiscord<queersorceress> the only reason that this works in C with the pre-processor is because it gets processed and evaluated/expanded prior to it being compiled
19:21:42FromDiscord<queersorceress> so the `path` would be converted into a value, not a symbol that is defined in the code. since it isn't a symbol then the compiler won't complain since it doesn't have to look-up the value
19:23:19FromDiscord<queersorceress> sent a code paste, see https://play.nim-lang.org/#ix=2Q73
19:23:55FromDiscord<ElegantBeef> Yea that or recursive imports is what i already suggested
19:24:26FromDiscord<Yjuq> In reply to @Yjuq "I already have a": ^
19:26:46FromDiscord<queersorceress> i get that, i was trying to explain why it isn't possible, and why it should be clear why it isn't possible based on how the language works.
19:29:32FromDiscord<Yjuq> In reply to @queersorceress "i get that, i": You could have shortcut that with the statement: It's not possible x) | I'm practical - I already understood that this normally doesn't work. I thought maybe this could be done with some kind of macro magic or something I was missing in the doc.
19:30:01ForumUpdaterBotNew thread by Cdunn2001: Nim in Meson?, see https://forum.nim-lang.org/t/7540
19:31:36FromDiscord<queersorceress> i mean, since macros allow for rewriting the AST completely, it might be possible to make custom macros to handle that sort of situation so that it can compile, but it would be pretty silly imo.
19:32:12FromDiscord<Yjuq> In reply to @Yjuq "I understand the difference": ^
19:33:12FromDiscord<Yjuq> It really doesn't matter how silly this might look for you :o - If you know of a way I would appreciate that. Otherwise I keep looking for it
19:34:27FromDiscord<Yjuq> In reply to @Yjuq "Sorry, I'm a hypocrite": ^
19:34:49FromDiscord<queersorceress> i'm no expert on nim macros, it may be possible but the purpose in doing so would run counter to the way the language is design, which seems like a wasteful endeavor, not an opinionated one; is what i mean.
19:35:05FromDiscord<queersorceress> (edit) "design," => "designed,"
19:37:25FromDiscord<queersorceress> i've known a number of people that have been dead set on using languages in ways that were never meant to be built purely because they wanted to, and there is nothing wrong with that but for the purposes of learning to use the language, if you don't ever recognize the distinction between "can" and "should" then it's going to be very hard to properly learn anything.
19:38:47*xrinzler quit (Quit: WeeChat 3.0)
19:39:59FromDiscord<Yjuq> Yes, it's true that I'm learning the language at the moment. I mean, hopping from one to another isn't that hard. As soon it hits the API / language specific features this requires a learning curve. But learning just the plain syntax is a matter of a couple of days.
19:40:20saem:wave
19:40:26saemboo, failed at emoji
19:40:31saemmorning
19:40:38FromDiscord<Yjuq> macros for example is a completly new topic for me. Nim is pretty unique with these since it can modify the AST
19:41:03FromDiscord<queersorceress> indeed, they are quite unique
19:41:05Prestigewhat's up today saem
19:41:11FromDiscord<hamidb80> In reply to @Prestige "Yeah, would be cool": hey Perstige, did you find answer of your last night question?
19:41:18saemgonna get mad about a bug and see if I can fix it.
19:41:36PrestigeYeah, mratsim was able to help. I didn't know channels were a thing for threads
19:41:37saemalso made about full disk encryption.
19:41:52Prestigespeaking of, there should probably be a mention of channels on the threads docs
19:42:17Prestigesaem: for nimlsp stuff still?
19:42:37saemPrestige: nah, that was a long time ago I was playing with nimlsp
19:42:49FromDiscord<Yjuq> But I also try to evaluate if nim can fit into the kind of projects. In the worst case I fall back to assembler, but I have hope that nim can actually replace it. It's seems very promising. And I want to stay away from C / C++ ^^
19:42:50saemI'm all sem all the time nowadays
19:43:10FromDiscord<Yjuq> I mean, C is ok. It's not like I didn't do anything in it so far, but C++ no thanks
19:43:48FromDiscord<Yjuq> (edit) "projects." => "projects i'm doing."
19:43:56PrestigeHoping I can finish up this ipc feature today, seems I have a clear path forward. Going to be neat to play with
19:44:51saem\o/
19:45:00FromDiscord<hamidb80> what should i do instead of creating global vars to make my code `GC-SAFE`?
19:46:13FromDiscord<hamidb80> should i follow certain pattern in my codes?
19:46:52Prestigein terms of using threads?
19:47:05FromDiscord<hamidb80> In reply to @Prestige "in terms of using": async, threads ,..
19:48:01PrestigeI'm just starting to play with threads for the first time myself, not sure. Just been trying to separate concerns and using channels to send basic data between threads
19:48:09PrestigeNot sure if that's the best answer
19:48:30FromDiscord<ElegantBeef> Using arc/orc you can tend to just use `{.cast(gcSafe).}:` afaik
19:49:11FromDiscord<ElegantBeef> https://forum.nim-lang.org/t/7475
19:49:37FromDiscord<queersorceress> speaking of, i'm using some of the docutils code and running into problems with gc-safety with some of the methods. i know i can do a cast and capturing block but is there a more correct way to handle this?
19:54:52FromDiscord<Yjuq> is there a command to stop the compiling process?
19:55:07FromDiscord<Yjuq> or procedure or whatever
19:56:14FromDiscord<queersorceress> what, you mean like abort mid-compile?
19:56:20FromDiscord<Rika> ctrl+c?
19:56:44FromDiscord<Rika> or do you mean within the code
19:57:08FromDiscord<Rika> within the code just make an error `{.error: "msg".}`
19:57:35FromDiscord<Yjuq> In the code, was looking for something like exit
19:57:41FromDiscord<Yjuq> but it's called quit in nim
19:57:50FromDiscord<Yjuq> so, kind of found it already
19:57:51FromDiscord<Yjuq> x)
19:58:21FromDiscord<Rika> quit does not stop compile
19:58:28FromDiscord<Rika> it stops runtime
19:58:46FromDiscord<queersorceress> it would be what rika said, you would have to use something like the `defined` to conditionally evaluate and present an error to the compiler
19:59:10FromDiscord<Rika> you dont need to attach the pragma i just sent to anything
19:59:15FromDiscord<Rika> it can stand alone i believe
19:59:26FromDiscord<Yjuq> This works for me
19:59:28FromDiscord<Yjuq> sent a code paste, see https://play.nim-lang.org/#ix=2Q7b
19:59:58FromDiscord<queersorceress> it would but i'm not sure that is actually what you intend here
20:00:19FromDiscord<Rika> it works i guess
20:00:29FromDiscord<Rika> eh
20:00:42FromDiscord<queersorceress> yeah, that's basically what i just said to myself πŸ™‚
20:00:54FromDiscord<Yjuq> Dunno, what would be better?
20:01:16FromDiscord<queersorceress> it shouldn't be in a `static` block tbh
20:01:21FromDiscord<Rika> `when not defined(path): {.error: "path not defined".}`
20:01:27FromDiscord<queersorceress> ^ yeah, that
20:01:41FromDiscord<Yjuq> But, isn't that at runtime then?
20:01:52FromDiscord<Rika> no
20:02:00FromDiscord<Rika> whens and pragmas are not runtime
20:02:07FromDiscord<queersorceress> no, if you read the `defined` docs, it gets done at compile time
20:02:08FromDiscord<enthus1ast> is there a "c like flag" module in the standardlib?
20:02:15FromDiscord<Rika> a what?
20:02:43FromDiscord<enthus1ast> where you "or" the different values
20:03:00FromDiscord<Yjuq> I get a bunch of warnings
20:03:04FromDiscord<enthus1ast> flagA | flagB
20:03:04FromDiscord<Yjuq> x)
20:03:10FromDiscord<queersorceress> oh, bitwise
20:03:14FromDiscord<enthus1ast> yeah
20:03:29FromDiscord<queersorceress> bitops
20:03:38FromDiscord<ElegantBeef> `flaga or flagb` is in the language without anything
20:03:44FromDiscord<ElegantBeef> But the nim way is to use bitsets
20:04:04FromDiscord<ElegantBeef> Then you do `{flagA, flagB}`
20:04:11FromDiscord<queersorceress> it's part of the stdlib, `bitops`: https://nim-lang.org/docs/bitops.html
20:04:16FromDiscord<Rika> you dont need the bitops module
20:04:23FromDiscord<ElegantBeef> bitops just gives you more clear operators
20:04:24FromDiscord<Rika> `or`ing ints is equivalent
20:04:56FromDiscord<Rika> its a preference thing
20:05:27FromDiscord<enthus1ast> i would like to set flags with flags.incl(myEnumValue) then transfer them to int
20:05:35FromDiscord<enthus1ast> and back πŸ™‚
20:06:04FromDiscord<Yjuq> sent a code paste, see https://paste.rs/OfD
20:06:09FromDiscord<queersorceress> i think bitops would probably be the best way to do that especially if you are going to interop with C
20:06:16FromDiscord<hamidb80> In reply to @ElegantBeef "Using arc/orc you can": "`cast` pragma only allowed in a statement context" says nim compiler
20:07:08FromDiscord<queersorceress> you can turn the particular hints off, in this case unreadablecode
20:07:08FromDiscord<Rika> i think what beef said is devel-only
20:07:16FromDiscord<Rika> unreachable
20:07:17FromDiscord<Rika> lol
20:07:47FromDiscord<Rika> @enthus1ast you can cast a set to an int just fine
20:07:50FromDiscord<queersorceress> if you using the default gc, the cast thing beef said should work on 1.4.2
20:08:25FromDiscord<hamidb80> In reply to @queersorceress "if you using the": nope
20:08:29FromDiscord<Rika> yjuq: the code you just posted will only "quit" when you run the binary
20:08:29FromDiscord<enthus1ast> @Rika huh thought i tried this, lememe try again
20:08:32FromDiscord<hamidb80> (edit) "nope" => "nope, it doen't word"
20:08:34FromDiscord<Rika> use {.error.}, please
20:08:37FromDiscord<hamidb80> (edit) "word" => "work"
20:08:56FromDiscord<queersorceress> In reply to @hamidb80 "nope, it doen't work": yes it does
20:09:14FromDiscord<Rika> @enthus1ast i think i know your error, can you post the enum values?
20:09:46FromDiscord<queersorceress> it may give you warnings instead of errors, but it should compile.
20:09:52FromDiscord<enthus1ast> ah cool @Rika, works
20:10:03FromDiscord<enthus1ast> thanks
20:10:08FromDiscord<Rika> in nim, the enum values are equivalent to the bit that is set, not the value that is or'ed
20:10:13FromDiscord<Rika> okay
20:10:15FromDiscord<Rika> nice
20:11:35FromDiscord<hamidb80> In reply to @queersorceress "it may give you": https://media.discordapp.net/attachments/371759389889003532/812778496484835328/unknown.png
20:11:44*natrys quit (Quit: natrys)
20:12:38FromDiscord<queersorceress> because that isn't using it correctly, if you look at the snippet it is a pragma on a capture block
20:13:05FromDiscord<queersorceress> `{.cast(gcsafe).}: doThing()`
20:13:39FromDiscord<queersorceress> it isn't a pragma on the proc signature
20:13:52FromDiscord<hamidb80> In reply to @queersorceress "`{.cast(gcsafe).}: doThing()`": so how to add other pragmas?
20:15:23FromDiscord<queersorceress> sent a code paste, see https://play.nim-lang.org/#ix=2Q7g
20:16:34FromDiscord<hamidb80> i asked too many questions these days, is there anywhere that has some articles about these stuff?
20:16:53FromDiscord<Rika> welcome to a small community language
20:17:15FromDiscord<Rika> questions are not bad
20:17:19FromDiscord<queersorceress> it was an easy mistake to make, no worries
20:17:20FromDiscord<Rika> keep asking, dont worry about it
20:18:09FromDiscord<Rika> it really is unfortunate that there arent enough articls
20:18:26FromDiscord<Rika> but its hard to make as many as another language has if we got like 10% of the community size
20:18:47FromDiscord<queersorceress> i may start writing some again once i finish rebuilding my website app.
20:20:41FromDiscord<Avatarfighter> In reply to @hamidb80 "i asked too many": Welcome to the community if you're new πŸ™‚
20:21:13FromDiscord<Rika> avatar why do i feel like you JUST changed avatar when i think you did that days ago
20:21:21FromDiscord<Avatarfighter> well i uh
20:21:22FromDiscord<Avatarfighter> uhm
20:21:35FromDiscord<Avatarfighter> maybe i did :p
20:21:59FromDiscord<Rika> maybe i should too
20:22:08FromDiscord<Rika> i found an amazing image a few hours ago
20:22:09*Prestige laughs in irc
20:22:14FromDiscord<Avatarfighter> @ElegantBeef have you messed with async at all recently ?
20:22:16FromDiscord<apollo> laughs at you in irc
20:22:20Prestigehaha
20:22:29FromDiscord<Avatarfighter> Prestige: you're just jealous of our profile pics sMh
20:22:36PrestigeI can't see them :(
20:22:41FromDiscord<Avatarfighter> exactly
20:22:43FromDiscord<apollo> ouch
20:22:48FromDiscord<Avatarfighter> ;P
20:23:00Prestigelet's get textual
20:23:12FromDiscord<Avatarfighter> πŸ₯²
20:23:40FromDiscord<Avatarfighter> What's the newest devel version ?
20:23:50FromDiscord<Rika> devel is devel
20:24:01FromDiscord<Rika> theres no newest version that stays for more than a day or something
20:24:05FromDiscord<Avatarfighter> πŸ₯²
20:24:11FromDiscord<Rika> its like asking what the newest master version is
20:24:13FromDiscord<Avatarfighter> What about the version #
20:24:18FromDiscord<Avatarfighter> well that is literally what i am asking
20:24:19FromDiscord<Rika> no clue
20:24:39FromDiscord<Rika> why? if your version is more than a day old you can basically assume its stale already
20:24:49FromDiscord<Avatarfighter> I know
20:25:11FromDiscord<Avatarfighter> I just can't remember if choosenim installs the newest devel version or if it still struggles with that
20:25:41FromDiscord<Rika> i think it uses nightlies
20:26:55FromDiscord<Avatarfighter> @ElegantBeef
20:27:02FromDiscord<Avatarfighter> Do you know the devel version by any chance ?
20:28:06saemchoosenim update devel --latest or something like that should ensure you're at the latest
20:28:42FromDiscord<Avatarfighter> thanks saem, I couldn't remember how to get the latest lol
20:28:59FromDiscord<Avatarfighter> I kept doing `choosenim update devel` but no dice which wasn't making sense
20:29:12FromDiscord<Avatarfighter> because I'm pretty sure devel got updated in the time I last did that lol
20:29:39saemyou're welcome
20:29:44FromDiscord<Avatarfighter> rip my chromebook too its not going to happy about this
20:42:20reversem3@yardanico you around ?
20:46:58*sacredfrog quit (Quit: ZNC 1.8.2 - https://znc.in)
20:47:41*sacredfrog joined #nim
20:50:09reversem3Does anyone if the wasm-ld linker has to be installed ?
20:53:33FromDiscord<brainproxy> is there a way to get stats re: the "shared heap" used by e.g. `allocShared`, `createShared`. If not with something Nim lang provides then with gdb/lldb? (have been learning a lot about Nim but I'm still a newbie when it comes to nim/c/gdb, etc.)
20:55:25FromDiscord<brainproxy> (edit) "nim/c/gdb, etc.)" => "nim/c/gdb/etc)"
21:06:47Prestigehm using multiple threads with xlib is apparently a nightmare
21:12:12Prestigeoh wait, it's just a channel issue. I guess tryRecv blocks?
21:14:25FromDiscord<brainproxy> receiving on a channel blocks the thread afaik
21:14:35FromDiscord<brainproxy> currently working on async channels πŸ˜„
21:14:50Prestigelol
21:14:53FromDiscord<brainproxy> (edit)
21:15:12Prestigewell, time to rethink the structure of everything yet again
21:15:27FromDiscord<brainproxy> well, I can't take credit, someone else wrote the "async channels" code, but it's in a never-merged PR branch of a nice repo
21:16:12FromDiscord<brainproxy> but I'm working on a "task runner" API that builds on top of "async channels" (and not really working on the API just yet, more the "use cases" which will hopefully inform how the API is shaped)
21:17:41FromDiscord<brainproxy> (edit) removed "but"
21:20:39*haxscramper quit (Remote host closed the connection)
21:20:59PrestigeWait, why would tryRecv block if it returns a bool saying if it has dataa
21:24:49Prestigei checked if channel.peek > 0 before using tryRecv and it seems to have solved the issue. Seems odd/wrong but whatever
21:24:52FromDiscord<brainproxy> oh... my apologies, channels on the brain, I honed in on "[r]ecv", I'm actually not sure about the behavior of `tryRev` πŸ€¦β€β™‚οΈ
21:25:12PrestigeNp, I think it must be blocking?
21:31:47FromDiscord<mikebelanger> hey has anyone ever got just a `signature mismatch` for an entire error, with no stack-trace?
21:33:19FromDiscord<mikebelanger> not even like blah blah function has such and such parameters, but this function call has these arguments etc. Just `signature mismatch`. On nim 1.4, on OS X `10.13.6`
21:34:25FromDiscord<mikebelanger> sent a code paste, see https://play.nim-lang.org/#ix=2Q7J
21:39:10FromDiscord<ElegantBeef> @Avatarfighter nope i dont touch async ever really, only when i'm forced to πŸ˜„
21:39:42FromDiscord<ElegantBeef> Prestige isnt there a purpose build X api for multithreading
21:40:04Prestigethere's xcb but I'm not using that lib, I'd have to change everything
21:40:19Prestigexlib support multithreading apparently but it's making everything lag
21:40:30Prestigeprobably something I'm doing incorrectly, I guess
21:41:48FromDiscord<queersorceress> what are you trying to do?
21:42:16PrestigeListen for events on one thread, and pass them via a channel to the main thread
21:43:12FromDiscord<queersorceress> so the functionality of libnotify?
21:43:54FromDiscord<queersorceress> quick search seems like there are a few packages on nimble.directory that do async event handling and callback registration.
21:45:12PrestigeThe problem I think might be with xlib but I'm not sure
21:45:15FromDiscord<queersorceress> i don't know why you would listen on one thread and then trigger events on the main thread vs just registering the event callback handler on the main thread as part of the run loop though.
21:45:41PrestigeBecause I'm implementing ipc which has to be on another thread
21:46:39FromDiscord<ElegantBeef> Does it really? Couldnt you just have a socket and poll it every tick?
21:46:44FromDiscord<queersorceress> implementing from scratch?
21:49:12PrestigeXNextEvent blocks the thread so I don't know a way around it
21:49:58FromDiscord<queersorceress> yeah it would depend highly on the method of implementation. if you are doing message passing, which is what it sounds like, then yeah it will need multiple threads to do it correctly
21:52:47PrestigeYeah
21:53:14PrestigeNot sure what's making it occasionally process events slower, it gets a little laggy. Maybe a locking issue
21:54:15FromDiscord<queersorceress> that would be my guess, i don't know much about the details of what you are using but the implementation of your serial queue might be doing it
21:54:42FromDiscord<brainproxy> In reply to @Prestige "Listen for events on": what I'm working on might be of interest to you, but take for granted that (1) myself and the other contributor the repo are not experts, (2) we're relying on code that is (yet) far from battle-tested, (3) you'd have to get in bed with nim-chronos which isn't compatible with the built-in asyncdispatch (can't use nim-chronos' `async` macro in same thread with the built-in equivalent):↡�
21:55:35FromDiscord<brainproxy> the backdrop for that work is the nim-chronos repo: https://github.com/status-im/nim-chronos
21:56:13FromDiscord<brainproxy> (edit) removed "(yet)"
21:58:23FromDiscord<QueenFuckingAdrielle> does anyone have any experience programming in nim with godot?
21:59:42FromDiscord<ElegantBeef> Some in #gamedev do πŸ˜„
22:00:52FromDiscord<QueenFuckingAdrielle> yea i realized that right after lol
22:01:35FromDiscord<QueenFuckingAdrielle> going through the search result rn, im thinking of making a 2d rpg for fun and thought it could be cool to check out godot finally
22:02:11FromDiscord<QueenFuckingAdrielle> im not big unity fan, godot seems like it could fit the bill
22:03:50FromDiscord<ElegantBeef> Yea godot is apparently very good for 2D, though i've toyed with Nico a fair bit for 2D pixel art games
22:05:09*narimiran quit (Ping timeout: 265 seconds)
22:05:13FromDiscord<QueenFuckingAdrielle> yea ive never really had time to dig in and really make a full game, ive mainly worked in unity, unreal, and gazebo (not a game engine) for simulation type of stuff
22:05:59FromDiscord<QueenFuckingAdrielle> unity is a great tool, but it seems like an odd place between 3d and 2d, id rather use unreal for anything 3d, and its got more than i want for a pixel game at least
22:08:39FromDiscord<ElegantBeef> https://jbeetham.itch.io/linerino this is the most complete thing i've made using nico, so i can vouch for it being good, but it's also very very different from a fully engine. You design everything yourself with the basic IO!
22:12:18*PMunch joined #nim
22:28:19ForumUpdaterBotNew thread by Mantielero: Templates - how to check if a template has been used, see https://forum.nim-lang.org/t/7541
22:31:53*D_ joined #nim
22:38:31reversem3So I needed to download wasm-sdk and then export wasi, I can now compile c to wasm without js glue
22:39:05reversem3Now to figure out how nim compiler uses wasm32
22:39:57reversem3Still getting wasm-ld error though with wasmrt
23:32:25FromDiscord<XxDiCaprioxX> Hey can someone help me resolve my issues with choosenim?
23:32:37Prestigewhat issues?
23:33:01FromDiscord<XxDiCaprioxX> I can't update somehow
23:33:10PrestigeI need more info
23:33:50FromDiscord<XxDiCaprioxX> I have nim 1.2.4 installed via choosenim and even if I change my environment variables to use the newest version from a folder on my desktop the compiler wont stop using 1.2.4
23:34:46PrestigeIs that a choosenim issue? What env variable(s) are you setting and how are you invoking the compiler?
23:34:55FromDiscord<ElegantBeef> did you do `choosenim update stable`?
23:35:27FromDiscord<XxDiCaprioxX> I'm not 100% sure if it is the issue with choosenim but I changed the env variables you change when installing nim by hand
23:36:00FromDiscord<XxDiCaprioxX> In reply to @ElegantBeef "did you do `choosenim": yeah I dad that now, Ima compile and see if it works out
23:37:33PrestigeI wonder if there's a way to deal with my problem with async instead of a thread. I think copying events and sending them through a channel is making the application lag a bit
23:37:47FromDiscord<XxDiCaprioxX> In reply to @XxDiCaprioxX "yeah I dad that": alright compiler works now
23:40:24*tane quit (Quit: Leaving)
23:52:12FromDiscord<XxDiCaprioxX> aaaaand I'm back with another question: is there a way to break out of a nestled while loop? java for example has `break label`, does nim have something similar?
23:54:10PMunchYes
23:54:27PMunchYou can do `block myName:` and then `break myName`
23:55:14PMunchPrestige, what're you trying to do?
23:56:19FromDiscord<XxDiCaprioxX> just a simple blackjack game
23:56:34FromDiscord<XxDiCaprioxX> sry me smol brain
23:56:45FromDiscord<XxDiCaprioxX> In reply to @PMunch "You can do `block": thanks
23:57:02PrestigePMunch: implementing ipc in Nimdow. Problem is, XNextEvent is blocking so I put that on another thread. I'm passing the events over a channel to the main thread for processing, but now the WM is kind of laggy. I think, since the events have to be copied, it's causing the lag. I'm not 100% sure, though
23:57:38PrestigeThinking of either using xcb or just sharing a pointer to a single event in an "unsafe" way, if possible
23:57:59PMunch@XxDiCaprioxX no worries, Nim has a lot of features and getting through them all is hard.
23:58:26PMunchPrestige, hmm that sounds wrong..
23:58:33PMunchXevents are pretty small IIRC
23:58:44PMunchAnd aren't they pointers anyways?
23:59:36PrestigeIf I try sharing the pointer to the events, they don't get processed for some reason. After passing the actual event through the channel, it start working
23:59:44PrestigeStarts*