00:00:04 | * | lumidify quit (*.net *.split) |
00:00:04 | * | vicecea quit (*.net *.split) |
00:00:05 | * | mal`` quit (*.net *.split) |
00:00:05 | * | NimEventer quit (*.net *.split) |
00:00:05 | * | meowray quit (*.net *.split) |
00:00:15 | * | tk quit (Quit: Well, this is unexpected.) |
00:00:43 | * | meowray joined #nim |
00:00:45 | FromDiscord | <Elegantbeef> Odd |
00:01:03 | * | NimEventer joined #nim |
00:01:08 | FromDiscord | <huantian> are you trying to build choosenim? or |
00:01:40 | * | tk joined #nim |
00:02:19 | FromDiscord | <huantian> wait no nvm ighnore me |
00:02:19 | fallback | trying to build nim |
00:03:15 | * | meowray quit (Changing host) |
00:03:15 | * | meowray joined #nim |
00:03:20 | fallback | should i git checkout origin/version-1-6 |
00:04:07 | * | mal`` joined #nim |
00:05:17 | * | lumidify joined #nim |
00:06:19 | fallback | i installed git curl wget gmake pcre libsass |
00:06:38 | fallback | is something missing? |
00:06:53 | fallback | idk what is std/os |
00:07:06 | FromDiscord | <Elegantbeef> It's a library |
00:07:13 | FromDiscord | <Elegantbeef> Did you try using choosenim? Or just going to build from source? |
00:07:54 | termer | Does anyone know how to create an array literal with macros? I can't find any examples on it, and there's no constructor for bracket expr other than newNimNode |
00:08:10 | termer | I need to create an array literal based on the contents of a file |
00:08:33 | FromDiscord | <Elegantbeef> you emit a `nnkBracket` with the contents you want |
00:08:50 | termer | how would I do that |
00:08:58 | termer | I'm just now learning macros |
00:09:16 | FromDiscord | <Elegantbeef> read the file then do `result = nnkBracket.newTree` then `result.add element` |
00:09:27 | termer | thanks |
00:10:34 | fallback | maybe i need to install old nim 1.2 first? |
00:10:52 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=3UNH |
00:11:40 | FromDiscord | <Elegantbeef> What are you presently doing fallback |
00:11:48 | FromDiscord | <Elegantbeef> Are you installing from source or using choosenim? |
00:12:35 | FromDiscord | <Elegantbeef> Either way uninstall the version you have installed |
00:12:39 | fallback | i have nim source from git clone https://github.com/nim-lang/Nim |
00:12:54 | FromDiscord | <Elegantbeef> Ok and you ran `./build_all.sh`? |
00:13:02 | fallback | i uninstall nim 1.2 from openbsd pkg_add |
00:13:04 | fallback | yes |
00:13:24 | fallback | build_all.sh has that failure |
00:13:26 | FromDiscord | <Elegantbeef> I highly suggest using choosenim if it works for you. Though no clue if it works with BSD |
00:13:50 | FromDiscord | <Elegantbeef> Ok that's an odd error |
00:14:25 | FromDiscord | <Elegantbeef> does there exist an `os.nim` inside `lib/pure`? |
00:14:26 | fallback | when i google for std/os it looks like c standard library |
00:14:53 | FromDiscord | <Elegantbeef> `std/os` is the Nim os library |
00:14:56 | termer | choosenim is what you should use |
00:15:16 | termer | anything in `std` is part of the nim stardard library |
00:15:24 | FromDiscord | <Elegantbeef> https://github.com/nim-lang/Nim/releases/tag/v1.6.4 is what you should download anyway |
00:15:24 | fallback | https://github.com/nim-lang/Nim |
00:15:26 | FromDiscord | <Elegantbeef> Stable Nim |
00:15:28 | termer | everything in std/system.nim is implicitly imported |
00:15:32 | fallback | oops |
00:15:37 | fallback | sorry wrong paste |
00:16:07 | fallback | -rw-r--r-- 1 root wsrc 130147 Apr 10 20:04 os.nim |
00:16:15 | FromDiscord | <Elegantbeef> Eh termer we're just trying to get the compiler to work no need for that explanation yet 😛 |
00:16:25 | termer | lol fair enough |
00:16:26 | FromDiscord | <Elegantbeef> Ok |
00:16:41 | FromDiscord | <Elegantbeef> So then i'd say either get that release or checkout version 1-5 |
00:16:41 | FromDiscord | <Elegantbeef> 1-6 i mean |
00:17:30 | FromDiscord | <Elegantbeef> I've never hadd this lacking `std/os` issue before, you're certain `nim` isnt in your path right? |
00:18:36 | fallback | i did git checkout origin/version-1-6 |
00:18:52 | fallback | right nim is not installed |
00:19:11 | fallback | > nim |
00:19:11 | fallback | -bash: nim: command not found |
00:20:05 | fallback | Sorry, your platform ($platform) is not supported by choosenim. |
00:20:17 | FromDiscord | <Elegantbeef> Ah ok thought it wasnt |
00:20:31 | FromDiscord | <Elegantbeef> Dont know why BSD isnt supported but meh |
00:22:23 | fallback | there is version 1.2 supported but it is too old |
00:22:26 | FromDiscord | <Elegantbeef> Same issue on 1.6? |
00:22:57 | fallback | if i install 1.2 can i use that to build 1.6? |
00:23:17 | FromDiscord | <Elegantbeef> Building from source bootstraps |
00:23:35 | FromDiscord | <Elegantbeef> So there is no reason to have Nim installed to build from source |
00:23:38 | FromDiscord | <Elegantbeef> If it doesnt work it should |
00:24:37 | fallback | hm |
00:25:07 | FromDiscord | <Elegantbeef> What's the entire output from the `build_all.sh`? |
00:27:02 | fallback | one sec plz |
00:27:18 | fallback | this is a long pastebin :) |
00:27:39 | fallback | hm i think it is too long |
00:30:58 | fallback | https://paste.ircnow.org/0pez8t67c1irclun8huf |
00:31:04 | fallback | i hope that works :) |
00:31:35 | FromDiscord | <Elegantbeef> Yep |
00:31:38 | fallback | i think it works |
00:31:44 | fallback | ok good :) |
00:31:57 | fallback | first time failed |
00:34:21 | fallback | i found something |
00:34:26 | fallback | https://github.com/nim-lang/Nim/issues/12103 |
00:34:29 | FromDiscord | <Elegantbeef> Hmphh seems for some reason the `std/os` import isnt working probably due to the config |
00:36:28 | fallback | this vps is very new |
00:37:01 | fallback | i only install updates and git curl wget gmake pcre libsass |
00:37:37 | fallback | and bash so i can have shell history :) |
00:38:44 | FromDiscord | <huantian> I have no idea how openbsd works, can you just download the newer compiled version onto an older version of openbsd?↵I see nim was updated to 1.6.4 late last month |
00:39:15 | fallback | i don't think that is for openbsd 7.0 |
00:39:34 | fallback | maybe 1.6.4 will be in 7.1? |
00:39:48 | fallback | > ls lib/std/os* |
00:39:48 | fallback | ls: lib/std/os*: No such file or directory |
00:40:14 | FromDiscord | <huantian> looks like it, just browsing in <https://ftp.openbsd.org/pub/OpenBSD/7.1/packages/amd64/> |
00:40:24 | FromDiscord | <huantian> It seems nim has been updated to 1.6.4 |
00:40:37 | fallback | bright future :) |
00:41:09 | fallback | i will be happy if that is supported in 7.1 |
00:41:30 | fallback | maybe now i just wait for 7.1 |
00:45:33 | FromDiscord | <huantian> I mean they were able to build nim somehow, there has to be a way to do it |
00:47:20 | FromDiscord | <!Patitotective> (someone knows why nimlime cant find `nim` in the PATH but if i type `nim` in the terminal works? :C)↵(and why even if i change `nim.executable` nimlime still calls `nim`) |
00:47:44 | FromDiscord | <!Patitotective> (why is it overwriting `nim_exe` https://github.com/nim-lang/NimLime/blob/master/core/configuration.py#L24 😕 ) |
00:51:25 | * | SamuelMarks joined #nim |
00:51:39 | FromDiscord | <ratapenado> Hi, on the scale from impossible to doable, how difficult it would be to generate nim bindings from c/c++/rust code by someone who is learning nim and don't especially know c/c++/rust ? |
00:52:40 | FromDiscord | <Elegantbeef> You can use `futhark` for C |
00:52:56 | FromDiscord | <Elegantbeef> There is https://github.com/arnetheduck/nbindgen for rust |
00:53:15 | FromDiscord | <Elegantbeef> And then for C++ there is c2nim/nimterop but they require tinkering |
00:53:30 | FromDiscord | <Elegantbeef> You can generally ask for help around here to get some things explained |
00:53:47 | FromDiscord | <Elegantbeef> But ideally you know lowlevel Nim to make this easier |
00:55:10 | FromDiscord | <Elegantbeef> Fallback i'd suggest making an issue, or forum post to atleast get some movement towards support |
00:55:36 | FromDiscord | <Elegantbeef> You might be the one that gets it supported following suggestions by others |
00:56:37 | * | SamuelMarks quit (Ping timeout: 260 seconds) |
00:59:17 | FromDiscord | <ratapenado> Thanks @ElegantBeef ! I'm learning nim by writing a small app for managing ebooks, and I will probably need to call some not-nim library at one point |
00:59:34 | FromDiscord | <ratapenado> I will try to avoid it though |
00:59:45 | FromDiscord | <Elegantbeef> Me or someone else around can always help 😀 |
01:00:20 | FromDiscord | <Elegantbeef> Eh if a library exists it makes more sense to use it than reimplement it if it's easier/faster |
01:03:30 | FromDiscord | <Elegantbeef> Really though if you want to use a library it should have a C-api |
01:03:42 | FromDiscord | <Elegantbeef> Otherwise i'd argue it's not aiming to be reused |
01:05:20 | FromDiscord | <ratapenado> Thanks ! |
01:05:50 | FromDiscord | <!Patitotective> In reply to @Patitotective "(someone knows why nimlime": (i must have messed up something to make the best way to install nim not to work) |
01:08:18 | FromDiscord | <Elegantbeef> nimline might not use path |
01:09:01 | FromDiscord | <!Patitotective> (i think its an issue with my sublime config cause running sublime in safe mode worked as expected) |
01:09:22 | FromDiscord | <!Patitotective> (so nvm, choosenim is great) |
01:14:45 | * | elph quit (Quit: Connection closed for inactivity) |
01:23:18 | FromDiscord | <Elegantbeef> You either choosenim or gitnim |
01:25:25 | FromDiscord | <!Patitotective> (the problem is that when i launch sublime from its icon the path is wrong, if i launch sublime from the terminal it works) |
01:25:46 | FromDiscord | <Elegantbeef> The CWD isnt set properly |
01:26:14 | FromDiscord | <Elegantbeef> `setCurrendDir(getAppDir())` |
01:26:21 | * | lumo_e quit (Quit: Quit) |
01:30:57 | * | SamuelMarks joined #nim |
01:38:34 | * | SamuelMarks quit (Ping timeout: 272 seconds) |
01:40:22 | FromDiscord | <!Patitotective> (got it working by hardcoding the path in my own sublime build file https://forum.sublimetext.com/t/why-doesnt-sublime3-use-global-path-variable-and-how-can-i-force-it-to-use-it/39392/16 lol) |
01:44:40 | * | arkurious quit (Quit: Leaving) |
01:49:18 | termer | how would I create a new object instance with macros? |
01:49:25 | termer | I don't know the term Nim uses for that |
01:49:40 | termer | like MyObject(property: "value", prop2: "another value) |
01:49:57 | FromDiscord | <Elegantbeef> It's a nnkobjectconstr with nnkEqColonEq iirc |
01:50:02 | FromDiscord | <Elegantbeef> Dumptree is your friend |
02:04:53 | * | zeus-supreme1 joined #nim |
02:07:42 | * | zeus-supreme quit (Ping timeout: 246 seconds) |
02:08:06 | FromDiscord | <aph> sent a code paste, see https://paste.rs/g7h |
02:08:15 | FromDiscord | <Elegantbeef> arrays are static |
02:08:17 | FromDiscord | <Elegantbeef> So no |
02:08:20 | FromDiscord | <aph> sad |
02:08:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/EGH |
02:08:48 | FromDiscord | <aph> yay |
02:08:49 | FromDiscord | <Elegantbeef> What you want seems to be a fixed size seq |
02:09:18 | FromDiscord | <Elegantbeef> In nim `static` generics are distinct types so `Foo[10] isnot Foo[1]` |
02:10:01 | FromDiscord | <aph> In reply to @Elegantbeef "What you want seems": i'm not sure if it's really "fixed size", because `baz` relies on `bar` and if `bar`'s value is different it isn't static hehe (oh no i dont know what i'm talking about) |
02:10:19 | FromDiscord | <aph> In reply to @Elegantbeef "In nim `static` generics": ohh |
02:10:34 | FromDiscord | <Elegantbeef> You want `bar` to be dynamic influencing the size of `baz`? |
02:10:39 | FromDiscord | <Elegantbeef> Or is this only assigned at compile time? |
02:11:35 | FromDiscord | <aph> In reply to @Elegantbeef "You want `bar` to": yes |
02:12:15 | FromDiscord | <aph> its not like `baz` will change though, `bar` depends on what the file defines |
02:12:33 | FromDiscord | <Elegantbeef> So then static will work |
02:12:39 | FromDiscord | <aph> 👍 |
02:12:42 | FromDiscord | <aph> thanks |
02:27:26 | * | vicfred quit (Quit: Leaving) |
02:33:40 | * | vicfred joined #nim |
02:36:21 | * | vicfred_ joined #nim |
02:38:51 | * | vicfred quit (Ping timeout: 246 seconds) |
03:17:20 | * | wyrd quit (Quit: leaving) |
03:35:34 | * | kayabaNerve joined #nim |
04:19:32 | FromDiscord | <!Patitotective> sent a code paste, see https://paste.rs/zyw |
04:20:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UOz |
05:06:15 | * | slowButPresent quit (Quit: leaving) |
05:29:50 | * | wyrd joined #nim |
05:31:48 | * | nisstyre quit (*.net *.split) |
05:31:48 | * | systemdsucks quit (*.net *.split) |
05:31:48 | * | nullsh quit (*.net *.split) |
05:31:49 | * | xaltsc quit (*.net *.split) |
05:31:49 | * | ormiret quit (*.net *.split) |
05:31:58 | * | systemdsucks joined #nim |
05:32:05 | * | ormiret joined #nim |
05:32:21 | * | nisstyre joined #nim |
05:32:28 | * | nisstyre quit (Signing in (nisstyre)) |
05:32:28 | * | nisstyre joined #nim |
05:32:34 | * | xaltsc joined #nim |
05:32:38 | * | xaltsc quit (Changing host) |
05:32:38 | * | xaltsc joined #nim |
05:33:35 | * | nullsh joined #nim |
05:34:12 | FromDiscord | <Solitude> i like your prs, beef. somehow every other fixes some annoyance ive already encountered in my own code. |
05:36:34 | FromDiscord | <Elegantbeef> Thanks, i fix stuff that's wrong |
05:37:22 | FromDiscord | <Elegantbeef> This stuff for some reason goes unnoticed i guess, small fixes that make the language nicer to use |
05:42:21 | NimEventer | New thread by Miran: Nim 1.6.6 release candidate, see https://forum.nim-lang.org/t/9100 |
05:43:09 | FromDiscord | <Elegantbeef> Ah nice, let's hope my two open PRs can land for 1.6.6 🙂 |
05:43:26 | * | NimBot joined #nim |
05:43:58 | FromDiscord | <Elegantbeef> Well solitude if you have any issues you want to get fixed i can look |
05:44:08 | * | dom96 joined #nim |
05:44:29 | FromDiscord | <narimiran> In reply to @Elegantbeef "Ah nice, let's hope": which ones? |
05:44:44 | FromDiscord | <narimiran> ok, i think i found them 🙂 |
05:44:56 | * | drewr joined #nim |
05:45:32 | * | reversem3[m] joined #nim |
05:45:40 | FromDiscord | <morgan> ok so i have a variable storing a proc, how do i call it? it seems to not be being called |
05:45:44 | FromDiscord | <Elegantbeef> The streams and openarray |
05:45:48 | FromDiscord | <creikey> `var consoleLog = newConsoleLogger(fmtStr=fmtStr)`↵any way to use a console logger like this across threads without passing it? |
05:45:50 | FromDiscord | <Elegantbeef> `myVar()` |
05:45:56 | FromDiscord | <huantian> I should get that await error wrapped up lmao |
05:46:19 | FromDiscord | <Elegantbeef> make them on the threads is the only way i know of crikey |
05:46:29 | FromDiscord | <creikey> In reply to @Elegantbeef "make them on the": oh I can just make this in a proc |
05:46:31 | FromDiscord | <creikey> that's not too bad |
05:46:36 | FromDiscord | <morgan> In reply to @Elegantbeef "`myVar()`": hm so i'm doing that but it looks like it's not being called |
05:46:45 | FromDiscord | <Elegantbeef> Code? |
05:46:59 | FromDiscord | <creikey> but var rollingLog = newRollingFileLogger("rolling.log", fmtStr=fmtStr) |
05:47:00 | FromDiscord | <creikey> will that work |
05:47:03 | FromDiscord | <creikey> like calling it twice |
05:47:05 | FromDiscord | <creikey> correctly use the log |
05:47:06 | FromDiscord | <Elegantbeef> File loggers will not |
05:47:22 | FromDiscord | <morgan> wait one sec i think the problem is elsewhere |
05:47:33 | FromDiscord | <Elegantbeef> The logging api is not thread safe really, i'd suggest making a thread that handles the logging that your others call |
05:47:48 | FromDiscord | <Elegantbeef> so a `Channel[(LogLevel, string)]` |
05:47:56 | FromDiscord | <huantian> Beef stole my words :p |
05:48:01 | FromDiscord | <Elegantbeef> Then you log and it sends it to the logging thread |
05:49:21 | FromDiscord | <creikey> In reply to @Elegantbeef "so a `Channel[(LogLevel, string)]`": this gets rid of the nice varargs |
05:49:34 | FromDiscord | <creikey> like `info "Some information: ", myVar` |
05:49:37 | FromDiscord | <creikey> & is a curse |
05:49:50 | FromDiscord | <Elegantbeef> You can always make it work that way |
05:49:54 | FromDiscord | <creikey> will this be better in nim 2 or is multithreaded logging never threadsafe |
05:49:55 | FromDiscord | <Elegantbeef> You drongo |
05:49:58 | FromDiscord | <creikey> In reply to @Elegantbeef "You drongo": drongo??? |
05:50:03 | FromDiscord | <Elegantbeef> Yes |
05:50:08 | FromDiscord | <Elegantbeef> Nim |
05:50:13 | FromDiscord | <creikey> In reply to @Elegantbeef "You can always make": I don't want to ask how because I think that's too general of a question |
05:50:13 | FromDiscord | <Elegantbeef> This is down to the logging API |
05:50:29 | FromDiscord | <creikey> is it just like |
05:50:34 | FromDiscord | <creikey> how do you varargs |
05:50:35 | FromDiscord | <creikey> of any type |
05:50:49 | FromDiscord | <Elegantbeef> Consider looking at the source of `std/logging` |
05:50:56 | FromDiscord | <creikey> wait I got it |
05:51:51 | FromDiscord | <creikey> sent a code paste, see https://paste.rs/zne |
05:51:58 | FromDiscord | <Elegantbeef> Should be yep |
05:52:17 | FromDiscord | <creikey> In reply to @Elegantbeef "Consider looking at the": why do they use template instead of proc? |
05:52:19 | FromDiscord | <creikey> is template always inlined |
05:52:47 | FromDiscord | <Elegantbeef> Yes |
05:53:25 | FromDiscord | <Elegantbeef> Logging is relatively small so you could change it to be a thread safe api |
05:56:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/tg2 |
05:56:40 | FromDiscord | <Elegantbeef> Instead of all the top level API |
05:57:36 | FromDiscord | <Elegantbeef> Actually i guess you dont even really need to modify it since it's all thread vars |
05:57:49 | FromDiscord | <huantian> Threading so fun! |
05:58:22 | FromDiscord | <Elegantbeef> Eh this isnt too bad to be fair |
06:01:08 | FromDiscord | <morgan> In reply to @MorganAlyssa "wait one sec i": yep fixed it |
06:01:26 | FromDiscord | <morgan> :rubberduck: |
06:02:00 | FromDiscord | <huantian> In reply to @Elegantbeef "Eh this isnt too": True |
06:08:13 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3UOZ |
06:09:33 | FromDiscord | <Elegantbeef> You then import that library and ensure you call create thread before you log and you're golden |
06:10:51 | FromDiscord | <Elegantbeef> Guess you dont even need the channel exported |
06:11:02 | FromDiscord | <Elegantbeef> And see how simple this is huan, threading is fun when it's' this simple 😛 |
06:12:29 | * | rockcavera quit (Remote host closed the connection) |
06:20:28 | FromDiscord | <huantian> Clean 👌 |
06:22:30 | * | SamuelMarks joined #nim |
06:27:11 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
06:50:01 | * | vicfred_ quit (Quit: Leaving) |
06:53:28 | * | jjido joined #nim |
07:07:40 | * | PMunch joined #nim |
07:09:41 | * | ltriant quit (Ping timeout: 256 seconds) |
07:28:33 | * | gsalazar joined #nim |
07:39:37 | * | ltriant joined #nim |
07:43:10 | * | kayabaNerve quit (Read error: Connection reset by peer) |
07:43:30 | * | kayabaNerve joined #nim |
07:51:52 | * | kayabaNerve quit (Remote host closed the connection) |
07:53:04 | PMunch | Hmm, anyone here familiar with plotly? |
07:53:17 | * | kayabaNerve joined #nim |
07:57:17 | * | kayabaNerve quit (Remote host closed the connection) |
07:57:57 | * | kayabaNerve joined #nim |
07:59:33 | PMunch | I just want to control the colour of each line in my graph :( |
08:10:19 | * | jmdaemon quit (Ping timeout: 256 seconds) |
08:15:50 | FromDiscord | <jmgomez> https://plotly.com/python/discrete-color/ (Explicitly Constructing a Color Sequence) see if that works↵I hate pandas, numpy, etc. apis |
08:19:04 | FromDiscord | <jmgomez> sent a code paste, see https://paste.rs/GSJ |
08:19:38 | FromDiscord | <jmgomez> Am I missing something? |
08:23:20 | PMunch | I'm using the nim-plotly wrapper |
08:23:55 | PMunch | @jmgomez, you need to compile Nim with `nim cpp` by the looks of it |
08:24:50 | FromDiscord | <jmgomez> Oh never use it, doesnt it respect the api? |
08:24:57 | FromDiscord | <jmgomez> Yeah, Im compiling it with nim cpp |
08:25:24 | FromDiscord | <jmgomez> still got the error, I think it's because it's trying to export it via extern C. Not sure why though |
08:25:32 | PMunch | It does, but I don't think it has the whole API wrapped |
08:25:42 | FromDiscord | <Elegantbeef> `dynlib` |
08:26:07 | FromDiscord | <Elegantbeef> I feel like dynlib makes it think it's outputting C compliant code\\ |
08:27:15 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
08:30:30 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3UPz |
08:31:15 | FromDiscord | <jmgomez> In reply to @PMunch "It does, but I": I think in the python API there is a sort of dictionary to set confs of the chart as string. Maybe that's expose? |
08:35:06 | * | zeus-supreme joined #nim |
08:37:57 | * | zeus-supreme1 quit (Ping timeout: 246 seconds) |
08:56:47 | FromDiscord | <jmgomez> In reply to @jmgomez "that was it but": agh I think the problem is in the Unreal Engine side not on nim's side of things https://forums.unrealengine.com/t/cant-link-a-library/396690/9 |
08:57:34 | PMunch | Hmm, anyone here know perl? |
09:13:12 | * | jjido joined #nim |
09:18:29 | FromDiscord | <jmgomez> In reply to @Elegantbeef "`dynlib`": is that what takes care about the mangle? |
09:18:47 | FromDiscord | <jmgomez> Im starting to think that's the problem |
09:18:56 | FromDiscord | <Elegantbeef> I do not know for C++ interop |
09:19:12 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3UPS |
09:19:19 | FromDiscord | <Elegantbeef> Nice compiler error hmmm |
09:20:13 | FromDiscord | <hmmm> hey I didn't break it, I won't pay for damages 🧐 |
09:20:37 | FromDiscord | <Elegantbeef> No ii mean no context |
09:20:43 | FromDiscord | <Elegantbeef> No code no full message |
09:24:04 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3UPU |
09:24:08 | FromDiscord | <hmmm> and made it for i,v |
09:24:18 | FromDiscord | <hmmm> wanted to use the counter and the line |
09:24:21 | FromDiscord | <Elegantbeef> well there you go |
09:24:43 | FromDiscord | <hmmm> hmm usually it works when I do it lol 🤔 |
09:24:49 | FromDiscord | <Elegantbeef> `import std/enumerate` `for i, line in enumerate bunchalines.splitlines` |
09:24:52 | FromDiscord | <Elegantbeef> No it doesnt |
09:25:01 | FromDiscord | <hmmm> I mean, not for splitlines, |
09:25:09 | FromDiscord | <Elegantbeef> It normally works when you allow it to implicitly calls `pairs` |
09:25:12 | FromDiscord | <hmmm> I just assumed it would work with splitlines too |
09:25:19 | FromDiscord | <Elegantbeef> `splitlines` is an iterator that yields `int` |
09:25:21 | FromDiscord | <Elegantbeef> string i mean |
09:25:27 | FromDiscord | <hmmm> hmm |
09:25:44 | FromDiscord | <Elegantbeef> Use enumerate and be happy |
09:25:55 | FromDiscord | <Elegantbeef> It's better than implicit (x, y) anyway |
09:25:57 | FromDiscord | <hmmm> works like for i,v? |
09:26:19 | FromDiscord | <Elegantbeef> no i lied cause i wanted to wast your time |
09:26:23 | FromDiscord | <Elegantbeef> Yes it works for i, v |
09:26:36 | FromDiscord | <hmmm> hehe beefy you ol doggy ❤️ |
09:27:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:32:57 | * | m5zs7k quit (Ping timeout: 272 seconds) |
09:37:42 | * | m5zs7k joined #nim |
09:40:15 | * | kayabaNerve quit (Read error: Connection reset by peer) |
09:41:06 | * | kayabaNerve joined #nim |
09:43:07 | FromDiscord | <hmmm> it worked beefy 👑 |
09:45:47 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
09:46:08 | * | kayabaNerve joined #nim |
09:48:56 | * | kayabaNerve quit (Read error: Connection reset by peer) |
09:49:09 | * | kayabaNerve_ joined #nim |
09:50:58 | * | noxnivi joined #nim |
09:51:03 | noxnivi | good day |
09:52:01 | FromDiscord | <Rika> Good day to you too, what's up? |
09:58:46 | * | SamuelMarks joined #nim |
10:02:59 | FromDiscord | <untoreh> sent a code paste, see https://paste.rs/muL |
10:03:04 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
10:09:22 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3UQc |
10:10:22 | FromDiscord | <exelotl> https://nim-lang.org/docs/manual.html#templates-varargs-of-untyped |
10:11:29 | FromDiscord | <Rika> I didn’t know you could declare a default for a parameter that gets its type later, though I should have expected it I guess |
10:12:05 | FromDiscord | <exelotl> I don't think the `: int` determines the type of `a` |
10:13:02 | FromDiscord | <exelotl> `proc f(a=0, b: uint): int = a + b` doesn't compile because a is an `int` and b is a `uint` |
10:16:44 | * | kayabaNerve_ quit (Remote host closed the connection) |
10:16:53 | * | kayabaNerve joined #nim |
10:19:47 | FromDiscord | <Rika> Really |
10:20:07 | FromDiscord | <Rika> I think I just forgot then |
10:25:32 | * | jjido joined #nim |
10:27:40 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
10:30:51 | * | kayabaNerve joined #nim |
10:47:10 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
10:47:22 | * | kayabaNerve joined #nim |
10:48:57 | FromDiscord | <Solitude> sent a code paste, see https://paste.rs/e5c |
10:52:49 | FromDiscord | <exelotl> lol |
10:53:08 | FromDiscord | <exelotl> I've been using it for years xD https://media.discordapp.net/attachments/371759389889003532/963028923715829800/Screenshot_from_2022-04-11_11-52-47.png |
10:56:57 | FromDiscord | <exelotl> oh wait I cropped out the version of `setup` that's actually used |
10:57:33 | FromDiscord | <exelotl> but yeah `varargs[untyped]` is pretty good... though I've had instances where it crashed the compiler :x |
10:58:17 | FromDiscord | <Solitude> yeah, man, you're walking on the edge |
11:10:37 | * | kayabaNerve quit (Remote host closed the connection) |
11:10:45 | * | kayabaNerve_ joined #nim |
11:16:25 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
11:29:05 | * | kayabaNerve joined #nim |
11:30:30 | * | kayabaNerve_ quit (Ping timeout: 246 seconds) |
11:32:44 | * | kayabaNerve_ joined #nim |
11:34:07 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
11:41:49 | FromDiscord | <Phil> In reply to @PMunch "Hmm, anyone here know": Not anymore, that knowledge went down the drain 5 years ago |
11:41:53 | FromDiscord | <Recruit_main707> In reply to @exelotl "`proc f(a=0, b: uint):": isnt that wrong? |
11:44:13 | PMunch | @Phil, I think I managed to figure it out :) |
11:45:03 | FromDiscord | <Phil> In Biology perl used to be so damn ubiquitous |
11:45:21 | FromDiscord | <Phil> NCBI still maintains its perl-code-examples to talk to their API |
11:46:30 | * | kayabaNerve_ quit (Remote host closed the connection) |
11:46:41 | * | kayabaNerve_ joined #nim |
11:46:56 | FromDiscord | <exelotl> no, it's correct. The parameters of a proc are a list of 1 or more `IdentDefs` (identifier definitions).↵Each identdefs has the following form (square brackets meaning "optional")↵`name1 [, name2 [, ...]] [: type] [= value]` |
11:47:29 | FromDiscord | <exelotl> so `a = 0` is one identdefs, `b: uint` is another |
11:48:03 | FromDiscord | <Recruit_main707> id say thats misleading, i may open an issue/rfc later |
11:48:08 | * | xet7 joined #nim |
11:51:27 | * | kayabaNerve_ quit (Ping timeout: 240 seconds) |
11:51:37 | PMunch | Hmm, there are a couple small things I'd like from Perl in Nim now that I've used it a little bit |
11:51:46 | * | kayabaNerve joined #nim |
11:52:04 | FromDiscord | <Zoom> Let's hear it↵(<@709044657232936960_=50=4dunch=5b=49=52=43=5d>) |
11:53:14 | PMunch | `rint` is nice, having to do `round.int` is annoying. Unpacking and repacking of tuples and arrays are nice (although might have been possible to do cleaner if it all was written in Nim from the beginning). Neo is a nice library, but it lacks features to easily create matrices from columns (at least that I could find) |
11:53:40 | PMunch | For the most part though Nim is much nicer :) |
11:54:11 | PMunch | Although I've run into style insensitivity being annoying for the first time ever when dealing with colour spaces.. |
11:54:30 | FromDiscord | <exelotl> In reply to @Recruit_main707 "id say thats misleading,": pretty sure it's working as intended. Keep in mind that a default parameter followed by a non-default parameter is very uncommon, so if you're writing code that looks like this you should know how the compiler will parse it |
11:55:16 | * | noxnivi quit (Quit: Leaving) |
11:57:26 | PMunch | Well we have unpacking of tuples, but unpacking arrays would be nice, after all they are static in size |
11:57:52 | PMunch | To be honest I would like to have unpacking of sequences as well |
12:00:13 | * | sagax joined #nim |
12:00:50 | FromDiscord | <Recruit_main707> sent a long message, see http://ix.io/3UQF |
12:03:27 | NimEventer | New thread by Archnim: Strange ambiguous call error, see https://forum.nim-lang.org/t/9101 |
12:07:20 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
12:16:02 | * | kayabaNerve joined #nim |
12:29:43 | FromDiscord | <frobnicate> How is it unrolling loops works, or whatever it's called? |
12:35:24 | FromDiscord | <Zoom> You mean manual&↵(@frobnicate) |
12:37:54 | FromDiscord | <frobnicate> Probably? I know the compiler does it to some degree, but I'm mostly working on vector math, so I have vectors that do the same operations and scale linearly, so I was wondering if there's even any point in implementing something on my side? |
12:38:22 | FromDiscord | <Zoom> sent a code paste, see https://play.nim-lang.org/#ix=3UQM |
12:38:43 | FromDiscord | <frobnicate> I see |
12:39:11 | FromDiscord | <frobnicate> There's no generic way of implementing it without using a macro to change the AST? |
12:39:30 | FromDiscord | <Rika> Why the macro avoidance? |
12:39:41 | FromDiscord | <frobnicate> Because I'm bad at it 🙃 |
12:39:58 | FromDiscord | <Solitude> if you avoid it for a bit longer, youll become good for sure |
12:40:04 | FromDiscord | <frobnicate> Thanks |
12:40:11 | FromDiscord | <frobnicate> I'll look into it |
12:42:34 | FromDiscord | <Zoom> I don't think you really need to make a macro for it, as you're not supposed to do it often. Unrolling can actually have negative perf. effect, so you need to apply it discriminatingly and only combined with benchmarking. |
12:44:04 | FromDiscord | <frobnicate> I see |
12:44:35 | FromDiscord | <Rika> thats a good point |
12:45:18 | FromDiscord | <Zoom> Well, if your macro can gen two versions of the loop and measure both of them, then we're talking \:P |
12:45:31 | FromDiscord | <exelotl> there was an {.unroll.} pragma but it never got implemented and was eventually removed |
12:46:00 | FromDiscord | <exelotl> macro-wise a very simple one would be something like this: https://play.nim-lang.org/#ix=3xc6 |
12:46:00 | FromDiscord | <frobnicate> I'm already struggling enough with the math as is, I think I'm trying to find a balance between performance and what I actually have brains for |
12:46:25 | FromDiscord | <exelotl> (I couldn't make it work for any iterable though because generic macros aren't a thing) |
12:46:37 | FromDiscord | <Zoom> Does your program use threading? |
12:46:42 | FromDiscord | <frobnicate> That's a http for python |
12:46:57 | FromDiscord | <frobnicate> In reply to @Zoom "Does your program use": Not yet 😕 |
12:47:00 | FromDiscord | <exelotl> uuuh wtf |
12:47:13 | FromDiscord | <exelotl> playground is bugging out lol |
12:47:21 | FromDiscord | <Zoom> If not, and it's theoretically can be paralleled, the gains are much higher there. I wouldn't care about loop unrolling then |
12:47:44 | PMunch | @exelotl, I'm on it |
12:47:47 | FromDiscord | <frobnicate> I see |
12:47:58 | FromDiscord | <exelotl> In reply to @frobnicate "That's a http for": https://play.nim-lang.org/#ix=3UQN |
12:48:07 | FromDiscord | <frobnicate> Is there a "baby's first threading" for Nim? |
12:49:37 | FromDiscord | <Zoom> Do you have any previous experience with it? The official docs are very sparse on the topic. There's a few words on the topic in Nim In Action book. |
12:49:44 | * | kayabaNerve_ joined #nim |
12:49:55 | PMunch | @frobnicate, not yet |
12:50:10 | FromDiscord | <Zoom> Anyway, there's a couple of examples there https://nim-lang.org/docs/threads.html |
12:50:11 | FromDiscord | <frobnicate> I've used Actions and such in C# |
12:50:19 | FromDiscord | <frobnicate> But that's not threading |
12:50:32 | * | kayabaNerve quit (Ping timeout: 248 seconds) |
12:50:35 | PMunch | I have been meaning to write one, but I'm waiting for more information on ARC.. |
12:50:52 | FromDiscord | <xflywind> In reply to @frobnicate "How is it unrolling": you can also use gcc unroll |
12:51:05 | FromDiscord | <xflywind> sent a code paste, see https://paste.rs/fcp |
12:51:08 | FromDiscord | <xflywind> generate |
12:51:22 | * | kayabaNerve_ quit (Remote host closed the connection) |
12:51:22 | FromDiscord | <xflywind> sent a code paste, see https://play.nim-lang.org/#ix=3UQO |
12:51:41 | * | kayabaNerve_ joined #nim |
12:52:16 | FromDiscord | <Zoom> May be if you could explain what your program does, where's the performance bottleneck and what you're trying to achieve, we could help you↵(@frobnicate) |
12:52:56 | FromDiscord | <frobnicate> Oh yeah sorry. Just writing an OpenGL renderer, and wanted to do the math myself to force myself to learn it. So I'm just making a math pckg |
12:53:42 | FromDiscord | <Rika> threading for opengl kind of math? |
12:53:52 | FromDiscord | <frobnicate> I should probably try to move some of the math over to shaders honestly |
12:54:28 | FromDiscord | <frobnicate> In reply to @Rika "threading for opengl kind": Yeah like transforms, perspective, scaling, all that jazz |
12:54:43 | FromDiscord | <Rika> doesnt sound like something that would need threading |
12:54:48 | FromDiscord | <frobnicate> alright |
12:55:15 | FromDiscord | <Rika> is this for learning or you're looking for performacne |
12:55:30 | FromDiscord | <Rika> if its for learning then ok, but if you're improving performance i think you should go the shader route instead |
12:56:03 | FromDiscord | <frobnicate> Learning mostly, but I'm also trying to do the performance improvements I read about. I also don't have a solid benchmarking setup so I know it's kinda stupid |
12:57:47 | FromDiscord | <exelotl> PMunch: I think it's an ix issue? First it generated me a URL with a space in it, then it generated me a URL for somebody else's code |
12:59:35 | FromDiscord | <Zoom> https://github.com/treeform/shady↵https://github.com/yglukhov/nimsl↵(@frobnicate) |
13:00:09 | FromDiscord | <frobnicate> awesome! thanks |
13:04:16 | PMunch | @exelotl, yeah I've seen ix doing weird stuff lately |
13:06:45 | * | rockcavera joined #nim |
13:06:45 | * | rockcavera quit (Changing host) |
13:06:45 | * | rockcavera joined #nim |
13:22:25 | * | SamuelMarks joined #nim |
13:33:43 | FromDiscord | <d4rckh> can i have a proc return multiple stuff? e.g. a sequence and an integer? |
13:34:32 | FromDiscord | <Rika> put it in a tuple |
13:34:40 | FromDiscord | <d4rckh> oh yeah thanks |
13:34:41 | PMunch | @d4rckh, sure just use an anonymous tuple |
13:34:51 | FromDiscord | <d4rckh> figured out |
13:34:53 | FromDiscord | <d4rckh> tysm |
13:41:24 | * | SamuelMarks quit (Ping timeout: 246 seconds) |
13:49:23 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3UQZ |
13:49:38 | FromDiscord | <TryAngle> is the channel initilized? |
13:50:04 | FromDiscord | <d4rckh> yes, forgot to include `chan.open()` right after i defined it |
13:50:17 | FromDiscord | <TryAngle> but that's a diff error nvm. |
13:50:18 | FromDiscord | <d4rckh> i was able to send and receive strings, but not custom types |
13:50:46 | FromDiscord | <Rika> what is the type def |
13:51:05 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3UR0 |
13:55:47 | * | arkurious joined #nim |
13:56:00 | FromDiscord | <d4rckh> oof, sorry for not sending the full error |
13:56:23 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3UR1 |
13:57:14 | FromDiscord | <TryAngle> `Channel[void]` 🤔 |
13:57:33 | FromDiscord | <Rika> Channel[void]?? how in the fuck |
13:58:07 | FromDiscord | <d4rckh> my channel is `var chan: Channel[VafFuzzResult]` |
13:58:13 | FromDiscord | <d4rckh> <:big_think:729161514899996744> |
13:58:35 | FromDiscord | <Rika> thats weirdddd |
13:58:55 | FromDiscord | <Rika> can you show the whole code? |
13:59:07 | FromDiscord | <d4rckh> one sec, let me push on github |
14:00:24 | FromDiscord | <d4rckh> @Rika https://github.com/d4rckh/vaf/blob/vaf-threads/src/vaf.nim#L109 |
14:00:24 | FromDiscord | <d4rckh> here |
14:02:24 | FromDiscord | <Rika> it might be because its not a global (because it is inside the try except) |
14:03:16 | FromDiscord | <d4rckh> It works completely fine when I'm using string |
14:05:36 | * | PMunch quit (Quit: Leaving) |
14:07:11 | FromDiscord | <Rika> let me look hader |
14:07:12 | FromDiscord | <Rika> harder |
14:07:15 | * | nrds quit (Remote host closed the connection) |
14:07:44 | FromDiscord | <Rika> i have a guess |
14:07:49 | FromDiscord | <Rika> its because you named your modules uppercase |
14:07:57 | FromDiscord | <Rika> and its mistaking the module for the type |
14:08:45 | * | nrds joined #nim |
14:10:15 | FromDiscord | <d4rckh> that... worked |
14:10:33 | FromDiscord | <d4rckh> wow |
14:10:45 | FromDiscord | <TryAngle> hmm I tried uppercase module also now and it works for me 🤔 |
14:11:48 | * | kayabaNerve joined #nim |
14:12:02 | FromDiscord | <Rika> not uppercase module |
14:12:02 | FromDiscord | <Rika> i mean |
14:12:06 | FromDiscord | <Rika> same name for module and type |
14:12:39 | FromDiscord | <TryAngle> ah true |
14:12:59 | * | kayabaNerve_ quit (Ping timeout: 256 seconds) |
14:13:40 | * | tiorock joined #nim |
14:13:40 | * | tiorock quit (Changing host) |
14:13:40 | * | tiorock joined #nim |
14:13:40 | * | rockcavera is now known as Guest3665 |
14:13:40 | * | tiorock is now known as rockcavera |
14:14:07 | * | Guest3665 quit (Ping timeout: 256 seconds) |
14:19:12 | * | kayabaNerve quit (Ping timeout: 246 seconds) |
14:19:19 | * | djanatyn quit (Ping timeout: 250 seconds) |
14:20:28 | * | djanatyn joined #nim |
14:26:25 | * | SamuelMarks joined #nim |
14:26:51 | * | kayabaNerve joined #nim |
14:30:46 | om3ga | how to pass more than 2 parameters to threads? Just don't get it by reading manual. I need to pass 5 params with type string, and one seq[string] |
14:31:11 | FromDiscord | <d4rckh> is there any way of converting a duration into a string of HH:MM:SS duration? |
14:31:20 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
14:31:33 | om3ga | Compiler writes warning: got: <typedesc[string], typedesc[string], typedesc[string], typedesc[string], typedesc[string]>, but expected: <TArg> |
14:32:04 | FromDiscord | <Yardanico> In reply to @om3ga "how to pass more": use tuples |
14:32:19 | FromDiscord | <Yardanico> so Thread[(string, string, string, string, string)] |
14:32:25 | FromDiscord | <Yardanico> or you can just make a proper object with those fields and pass it instead |
14:32:39 | om3ga | Yardanico, like this? - thr: array[1, Thread[tuple[param1: string, param2: string, param3 string,param4 string, param5: string]]] |
14:33:00 | FromDiscord | <Yardanico> yes, my example works too (it's anonymous tuples) |
14:33:17 | om3ga | Yardanico, thanks I will try right now |
14:37:57 | * | SamuelMarks joined #nim |
14:38:15 | FromDiscord | <Rika> In reply to @d4rckh "is there any way": write your own in that case i believe |
14:40:30 | FromDiscord | <d4rckh> thats unfortunate |
14:46:49 | FromDiscord | <Yardanico> In reply to @d4rckh "is there any way": as a workaround you can just create a zero DateTime and add your duration to it |
14:47:18 | FromDiscord | <d4rckh> yeah thats what im doing rn |
14:50:25 | FromDiscord | <d4rckh> how do you get a zero datetime? |
14:51:17 | FromDiscord | <Daan Breur> i was thnking make a `DateTime` with the millis as time and then format it |
14:51:51 | FromDiscord | <Daan Breur> sent a code paste, see https://play.nim-lang.org/#ix=3UR8 |
14:52:05 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3UR9 |
14:55:19 | FromDiscord | <Yardanico> In reply to @d4rckh "did it with this": you don't need this "parse" |
14:55:24 | FromDiscord | <Yardanico> just `newDateTime(0, 0)` is enough |
14:55:25 | FromDiscord | <Yardanico> and faster |
14:55:41 | FromDiscord | <Yardanico> sorry, initDateTime( |
14:55:58 | FromDiscord | <d4rckh> thanks!!! |
14:56:00 | FromDiscord | <Yardanico> ah nvm, i used time |
14:56:48 | FromDiscord | <Yardanico> although you might need to call `.utc` as well, not sure if you can do without it |
14:56:59 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3URb |
14:58:38 | FromDiscord | <d4rckh> great |
14:58:49 | FromDiscord | <Yardanico> or you can just format manually |
14:59:47 | FromDiscord | <Rika> cant you just `initTime(0, 0).utc + a` |
15:00:08 | * | kayabaNerve quit (Ping timeout: 248 seconds) |
15:01:09 | FromDiscord | <huantian> Huh does Nim not have a equivalent to pythons TimeDelta? |
15:01:41 | FromDiscord | <Yardanico> TimeInterval ? |
15:03:32 | * | kayabaNerve joined #nim |
15:05:01 | FromDiscord | <huantian> Hm I have no idea where I was going with this |
15:05:10 | FromDiscord | <Daan Breur> kek |
15:05:19 | * | zeus-supreme1 joined #nim |
15:08:40 | * | zeus-supreme quit (Ping timeout: 248 seconds) |
15:09:48 | * | slowButPresent joined #nim |
15:24:53 | * | justsomeguy joined #nim |
15:35:30 | * | justsomeguy quit (Quit: WeeChat 3.4) |
15:35:50 | * | kayabaNerve quit (Ping timeout: 272 seconds) |
15:37:21 | FromDiscord | <TryAngle> sent a code paste, see https://play.nim-lang.org/#ix=3URD |
15:38:28 | nrds | <Prestige99> Do you want like a 2 way map? Not sure what you want here |
15:39:22 | FromDiscord | <TryAngle> In reply to @nrds "<Prestige> Do you want": yes |
15:39:27 | FromDiscord | <TryAngle> also imagine I wrote : instead of = |
15:39:37 | FromDiscord | <TryAngle> (edit) "imagine" => "act like" |
15:41:24 | FromDiscord | <TryAngle> oh, this doesn't even work normally o_O |
15:41:59 | nrds | <Prestige99> https://nim-lang.org/docs/tables.html if you want a table but don't really know what you're trying to accomplish |
15:43:34 | nrds | <Prestige99> or maybe https://nim-lang.org/docs/manual.html#types-enumeration-types |
15:45:08 | FromDiscord | <huantian> You can just use parseEnum |
15:45:10 | FromDiscord | <huantian> https://nim-lang.org/docs/strutils.html#parseEnum%2Cstring |
15:45:19 | FromDiscord | <Phil> Enums are great |
15:45:21 | FromDiscord | <Phil> Enums are your friend |
15:45:22 | FromDiscord | <TryAngle> In reply to @nrds "<Prestige> https://nim-lang.org/docs/tables.html if": well I'm working with an external api where I often have ids that are different then the ones I use, so I want to convert between them without writing two maps |
15:45:25 | FromDiscord | <huantian> If your associated string is always the same as the name |
15:45:47 | FromDiscord | <TryAngle> In reply to @huantian "You can just use": not sadly because ↵1. the api is not consistent with its namings↵2. I have different namings |
15:46:12 | nrds | <Prestige99> Yeah an enum would probably work then |
15:46:50 | FromDiscord | <huantian> Well maybe you can just use your const Enum indexed array |
15:47:00 | FromDiscord | <huantian> Then make a compile time proc that inverts it |
15:47:08 | FromDiscord | <TryAngle> I still don't understand how riot games is able to go that inconsistent with their api types between their endpoints 😐 |
15:47:16 | FromDiscord | <huantian> In reply to @huantian "Then make a compile": Into a table |
15:47:26 | FromDiscord | <TryAngle> biggest single game compay besides mojang |
15:47:31 | FromDiscord | <TryAngle> and they do this |
15:47:32 | FromDiscord | <TryAngle> 😐 |
15:48:54 | nrds | <Prestige99> Riot has done some questionable stuff so I'm not surprised |
15:49:13 | FromDiscord | <huantian> You can probably like iterator over pairs of your enum indexed array, and inverse each pair and then toTable |
15:50:19 | FromDiscord | <huantian> `const StringToSummenor = summonerToString.pairs.toSeq.mapIt((it[1], it[0])).toTable` |
15:50:22 | FromDiscord | <huantian> Maybe this will work |
15:51:20 | FromDiscord | <TryAngle> In reply to @huantian "`const StringToSummenor = summonerToString.pairs.to": o_O |
15:51:24 | FromDiscord | <TryAngle> thanks I'll try that later |
16:02:53 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=3URK |
16:04:02 | FromDiscord | <exelotl> no need to generate the table yourself when `parseEnum` exists |
16:04:47 | FromDiscord | <TryAngle> In reply to @exelotl "no need to generate": nono they use multiple different ids / names at different places for the same thing |
16:04:53 | FromDiscord | <exelotl> ahh ok |
16:05:08 | FromDiscord | <TryAngle> It's pretty annoying 😐 |
16:05:17 | FromDiscord | <TryAngle> and then ingame they use different names agian |
16:05:17 | FromDiscord | <TryAngle> XD |
16:20:10 | FromDiscord | <d4rckh> sent a code paste, see https://play.nim-lang.org/#ix=3URO |
16:23:01 | FromDiscord | <d4rckh> ok, it does, but slow, i wanna have a progress bar which updates every second, but also receive all messages instantly, not sure what to do |
16:24:26 | FromDiscord | <TryAngle> In reply to @d4rckh "ok, it does, but": u can do another loop |
16:25:30 | FromDiscord | <Rika> maybe sleep less long? |
16:25:51 | FromDiscord | <Rika> why the long sleep anyway? if you have code that executes for a long time, try having more than one thread processing |
16:26:36 | FromDiscord | <TryAngle> In reply to @TryAngle "u can do another": I mean another loop in that while loop that goes as long as tryRecv() returns something |
16:27:03 | FromDiscord | <TryAngle> sadly nim has no while let 😦 |
16:29:07 | om3ga | heh, fun time with threads :) error: incompatible types when assigning to type ‘tySequence__sM4lkSb7zS6F7OVMvW9cffQ *’ from type ‘tySequence__sM4lkSb7zS6F7OVMvW9cffQ’. Can I pass IDs: var seq[string] to multiple thread? |
16:31:25 | FromDiscord | <d4rckh> In reply to @Rika "why the long sleep": actually, i changed the flow of the code a bit and achieved what i wanted without any sleep 😄 |
16:31:33 | FromDiscord | <d4rckh> now its so fast |
16:31:40 | om3ga | Yardanico, it worked after I switched to createThread[ThreadData] proc, as I understand createThread* expects no args to the threaded function |
16:34:00 | * | xet7 quit (Ping timeout: 248 seconds) |
16:47:12 | * | xet7 joined #nim |
16:52:08 | * | xet7 quit (Ping timeout: 260 seconds) |
16:57:06 | * | xet7 joined #nim |
16:59:07 | FromDiscord | <planetis> no it takes an args tuple |
16:59:25 | FromDiscord | <planetis> and a var seq[string] isn't going to work |
17:00:33 | FromDiscord | <planetis> you need to either use low level pointers provided you know what you're doing or a global or a sharedptr |
17:00:41 | * | xet7 quit (Remote host closed the connection) |
17:01:00 | FromDiscord | <planetis> all require some form of synchronization lock or atomic |
17:01:13 | * | xet7 joined #nim |
17:03:32 | * | Gustavo6046 joined #nim |
17:03:37 | * | jjido joined #nim |
17:05:05 | om3ga | planetics, I did it using poiners before |
17:05:26 | om3ga | only just difference was - the proc was void |
17:05:57 | om3ga | oh... bad news |
17:06:31 | om3ga | I need exactly sequences... |
17:06:48 | * | Gustavo6046 quit (Max SendQ exceeded) |
17:07:19 | * | Gustavo6046 joined #nim |
17:10:04 | om3ga | well, I may store that seq's in DB, and fetch them every time thread starts... may work as solution |
17:13:45 | om3ga | planetics, what if I declare global seq, and global lock. when it would be required expanding tat seq's array, I just will use lock then. What you think? |
17:14:33 | FromDiscord | <Yardanico> that would work, but only with arc/orc |
17:14:56 | om3ga | Yardanico_, great! yeah sure. I use orc |
17:15:32 | om3ga | so it seems threads in nim is just wrapper to posix threads? right? |
17:16:03 | FromDiscord | <Yardanico> well, they're not wrappers for posix threads specifically |
17:16:05 | FromDiscord | <Yardanico> they're wrappers for OS threads |
17:16:23 | om3ga | aha, thanks for explanation |
17:24:32 | * | sagax quit (Ping timeout: 250 seconds) |
17:26:12 | FromDiscord | <tandy> is there a way to concatenate `varargs[(string, string)]`? |
17:26:37 | FromDiscord | <leorize> varargs are openArray |
17:27:30 | FromDiscord | <leorize> so concat can just be done via a seq beforehand |
17:28:28 | FromDiscord | <tandy> thanks! |
17:30:18 | * | PMunch joined #nim |
17:32:05 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
17:34:57 | * | Lord_Nightmare joined #nim |
17:37:28 | NimEventer | New thread by Arnetheduck: Nlvm updated, see https://forum.nim-lang.org/t/9102 |
17:43:56 | * | xet7 quit (Remote host closed the connection) |
17:45:04 | * | xet7 joined #nim |
17:45:20 | * | xet7 quit (Remote host closed the connection) |
18:07:28 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
18:29:22 | FromDiscord | <jmgomez> How do you skip the ssl verification on a request with nim? (cert in the backend is invalid) |
18:31:54 | * | SamuelMarks quit (Ping timeout: 272 seconds) |
18:39:01 | FromDiscord | <morgan> is it possible to have a variant type switched with a bool or do i need to make a two value enum? |
18:44:05 | FromDiscord | <morgan> i switched it to an enum |
18:44:47 | FromDiscord | <morgan> i have so much variant-ness in this type lol |
18:46:03 | FromDiscord | <Solitude> you can switch with a bool |
18:46:26 | FromDiscord | <morgan> i was getting errors in vscode tho i didn't try to run it |
18:46:37 | FromDiscord | <morgan> this is in a type not in a proc |
18:46:53 | FromDiscord | <morgan> sent a code paste, see https://play.nim-lang.org/#ix=3USy |
18:47:19 | FromDiscord | <Solitude> damn, that works? |
18:47:25 | FromDiscord | <morgan> yea |
18:47:45 | FromDiscord | <Solitude> i didnt know we can have nested cases in types |
18:47:49 | PMunch | Why wouldn't it? :) |
18:47:53 | FromDiscord | <morgan> was working before i added the last 3 cases at the bottom, still gotta add stuff to other procs to make it work |
18:48:08 | FromDiscord | <Solitude> In reply to @PMunch "Why wouldn't it? :)": if i dont need it, i assume its not possible |
18:48:27 | FromDiscord | <morgan> https://media.discordapp.net/attachments/371759389889003532/963148538433376326/unknown.png |
18:48:30 | * | jmdaemon joined #nim |
18:48:39 | FromDiscord | <morgan> that |
18:48:48 | FromDiscord | <morgan> (edit) "that" => "that's weird it;'s shifted from what i selected" |
18:49:01 | FromDiscord | <morgan> https://media.discordapp.net/attachments/371759389889003532/963148683975753749/unknown.png |
18:49:26 | FromDiscord | <Solitude> you sure love indentation |
18:49:29 | FromDiscord | <morgan> i do |
18:50:32 | PMunch | May I interest you in some style-guide compliant 2-space indents? |
18:50:38 | FromDiscord | <morgan> no |
18:50:42 | PMunch | Saves you from having to buy an ultrawide monitor |
18:51:03 | FromDiscord | <Solitude> perhaps `of` aligned with `case` may interest you? |
18:51:23 | FromDiscord | <morgan> i could fit that three times on just my larger monitor |
18:51:52 | FromDiscord | <morgan> i don't even have the vscode window full screened so i can see a bit of older code i sometimes reference for this |
18:52:22 | FromDiscord | <morgan> nah i like the ofs indented |
18:53:09 | FromDiscord | <morgan> here's some more code of mine :) https://media.discordapp.net/attachments/371759389889003532/963149723492048987/unknown.png |
18:53:20 | FromDiscord | <!Patitotective> 💀 |
18:54:08 | FromDiscord | <morgan> i think the most indented anything is in this project is 13 levels |
18:54:33 | FromDiscord | <morgan> https://media.discordapp.net/attachments/371759389889003532/963150079169028136/unknown.png |
18:54:39 | FromDiscord | <morgan> i like indentation |
18:54:47 | FromDiscord | <Solitude> you even ran out of colors... |
18:54:59 | PMunch | Well, I'm not going to kind-shame |
18:55:00 | FromDiscord | <morgan> i have it looping i think 6 colors |
18:55:15 | FromDiscord | <morgan> and the whole set including the first one loops after 25 levels |
18:56:23 | FromDiscord | <Solitude> yeah, thats understandable, but one thing cant be forgiven - echo with parens... |
18:56:39 | FromDiscord | <morgan> In reply to @MorganAlyssa "": i think this is so 3\5\2\2 or 60 variations |
18:56:46 | * | SamuelMarks joined #nim |
18:57:06 | FromDiscord | <morgan> echo or any function without parens looks weird to me |
18:58:05 | FromDiscord | <!Patitotective> i dont write parens to almost any procedure cause its soooo tiring |
18:58:36 | FromDiscord | <!Patitotective> specifically echo, that should be for debug |
18:58:47 | FromDiscord | <morgan> oh yea that's all for debugging |
18:58:51 | FromDiscord | <morgan> the echos will be removed |
18:59:45 | FromDiscord | <morgan> tho i may have some verbose mode idk |
19:00:47 | FromDiscord | <morgan> i often use more parens than i need because it's easier to make sure math works the way i want that way, tho i do leave them off for conditionals (unless i have more than one condition and i wanna make sure it's executing right) |
19:01:12 | * | SamuelMarks quit (Ping timeout: 248 seconds) |
19:01:42 | FromDiscord | <jmgomez> can you add pragmas to test? or maybe overload somehow the template? |
19:02:32 | FromDiscord | <!Patitotective> @morgan that moment when you use another computer and need to reconfigure e v e r y t h i n g 💀 |
19:02:40 | FromDiscord | <morgan> In reply to @jmgomez "can you add pragmas": oh so it could be compiled in a test mode with debug echoing? |
19:03:41 | FromDiscord | <jmgomez> no more like for example creating a test that handles async by using await instead of waitFor. Im ok with it, but just wondering |
19:04:02 | PMunch | Patiodetective, put all your config files in a git repo. git clone and you're done :) |
19:04:19 | FromDiscord | <morgan> oh yea that's a fancy way of doing it |
19:04:21 | FromDiscord | <morgan> reminds me i might make some more changes to saem's nim extension |
19:04:45 | FromDiscord | <morgan> wanna get it highlighting result and \`stuff\` |
19:04:46 | FromDiscord | <!Patitotective> In reply to @PMunch "Patiodetective, put all your": you have solved my life |
19:05:44 | PMunch | Then of course share them with us :) https://github.com/PMunch/Configuration |
19:05:54 | PMunch | (That is an old configuration) |
19:06:16 | FromDiscord | <!Patitotective> vim? 💀 |
19:06:42 | PMunch | Of course |
19:07:36 | FromDiscord | <morgan> you could store a vscode settings json in github/whatever |
19:07:43 | FromDiscord | <Rika> It’s either vim, emacs, or wrong |
19:07:54 | FromDiscord | <Rika> I’m joking |
19:07:56 | FromDiscord | <!Patitotective> In reply to @Rika "It’s either vim, emacs,": wrong 😃 |
19:09:13 | PMunch | @Rika, I'd accept Kakoune or Moe as well |
19:10:29 | FromDiscord | <Rika> ok |
19:11:33 | FromDiscord | <!Patitotective> just wrote an emoji as a commit message 🤡 |
19:21:36 | PMunch | You monster! |
19:24:43 | FromDiscord | <!Patitotective> i think i broke github 💀 https://media.discordapp.net/attachments/371759389889003532/963157668904730624/unknown.png |
19:52:43 | * | sagax joined #nim |
19:53:49 | * | kayabaNerve joined #nim |
19:59:20 | * | SamuelMarks joined #nim |
20:01:26 | FromDiscord | <Yardanico> you probably enabled RTL somewhere on github on in your browser/OS |
20:03:23 | FromDiscord | <gerwy> quick question↵Does choosenim needs admin privileges on Windows? |
20:05:01 | * | SamuelMarks quit (Ping timeout: 272 seconds) |
20:06:06 | FromDiscord | <Yardanico> probably, because it modifies PATH |
20:06:14 | FromDiscord | <Yardanico> but not 100% sure |
20:08:06 | * | kayabaNerve_ joined #nim |
20:10:36 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
20:11:33 | FromDiscord | <creikey> sent a code paste, see https://play.nim-lang.org/#ix=3USR |
20:12:12 | * | jjido joined #nim |
20:13:05 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3USS |
20:13:14 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#templates-identifier-construction |
20:13:37 | FromDiscord | <creikey> In reply to @Yardanico "https://nim-lang.org/docs/manual.html#templates-ide": was about to ask for the man page thanks |
20:18:54 | * | neurocyte8614492 joined #nim |
20:24:10 | FromDiscord | <dom96> In reply to @Yardanico "probably, because it modifies": it doesn't modify the PATH and it doesn't need admin privs |
20:24:29 | FromDiscord | <dom96> In reply to @Life Sucks "quick question Does choosenim": so no in answer to your question 🙂 |
20:30:59 | FromDiscord | <Yardanico> @dom96 do you know any reason https://forum.nim-lang.org/t/6295 doesn't want to shop my thread starting post? |
20:31:05 | FromDiscord | <Yardanico> I didn't use any special stuff in the rst - https://forum.nim-lang.org/post.rst?id=38822 |
20:31:41 | FromDiscord | <Yardanico> time to spin up a local nimforum instance |
20:32:30 | FromDiscord | <dom96> yes, I fixed it |
20:33:08 | FromDiscord | <dom96> it's because there is a regression in the new rst gen which breaks when you don't put a newline between text and a code-block |
20:34:31 | FromDiscord | <Yardanico> oh |
20:37:33 | * | kayabaNerve_ quit (Read error: Connection reset by peer) |
20:38:22 | * | SamuelMarks joined #nim |
20:38:33 | * | kayabaNerve joined #nim |
20:39:41 | FromDiscord | <gerwy> In reply to @dom96 "so no in answer": Niceee, thanks :>> |
20:39:56 | FromDiscord | <gerwy> i want to install nim on my school computer |
20:40:02 | FromDiscord | <gerwy> (edit) removed "my" |
20:40:31 | FromDiscord | <dom96> Your school's anti-virus might not like that |
20:41:03 | FromDiscord | <dom96> Nim at this point gets falsely flagged practically all the time on windows :/ |
20:41:56 | FromDiscord | <Yardanico> at least it doesn't get flagged if you self-compile, at least not in my experience |
20:42:54 | FromDiscord | <gerwy> In reply to @dom96 "Your school's anti-virus might": thats true too |
20:43:05 | FromDiscord | <gerwy> but it was nimble that was flagged right? |
20:43:20 | FromDiscord | <gerwy> to be honest i only need compiler |
20:43:33 | FromDiscord | <Yardanico> In reply to @Life Sucks "but it was nimble": nope |
20:43:44 | FromDiscord | <Yardanico> other things get flagged sometimes as well, even the compiler itself |
20:43:49 | FromDiscord | <gerwy> and can stay the same version (i doubt i would need to update it) |
20:48:30 | * | PMunch quit (Quit: leaving) |
20:55:43 | FromDiscord | <ratapenado> Hi, what is the prefered way for parsing command line arguments ? std/parseopt or something else ? |
20:56:00 | * | kayabaNerve quit (Ping timeout: 250 seconds) |
20:56:57 | FromDiscord | <Yardanico> there's no "preferred way" really, for simple stuff (or if you don't want to depend on third party packages) it's usually std/parseopt |
20:57:16 | FromDiscord | <Yardanico> otherwise there's a lot of choice - cligen (seems to be the most popular choice for CLI arguments parsing), argparse, docopt |
20:57:24 | FromDiscord | <Yardanico> i probably missed a few as well |
20:57:49 | * | vicfred joined #nim |
20:59:24 | FromDiscord | <morgan> i think i need to learn macros so i can simplify a bunch of procs |
20:59:36 | FromDiscord | <morgan> already have 30 of one set and now it's gotta be 60 |
21:09:22 | FromDiscord | <ratapenado> In reply to @Yardanico "otherwise there's a lot": thanks ! |
21:09:47 | FromDiscord | <Yardanico> i personally prefer https://github.com/iffy/nim-argparse because it's pluggable and not tied to actual CLI |
21:09:56 | FromDiscord | <Yardanico> you can use it to e.g. implement command parsing for a telegram bot |
21:20:49 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
21:21:51 | FromDiscord | <morgan> im writing my own and yea being able to plug it into something else is def something it's gonna have |
21:22:28 | FromDiscord | <morgan> like for a multiplayer game, it'll include optional permissions so you can separate out admin commands from user commands for example |
21:23:25 | FromDiscord | <morgan> once it's in a stable state maybe it'll work well for you if you don't like the other options |
21:34:35 | * | zeus-supreme joined #nim |
21:37:24 | * | zeus-supreme1 quit (Ping timeout: 246 seconds) |
21:58:47 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
21:59:41 | * | SamuelMarks joined #nim |
22:02:36 | * | xet7 joined #nim |
22:13:42 | FromDiscord | <morgan> welp this is gonna be a long macro |
22:13:51 | FromDiscord | <morgan> sent a code paste, see https://play.nim-lang.org/#ix=3UTj |
22:14:39 | FromDiscord | <morgan> and ofc different variants for each bit of it |
22:14:39 | FromDiscord | <Elegantbeef> Uh oh i see the "addIntFlag" still |
22:14:55 | FromDiscord | <morgan> yeah for now im keeping them |
22:15:31 | FromDiscord | <morgan> but i decided 60 similar proc defs was too much so i'm going to write a macro |
22:15:50 | FromDiscord | <morgan> 30 was ok but 60 is too much |
22:16:00 | FromDiscord | <morgan> still gonna be 60 calls to the macro |
22:16:02 | FromDiscord | <Elegantbeef> Imagine not just having 1 |
22:16:11 | FromDiscord | <Elegantbeef> This brought to you by a single add proc |
22:16:21 | FromDiscord | <Elegantbeef> Nim isnt C so dont writei t as such! |
22:16:40 | FromDiscord | <morgan> hmm i could make the macro be what you use to assign, right? |
22:16:53 | FromDiscord | <Elegantbeef> No clue what you mean |
22:17:07 | FromDiscord | <Elegantbeef> You're making quite an elaborate system instead of just using the procedure i suggested |
22:17:13 | FromDiscord | <Elegantbeef> So i shush and go "yep carry on" |
22:17:29 | FromDiscord | <morgan> so the macro takes a simpler set of inputs and creates AST for the full object construction |
22:18:59 | FromDiscord | <morgan> anyways i'll think about this while i eat dinner and drive to and from d&d |
22:19:28 | FromDiscord | <Elegantbeef> Why dont you use what i suggested again, i dont recall |
22:20:05 | FromDiscord | <morgan> i don't really like using sometype.theproc |
22:20:06 | FromDiscord | <morgan> idk |
22:20:13 | FromDiscord | <morgan> idr all of it |
22:20:24 | FromDiscord | <Elegantbeef> so then just do `intFlag` |
22:20:46 | FromDiscord | <Elegantbeef> Though i hardly think that's a good reason to avoid it, but YMMV |
22:21:22 | FromDiscord | <morgan> lemme look back at it |
22:23:59 | FromDiscord | <Elegantbeef> It was just make a constructor for your flags using optional parameters so you dont have to have custom adds |
22:24:56 | * | kayabaNerve joined #nim |
22:32:13 | FromDiscord | <yoyojambo> Can I give the executable of a nimble project a name in the .nimble file? |
22:32:58 | FromDiscord | <Elegantbeef> Do not think so |
22:36:40 | FromDiscord | <yoyojambo> sent a code paste, see https://play.nim-lang.org/#ix=3UTo |
22:39:47 | * | kayabaNerve quit (Ping timeout: 240 seconds) |
22:45:26 | FromDiscord | <spoon> err |
22:45:44 | FromDiscord | <Elegantbeef> rre |
22:48:23 | FromDiscord | <Yardanico> rer |
22:51:29 | * | SamuelMarks quit (Ping timeout: 256 seconds) |
22:56:58 | FromDiscord | <yoyojambo> what does `{.inline.}` mean when declaring a proc? |
22:57:19 | FromDiscord | <Yardanico> "The inline convention means the caller should not call the procedure, but inline its code directly. Note that Nim does not inline, but leaves this to the C compiler; it generates inline procedures. This is only a hint for the compiler: it may completely ignore it and it may inline procedures that are not marked as inline." |
22:57:22 | FromDiscord | <Elegantbeef> The procedure is suggested to be inlined |
22:57:27 | FromDiscord | <Elegantbeef> Which means it's pasted in place at the call site |
22:57:31 | FromDiscord | <Yardanico> Manual is pretty helpful for a lot of stuff like this :) |
22:57:47 | FromDiscord | <Elegantbeef> Yardanico i'm the one with bot next to me! |
22:57:58 | FromDiscord | <Elegantbeef> Also hello, been a while since i've seen you active 😀 |
22:58:07 | FromDiscord | <Yardanico> hello, i've been active again since a few days ago |
23:00:08 | FromDiscord | <exelotl> In reply to @yoyojambo "what does `{.inline.}` mean": I wrote a more thorough explanation on the forums the other day if that helps: https://forum.nim-lang.org/t/9081#59189 |
23:00:17 | FromDiscord | <yoyojambo> In reply to @Yardanico ""The inline convention means": thanks a lot |
23:00:47 | FromDiscord | <yoyojambo> In reply to @Yardanico "Manual is pretty helpful": yeah was looking for it in the wrong place |
23:03:51 | NimEventer | New question by PreFiXAUT: How to generate C headers from Nim, see https://stackoverflow.com/questions/71835238/how-to-generate-c-headers-from-nim |
23:04:07 | FromDiscord | <yoyojambo> In reply to @exelotl "I wrote a more": It totally helps, thank you |
23:42:56 | * | SamuelMarks joined #nim |
23:47:07 | * | SamuelMarks quit (Ping timeout: 240 seconds) |
23:48:04 | * | SamuelMarks joined #nim |
23:55:49 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
23:56:58 | * | Gustavo6046 joined #nim |
23:58:39 | FromDiscord | <!Patitotective> testing github actions... https://media.discordapp.net/attachments/371759389889003532/963226605193400330/Screenshot_from_2022-04-11_18-57-52.png |