<< 25-08-2021 >>

00:02:40*auxym_ quit (Ping timeout: 240 seconds)
00:03:01FromDiscord<Elegantbeef> Uhh smokebomb
00:03:22*auxym_ joined #nim
00:04:17nrds<Prestige99> Haha oh
00:05:52FromDiscord<Elegantbeef> I wanted to run it but i never got around to making it work with the gnome keyrin
00:06:05FromDiscord<Elegantbeef> So everytime i use it just logs me out of my accounts and it's not fun
00:09:20nrds<Prestige99> Wait, do you have to do something specific for the gnome keyring?
00:09:49FromDiscord<Elegantbeef> Uncertain, think you need to start a daemon but i was getting too tired of getting logged out of the accounts to test
00:10:41nrds<Prestige99> Can you just do it in xephyr? Maybe not since you are already logged in... I never had a problem with it, so idk
00:10:57nrds<Prestige99> Maybe some verbose logging
00:12:05FromDiscord<Elegantbeef> I dont know what you mean verbose logging
00:13:45nrds<Prestige99> Just to find out why you are getting logged out. I just have to enter my password in the gnome key ring GUI
00:16:30FromDiscord<Elegantbeef> Well i think it's just how i have my wm log me in maybe, doesnt call the proper xinit stuff
00:20:24arkanoidElegantbeef, I've successfully converted the template into a macro (quote do and replace vars with `vars` basically). I've also turned the wannabe generated proc name into a myProcName: static[string] macro argument. I do the required transformation of the string before the "quote do", but I'm failing to use the name inside it
00:22:33arkanoidI keep getting errors on the first like of the quote do like "Error: identifier expected, but found '"getNetworkInterfaces"'" where the string is the wannabe name of the generated proc
00:22:47FromDiscord<Elegantbeef> If a picture could speak a thousand words why cannot i not see the code?
00:23:59arkanoidElegantbeef: https://play.nim-lang.org/#ix=3wSj
00:24:39FromDiscord<Elegantbeef> you're trying to use a strlit as an ident
00:25:07FromDiscord<Elegantbeef> `let nameIdent = ident(name)` then use `nameIdent`
00:25:35FromDiscord<Elegantbeef> what you're doing is writing `proc "getNetworkInterfaces"(args)` instead of `proc getNetworkInterfaces(args)`
00:26:11arkanoidit works!
00:26:33arkanoidyes it makes sense, strLit is not ident
01:06:06*ozzz quit (Ping timeout: 268 seconds)
01:18:27*auxym_ quit (Ping timeout: 240 seconds)
01:37:17FromDiscord<JSONBash> In reply to @arkanoid "<@145405730571288577>: https://play.nim-lang.org/#i": are you doing a soap interfacing?
01:42:28FromDiscord<codic> gnome keyring works fine for me
02:01:23nrds<Prestige99> we mean on beef's wm
02:01:29nrds<Prestige99> guess there's an issue
02:02:23FromDiscord<Elegantbeef> Yea i'm missing something on startup, prestige are you using a login manager?
02:02:53nrds<Prestige99> nope just startx
02:18:58*arkurious quit (Quit: Leaving)
02:31:40nrds<Prestige99> hbu Elegantbeef
02:36:33FromDiscord<Termer> Hi, how would I go about importing two modules which have the same name, but are in different places?
02:37:01FromDiscord<Termer> I have `tm_client/private/objects` and `objects` (which is in the same directory as the module I'm importing in)
02:37:05FromDiscord<Termer> but I can only import noe
02:37:07FromDiscord<Termer> (edit) "noe" => "one"
02:37:22FromDiscord<Termer> is there some way to import both, possibly one under an alias?
02:38:20nrds<Prestige99> import foo as bar ?
02:38:29FromDiscord<Termer> oh, thanks
02:40:45*def- quit (Quit: -)
02:42:32*def- joined #nim
02:44:31FromDiscord<Rika> you can use relative directories in import names
03:33:33*rockcavera quit (Remote host closed the connection)
04:06:02*supakeen quit (Quit: WeeChat 3.2)
04:06:31*supakeen joined #nim
04:29:18FromDiscord<codic> > <Prestige> we mean on beef's wm↵yeah I meant I didn't need to do anything special
04:47:56FromDiscord<retkid> at first i was like
04:48:14FromDiscord<retkid> "kinda lame we have to make our own iterators, theres not much to do besides just copy pasta the same 5 lines"\
04:48:23FromDiscord<retkid> then i was like "holy shit this is actually amazing"
04:49:10FromDiscord<retkid> because, yes like 90% of the time its just the same 5 lines, but it gives you control over how your code looks, and also you can do really efficient code via not mincing and chaining loops
04:50:17FromDiscord<Yardanico> btw, if you actually want some pre-defined efficient chaining, there's https://github.com/zero-functional/zero-functional
04:50:18nrds<R2D299> itHub: 7"A library providing zero-cost chaining for functional abstractions in Nim."
04:50:40FromDiscord<retkid> why not just make my own library with all the loops i will ever need as i need them
04:51:05FromDiscord<retkid> oh
04:51:10FromDiscord<retkid> because theres a fuckton of loops here
05:18:10*kayabaNerve_ quit (Ping timeout: 252 seconds)
05:25:45FromDiscord<linux user> nim and js same color
05:25:50FromDiscord<linux user> colour
05:28:58FromDiscord<Rika> Discussed before already
05:45:24FromDiscord<Yardanico> @linux user different :)
05:45:41FromDiscord<Yardanico> also we had to change the color before GitHub removed the similar color rule
05:46:01FromDiscord<Yardanico> (in the past you couldn't have a language with the color that's too similar to another language's color)
05:46:07FromDiscord<Yardanico> but now that restriction doesn't exist
05:46:49FromDiscord<Yardanico> @linux user see https://forum.nim-lang.org/t/6350 https://github.com/github/linguist/pull/4866 and https://github.com/github/linguist/pull/4900 for more context
05:47:38FromDiscord<Yardanico> lemme find a project with both nim and js to show you the difference
05:49:24FromDiscord<Yardanico> @linux user this is how a project with 50% nim 50% js would look like (edited html manually for 50/50 distribution) https://media.discordapp.net/attachments/371759389889003532/879965661944758292/unknown.png
05:50:19FromDiscord<Yardanico> and on light github theme https://media.discordapp.net/attachments/371759389889003532/879965891230564363/unknown.png
05:50:47FromDiscord<Bren> Is there a matrix protocol sdk for nim?
05:51:12FromDiscord<Yardanico> don't think so
05:51:39FromDiscord<Elegantbeef> Someone was working on one but idk how that's went
05:52:11FromDiscord<linux user> owo
05:53:52FromDiscord<linux user> i cant beleie it had cow poop green
05:53:54FromDiscord<linux user> bruh
05:54:37FromDiscord<Yardanico> that was set by some github employee in like 2012
05:54:52FromDiscord<Yardanico> but it wasn't that bad as you're describing it :)
06:03:18FromDiscord<Clonkk> https://without.boats/blog/the-problem-of-effects/ an interesting read about effects in programming language
06:13:05FromDiscord<Rika> If you say it’s interesting then I shall read it
06:16:36FromDiscord<Rika> It’s fine, but it need some intermediate knowledge about Rust
06:19:56*PMunch joined #nim
06:39:34FromDiscord<enthus1ast> i started one but its more like "i throw stuff in there when i need it" and no encryption, and exactly like this it looks ;) .↵https://github.com/enthus1ast/nimMatrix
06:39:35nrds<R2D299> itHub: 7"matrix chat client library"
06:40:16FromDiscord<enthus1ast> BUT i use it
06:54:47*jjido joined #nim
07:05:53*ozzz joined #nim
07:06:02*max22- joined #nim
07:12:21FromDiscord<gogolxdong (liuxiaodong)> How to listen on all address for http/https with Jester or prologue?
07:13:13madpropsif you mean without a port you'd have to reverse proxy i think
07:13:47PMunch@gogolxdong, what do you mean all addresses?
07:21:17FromDiscord<enthus1ast> you must listen on 0.0.0.0
07:26:21*kayabaNerve joined #nim
07:44:02FromDiscord<ondrejoda> good morning
07:44:21FromDiscord<Ondrejoda> hey there
07:44:40FromDiscord<Ondrejoda> how are you?
07:44:46FromDiscord<ondrejoda> i'm good
07:45:18FromDiscord<Elegantbeef> Someone's gone mad
07:45:26FromDiscord<ondrejoda> yeah, kinda
07:45:35FromDiscord<ondrejoda> i was just testing what would discord do
07:45:45FromDiscord<ondrejoda> when i would type in the matrix room
07:46:51FromDiscord<ondrejoda> and it does seem to work
07:47:02FromDiscord<ondrejoda> so yeah
07:47:12FromDiscord<ondrejoda> kind of a cool feature i guess
07:50:27*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
07:52:52*stkrdknmibalz joined #nim
08:06:56PMunchHmm, is Matrix also bridged through Discord?
08:07:27PMunchBecause to me it appears like you're two different accounts on Discord with the same name just capitalized differently talking to each other
08:07:54FromDiscord<Elegantbeef> Yea it is
08:26:58FromDiscord<Rika> Lol
08:27:04FromDiscord<Rika> That’s hilarious
08:37:47PMunchHmm, would this cause a string copy? http://ix.io/3wTy/nim
08:38:38FromDiscord<Elegantbeef> It should not afaik
08:39:19PMunchNice
08:39:38FromDiscord<ondrejoda> yeah, i got somewhat confused by this
08:40:12FromDiscord<ondrejoda> and that there was no issue with the same names
08:42:26arkanoidwhat's the most convenient way to pass args to a proc generating macro that describes the input arguments of the generated proc?
08:43:06FromDiscord<haxscramper> I'd just pass proc signature and unparse it in macro
08:43:32FromDiscord<haxscramper> `macroCall(proc(arg1: int): ReturnType {.MaybeSomeSideEffects.})`
08:43:59arkanoidwitty idea! thanks!
08:46:20*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
09:19:06arkanoidI have noob question about macros. I have a NimNode of kind nnkProcDef, I need to modify it's nnkFormalParams tree, what's the correct way to access it? I see that it is the 4th child of the nnkProcDef, is it correct to do myProcDef[3]? is there a better way to navigate AST?
09:31:08FromDiscord<haxscramper> https://nim-lang.org/docs/macros.html#params%2CNimNode
09:31:17FromDiscord<haxscramper> But usually you do `[3]`
09:31:32FromDiscord<haxscramper> If you want to deconstruct proc you can use pattern matching
09:31:48FromDiscord<haxscramper> https://nim-lang.github.io/fusion/src/fusion/matching.html#tree-matching
09:34:59arkanoidthanks!
09:35:04FromDiscord<haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test5.nim#L31
09:35:23arkanoidbut if NimNode is a variant objects, shouldn't it have attributes specific for it's kind?
09:35:38arkanoidI mean something like myProcDefNode.formalParams
09:36:15arkanoidor maybe not as it's just a tree of nodes
09:42:01FromDiscord<haxscramper> It does not have specific attributes, it is a homogeneous ast
09:42:19FromDiscord<haxscramper> There are some helper procs like `std/macros.params`
09:43:52arkanoidnow I unserstand why you added many many utility funcs for that in your runtime ast generator library
09:45:47FromDiscord<haxscramper> yes
09:46:10FromDiscord<haxscramper> Actually I support both use case - homogenous AST via helper functions
09:46:43FromDiscord<haxscramper> And more structured one that has everything put in separate fields
09:46:53arkanoidI'm actually puzzle if I should use the helper functions, or just program the way dumpAstGen prints
09:46:57arkanoid*puzzled
09:49:45FromDiscord<ondrejoda> how do i do pointers in nim?
09:50:19FromDiscord<ondrejoda> i'm asking because i am using this sdl `getMouseState()` function and it takes in 2 int pointers
09:51:06FromDiscord<Yardanico> if you're using sdl2 from nim-lang, you don't need pointers, it has two overloads for getMouseState
09:51:11FromDiscord<Yardanico> although I'm not sure how correct that usage is
09:51:14FromDiscord<Yardanico> it has proc getMouseState(x, y: var cint): uint8 {.importc: "SDL_GetMouseState", discardable.}
09:51:30FromDiscord<Yardanico> so you can do `var x, y: int; getMouseState(x, y)`
09:51:39FromDiscord<Yardanico> (sent as one line for chat purposes)
09:51:45FromDiscord<ondrejoda> well i did
09:52:01FromDiscord<Yardanico> ah sorry, not int but cint
09:52:06FromDiscord<ondrejoda> and it gives me an error
09:52:16FromDiscord<ondrejoda> huh
09:52:16FromDiscord<ondrejoda> cint works
09:52:21FromDiscord<ondrejoda> gimme a sec
09:52:22FromDiscord<Yardanico> yeah, because nim's int is not cint
09:52:42FromDiscord<Yardanico> cint is C's int which is 32-bit even on 64-bit platforms
09:52:46FromDiscord<Yardanico> nim's int is arch-dependent
09:53:25*arkanoid raises finger: cint stands for compatible int, not C int!
09:53:37arkanoidI actually are the noob here, just a joke
09:53:38FromDiscord<haxscramper> It stands for common int
09:53:46FromDiscord<haxscramper> cstring is a common string
09:53:55FromDiscord<ondrejoda> so the var x, y\:cint getMouseState(x, y) doesn't work
09:54:05FromDiscord<haxscramper> In reply to @arkanoid "I'm actually puzzle if": It depends on your particular use case. For large blocks of code with some injections I use `quote do` (or my own reimplementation). When I need more sophisiticated logic I get to `newTree()` and helper pocs
09:54:09FromDiscord<Yardanico> then that usage is indeed incorrect I guess
09:54:13FromDiscord<Yardanico> @ondrejoda then just use it like this
09:54:21FromDiscord<Yardanico> var x,y: cint; getMouseState(addr x, addr y)
09:54:29FromDiscord<haxscramper> When I need some nuclear-tear AST transforms I start to add IR that also has own helper functions
09:54:31FromDiscord<ondrejoda> ah
09:54:36FromDiscord<Yardanico> addr is for getting a pointer of a variable
09:54:38FromDiscord<ondrejoda> now that is what i was looking for
09:54:50FromDiscord<ondrejoda> so addr acts like \ or & in c++?
09:54:52FromDiscord<Yardanico> yes
09:54:53FromDiscord<haxscramper> If you want to look at what complicated macros looks like you can see pattern matching implementation and accompanying article
09:54:55FromDiscord<Yardanico> kind of
09:55:11FromDiscord<haxscramper> In reply to @ondrejoda "so addr acts like": `addr` is `&`, `expr[]` is `expr`
09:55:17FromDiscord<ondrejoda> and yes i do know that pointers and references are two different things
09:56:42FromDiscord<Yardanico> @haxscramper do you think it's valid to do `var cint` for arguments that expect a pointer to a variable on the C side?
09:56:47FromDiscord<Yardanico> because apparently sdl2 package has an overload like this
09:57:01FromDiscord<Yardanico> multiple actually
09:58:55FromDiscord<haxscramper> If compiled to C there is no other way to get `var cint` semantics so yes
09:59:05FromDiscord<haxscramper> I would assume it is safe to do so
09:59:15FromDiscord<ondrejoda> praise the person that came up with `any`
09:59:17FromDiscord<Yardanico> well I just mean that it's essentially relying on an implementation detail but it's highly unlikely to change :P
09:59:21FromDiscord<Yardanico> @ondrejoda that's not what you think it is
09:59:34FromDiscord<ondrejoda> In reply to @Yardanico "<@!533966976754909216> that's not what": for proc input args?
09:59:36FromDiscord<haxscramper> In reply to @Yardanico "well I just mean": yes, it is a bad style by all accounts
09:59:49FromDiscord<Yardanico> In reply to @Ondrejoda "for proc input args?": for proc arguments it'll essentially create a new instantiation of a proc for every type of that argument
09:59:49FromDiscord<haxscramper> not everyone knows that `var == ptr` if you compile to C
10:00:10FromDiscord<Yardanico> it's not a dynamic type, all typing is still static even with `any`
10:00:15FromDiscord<Yardanico> lemme show you what I mean
10:00:22FromDiscord<ondrejoda> i think i know what you mean
10:01:04FromDiscord<ondrejoda> if i have a proc like this `proc something(x, y:any)`↵it makes all of the possible combinations
10:01:07FromDiscord<ondrejoda> right?
10:01:11FromDiscord<Yardanico> yes, essentially
10:01:14FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wTO
10:01:24FromDiscord<Yardanico> here test and test2 are effectively the same, it's just that test is a bit shorter
10:01:26FromDiscord<ondrejoda> so i should use templates?
10:01:42FromDiscord<haxscramper> what `something` does exactly?
10:01:50FromDiscord<ondrejoda> lemme show you
10:01:56FromDiscord<haxscramper> I doubt it is really "can accept any type" proc
10:02:06FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wTP
10:02:08FromDiscord<Yardanico> uhh
10:02:12FromDiscord<Yardanico> what you want is SomeInteger probably
10:02:12FromDiscord<haxscramper> `T: SomeInteger`
10:02:32FromDiscord<ondrejoda> but then again, i sometimes pass a mix of floats and ints
10:02:45FromDiscord<Yardanico> In reply to @Ondrejoda "but then again, i": then SomeNumber
10:02:50FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wTR
10:02:50FromDiscord<ondrejoda> ah
10:02:52FromDiscord<Yardanico> !eval (5.0).cint
10:02:54NimBotCompile failed: /usercode/in.nim(1, 6) Error: expression 'cint(5.0)' is of type 'cint' and has to be used (or discarded)
10:02:57FromDiscord<ondrejoda> now i didn't know that that existed
10:03:01FromDiscord<Yardanico> yeah, that works apparently
10:03:07FromDiscord<Yardanico> In reply to @Ondrejoda "now i didn't know": and no need for `void` return type :)
10:03:14FromDiscord<ondrejoda> k
10:03:32FromDiscord<Yardanico> see some generic types here https://nim-lang.org/docs/system.html#SomeSignedInt
10:03:34FromDiscord<Yardanico> and below
10:03:46FromDiscord<ondrejoda> huh
10:03:50FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wTp
10:04:02FromDiscord<Yardanico> yeah, because with what I sent you all types must be of the same type
10:04:06FromDiscord<Yardanico> or even with your any example
10:04:10FromDiscord<Yardanico> the proper fix would be this:
10:04:44FromDiscord<Yardanico> but again, IMO in this case you can just make it a template
10:04:49FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wTS
10:05:19FromDiscord<Yardanico> and about why you need separate arguments - if you have "x, y, x1, x2: SomeNumber" it means that all of those arguments must be of one type that is a part of SomeNumber
10:05:37FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wTU
10:05:45FromDiscord<ondrejoda> no wait
10:05:46FromDiscord<Yardanico> no, that'll be the same as SomeNumber
10:05:55FromDiscord<Yardanico> as my SomeNumber example
10:06:04FromDiscord<ondrejoda> there
10:06:09FromDiscord<ondrejoda> sent a code paste, see https://paste.rs/ZLR
10:06:29FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3wTW
10:06:34FromDiscord<Yardanico> ah wait sorry
10:06:36FromDiscord<Yardanico> that won't work obviously
10:06:50FromDiscord<ondrejoda> yeah, i still get that error
10:06:52FromDiscord<Yardanico> because in the end it's still the same as specifying "x, y, x1, x2: SomeNumber"
10:06:55FromDiscord<Yardanico> because you have only one T
10:07:08FromDiscord<Yardanico> so you must have 4 arguments specifying the type in each
10:07:15FromDiscord<Yardanico> as i said, you might as well just make it a template
10:07:15FromDiscord<ondrejoda> so i need to have [T, T1, T2, T3]?
10:07:17FromDiscord<Yardanico> yes
10:07:29*max22- quit (Remote host closed the connection)
10:07:59FromDiscord<ondrejoda> yeah, that works
10:08:09FromDiscord<ondrejoda> thanks for the help!
10:08:11FromDiscord<Yardanico> you might want to skim over https://nim-lang.org/docs/manual.html#generics for more info about generics
10:08:21*max22- joined #nim
10:17:30FromDiscord<enthus1ast> i'm currently fighting with a webcrawler it seems that std/htmlparser is not capable of parsing this cra\. ↵Is the fusion/htmlparser any different?
10:17:59FromDiscord<Yardanico> I think it does have some differences, but not a lot
10:18:00FromDiscord<enthus1ast> when i diff them they seem quite similar.
10:18:40FromDiscord<enthus1ast> mh yeah
10:18:51FromDiscord<enthus1ast> it think i just regex everyhting then \:/
10:24:07*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
10:44:08*auxym_ joined #nim
10:45:13PMunch@dom96, you around?
10:50:56madpropscan I use block to continue a parent loop?
10:50:59madpropsi have a for inside a for
10:51:11madpropsi want to trigger continue on the parent loop
10:51:23madpropsnot just break the inner loop
10:54:26PMunchYou can use a named block that you can break from the inside loop
10:54:45PMunchIf that block extends to the end of the outer for loop that would essentially be the same as a continue
10:58:05madpropsah cool
11:00:59madpropsI'm trying to add `block exit: discard` at the end
11:01:05madpropsand before that `break exit` but it fails
11:01:23madpropsundeclared identifier
11:03:28PMunchYou have to put your stuff within the block and then you can use `break` to get out of it
11:08:21PMunchmadprops, something like this: https://play.nim-lang.org/#ix=3wUe
11:08:38madpropsyeah, thanks
11:16:31NimEventerNew thread by Kalbhairab: A == b == c format, see https://forum.nim-lang.org/t/8364
11:16:50arkanoidCan macros emit code in specific module without generating nim files?
11:17:53FromDiscord<Rika> You mean macros generating code across another file?
11:17:59FromDiscord<Rika> I’ve never seen such a thing
11:19:57arkanoidlet me explain. I N xml files, each would generate a nim module. If I would put all the generated code into a single module I'd have overlapping proc names. I'd surely append a prefix to proc names, but it'd be nicer using modules
11:20:43FromDiscord<enthus1ast> if you want to save the generated nim ast as a nim file your can just print it into a file
11:22:40*auxym_ quit (Ping timeout: 240 seconds)
11:22:47FromDiscord<Rika> If you put it into separate modules, you would still have overlapping proc names, and it would probably still be annoying to fully qualify your procs
11:22:57FromDiscord<Rika> Can you not make them bound to a type?
11:23:07FromDiscord<Rika> Like perhaps each file is a certain type
11:23:14FromDiscord<Rika> Because it feels like that would work better
11:23:49arkanoidno, the splitting logic is namespace
11:23:53arkanoidnot type
11:24:25arkanoidbut you're right, I'd have overlapping proc anyway in the logic if two modules are imported at same time
11:24:46arkanoidmaybe adding prefix is not so bad
11:26:10*Vladar joined #nim
11:28:38FromDiscord<Rika> I know, but modules are not exactly namespaces
11:29:57arkanoidI should create mock type (empty object) just to differentiate procs? I surely can
11:34:16FromDiscord<Rika> Maybe? You can also, like, use the types for, uh, type stuff
11:34:22FromDiscord<Rika> Unless you don’t need to I guess
11:34:52arkanoidlet's see what feels better
11:50:12PMunchHmm, how do people deal with wrapped libraries and updates?
11:51:24PMunchFor reference I have written a dynamic library in Nim, for this I have created definitions for my C types in Nim. But whenever the library updates there is a chance that they have added a field to an object which then causes my program to segfault or read the wrong data
11:54:08PMunchI tried to set up c2nim to make the bindings automatically, but the sources are too complex for it to handle
11:57:00PMunchHmm, I could set up a test in C that just outputs the sizes and offsets of all the types and fields, and then a similar thing for Nim, and make a diff thing part of my tests
11:57:39arkanoidPMunch: isn't gintro doing something similar?
12:00:09PMunchI don't think so, not exactly sure how gintro works
12:00:27PMunch@StefanSalewski might be able to shed some light on it
12:00:47NimEventerNew thread by Mareklachbc: Does Nim have anything equivalent to Ruby's puts, or Python's print, or Perl's say?, see https://forum.nim-lang.org/t/8365
12:01:50arkanoidI'm not into gtk, but I know gintro reads some xml files to generate nim code, and does that when you install gintro
12:02:23arkanoidxml from libgtk/libgobject, not from gintro
12:06:01*supakeen quit (Quit: WeeChat 3.2)
12:06:29*supakeen joined #nim
12:19:52FromDiscord<MrOkram> When trying to statically compile with "re" library imported it compiles fine but when i try to run it i get "could not load: libpcre.so(.3|.1|)", any recommendations or replacement for that lib ?
12:22:08FromDiscord<Yardanico> Pure-nim regex - https://github.com/nitely/nim-regex
12:22:10nrds<R2D299> itHub: 7"Pure Nim regex engine. Guarantees linear time matching"
12:22:35FromDiscord<Yardanico> https://nitely.github.io/nim-regex/regex.html
12:24:51*jjido joined #nim
12:24:53FromDiscord<MrOkram> Thanks, that did the trick.
12:25:52FromDiscord<Yardanico> also, i'm curious because you said you need to compile your project for routers - what's the project's purpose? of course you don't have to answer if it's a private matter :)
12:27:01FromDiscord<MrOkram> In reply to @Yardanico "also, i'm curious because": I work at an ISP, we needed something that can run on the end router and send periodic updates to some API, it needed to be light and fast and that's where Nim came into play (Also, not really into coding C/C++
12:27:06FromDiscord<MrOkram> (edit) "In reply to @Yardanico "also, i'm curious because": I work at an ISP, we needed something that can run on the end router and send periodic updates to some API, it needed to be light and fast and that's where Nim came into play (Also, not really into coding C/C++ ... " added "\:) )"
12:27:08FromDiscord<Yardanico> oh, nice
12:27:10FromDiscord<Rika> Nice
12:27:18FromDiscord<Yardanico> If you start using it at the company, pls add it to https://github.com/nim-lang/Nim/wiki/Organizations-using-Nim :P
12:27:30FromDiscord<Yardanico> if sharing the company name is fine
12:27:49FromDiscord<MrOkram> I'll talk with my supervisor and see if it's fine with him
12:45:49PMunchHmm, maybe I should try to get the name of the company I work for on that list as well
12:45:53FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wUz
12:46:04FromDiscord<Yardanico> the more the better :)
12:46:18FromDiscord<haxscramper> When I add `--debugger:native` code is magically fixed
12:46:33FromDiscord<Yardanico> well that enables gcc's -g
12:46:56*rockcavera joined #nim
12:46:56*rockcavera quit (Changing host)
12:46:56*rockcavera joined #nim
12:47:15FromDiscord<haxscramper> Do you think this has an effect? I mean I can literally do `echo str.isSlice` and it reports `false`
12:47:23FromDiscord<haxscramper> And on the next line `echo str.str` fails
12:47:27FromDiscord<Yardanico> ah sorry actually -Og
12:47:43FromDiscord<Yardanico> In reply to @haxscramper "And on the next": maybe it's a result of specific optimizations being enabled/disabled with -Og ?
12:47:47FromDiscord<Yardanico> in gcc
12:47:49FromDiscord<Yardanico> can you try with clang?
12:48:32FromDiscord<haxscramper> alright, clang is working fine without debugger
12:50:53FromDiscord<enthus1ast> While developing nimja I always thought that it would be a nice match for router websites because it's so lightweight and the heavy lifting is done on compile time.↵(@MrOkram)
12:51:01arkanoidhow to unittest macros? I've a macro that generated a proc*, if I run it into a test block I get "Error: 'export' is only allowed at top level"
12:51:21*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
12:51:24FromDiscord<enthus1ast> I've done it with testament
12:51:37FromDiscord<enthus1ast> And matched on the output
12:51:38*def- quit (Quit: -)
12:52:19FromDiscord<haxscramper> also test macro functionality
12:52:53FromDiscord<haxscramper> https://github.com/haxscramper/fusion/blob/matching-fixup/tests/tmatching.nim#L977
12:53:10FromDiscord<enthus1ast> https://github.com/enthus1ast/nimja/blob/master/tests/basic/test_tokens_before_extend_error.nim
12:56:04FromDiscord<Yardanico> searching "httpbeast" in shodan is fun :P
12:56:07FromDiscord<Yardanico> not a lot of results, but still
12:56:09FromDiscord<Yardanico> http://103.107.181.156:5005/
12:56:30FromDiscord<Yardanico> http://159.138.5.194:8000/
12:56:40FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wUC
12:56:47FromDiscord<haxscramper> Idenical (obviously) produced code, but fails with gcc
12:56:57FromDiscord<Yardanico> what's your gcc version?
12:57:07FromDiscord<Yardanico> maybe somehow try a newer one
12:57:08FromDiscord<haxscramper> `gcc version 11.1.0 (GCC)`
12:57:23FromDiscord<Yardanico> it could either be: a bug in clang that it allows this to work, a bug in gcc that it doesn't allow this to work, or some other weird stuff
12:57:26FromDiscord<Yardanico> but nonetheless it's very fun
12:57:30FromDiscord<Yardanico> "fun"
12:57:44PMunch@Yardanico, shodan?
12:57:48FromDiscord<Yardanico> yes
12:57:49FromDiscord<Yardanico> shodan.io
12:57:49FromDiscord<haxscramper> I'm going to try tcc
12:58:06FromDiscord<Yardanico> a service that scans whole IPv4 space for devices and fetches device banners
12:58:23FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/880073619479363604/unknown.png
12:58:53FromDiscord<Yardanico> seems like there are quite a lot of internet-facing chinese web services using httpbeast
12:58:58FromDiscord<Yardanico> i mean out of 16
12:59:18FromDiscord<Yardanico> and i meant hong kong as a part of china (pls no politics :P)
13:00:14FromDiscord<haxscramper> In reply to @haxscramper "I'm going to try": it fails, but also in different place
13:00:18FromDiscord<Yardanico> huh
13:00:43FromDiscord<haxscramper> I'm curious about differences in program control flow due to `!(((1 &((NU8)1<<((NU)((str).isSlice)&7U)))!=0))` code like this
13:01:09FromDiscord<haxscramper> And different "standart compliant C compilers" having varying interpretations of this
13:01:35FromDiscord<Yardanico> you can make a minimized C code version and check it on wandbox.org
13:01:39PMunchHuh, interesting
13:01:39FromDiscord<haxscramper> And no, I don't think I can minimize it
13:01:40FromDiscord<Yardanico> with different C compilers and their versions
13:01:42FromDiscord<haxscramper> Ah, C only
13:01:59FromDiscord<Yardanico> wandbox has GCC from the latest devel version to 1.27
13:02:17FromDiscord<Yardanico> @PMunch yeah, people over the years found a lot of "bad" things here
13:02:22FromDiscord<Yardanico> like exposed mongodb instances
13:02:27FromDiscord<Yardanico> VNC without passwords (you can still find those)
13:02:32FromDiscord<Rika> Lol
13:03:28PMunchYikes
13:03:29FromDiscord<Yardanico> for vnc without password on port 5900 (but that's really for #offtopic ) https://media.discordapp.net/attachments/371759389889003532/880074906300211220/unknown.png
13:03:38FromDiscord<Yardanico> will continue the discussion about it there
13:04:21FromDiscord<enthus1ast> why discord and not matrix?
13:04:25FromDiscord<enthus1ast> Matrix is open
13:04:33FromDiscord<enthus1ast> discord is like the new facebook
13:04:44FromDiscord<Yardanico> isn't the offtopic channel bridged to matrix?
13:05:59FromDiscord<enthus1ast> never seen any traffic there\: https://matrix.to/#/#nim-offtopic:matrix.org
13:06:10FromDiscord<enthus1ast> but idn maybe this is the wrong room
13:06:14FromDiscord<Yardanico> isn't nim's matrix in the different server now
13:06:27FromDiscord<Yardanico> https://matrix.to/#/#nim:envs.net
13:08:38FromDiscord<enthus1ast> it should not make a difference when the servers are federated
13:08:59*def- joined #nim
13:09:14FromDiscord<Yardanico> well, but the channel can only be bridged to a matrix channel on one of the servers
13:09:40FromDiscord<haxscramper> In reply to @Yardanico "you can make a": ``c
13:09:47*arkurious joined #nim
13:09:50FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wUK
13:09:53FromDiscord<haxscramper> and of course it does not fail, who could've guessed
13:10:24FromDiscord<Yardanico> it gives me different results with gcc
13:10:35FromDiscord<Yardanico> 0 without any compiler flags and 235 (return code I guess? or something) with -Og
13:11:06FromDiscord<haxscramper> I don't `return` from main explicitly, so
13:11:27FromDiscord<Yardanico> ah right, it's just a random return value
13:15:50*jjido joined #nim
13:28:23*stkrdknmibalz joined #nim
13:29:52*stkrdknmibalz quit (Client Quit)
13:36:55FromDiscord<Yardanico> https://news.ycombinator.com/item?id=28293836
13:37:01FromDiscord<Yardanico> "I am the Nelua author, and I've used Nim for a reasonable amount of time before creating Nelua, thus Nim served as one of the inspirations for the project and they share similarities. But while Nim resembles Python, Nelua resembles Lua. Also when comparing both, Nelua tries to be more minimal and generate more readable and compact C code."
13:37:08FromDiscord<Yardanico> Nim mentioned a few times in the comments regarding the GC
13:51:46FromDiscord<lamersc.com 🐧> In reply to @Yardanico ""I am the Nelua": Gave me a good chuckle this morning
14:04:18FromDiscord<haxscramper> If it compiled to lua it could be used instead of it
14:06:15*PMunch quit (Quit: Leaving)
14:18:25FromDiscord<lamersc.com 🐧> Why would they reinvent the wheel when there’s already languages targeting low level sectors of lua, such as https://terralang.org
14:21:26FromDiscord<Rika> another comment said this
14:21:27FromDiscord<Rika> "Telling a programmer there's already a library to do X is like telling a songwriter there's already a song about love." - Pete Cordell
14:29:30FromDiscord<tandy> i tried that
14:30:43FromDiscord<tandy> but its hard to know whether its actually working
14:30:58FromDiscord<lamersc.com 🐧> In reply to @Rika ""Telling a programmer there's": Yeah you bring a good point
14:30:59FromDiscord<tandy> because the json should be fixed
14:31:10FromDiscord<Rika> i am merely the messenger
14:40:14FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3wVb
15:00:14*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
15:01:25NimEventerNew post on r/nim by binaryfor: An alternative Twitter front-end written in Nim, see https://reddit.com/r/nim/comments/pbczm8/an_alternative_twitter_frontend_written_in_nim/
15:01:40FromDiscord<Yardanico> well, we do know about nitter already :)
15:02:00FromDiscord<Yardanico> and the link is borked
15:03:10FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/880105025878241380/unknown.png
15:03:19FromDiscord<Yardanico> my bot is too fast for those people :P
15:03:25FromDiscord<Yardanico> it doesn't give them any time to delete or edit
15:03:26NimEventerNew post on r/nim by prefixcoder: How does standard `set` work?, see https://reddit.com/r/nim/comments/pbd24a/how_does_standard_set_work/
15:03:36FromDiscord<Yardanico> wow that is a nice coincidence
15:03:47FromDiscord<Yardanico> two reddit posts in a short amount of time
15:04:20FromDiscord<Recruit_main707> too mainstream, time to search for another language
15:06:11FromDiscord<xflywind> In reply to @Yardanico "well, we do know": I guess it is posted because nitter was on hackernews front page before.
15:06:34FromDiscord<xflywind> 19 hours ago
15:06:36FromDiscord<Yardanico> ah right seems like someone reposted it on HN again 19 hours ago
15:06:53FromDiscord<Ayy Lmao> Does anyone have any advice on how you would structure a gui library in nim? I'm looking for ideas.
15:21:41*krux02 joined #nim
15:23:29krux02leoriz
15:23:55krux02sorry, accidental send, can't delete here on IRC
15:25:26*max22- quit (Quit: Leaving)
15:27:08*jjido joined #nim
15:28:08FromDiscord<tandy> is there a function for parsing bools from a string?
15:28:13FromDiscord<tandy> like "true" = 1?
15:28:21FromDiscord<tandy> im trying to write a jsony parsehook
15:30:06FromDiscord<tandy> https://nim-lang.org/docs/strutils.html#parseBool%2Cstring
15:30:09FromDiscord<tandy> yee
15:36:43FromDiscord<aep> hi i'm wondering if nim might be useful for microcontrollers, where we only have C. Is compiling to C merely a temporary measure or is this its final form? the website only mentions x86
15:39:24FromDiscord<Rika> nim has been compiling to C for a long time already, im pretty sure it is its final form
15:39:47FromDiscord<Rika> extra backends are being proposed but i dont think that would usurp C
15:39:54FromDiscord<Rika> (edit) "extra backends are being proposed but i dont think that would usurp ... Cbackend" added "the" | "theC ... " added "backend"
15:40:01FromDiscord<xflywind> You can find many posts on Nim forum https://forum.nim-lang.org/t/7731
15:41:07FromDiscord<xflywind> https://forum.nim-lang.org/t/7636
16:23:53NimEventerNew thread by Mareklachbc: What's Nim's equivalent of Python's append() method for lists?, see https://forum.nim-lang.org/t/8366
16:33:31FromDiscord<dankrad> I've encountered that this issue https://github.com/nim-lang/Nim/issues/15452 is also on arch linux, but it's closed. ↵Do I need to wait before someone reopened it, or can I create a pr nevertheless.
16:52:42*auxym_ joined #nim
17:06:02NimEventerNew post on r/nim by Ether-naut: Sequence allocations, see https://reddit.com/r/nim/comments/pbfiud/sequence_allocations/
17:08:21arkanoidcould you give me an example on how can I unittest macros?
17:10:26*dmu joined #nim
17:16:04*auxym_ quit (Quit: Konversation terminated!)
17:16:20*auxym_ joined #nim
17:26:39FromDiscord<konsumlamm> that heavily depends on the macro
17:32:42arkanoidkonsumlamm, macro that returns a procDef
17:34:04FromDiscord<konsumlamm> then test the generated proc?
17:35:54*auxym_ quit (Ping timeout: 250 seconds)
17:38:39arkanoidkonsumlamm, if the the proc is exported, so it fails to be generated within the test block
17:40:06FromDiscord<haxscramper> Then put things on the toplevel?
17:40:07FromDiscord<haxscramper> Or make `doExport: static[bool] = true` argument in macro
17:47:37arkanoidok, got it, gonna take the long road :D
17:49:22arkanoidI have question. I'm using proc readFile to read file contents at compile time. It works, but if it raises exception it doesn't get catched and compilation fails
17:49:39arkanoidI though exceptions were suppoted at compile time
17:51:23FromDiscord<haxscramper> exceptions are supported at compile time
17:51:24FromDiscord<haxscramper> But if exception leaves macro body it is turned into compilation errors
17:53:59FromDiscord<Neko~Neko~ni> i am facing a problem and i think its linux specific(atleast it was with python),↵lets say i am running an infinite loop and taking input from user to do specific things like cmd,in cmd or↵terminal when you press the Up key,that returns the previous command BUT that does not happen when i use the Up key. it just shows me garbled characters(`^[[A`).in python i would import the famous linux specific module called readline to resolv
17:54:08arkanoidit doesn't leave macro body, is a straight try: parseXml(path.readFile) except: ...
17:54:34*auxym_ joined #nim
17:57:05FromDiscord<haxscramper> and what `parseXml` is?
17:57:37arkanoidis in std/xmltree
17:58:26arkanoidargument calculated before it, am I wrong?
17:58:57FromDiscord<haxscramper> I mean, exceptions won't be transferred from compile-time to runtime if that's what you are implying
17:59:39arkanoidno, I just have a chain of try: .. except: try: ... except: ... in a single static: proc
18:00:12FromDiscord<Rika> In reply to @Neko~Neko~ni "i am facing a": the up key does not return "previous command". it is a feature of the shell (bash, fish, zsh)
18:01:01FromDiscord<Rika> the "garbled characters" is the characters that are actually sent by the terminal, the shell just interprets it as "last entry in history"
18:01:13FromDiscord<Rika> (edit) "is" => "are"
18:01:13arkanoidhaxscramper, here https://play.nim-lang.org/#ix=3wWw
18:01:31FromDiscord<Rika> there is a linenoise implementation in nim
18:01:39FromDiscord<Rika> https://nim-lang.org/docs/linenoise.html
18:01:45FromDiscord<Rika> implementation -> wrapper
18:01:52FromDiscord<Rika> but there are also implementations
18:02:27FromDiscord<haxscramper> That runs at compile-time?↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
18:02:40FromDiscord<haxscramper> s/parseXml/findXml/
18:02:43FromDiscord<haxscramper> sent a code paste, see https://paste.rs/sT2
18:04:14FromDiscord<Neko~Neko~ni> In reply to @Rika "the "garbled characters" are": i see,didn't knew about that,thanks alot
18:04:30arkanoidhaxscramper, no, I call the findXml proc from a static: block
18:05:08arkanoidit works if it doesn't raise the exception (if it get the paths right on first shot)
18:05:10FromDiscord<Rika> @Neko~Neko~ni https://nim-lang.org/docs/linenoise.html
18:05:20FromDiscord<haxscramper> `static:` runs at compile-time
18:05:48FromDiscord<Rika> the garbled characters are called "terminal escape codes" i believe
18:05:56arkanoidexactly (am I misinterpreting your question?)
18:05:57FromDiscord<Rika> this is the reference i usually use https://www.csie.ntu.edu.tw/~r92094/c++/VT100.html
18:07:40FromDiscord<haxscramper> I don't understand the question then. You raise something in `static:` block, and don't handle it in the same static block, so things propagage upwards and turn into compilation error. Once the exception leaves the static block and turns into error, there is no way to catch it↵(<@709044657232936960_arkanoid=5b=49=52=43=5d>)
18:07:47FromDiscord<Neko~Neko~ni> In reply to @Rika "the garbled characters are": Been usin linux for a long time but didn't knew that it was a feature of shell.this isn't a problem in windows.i think this feature is already present in windows command-interpreter.
18:07:58FromDiscord<haxscramper> `static: assert arg is string` etc.
18:08:02FromDiscord<Rika> windows is, uh, different
18:08:08FromDiscord<Rika> and i am completely unfamiliar
18:08:13FromDiscord<Rika> so you will need to figure that out
18:08:25FromDiscord<haxscramper> Like, you need to run something at compile-time and then unittest it?
18:08:49FromDiscord<Neko~Neko~ni> i see,thanks anyway!
18:09:03FromDiscord<haxscramper> The original question was "It works, but if it raises exception it doesn't get catched and compilation fails. I though exceptions were suppoted at compile time" so I assumed you somehow want to catch/test the exception
18:09:20arkanoidhaxscramper, no, you can see here that findXml proc has 3 nested try/except. If first one raises, it doesn't get to the second if findXml is called from a static block
18:09:24arkanoidhttps://play.nim-lang.org/#ix=3wWw
18:10:21FromDiscord<Neko~Neko~ni> one question more,is there an HTTP library like pythons requests,httpx?
18:10:28FromDiscord<Rika> httpclient
18:10:30FromDiscord<Neko~Neko~ni> in nim.
18:10:33FromDiscord<Rika> https://nim-lang.org/docs/httpclient.html
18:10:43arkanoidthe logic is quite simple: try to load from compilation dir, if fails try load from cache dir, otherwise download it. While I don't expect it to reach the third option, it doesn't even get to the second
18:10:48FromDiscord<Rika> literally called httpclient
18:11:04arkanoidif I remove the first option it works
18:14:40FromDiscord<haxscramper> Can you make a reproducible example? It is possible you hit a bug, because nested exceptions work perfectly fine https://wandbox.org/permlink/wMeEVSBEVpvUfjo0
18:15:15FromDiscord<haxscramper> Also, does httpclient even work at compile-time? `newHttpClient(timeout = 10000).getContent(schemaLocation)`
18:16:23FromDiscord<haxscramper> And xml as well, IIRC it uses streams module
18:16:34arkanoidhaxscramper, don't know, I was curious, but I spotted this problem before even reaching it. It's not required to trigger it. Let me reduce it
18:16:39arkanoidno, xml works at compile time
18:16:49arkanoidI've been using it a lot
18:17:09arkanoidtalking about xmlparser, xmltree and strtabs
18:22:30arkanoidhaxscramper, here's a minimal version https://play.nim-lang.org/#ix=3wWE
18:22:39arkanoidno xml, no httpclient, not even an import
18:23:30arkanoidnot sure if it is worth posting, I fear the answer would be "you should use staticRead"
18:23:51arkanoidbut this doesn't explain the broken exception handling
18:25:02arkanoidwhat do you suggest?
18:25:45FromDiscord<haxscramper> Start with minimized example a
18:28:28arkanoidhaxscramper, I've already produced it https://play.nim-lang.org/#ix=3wWE
18:31:22arkanoidI'll post on the forum
18:31:43FromDiscord<haxscramper> I guess it is a bug then, because ten nested try-catch work ok https://wandbox.org/permlink/vDjDg5vVLYK9iQnl
18:31:46FromDiscord<haxscramper> but readFile fails
18:31:51FromDiscord<haxscramper> and `staticRead` also fails
18:32:01FromDiscord<haxscramper> But `staticRead` at least has correct stactrace
18:34:16NimEventerNew thread by Giaco: Using readFile at compile time break exceptions, see https://forum.nim-lang.org/t/8367
18:35:14arkanoidmay I post your wandbox link in forum thread?
18:36:21FromDiscord<haxscramper> yes, of course
18:38:18arkanoidthanks
18:38:50arkanoidhave to go now, let's wait for more feedback. Thanks for the help
18:41:52*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
18:54:11FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wWP
18:54:11FromDiscord<ondrejoda> how can i fix this?
19:00:12FromDiscord<Yardanico> uint8 is not int
19:00:20FromDiscord<Yardanico> as it says "ptr int" you need var val: int
19:00:25FromDiscord<Yardanico> and then pass it with addr
19:00:43FromDiscord<ondrejoda> gives me
19:00:46FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wWW
19:00:56FromDiscord<ondrejoda> `/home/ondrejoda/Nim/Zimmer/engine.nim(35, 28) Error: type mismatch: got <ptr array[0..512, uint8]> but expected 'int'`
19:01:15FromDiscord<ondrejoda> (edit) "https://play.nim-lang.org/#ix=3wWW" => "https://play.nim-lang.org/#ix=3wWX"
19:01:18FromDiscord<Yardanico> you're assigning to keyboard
19:01:29FromDiscord<Yardanico> getKeyboardState returns a pointer to an array
19:01:35FromDiscord<Yardanico> you can't assign it to keyboard itself
19:02:30FromDiscord<ondrejoda> got it
19:02:37FromDiscord<ondrejoda> thanks!
19:17:20FromDiscord<tandy> is it possible to store a large string as a hash in nim?
19:17:27FromDiscord<tandy> so i dont have to have a huge string in my test?
19:20:36FromDiscord<Yardanico> uh, what do you mean by that?
19:21:04FromDiscord<Yardanico> if your testing only needs a string's hash, then you can use the hash
19:21:09FromDiscord<Yardanico> but otherwise you need to have the string itself
19:21:43FromDiscord<tandy> well its json↵(@Yardanico)
19:21:50FromDiscord<Yardanico> well what exactly are you testing
19:21:59FromDiscord<tandy> i guess i could get away with calculating hashes
19:22:01FromDiscord<Yardanico> if you need the original string for the test, then you obviously can't remove it
19:22:39FromDiscord<tandy> i want to make sure jsony is working so converting json to object, then object to json↵(@Yardanico)
19:22:53FromDiscord<Yardanico> well why don't you want to have the original string in the test?
19:23:01FromDiscord<tandy> just cos its so big
19:23:04FromDiscord<Yardanico> if you don't want to store it in the .nim file itself you can just put it to a different file
19:23:06FromDiscord<Yardanico> how big?
19:23:09FromDiscord<tandy> true
19:23:15FromDiscord<tandy> just like 50 lines or so lol
19:23:21FromDiscord<Yardanico> well, I mean file size
19:23:30FromDiscord<tandy> hmm
19:23:32FromDiscord<Yardanico> 50 lines is small :)
19:23:41FromDiscord<Yardanico> unless each line has like 5k characters
19:24:00FromDiscord<tandy> 500 bytes lol
19:24:06FromDiscord<Rika> small
19:24:08FromDiscord<lamersc.com 🐧> Waiting for the day we get a system programming dialect of html 👀
19:24:12FromDiscord<Yardanico> ?
19:24:17FromDiscord<Yardanico> use karax server-side rendering
19:24:34FromDiscord<lamersc.com 🐧> It was a joke :P
19:24:40FromDiscord<Yardanico> about wat? 🤔
19:24:55FromDiscord<lamersc.com 🐧> System programming html
19:25:01FromDiscord<lamersc.com 🐧> (edit) "System" => "Systems"
19:26:01FromDiscord<Yardanico> html is not a programming language
19:27:15FromDiscord<Recruit_main707> i guess thats the joke
19:28:01FromDiscord<Yardanico> a joke has to be at least a bit funny :/
19:28:31FromDiscord<lamersc.com 🐧> Jokes are subjective, no need to hurt my feelings 🥲
19:34:34NimEventerNew thread by Stefan_Salewski: String expression parsing, see https://forum.nim-lang.org/t/8368
19:43:11*PMunch joined #nim
19:43:30FromDiscord<ondrejoda> i have another question to the people that know how to use the sdl2 wrapper
19:43:48FromDiscord<ondrejoda> how do you use sdl scancodes in nim?
19:44:27FromDiscord<ondrejoda> because i can't seem to use the result from `getKeyboardState()` and a scancode in an if statement like i could in c++
19:44:36FromDiscord<ondrejoda> so how do i compare these in nim?
19:47:44PMunchWhy aren't you able to use it?
19:47:55FromDiscord<ondrejoda> `/home/ondrejoda/Nim/Zimmer/main.nim(17, 24) Error: type mismatch: got <int, Scancode>`
19:48:02FromDiscord<ondrejoda> (edit) "`/home/ondrejoda/Nim/Zimmer/main.nim(17," => "`/main.nim(17,"
19:48:20FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wXc
19:48:57PMunchHave you read the documentation for getKeyboardState?
19:49:17FromDiscord<ondrejoda> yes, i have actually used it like this in c++
19:49:18PMunchIt returns a pointer to an array indexed by scancodes
19:49:29FromDiscord<ondrejoda> oh wait
19:49:33FromDiscord<ondrejoda> i know what's wrong
19:49:36FromDiscord<ondrejoda> 🤦‍♂️
19:50:06FromDiscord<ondrejoda> no wait that still gives me an error
19:50:56PMunchSomething like this: https://play.nim-lang.org/#ix=3wXd
19:52:42FromDiscord<ondrejoda> that gives me a `/main.nim(17, 24) Error: type mismatch: got <int, typeof(nil)>`
19:52:55PMunchIt's pretty well explained in the docs: https://github.com/Vladar4/sdl2_nim/blob/master/sdl2/private/keyboard.nim#L46-L58
19:53:23PMunchPlease share a code snippet, that makes it way easier to see what you're doing wrong
19:53:54FromDiscord<ondrejoda> ok gimme a sec
19:56:59FromDiscord<ondrejoda> sent a code paste, see https://play.nim-lang.org/#ix=3wXf
19:57:09FromDiscord<ondrejoda> here
19:58:49FromDiscord<ondrejoda> i can't really share all of the code because it's all part of a game engine
19:59:06FromDiscord<ondrejoda> so if i shared all of it i would fill up this whole chat room :D
20:00:25FromDiscord<ondrejoda> the error is `/home/ondrejoda/Nim/Zimmer/main.nim(17, 23) Error: type mismatch: got <array[0..512, uint8], Scancode>`
20:00:35FromDiscord<ondrejoda> (edit) "`/home/ondrejoda/Nim/Zimmer/main.nim(17," => "`/main.nim(17,"
20:01:26FromDiscord<Rika> need to change scancode to int i assume
20:01:41FromDiscord<ondrejoda> `.toInt` doesn't work
20:01:45FromDiscord<Rika> `.int`
20:01:59PMunchHmm, let me guess, you don't use the wrapper that I linked to?
20:02:08FromDiscord<ondrejoda> In reply to @PMunch "Hmm, let me guess,": i don
20:02:11FromDiscord<ondrejoda> t
20:02:13FromDiscord<ondrejoda> yeah
20:02:18FromDiscord<ondrejoda> In reply to @Rika "`.int`": that did work!
20:02:27PMunchBut yeah, .int should work for you then
20:12:28*auxym_ quit (Ping timeout: 252 seconds)
20:24:19FromDiscord<⃟⃟> can be used for msdos?
20:38:54*jjido joined #nim
20:54:55*auxym_ joined #nim
20:59:15*krux02 quit (Ping timeout: 250 seconds)
21:15:29FromDiscord<treeform> In reply to @tandy "i want to make": Let me know if you run into any issues with that. I have tests for this in jsony, but more tests always help.
21:16:51FromDiscord<exelotl> is it normal that you can't do `proc main() {.tags: [].} = ...`
21:17:05FromDiscord<exelotl> I have to do `proc main() {.tags: [RootEffect].} = ...` instead
21:19:35FromDiscord<dom96> certainly doesn't seem normal
21:24:24FromDiscord<exelotl> is there a way to tell where the effect came from?
21:24:40*flynn quit (Ping timeout: 240 seconds)
21:25:08*auxym_ quit (Ping timeout: 250 seconds)
21:27:04*flynn joined #nim
21:29:48*Gustavo6046 joined #nim
21:29:54Gustavo6046is a concept akin to a trait in rust?
21:31:07FromDiscord<Elegantbeef> Concepts are type classes defined by what they fulfill instead of their name
21:32:21FromDiscord<dain> like duck typing?
21:32:40FromDiscord<Elegantbeef> User defined duck typing yes
21:32:51FromDiscord<Elegantbeef> It's the easiest way to explain it infact
21:33:43FromDiscord<Elegantbeef> To show a practical example https://forum.nim-lang.org/t/8328#53675
21:52:19FromDiscord<⃟⃟> has anyone made a nim application for msdos
21:59:37*def- quit (Quit: -)
21:59:50*def- joined #nim
22:00:49FromDiscord<Ayy Lmao> Are concepts basically just meant to give more helpful error messages than generics, or are there more benefits?
22:04:49FromDiscord<Recruit_main707> any funtion to reverse a sequence in the stdlb?
22:07:42*PMunch quit (Quit: leaving)
22:14:18FromDiscord<Recruit_main707> found the algorithm module
22:20:01FromDiscord<retkid> > /usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld: unrecognized option '-z'↵> /usr/lib/gcc/x86_64-w64-mingw32/11.2.0/../../../../x86_64-w64-mingw32/bin/ld: use the --help option for usage information↵> collect2: error: ld returned 1 exit status
22:20:13FromDiscord<retkid> i have no clue how to fix this
22:20:19FromDiscord<retkid> i've updated my system
22:20:23FromDiscord<retkid> (edit) "i've updated my system ... " added "and uh"
22:20:24FromDiscord<retkid> dunno
22:20:55FromDiscord<retkid> google not very usefulk
22:20:56FromDiscord<retkid> (edit) "usefulk" => "useful"
22:21:22FromDiscord<Gustavo6046> In reply to @Gustavo6046 "I'll take a deeper": Back! Did anyone figure it out?
22:22:05FromDiscord<retkid> alright maybe compiling through wine will be easier
22:22:08FromDiscord<Gustavo6046> In reply to @Elegantbeef "Concepts are type classes": Ahh, I see, like Python's typing.Protocol
22:22:14FromDiscord<Gustavo6046> or kiinda sorta like a Rust trait
22:22:28FromDiscord<retkid> Nim is kinda a mix of a lot of language
22:22:29FromDiscord<retkid> (edit) "language" => "languages"
22:22:33FromDiscord<Gustavo6046> In reply to @⃟⃟ "has anyone made a": That would be fun
22:22:38FromDiscord<retkid> i see some rust, then i see some kotlin, and then i see some jva
22:22:40FromDiscord<retkid> (edit) "jva" => "java"
22:22:53FromDiscord<retkid> python, even bash stuff
22:23:17FromDiscord<retkid> obviously strong C and C++\
22:23:21FromDiscord<retkid> (edit) "C++\" => "C++"
22:23:26FromDiscord<retkid> we even got inline asm
22:23:38FromDiscord<tandy> can you index a seq like \`exampleSeq[1\:]\` to get items after index 1?
22:23:57FromDiscord<treeform> In reply to @tandy "can you index a": `exampleSeq[1..^1]`
22:24:26FromDiscord<retkid> hey treeform do you have a guide to install nim underwine
22:24:29FromDiscord<retkid> (edit) "underwine" => "unde rwine"
22:24:37FromDiscord<retkid> (edit) "unde rwine" => "under wine"
22:27:37FromDiscord<Gustavo6046> the issue happens in both stable and devel
22:28:06*def- quit (Quit: -)
22:28:16*def- joined #nim
22:28:25FromDiscord<Gustavo6046> can i use choosenim/nimble to build nim from source (without manually git cloning and such) and apply optimizations like `-O2 -march=native -Xclang -load -Xclang LLVMPolly.so -mllvm -polly7`?
22:30:53FromDiscord<Gustavo6046> In reply to @Gustavo6046 "the issue happens in": http://ix.io/3wXV
22:38:32FromDiscord<dom96> no, you can't
22:39:42FromDiscord<Gustavo6046> oh
22:39:54FromDiscord<Gustavo6046> also i typoed the last arg
22:41:19*mjsir911 quit (Remote host closed the connection)
22:41:37*mjsir911 joined #nim
22:47:47FromDiscord<RattleyCooper> Anybody have experience using the `triggerTypingIndicator` proc from `dimscord`?
22:49:42FromDiscord<RattleyCooper> I'm running into an issue with an `OSError` that is hard to reproduce, but it seems to always happen after a call to `triggerTypingIndicator`. What is the difference between a `Future` and an `owned(Future)`?
22:49:45*Vladar quit (Remote host closed the connection)
22:53:37FromDiscord<RattleyCooper> The `OSError` is `the network connection was aborted by the local system`
22:53:54FromDiscord<5271> can i run a terminal command in nim?
22:54:12FromDiscord<5271> like system("mkdir test") or smth like that
22:54:26FromDiscord<RattleyCooper> In reply to @5271 "can i run a": Check `osproc`
22:54:38FromDiscord<5271> okay
22:54:57*jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…)
22:55:25FromDiscord<RattleyCooper> If you need to read the output check out `execCmdEx`. If running on windows, you may need to prepend `cmd /c` to run the command in it's own `cmd.exe`
22:56:05FromDiscord<RattleyCooper> Depending on the command. Certain commands are not binaries(or something like that) and it seems like nothing in `osproc` can run these commands
22:56:41FromDiscord<RattleyCooper> (edit) "Depending on the command. Certain commands are not binaries(or something like that) and it seems like nothing in `osproc` can ... run(and" added "actually" | "actuallyrun these commands ... " added "(and if they can it's not obvioius in the docs)"
23:27:31FromDiscord<Gustavo6046> if the AUR has -git packages for nim and nimble
23:27:38FromDiscord<Gustavo6046> and also one for choosenim, but those are incompatible
23:27:39FromDiscord<Gustavo6046> which should I pick?
23:27:55FromDiscord<Gustavo6046> I already built nim{,ble}-git (optimized) but it might be a worse idea
23:28:03FromDiscord<Gustavo6046> I dunno I didn't think it through and I want you to do it for me because I'm big dumb
23:31:11*auxym_ joined #nim
23:31:59FromDiscord<Gustavo6046> "function definition not found"? zsh, wut?
23:35:19FromDiscord<Gustavo6046> As for Nim itself, is there no uint / uint? Only int / uint?
23:38:40*krux02 joined #nim
23:52:34FromDiscord<Gustavo6046> Aaaa
23:52:43FromDiscord<Gustavo6046> I have an object definition with arrays whose size is static at runtime but not at compile time
23:52:54FromDiscord<Gustavo6046> I don't want to use generics because that screws up with the compiler
23:53:03FromDiscord<Gustavo6046> I don't want to use a predefined constant because that's lame and potentially inflexible
23:54:10FromDiscord<Gustavo6046> (I don't want to use an array of structs either, SoA > AoS)
23:54:44FromDiscord<Gustavo6046> but I can't assign an array to an openarray variable type when constructing this object
23:58:27FromDiscord<InventorMatt> you could possibly generate it in a macro then