00:04:20FromDiscord<Rika> huh... nim is generating weird js? https://media.discordapp.net/attachments/371759389889003532/813561843913326642/unknown.png
00:04:45FromDiscord<Rika> length is readonly
00:05:00Prestigewhat data type?
00:05:29FromDiscord<Rika> im checking
00:05:41FromDiscord<Rika> supposedly string
00:05:58Prestigehm I mean it won't throw an error in js but it won't do anything
00:07:14FromDiscord<Rika> `Uncaught (in promise) TypeError: setting getter-only property "length"`
00:07:17FromDiscord<Rika> mhm
00:07:36Prestigehttps://i.imgur.com/VnGu3vs.png works in node at least
00:08:14FromDiscord<Rika> i have use strict (and cannot change it)
00:08:26FromDiscord<Rika> https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Errors/Getter_only says only on use strict
00:08:40FromDiscord<Rika> cant do anything about removing use strict or so though
00:09:15PrestigeYeah, it's incorrect either way. Seems to just be incorrect js output I guess
00:09:50FromDiscord<Rika> imma look at the issues and see if its there
00:10:12FromDiscord<Rika> oh wow none
00:47:18*vicfred quit (Quit: Leaving)
00:56:26*lritter quit (Quit: Leaving)
01:02:47FromDiscord<ElegantBeef> Any suggestions on how i can get around this shitty array impl? 😄 https://github.com/beef331/constructor/blob/master/src/constructor/variants.nim#L132
01:04:33FromDiscord<Rika> git gud
01:05:06FromDiscord<Rika> more seriously, i got no damn clue whatcha doing at a glance
01:06:16FromDiscord<ElegantBeef> If you scroll down to the very bottom you can see the usage of it, basically just makes an array of lambda's so you can call the proc on the variant object and it'll call the correct one
01:07:21FromDiscord<ElegantBeef> Instead of case statements, it just uses a LUT, which is kinda silly
01:07:57FromDiscord<ElegantBeef> I suppose i might be able to use a table to store all the impls for each kind then just call a `impl(object, proc)`
01:25:42*Tanger joined #nim
01:43:19*abm quit (Read error: Connection reset by peer)
01:49:26*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
01:49:46*njoseph joined #nim
02:03:48*Jjp137 quit (Ping timeout: 260 seconds)
02:11:02*NimBot joined #nim
02:42:05*asdflkj_ quit (Ping timeout: 240 seconds)
02:48:21*Jjp137 joined #nim
03:34:26*muffindrake quit (Ping timeout: 240 seconds)
03:36:20*muffindrake joined #nim
04:00:50*blueberrypie quit (Quit: leaving)
04:01:54*blueberrypie joined #nim
04:07:55FromDiscord<Seedofarson> bro
04:08:01FromDiscord<Seedofarson> the nim discord libarys
04:08:02FromDiscord<Seedofarson> dont work for me
04:08:10FromDiscord<Seedofarson> thats a fat L
04:11:38*vicfred joined #nim
04:16:44FromDiscord<Yardanico> @Seedofarson did you try dimscord?
04:16:52FromDiscord<Yardanico> And what do you mean by "don't work"?
04:18:28FromDiscord<ElegantBeef> I've used dimscord and made a small wrapper on it worked fine for me
04:19:23FromDiscord<Seedofarson> ugh
04:19:41FromDiscord<Seedofarson> "Undeclared Identifier: 'MZ'"
04:19:50FromDiscord<Yardanico> can you show the full error?
04:19:58FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qs9
04:20:07FromDiscord<Yardanico> you are trying to compile an exe file
04:20:13FromDiscord<Seedofarson> (edit) "https://play.nim-lang.org/#ix=2Qs9" => "https://play.nim-lang.org/#ix=2Qsa"
04:20:29FromDiscord<Yardanico> instead of the .nim source file
04:20:31FromDiscord<Seedofarson> im a fucking moron
04:20:31FromDiscord<Seedofarson> (edit) "moron" => "moron."
04:20:40FromDiscord<Seedofarson> lmao
04:21:30FromDiscord<Seedofarson> https://media.discordapp.net/attachments/371759389889003532/813626565166366770/message.txt
04:22:06FromDiscord<Seedofarson> is
04:22:09FromDiscord<Seedofarson> the short version
04:22:09FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qsb
04:22:16FromDiscord<Yardanico> Well isn't that error obvious
04:22:22FromDiscord<Yardanico> Your credentials are wrong
04:22:24FromDiscord<Seedofarson> discord token
04:22:25FromDiscord<Seedofarson> yeah
04:22:26FromDiscord<Seedofarson> but
04:22:32FromDiscord<Seedofarson> (edit) "discord" => "bot"
04:23:56FromDiscord<Yardanico> Also you might want to ask in the Dimscord server to get more specific help
04:23:57FromDiscord<Yardanico> https://discord.gg/bw4mHUV
04:29:04FromDiscord<Seedofarson> agh
04:34:38*spiderstew_ joined #nim
04:36:02*spiderstew quit (Ping timeout: 260 seconds)
04:53:04*rockcavera quit (Remote host closed the connection)
04:55:14FromDiscord<Seedofarson> hmm
04:55:25FromDiscord<Seedofarson> in nim
04:55:31FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qsg
04:55:38FromDiscord<Seedofarson> (edit)
05:04:44FromDiscord<Seedofarson> this is what I have
05:04:45FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qsl
05:04:47FromDiscord<Seedofarson> its not working
05:04:58FromDiscord<Seedofarson> im tryna learn more with functions haha
05:04:59FromDiscord<Seedofarson> (edit) "https://play.nim-lang.org/#ix=2Qsl" => "https://play.nim-lang.org/#ix=2Qsm"
05:05:06FromDiscord<Yardanico> https://nim-lang.org/docs/tut1.html#advanced-types-slices
05:06:46FromDiscord<Seedofarson> like that?
05:06:46FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qsn
05:06:51FromDiscord<Hi02Hi> so if you want to return the string you need `:string` at the end of the proc definition
05:07:32FromDiscord<Yardanico> Well all of that is covered in https://nim-lang.org/docs/tut1.html#procedures
05:07:51FromDiscord<Hi02Hi> also i dont see you modifying the start and the endstring vars, so i would change them to immutable vars with `let` instead of `var`
05:09:55FromDiscord<Seedofarson> haha
05:09:58FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2Qso
05:10:02FromDiscord<Seedofarson> this is my final function!
05:10:19FromDiscord<Seedofarson> (edit) "https://play.nim-lang.org/#ix=2Qso" => "https://play.nim-lang.org/#ix=2Qsq"
05:14:09FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Qsr
05:15:22FromDiscord<Seedofarson> Oh
05:15:23FromDiscord<Seedofarson> Okay
05:15:28FromDiscord<sh_oe> might be a dumb question, does nim allow you to store the address or a reference to a procedure in anyway?
05:15:40FromDiscord<Yardanico> @sh_oe wdym "store the address"?
05:15:45FromDiscord<sh_oe> like c
05:15:50FromDiscord<Yardanico> @Seedofarson You might want to give https://narimiran.github.io/nim-basics/ a read
05:15:52FromDiscord<Hi02Hi> pointer?
05:16:02FromDiscord<sh_oe> yeah a pointer to a procedure
05:16:16FromDiscord<Yardanico> `var a = myproc # a reference to myproc`
05:16:21FromDiscord<ElegantBeef> Yea it's a first class feature
05:16:23FromDiscord<sh_oe> oh really
05:16:30FromDiscord<sh_oe> well it was a dumb question then lol
05:16:32FromDiscord<sh_oe> thank you
05:16:39FromDiscord<Yardanico> you can pass procs just like normal variables, yes
05:17:13FromDiscord<sh_oe> ok just comming from c and its late (excuses excuses) thanks guys ya'll are great and i think i will read that basics page again
05:17:22FromDiscord<ElegantBeef> Have fun
05:17:26FromDiscord<Seedofarson> Will do
05:17:29FromDiscord<Seedofarson> Although
05:17:32FromDiscord<Seedofarson> In the past
05:20:36*kitech1- quit (Quit: ZNC 1.7.5 - https://znc.in)
05:20:55*kitech1 joined #nim
05:33:28*vicfred quit (Quit: Leaving)
05:38:32*njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
05:38:39*njoseph joined #nim
05:45:17FromDiscord<arun> Blogged about recent improvements in py2many today:↵↵https://adsharma.github.io/py2many/
05:46:01FromDiscord<arun> I'm not super familiar with nim. Is this the recommended way to do enums?↵↵https://github.com/adsharma/py2many/blob/main/tests/expected/int_enum.nim
05:47:00FromDiscord<Yardanico> well of course, that's why it's the `enum` keyword :) although enums with holes have some limitations
05:48:47FromDiscord<arun> Good to know! It was non trivial to do so in golang, which doesn't have the `enum` keyword 🙂↵↵What type of limitations?
05:49:04FromDiscord<arun> int_enum.go in the url above..
05:52:11FromDiscord<Yardanico> for some info you can check https://github.com/nim-lang/Nim/issues/13980
05:53:33*narimiran joined #nim
05:55:42FromDiscord<ElegantBeef> They also cannot be used for enum indexing
05:55:50FromDiscord<ElegantBeef> (edit) "indexing" => "indexed arrays"
06:30:12*waleee-cl quit (Quit: Connection closed for inactivity)
07:00:59*krux02 joined #nim
07:05:22FromDiscord<carpal> In reply to @arun "Blogged about recent improvements": mhhh
07:05:55FromDiscord<carpal> I'm reading <https://github.com/adsharma/py2many/blob/main/pynim/transpiler.py> but honestly I don't think it could be riable
07:08:09FromDiscord<carpal> it uses replace and string formatting to convert python code to nim
07:16:48krux02carpal: I think so, too. But it could be a first step to port some code.
07:17:27FromDiscord<carpal> the python code shouldn't be parsed by the repo owner, python is open source, anyone ↵can get the ast of any python code without write a parser, so you can follow the python updates without working everytime, maybe on features you are not able to implement
07:18:05krux02if python could be transpiled reliably in a language that is significantly faster than python, then there would probably a python compiler that does it in the packground and calling it a python performance improvement thing
07:18:12FromDiscord<carpal> search for a python parser online and redirect the ast to nim code generation
07:18:46krux02yea that is probably a better aproach.
07:19:01FromDiscord<carpal> In reply to @krux02 "if python could be": python is compiled to c officially
07:19:40FromDiscord<Yardanico> you mean cython? that's a different thing
07:20:04krux02I've heared about the go compiler that was first written in c++ and then later ported to go. What they did was, they limited their usages of c++ to a degree that was convertable to go and then, when everything was translatable they did the transition.
07:20:23krux02similarly with the nim compiler that was initially written in I think pascal
07:21:05krux02@carpal: I know there is a python to c compiler, but the generated C code is neither fast nor readable.
07:21:34krux02it is nothing you would want to use as a base for a C port of a python library.
07:21:53FromDiscord<carpal> In reply to @Yardanico "you mean cython? that's": no
07:22:05FromDiscord<carpal> python has a python to c compiler
07:22:06krux02probably mypyc
07:23:10FromDiscord<carpal> but if python exists is for the interpreter benefits
07:23:30FromDiscord<carpal> > if python could be transpiled reliably in a language that is significantly faster than python
07:23:40FromDiscord<carpal> referred to this ^
07:26:10FromDiscord<carpal> In reply to @krux02 "it is nothing you": python has good abstractions, the python tranpilation does not generate fast code because type matching and other operations are calculated at runtime by the PyObject, written in c
07:27:52*Kiloneie joined #nim
07:32:34FromDiscord<carpal> anyway. Transpilations usually don't generate a readable code, so I don't see the benefits in converting it to nim code
07:33:09FromDiscord<carpal> performance? convert it to c or c++ with some optimization tool
07:33:42FromDiscord<carpal> porting to nim and stop? again, it usually don't generate readable code
07:36:42FromDiscord<carpal> btw, is there any c backend library for nim?
07:36:47FromDiscord<Yardanico> as in?
07:38:27*synthmeat quit (Quit: WeeChat 3.0.1)
07:39:26FromDiscord<carpal> github says the v compiler is written in v it self https://media.discordapp.net/attachments/371759389889003532/813676376136744980/unknown.png
07:39:29*synthmeat joined #nim
07:39:33FromDiscord<Yardanico> yes
07:39:33FromDiscord<carpal> but https://media.discordapp.net/attachments/371759389889003532/813676407699144724/unknown.png
07:39:38FromDiscord<Yardanico> matching what?
07:39:44GreaseMonkeyPython comes with an "ast" module in the stdlib which is really useful for if you want an already-existing syntax to compile into something
07:40:13GreaseMonkeyand i have a project lying around somewhere which hijacks the import machinery so you can have a module which gets exposed as Python but also transpiles to GLSL
07:41:14FromDiscord<carpal> clicking on the v percent
07:43:07madnightpython has some language features that makes it hard to compile
07:44:14madnightthe python to C code compiler basically has to spit out another python interpreter in C to run those features, that's why it is slow and unreadable, albeit being C
07:46:18madnighthowever it's very possible to have a high level language similar to python that compiles well, but you have to design it as such from the get-go
07:47:58FromDiscord<mratsim> compilation is easier with static typing.
07:49:23FromDiscord<mratsim> In reply to @carpal "anyway. Transpilations usually don't": We bootstrap Nimbus-eth1 which is part of the biggest commercial Nim project by transpiling a Python implementation.
07:49:27FromDiscord<mratsim> (edit) "bootstrap" => "bootstrapped"
07:50:21FromDiscord<carpal> In reply to @madnight "python has some language": for example?
07:51:44FromDiscord<mratsim> everything is a dictionary
07:53:15FromDiscord<carpal> what?
07:53:17FromDiscord<carpal> no lol
07:53:24FromDiscord<carpal> what do you mena
07:53:25FromDiscord<carpal> (edit) "mena" => "mean"
07:53:27FromDiscord<carpal> (edit) "mean" => "mean?"
07:54:24FromDiscord<Kiloneie> @Araq Hey are you available today ?
07:56:01*Kiloneie left #nim ("Leaving")
07:57:12madnightcarpal: python has duck-typing for everything
08:00:38*Jjp137 quit (Ping timeout: 264 seconds)
08:03:27FromDiscord<mratsim> @carpal https://lukeplant.me.uk/blog/posts/everything-is-an-x-pattern/
08:03:32FromDiscord<carpal> In reply to @madnight "<@699146708466008115>: python has duck-typing": you can avoid this
08:03:50FromDiscord<mratsim> "everything is an object" in python, and all objects are dictionaries of properties.
08:03:54FromDiscord<carpal> in c compilation you can say "it is mandatory to use static typing"
08:04:49FromDiscord<carpal> In reply to @mratsim ""everything is an object"": ah ok you meant that. Yes I wrote a vm some time ago and I structured it at the same
08:04:56FromDiscord<carpal> dictionaries of properties
08:05:05FromDiscord<carpal> also to allow reflection
08:05:11*Jjp137 joined #nim
08:06:22FromDiscord<whisperdev> Did anyone try this for Nim? https://github.com/jart/cosmopolitan
08:06:52FromDiscord<mratsim> In reply to @whisperdev "Did anyone try this": every week someone asks about that.
08:07:41FromDiscord<Yardanico> @whisperdev isn't it really niche and C-specific, like the fact that it uses -nostdlib and its own libc?
08:07:57FromDiscord<carpal> but java vm is written in c lol and what more compatible than c? https://media.discordapp.net/attachments/371759389889003532/813683552238960651/unknown.png
08:08:18FromDiscord<Yardanico> @carpal he's talking about building applications, not the VM/compiler itself
08:09:18krux02@carpal: please don't pretend you know more than you do.
08:09:42FromDiscord<carpal> what
08:09:43FromDiscord<carpal> ...?
08:09:48FromDiscord<carpal> I only asked lol
08:09:51FromDiscord<carpal> this is so toxic
08:10:18FromDiscord<mratsim> agree I don't see any pretending
08:10:54FromDiscord<mratsim> Java VM is written in C in general but you don't have to.
08:11:16FromDiscord<mratsim> Java programs are just bytecode that any JVM can execute and you can write it in Nim if you want or assembly or JS.
08:11:44FromDiscord<mratsim> the run anywhere means as long a syou have a JVM runtime on your machine you can run the java program without recompiling it.
08:11:49FromDiscord<whisperdev> In reply to @mratsim "every week someone asks": Hehe you need a FAQ then
08:12:12FromDiscord<mratsim> I don't specially mind, it's an interesting project.
08:12:39krux02@carpal: The java runtime is written mostly in c++, but it is a just in time compiler that generates binary instructions at runtime.
08:13:08krux02The original interpreter was written in C I think. But that was only a java bytecode interpreter. Not much faster than python.
08:13:24krux02well a bit faster it was.
08:13:39krux02And these low level optimizations in the jvm are very platform specific.
08:14:20FromDiscord<carpal> jvm has an interpreter and a jit, I read that the interpreter is used more than the jit
08:14:26*haxscramper joined #nim
08:14:34*haxscramper quit (Remote host closed the connection)
08:14:37FromDiscord<SneakyBaguette> In reply to @carpal "jvm has an interpreter": It depends on what you fo
08:14:42FromDiscord<SneakyBaguette> (edit) "fo" => "do"
08:14:54krux02@carpal: well it depends on how you weight thigs.
08:15:01*haxscramper joined #nim
08:15:16FromDiscord<mratsim> it depends on it depends
08:15:21FromDiscord<carpal> jit performs processor specific optimization I know
08:15:23krux02I you just measure in written lines of code, maybe. If you measure in execution time, probably not that much.
08:15:24FromDiscord<SneakyBaguette> I used to port JVM written in C for IoT (microcontroller and stuff) and it's full interpreter no jit. But server stuff makes heavy uses of jit
08:15:28FromDiscord<carpal> .net does the same
08:15:41krux02yes .net is basically a java clone
08:15:48krux02at least initially
08:15:55FromDiscord<carpal> mhh
08:15:56FromDiscord<SneakyBaguette> .net is microsoft Java with C++ syntax lol
08:16:04FromDiscord<mratsim> Then it got this Haskelly influence
08:16:06FromDiscord<carpal> a better clone imho
08:16:09FromDiscord<carpal> (edit) "imho" => "imho"
08:16:09krux02java already has c++ syntax
08:16:17FromDiscord<SneakyBaguette> F# looks solid
08:16:24FromDiscord<SneakyBaguette> (edit) "F# looks solid ... " 03added "though"
08:16:28FromDiscord<mratsim> Q# looks uncertain
08:16:31FromDiscord<carpal> In reply to @SneakyBaguette ".net is microsoft Java": java already has c++ syntax
08:16:38FromDiscord<carpal> (edit) "c++" => "c-like"
08:17:03FromDiscord<carpal> anyway, java and c# are on different layers
08:17:04krux02I've looked into C# and it seems to me that it really isn't a focused language at all. It is like c++ a mashup of everything.
08:17:18FromDiscord<SneakyBaguette> I find C # syntax closer to C++ than Java but that's not really.important anyway
08:17:36krux02tools work better than in c++ though.
08:17:36FromDiscord<carpal> I use c# and java sounds me so bad
08:18:10FromDiscord<carpal> In reply to @SneakyBaguette "I find C #": .net features are very nice
08:18:21FromDiscord<carpal> .net is also faster then java jit
08:18:22krux02Well with c# I am objectively in the past.
08:18:27FromDiscord<whisperdev> .NET and Java are super enterprisey
08:18:50FromDiscord<carpal> In reply to @SneakyBaguette ".net is microsoft Java": at your eyes yes...
08:19:31FromDiscord<carpal> you should try somethig to say if it is good or bad, and that opition will be for ever valid only for you
08:19:45FromDiscord<SneakyBaguette> Of course I don't disagree with that
08:20:03FromDiscord<SneakyBaguette> But I mostly works with low level stuff so VM are not something I use often
08:20:11FromDiscord<whisperdev> What I like about C# is that they brought it to almost every platform.
08:20:16krux02@carpal: Did you know that microsoft did develop their own JVM and then tried to play their embrace extend extinguish strategy on it. They got sued, had to stop it. And then made C# out of it?
08:20:42FromDiscord<carpal> how many years ago?
08:20:44FromDiscord<carpal> ahha
08:20:45FromDiscord<carpal> a lot
08:20:48krux02@wisperdev: yea, but it took them a very very long time.
08:20:58FromDiscord<SneakyBaguette> Calling C# Java Microsoft isn't a criticism of C#
08:21:10FromDiscord<whisperdev> @krux02: yeah that's surprising for a behemoth like Microsoft.
08:21:31krux02no not surprising at all.
08:21:44krux02They explicity wanted to prevent linux from becoming more popular.
08:21:47FromDiscord<whisperdev> On a different topic.How do I debug a Nim program "in production" that was compiled with d:release d:danger?
08:22:03krux02So it is not surprising that they didn't support it as a backend for their language.
08:22:16FromDiscord<carpal> anyway stop this discussion please, it is only toxic
08:22:34FromDiscord<whisperdev> It was a different era to be honest.
08:22:52krux02@whisperdev: you need debug symbols in order to debug
08:23:23FromDiscord<SneakyBaguette> In reply to @whisperdev "On a different topic.How": Do you have the source available to modify & recompile or just the binary ?
08:23:29krux02it enables optimizations but also debug information
08:24:12krux02and then you need to run it with nim-gdb
08:24:13FromDiscord<SneakyBaguette> Aren't stacktrace turned off with -d : danger as well ?
08:24:41krux02ah and also rememebr, choosenim comes with a broken nim-gdb
08:25:03krux02if you have nim build from git, then nim-gdb works
08:25:36krux02@SneakyBaguette: nims own stack traces are turned off
08:25:59krux02@SneakyBaguette: but when you have debug symbols you get a stack trace from gdb
08:26:06FromDiscord<SneakyBaguette> Ah makes sense
08:26:09FromDiscord<Avatarfighter> o7 krux02, nice to see you back in here 🙂
08:26:17*Tanger quit (Quit: Leaving)
08:26:25krux02both gdb and nim keep their own stack information, that is pretty much redundant.
08:26:26FromDiscord<SneakyBaguette> I usually use debug() and stacktrace before using gdb
08:26:50krux02@Avatarfighter, I am mostly just lurking.
08:27:35krux02@SeakyBaguette: what `debug` are you talking about?
08:27:40FromDiscord<19> <krux02> are you still using nim? i really like your work with nim and opengl
08:28:15krux02well using nim isn't the right word, but nim is still a lot in my head and I think about it a lot.
08:28:17FromDiscord<SneakyBaguette> In reply to @krux02 "@SeakyBaguette: what `debug` are": It's basically echo but called debug
08:28:43krux02ok, it is probably a recent addition
08:29:29krux02@19: did you try opengl-sandbox?
08:29:53krux02I've invested a lot of work in that project, but somehow I feel like I am in isolation with that project.
08:30:09krux02Nobody says it is good/bad there are issues bugs.
08:30:13FromDiscord<19> i tried to run it on a mac and on a windows machine, no luck, i just like to look at the source code from time to time
08:30:30krux02yea sorry mac isn't supported.
08:30:35FromDiscord<19> i also watch your videos
08:30:51krux02windows should be working. if it doesn't please open an issue about it, so that I can fix it.
08:30:58krux02I will answer as fast as possible.
08:31:10FromDiscord<19> im gonna try now ^_^
08:31:15krux02my try to maintain a 0 open issue count for my projects.
08:31:43FromDiscord<19> that's awesome
08:32:20FromDiscord<19> how was your experience with spring C++ if you dont mind me askgin
08:32:46krux02I tried to improve the compatibility and reliability of the project, and that meant that I had to drop nimble as the build tool.
08:33:05krux0219: horrible
08:33:25FromDiscord<19> i can imagine
08:33:25krux02the build system was just torture I have no idea how they are able to develop with that engine.
08:33:44krux02I mean with that build system.
08:33:46FromDiscord<19> what c++ build system is not torture?
08:33:59FromDiscord<19> 😅
08:34:02krux02They need to seriously improve it, so that people can easily clone the project and start contributing.
08:34:12krux02And that also means seriously cutting the dependencies.
08:34:34krux0219: yea I am not used to the c++ build system nightmare anymore.
08:34:45krux02I think the best experience so far is Go.
08:34:51krux02you just write your sourcecdo.
08:35:06krux02Done, nothing else. It just compiles and works.
08:35:18krux02import from github, np
08:35:26krux02no package provider needed
08:35:42krux02no publish to some stupid list of released packages needed.
08:43:18FromDiscord<mratsim> In reply to @whisperdev "On a different topic.How": if you can't recompile it, you need GDB and a detective.
08:46:37FromDiscord<19> <Krux02> it works on win, ill open an issue regarding the font path ^_^
08:47:07krux02never tested it personally
08:47:22krux02just linux testing here :P
08:49:06FromDiscord<19> lol, time to learn some DSL craziness
08:58:39FromDiscord<carpal> but does nim compiler generate a string and than compiles it with gcc or what?
08:59:06FromDiscord<carpal> I think it generates c code with an api
08:59:21FromDiscord<carpal> which?
08:59:56FromDiscord<Yardanico> it doesn't use an "api" and you can easily check that by looking into the c backend code
09:00:13FromDiscord<Yardanico> it just creates C source files with strings and then compiles them with the C compiler
09:00:19FromDiscord<Yardanico> there's nlvm which uses LLVM instead though
09:00:23FromDiscord<carpal> oh lol
09:01:08*PMunch joined #nim
09:01:42FromDiscord<carpal> https://media.discordapp.net/attachments/371759389889003532/813697077702819900/unknown.png
09:01:57FromDiscord<Yardanico> @carpal those files in compiler/ are the C/C++/ObjC backend https://media.discordapp.net/attachments/371759389889003532/813697139767115806/unknown.png
09:02:13FromDiscord<Yardanico> main file of the c backend is https://github.com/nim-lang/Nim/blob/devel/compiler/cgen.nim
09:07:07FromDiscord<carpal> thank you
09:07:10FromDiscord<carpal> I'm reading it
09:11:16FromDiscord<carpal> but this makes slow the compilation
09:11:53FromDiscord<Yardanico> not necessarily
09:32:03krux02@carpal: nim compiles faster than c/c++ even though nim compiles to c/c++
09:32:14krux02the reason for that is header files.
09:32:19*Arrrrrrrr joined #nim
09:32:48krux02The inclusion of header files has quadratic complexity because every file potentionally includes every other header file.
09:33:02FromDiscord<Solitude> In reply to @carpal "but this makes slow": still faster than rust
09:33:41krux02In nim only generates the parts of the interface that are actually used. So no header files explosion
09:34:17krux02nim compilation is actually quite fast compared to other languages.
09:34:26krux02but compilation can be made arbitrarily slow
09:34:30krux02through macros.
09:34:37krux02they can kill every performace.
09:34:47krux02But people are not yet that crazy with macros.
09:35:40PMunchSpeak for yourself :
09:35:41krux02@19: regarding the nim dsl that I wrote, you can enable debugging and then the macros prints its generated source code.
09:38:13FromDiscord<mratsim> Generics/concepts are slow than macros :/
09:38:17FromDiscord<mratsim> slower
09:38:52FromDiscord<mratsim> I don't know what's going on in sigmatch/semtypes/semchecks but it can be very slow.
09:38:57FromDiscord<19> <krux02> thanks, that will come in very handy since i have zero experience with dsls anyway xD
09:48:38FromDiscord<19> In reply to @krux02 "they can kill every": do you mean kill compile time speed or runtime execution speed?
09:49:09krux02both :P but mostly compile time performance
09:49:35krux02and generally people tend to completely ignore compile time performance and call it "zero cost abstraction"
09:49:37FromDiscord<19> can we cache the macros results?
09:50:05FromDiscord<19> the term zero cost abstraction is very elusive
09:50:15krux02there are efforts to do incremental compilation to do exactly that
09:50:25FromDiscord<19> cant wait for incremental comp
09:51:34krux02my thoughts on incremental compilation would be very posix oriented :P
09:52:01saemHmm, is nim compiler speed tracked over time anywhere?
09:52:50krux02make a fork of the process after every module. fork on Linux is cheap. Then when recompilation is necessary, resume to the latest fork that still recompiles all the current changes.
09:53:00krux02saem, nope
09:53:13krux02it is on my todo list though
09:53:41krux02the old todo list from when I was still working on the compiler.
09:53:54krux02I would implement trackang of all tests as well.
09:54:06krux02so that you can plot which tests are most expensive etc.
09:54:18krux02and how much a single test performance changed over time.
09:56:38*SebastianM joined #nim
09:59:28saemAm curious if @mratsim notices any difference in the latest devel version in code bases like arraymancer etc?
09:59:37SebastianMGuys is there a way to initialize sequence with range of numbers like in python l = list(range(1,10))?
10:00:47FromDiscord<mratsim> In reply to @saem "Am curious if <@570268431522201601>": in terms of compilation time? It's been a while since I tested in Arraymancer. I definitely feel Nim slowness in Constantine but unsure if it became slow or if I'm just using too much generics/static
10:00:57FromDiscord<mratsim> and compile-time evaluation
10:01:08FromDiscord<mratsim> (doing some bigint precomputation at compile-time).
10:02:56FromDiscord<Yardanico> @SebastianM not that I know of, you can just use a for loop though
10:03:06FromDiscord<Yardanico> and preallocate the seq with the length since it's known
10:03:26FromDiscord<InventorMatt> toseq(1..10) should work for that
10:03:58FromDiscord<Yardanico> ah yeah
10:04:30ForumUpdaterBotNew post on r/nim by Unaimend: Hyped abou Nim - Use in Bioinformatics, see https://reddit.com/r/nim/comments/lqevsr/hyped_abou_nim_use_in_bioinformatics/
10:04:45FromDiscord<Yardanico> "Hi, so I'd like to use vim " lol that typo :P
10:04:55FromDiscord<flywind> there is a PR attempted to track compile time https://github.com/nim-lang/Nim/pull/14614
10:05:11SebastianM@Yardanico @InventorMatt Thank you for quick answer.
10:05:38*ThomasDost joined #nim
10:07:37FromDiscord<Yardanico> btw, if you want python's range there's https://github.com/Yardanico/nimpylib/blob/master/src/pylib/xrange.nim (shameless self plug)
10:13:09*abm joined #nim
10:15:39SebastianM@Yardanico Thank you once again
10:18:52*SebastianM left #nim (#nim)
10:18:56ForumUpdaterBotNew thread by Clavismax: Cairo Wrapper tests failed: could not load: libcairo-2.dll (Newbie), see https://forum.nim-lang.org/t/7548
10:23:52FromDiscord<hamidb80> does regex have sideEffect? 😕 https://media.discordapp.net/attachments/371759389889003532/813717755470675988/Screenshot_at_2021-02-23_13-52-10.png
10:24:02FromDiscord<hamidb80> (edit) 04removed "does" | "have sideEffect?" => "has sideEffect!?"
10:24:38krux02it should not
10:24:50FromDiscord<Yardanico> @hamidb80 you're using the `re` module?
10:25:01FromDiscord<hamidb80> In reply to @Yardanico "<@!745944009918251010> you're using the": yes
10:27:34Clonkk[m]What's the trick to have a generic proc construct a generic object ? I get a "expression has no type or if ambiguous" error ? https://play.nim-lang.org/#ix=2QtT
10:27:47Clonkk[m] * What's the trick to have a generic proc construct a generic object ? I get a "expression has no type or is ambiguous" error ? https://play.nim-lang.org/#ix=2QtT
10:29:45FromDiscord<Yardanico> typedesc can't exist at runtime
10:29:51FromDiscord<Yardanico> it's a compile-time only type
10:30:03FromDiscord<Yardanico> why do you want to store `t` in the object?
10:30:36FromDiscord<Yardanico> e.g. this works just fine https://play.nim-lang.org/#ix=2QtU (but I don't think that this usage of addr is safe)
10:30:46FromDiscord<hamidb80> In reply to @hamidb80 "regex has sideEffect!? 😕": any idea?
10:30:56FromDiscord<Yardanico> sorry, no idea about that
10:31:16Clonkk[m]<FromDiscord "<Yardanico> e.g. this works just"> Oh ok ! Yeah ignore the usage of addr, in practice it's a C function that gives an allocated pointer
10:33:49Clonkk[m]<FromDiscord "<Yardanico> why do you want to s"> The idea is just to encode the type since I store a ``pointer``
10:35:09FromDiscord<Solitude> In reply to @hamidb80 "regex has sideEffect!? 😕": lines is proc that reads file from filename line by line
10:35:12FromDiscord<Solitude> not line splitting
10:35:33FromDiscord<hamidb80> In reply to @Solitude "not line splitting": oh,
10:35:47FromDiscord<Yardanico> @hamidb80 for line splitting there's `strutils.splitLines` iterator/proc
10:36:30FromDiscord<Yardanico> @Clonkk well you generally don't need to store the type as long as you don't need to do different stuff based on the object type at runtime
10:37:44Clonkk[m]<FromDiscord "<Yardanico> @Clonkk well you gen"> I do. I have a ``ptr value`` type that represents an array type and the type of the array is encoded at run-time with a ``apply_array_type`` proc
10:40:36FromDiscord<Yardanico> huh
10:40:52FromDiscord<Yardanico> then you need to think of your own way to store the type - e.g. if it's a predefined known set, you can use an enum
10:44:22Clonkk[m]<FromDiscord "<Yardanico> then you need to thi"> I'd rather not have this limitations of having to extend the enum for every defined type. Passing it a generic parameters will be enough for a first draft (even if it disallows doing ``x.myproc[type]()``)
10:45:34*Vladar joined #nim
10:57:49FromDiscord<XeroOl> Hello. I don't have easy access to a windows machine, but I'd like to compile some nim code for windows. What is the cross compilation process like?
10:58:11FromDiscord<Yardanico> @XeroOl you can install mingw through your distro's package manager
10:58:26FromDiscord<Yardanico> or sometimes you can also use zig's cc
10:59:05FromDiscord<XeroOl> I have zig installed already so I should probably try that
10:59:16FromDiscord<19> <PMunch> i really like your latest arduboy work. thats some pretty hardcore low level stuff
10:59:30PMunchOh thanks :)
11:00:11*nxnl[m] joined #nim
11:00:19PMunchNim definitely has a lot of potential for microcontroller programming
11:01:43PMunchHmm, I seem to remember that I recorded a stream where I did cross-compiling with MinGW. But I can't seem to find it..
11:02:49FromDiscord<Yardanico> it's quite easy
11:03:01FromDiscord<Yardanico> https://github.com/Yardanico/adbscan/blob/master/src/adbscan.nims#L18
11:03:10FromDiscord<Yardanico> provided you have mingw already installed
11:07:44FromDiscord<19> < PMunch> i like your presentations ;D
11:08:01FromDiscord<19> even though i understand 0.001% of it, its fun and informative
11:08:22FromDiscord<Yardanico> @19 btw, it doesn't matter much but you don't need <> to ping people on IRC
11:08:22PMunchThanks again :) I try my best to make good presentations
11:08:30FromDiscord<Yardanico> you can just use @ to universally ping people on both discord/irc
11:09:11PMunchHmm, I should do some more video content. But that requires freeing up time in my schedule..
11:09:19FromDiscord<19> i tried that but couldnt find some members in the discord autocompletion
11:09:38FromDiscord<Yardanico> well, because they are not there
11:09:42PMunchI don't think IRC users autocomplete on Discord
11:09:47FromDiscord<Yardanico> you have to type their name manually if they're on IRC/Gitter/Matrix
11:09:55FromDiscord<Yardanico> so @ is better anyway
11:10:20FromDiscord<19> @PMunch a nice "macro for dummies" would be cool but idk if you are into that
11:12:46FromDiscord<mratsim> macro dummy(pmunch: untyped): untyped =↵ result = pmunch
11:12:59PMunchHaha :P
11:13:10FromDiscord<exelotl> Nim in Action has a nice chapter which is basically macros for dummies
11:13:15PMunchI've written my fair share of macros, definitely something I could do
11:13:18FromDiscord<exelotl> that's basically how I learned them x)
11:13:33PMunchOoh, I should check that chapter out for reference
11:13:37FromDiscord<mratsim> I have written macros when the compiler held a gun to my head.
11:13:47FromDiscord<mratsim> very motivating.
11:13:51FromDiscord<Rika> are you sure its not the reverse
11:13:54FromDiscord<mratsim> instinct of survival is a great teacher
11:14:03FromDiscord<mratsim> maybe :p
11:14:17FromDiscord<Rika> you seem like the guy who would hold a gun to the compilers head
11:14:31FromDiscord<Yardanico> :nimRawr:
11:16:17FromDiscord<mratsim> that's just retaliation
11:17:11FromDiscord<19> ive been waiting for the book for 3 months, thanks amazon :)
11:17:40FromDiscord<Yardanico> https://livebook.manning.com/book/nim-in-action/chapter-9/
11:18:22FromDiscord<19> yeah guess ill grab a digital copy, the letters start morphing at some point in manning xD
11:18:46FromDiscord<Yardanico> weird, I can view this whole chapter just fine
11:18:57FromDiscord<Yardanico> without signing in
11:19:06FromDiscord<Kiloneie> you get some free points
11:19:18FromDiscord<Yardanico> "without signing in"
11:19:24FromDiscord<Kiloneie> i think so yes
11:20:34FromDiscord<Kiloneie> for me it stops a little under template hygiene
11:20:57FromDiscord<Kiloneie> but then it works again ?...
11:21:17FromDiscord<Yardanico> see
11:21:41FromDiscord<Kiloneie> pretty sure there is some point system with time aswell
11:21:49FromDiscord<Kiloneie> i don't think it will
11:21:50FromDiscord<Kiloneie> yeh
11:21:54FromDiscord<Kiloneie> just got denied
11:22:02FromDiscord<Kiloneie> it expired in like 2 minutes
11:22:23FromDiscord<Kiloneie> now it will no longer un obfuscate
11:22:48FromDiscord<Kiloneie> the code is still accessible but not the explanation
11:22:59FromDiscord<Kiloneie> which is the point of a book
11:23:21FromDiscord<19> theres also a nice macros tutorial here https://nim-lang.org/docs/tut3.html
11:23:46FromDiscord<Yardanico> also there's https://dev.to/beef331/demystification-of-macros-in-nim-13n8
11:24:26FromDiscord<19> that's some elegant beef right there
11:27:09PMunchOh, I don't think I've seen that post by @ElegantBeef
11:28:25*Onionhammer quit (Ping timeout: 240 seconds)
11:31:13*Onionhammer joined #nim
11:35:03krux02@19: thank you, I wrote that tutorial :D
11:35:21FromDiscord<Kiloneie> I should learn macros already and make a video about it at some point soonish
11:35:43FromDiscord<19> @krux02 nice :D
11:44:51*Onionhammer6 joined #nim
11:45:16*Onionhammer quit (Ping timeout: 240 seconds)
11:45:16*Onionhammer6 is now known as Onionhammer
11:58:05*Onionhammer quit (Quit: Ping timeout (120 seconds))
12:02:49*Onionhammer joined #nim
12:06:54nxnl[m]I've encountered a strange problem with locks: as a property on one class i get "no member named ´abi´", but on another class in the same module it compiles and runs fine.. Any idea on what might be wrong?
12:08:56FromDiscord<Yardanico> https://github.com/nim-lang/Nim/issues/14873
12:08:59FromDiscord<Yardanico> maybe this?
12:12:13nxnl[m]I looked at that earlier, but I don't really know what it means
12:13:02FromDiscord<Yardanico> do you have an object that has a member of the type `Lock`?
12:13:03nxnl[m]I don't have to touch the lock in any way, just define it as a property on this one class and it fails to compile
12:13:07FromDiscord<Yardanico> and can you show the full error?
12:14:13*nxnl[m] sent a long message: < https://matrix.org/_matrix/media/r0/download/matrix.org/yQahMJEeESoyLUPeLRntKmQs/message.txt >
12:14:44nxnl[m]some paths before and after contains some company info so I've omitted that
12:15:13FromDiscord<Yardanico> yeah, that's this issue
12:15:30FromDiscord<Yardanico> you're trying to `echo` an object that has a `Lock` member in one of it's members (maybe nested)
12:15:46FromDiscord<Yardanico> or some code you're calling is trying to echo an object like that
12:16:03nxnl[m]hmm, I'll have a look to see if I echo the object anywhere
12:16:42FromDiscord<Yardanico> ah hm, maybe it's something else, I'm not sure
12:20:21FromDiscord<flywind> !eval echo "down"
12:20:28*rockcavera joined #nim
12:21:16*rinzlxr quit (Ping timeout: 240 seconds)
12:21:21NimBotCompile failed: <no output>
12:21:29nxnl[m]the object is never echoed in any way I'm afraid
12:29:27*lkjasdf joined #nim
12:36:08FromDiscord<Yardanico> 👁️ https://media.discordapp.net/attachments/371759389889003532/813751038985240596/unknown.png
12:42:30FromDiscord<Rika> It took me a moment to realise
12:44:02FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/813753030833864744/unknown.png
12:44:22FromDiscord<Yardanico> right now I want to make it work like python's `with` (yes for `nimpylib` again because why not)
12:45:19FromDiscord<flywind> yeah, this is a great feature
12:45:30FromDiscord<flywind> I miss it
12:45:40FromDiscord<Yardanico> I mean you can make a simple template just for stuff that has `close`
12:45:50FromDiscord<Yardanico> ah actually no
12:45:58FromDiscord<Yardanico> it needs to be a macro, but anyway, it can be relatively simple
12:46:18FromDiscord<flywind> Using Nim, you defined endless `withDir`, `withTemporaryFile`, `withSomethingElse`
12:46:26FromDiscord<Yardanico> yeah, that was juan :P
12:46:36FromDiscord<Yardanico> ah you mean nim generally
12:47:25FromDiscord<flywind> destructor is a great alternative feature but not very often used.
12:47:42FromDiscord<Yardanico> true
12:49:38FromDiscord<Rika> We won’t need the close thing soon though
12:51:08FromDiscord<flywind> https://github.com/nim-lang/Nim/pull/16048#issuecomment-730248760
12:55:01FromDiscord<flywind> In reply to @flywind "destructor is a great": fortunately destructors begin to be documented in manual now https://github.com/nim-lang/Nim/pull/17063/files
12:59:28*abm quit (Quit: Leaving)
13:06:50FromDiscord<KnorrFG> is the only difference between var and let the mutability? I ask because you can use new and addr with a var - variable but not with a let variable. Var feels more like a save pointer.
13:07:42FromDiscord<KnorrFG> but it seems returning a var from a proc still makes a copy, so im a little confused in that regard
13:09:38FromDiscord<haxscramper> `ref` is a "safe pointer". When you return `var` from a procedure and assign it to something then it might make a copy
13:10:15*lkjasdf quit (Read error: Connection reset by peer)
13:10:22*lkjasdf joined #nim
13:10:22FromDiscord<haxscramper> But if you return `var T` and then run `procThatMutatesArgs(arg: var T)` then it shouldn't make a copy and instead will reuse the same object IIRC
13:11:13FromDiscord<KnorrFG> ok. ty
13:13:11*Arrrrrrrr quit (Quit: Arrrrrrrr)
13:13:56FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2QuU
13:14:35FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2QuV
13:14:45FromDiscord<Yardanico> otherwise replace both instances of `MyObj` with `var MyObj`
13:15:02FromDiscord<Yardanico> but I don't like that syntax imo :P
13:15:17FromDiscord<KnorrFG> i tried the second one, because it works with an object that is defined in foreign code, but then it seems to return a copy
13:15:33FromDiscord<Yardanico> e.g. https://nim-lang.org/docs/with.html
13:15:42FromDiscord<Yardanico> @KnorrFG as I said, replace _both_ instances
13:15:46FromDiscord<Yardanico> return type should be `var MyObj` as well
13:16:41FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2QuX
13:17:43FromDiscord<haxscramper> In reply to @haxscramper "`ref` is a "safe": Assigning to `var` might make a copy
13:17:58FromDiscord<haxscramper> IIRC it always makes a copy for types with value semantics, but I'm not sure
13:17:59FromDiscord<Yardanico> @KnorrFG yes, but you were asking about chaining with .
13:18:44FromDiscord<rramos.eth> sent a code paste, see https://play.nim-lang.org/#ix=2QuY
13:19:05FromDiscord<Yardanico> @rramos.eth `thread safe` as in modifying same json nodes from multiple threads?
13:19:23FromDiscord<KnorrFG> actually i just want to understand what happens under the hood, and my mental model was from c++ where u return a ref to self. then I noticed that it might be easier and used the python example. So i thought in the end it would be the same
13:19:43FromDiscord<Yardanico> it doesn't have any global state that I know of so it should work just fine, maybe your problem is with something else
13:21:45FromDiscord<Yardanico> @KnorrFG you can use `ref object` for the behaviour you want
13:22:08FromDiscord<rramos.eth> In reply to @Yardanico "<@!532997111273226259> `thread safe` as": sent a code paste, see https://play.nim-lang.org/#ix=2Qv0
13:22:09FromDiscord<KnorrFG> sent a code paste, see https://paste.rs/tEH
13:22:28FromDiscord<rramos.eth> but sometimes i run into the prev issue when it reaches parseJSON invokation
13:23:54FromDiscord<rramos.eth> `result` is filled by calling a C function that returns a cstring
13:24:45FromDiscord<rramos.eth> which i convert to string with $
13:27:47FromDiscord<rramos.eth> it makes me wonder if the issue is related to the cstring being garbage collected, and not the parseJSON proc being the problem
13:29:46krux02@19: any progress in experimentation with opengl-sandbox?
13:29:57FromDiscord<Clyybber> In reply to @flywind "fortunately destructors begin to": They have been for quite some time actually https://nim-lang.github.io/Nim/destructors
13:31:01FromGitter<gogolxdong> Is there any arc benchmark link ?
13:31:07FromDiscord<flywind> I knew that docs, I mean in manual.
13:31:17FromDiscord<Yardanico> @gogolxdong why would you need that?
13:31:22FromDiscord<Clyybber> ah I see
13:31:31FromDiscord<Yardanico> there are some benchmarks from 4raq's talks for example
13:32:47*kitech1 quit (Quit: ZNC 1.7.5 - https://znc.in)
13:32:55FromDiscord<19> @krux02 i wish, i have a full time non-dev job
13:32:55FromGitter<gogolxdong> they don't believe arc is faster than manually sometimes.
13:33:07*kitech1 joined #nim
13:33:11krux02what is your full time job?
13:33:22FromDiscord<Yardanico> @gogolxdong who "they" ? :P
13:33:29FromDiscord<19> game technical artist
13:33:50FromGitter<gogolxdong> whom I present https://github.com/gogolxdong/2DeFi/releases/tag/v1.0
13:33:56FromDiscord<haxscramper> In reply to @KnorrFG "so i also just": sent a code paste, see https://play.nim-lang.org/#ix=2Qv3
13:35:26FromDiscord<19> @krux02 i also need to get better at OpenGL to understand your code better
13:35:29FromGitter<gogolxdong> commented out isLiteral of nim-chronos to get it compiled with arc , seems there is memory leak.
13:35:57FromDiscord<Yardanico> you should try orc instead
13:36:00FromDiscord<flywind> async + arc = leaking
13:37:06FromGitter<gogolxdong> orc crashes the application
13:38:45krux02@19: that is cool, whenever I think technical artist this is what I think about: https://youtu.be/Y7f0YtzWBG4?t=206
13:39:09FromDiscord<19> wow this game
13:39:09krux02the idea behind my code is to make opengl easier to understand.
13:39:09FromDiscord<Yardanico> @gogolxdong then you should stick to `refc` for the time being and try to minimize (I know it can be hard) the bug with orc
13:39:20FromDiscord<19> oh nice
13:39:25FromDiscord<Yardanico> since with `arc` you'll leak memory because of using async (even with nim-chronos)
13:39:30FromDiscord<KnorrFG> In reply to @haxscramper "it works because function": cool, ty
13:39:56krux02yea I really like oddworld. But I can't do art like that.
13:40:05krux02I just like the genre
13:40:35krux02Starting with Prince of Persia (1989), Flashback, Oddworld ...
13:40:41krux02all great games
13:40:59FromDiscord<19> i think oddworld used 3d models rendered to sprites
13:41:13krux02the old version yes,
13:41:14FromDiscord<19> diablo1/2 also
13:41:17krux02The remaster is full 3D
13:41:35FromDiscord<19> i like that style
13:41:36krux02diablo 2 remaster also uses 3D modles
13:42:10FromGitter<gogolxdong> refc leaks as well, make application more unstable than orc
13:42:10FromDiscord<19> yeah, the old one still looks better though
13:42:26FromDiscord<19> kind of like starcraft broodwar vs starcraft 2
13:42:43krux02well, I think that is also a lot of nostalgia.
13:42:58FromGitter<gogolxdong> will it be fixed once chronos supports arc.
13:43:03krux02But I also think that for certain styles 256 colors actually improve the atmosphere
13:43:25FromDiscord<19> yeah probably that nostalgia kicking in
13:43:28krux02KKND just looks better in my opinion than KKND 2
13:43:44FromDiscord<19> but i like how protoss looked better for example in broodwar
13:43:45krux02I don't think it is just nostalgia.
13:43:54krux02both kknd and kknd 2 are old games.
13:44:01krux02I played both as a child.
13:44:37krux02there are several reasons why some old style graphics look better than modern styles.
13:44:46krux02And I think a lot of it has to do with smoothness.
13:44:51FromGitter<gogolxdong> I am testing orc again.
13:45:05krux02Old style is rough with precise borders. Modern style is smooth.
13:45:22FromDiscord<mratsim> @gogolxdong there is a PR with experimental orc support in Chronos
13:45:23FromDiscord<Yardanico> @gogolxdong are you sure that it actually leaks?
13:45:29FromDiscord<Yardanico> i mean refc
13:45:45FromDiscord<mratsim> https://github.com/status-im/nim-chronos/pull/135
13:45:47krux02When your game is post apocalypse in a Mad Max like environment, smooth is not a property that is very important.
13:45:52FromDiscord<19> its also funny how when u emulate old games written in asm they perform exactly like the old, but in the new ones ( ps1 ps2 emulations) they are buggy with emulation xD
13:46:32krux02well ps1 isn't buggy anymore,
13:46:39krux02but sure I get what you want to say.
13:47:09krux02and no, they do not perform exactly like the old.
13:47:58krux02games that abused the hardware too much to get to the desired result tend to not work in emulation because the games don't use specified behavior anymore.
13:47:59FromDiscord<19> yeah understandable
13:48:27krux02I think commander Keen in dosbox is not like commander keen in native dos on old hardware.
13:48:41FromDiscord<19> i really like wc3 reign of chaos style
13:48:51FromGitter<gogolxdong> testing with refc as well , orc is noticable slow than arc/refc.
13:49:00krux02I don't, I always thought that WC3 looked ugly.
13:49:09krux02from the beggining.
13:49:23krux02I prefer WC2 over WC3
13:49:43FromDiscord<19> what about wc3 vs wc reforged
13:49:55krux02I don't really care personally.
13:49:56FromDiscord<haxscramper> we have `#gaming` and `#offtopic`
13:50:08krux02I am not attached to WC3, but I heared about the dispute about reforged.
13:50:30FromDiscord<Yardanico> @haxscramper gaming is not bridged to IRC
13:50:31krux02@haxscramper, I am on irc
13:50:35FromDiscord<Yardanico> #nim-offtopic is though
13:50:56FromDiscord<19> let's dm
13:50:59FromDiscord<Yardanico> he's on IRC
13:51:34FromGitter<gogolxdong> refc crashes sooner.
13:51:48FromDiscord<Yardanico> maybe it's a bug in your code ?:P
13:52:55FromGitter<gogolxdong> it keeps running for one or two days with momory leaking using arc.
13:53:12FromDiscord<Yardanico> yes but that's not good
13:59:20ForumUpdaterBotNew thread by Miran: Nim 1.4.4 and 1.2.10 released, see https://forum.nim-lang.org/t/7549
14:02:25federico3dom96: want to add CVEs to the changelog?
14:03:17FromGitter<gogolxdong> I think it's bug in orc or refc. Does it make sense?
14:04:57FromGitter<gogolxdong> arc ensures application doesn't crash during presentation
14:09:09FromDiscord<hamidb80> Error: type mismatch: got <>↵but expected one of: ↵proc (s: string){.closure.}
14:09:23FromDiscord<hamidb80> In reply to @hamidb80 "Error: type mismatch: got": got <> ???
14:09:29FromDiscord<hamidb80> (edit) "<>" => "`<>`"
14:13:17FromDiscord<haxscramper> Got no arguments, but expected `string`
14:13:30FromGitter<gogolxdong> BTW, send me arc benchmark link if there is any. I saw some.
14:17:07FromGitter<gogolxdong> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=60350e627ba8124e5483d717]
14:24:05FromDiscord<KnorrFG> im currently trying to wrap a c-library (the drawing area part of libui to be precise) there is an object type path. to create one you need to call drawNewPath(fillMode) and then it needs to be freed after use with drawFreePath(). To wrap this safely I think normally I would have to use new and pass drawFreePath as a finalizer, but here I cannot really just use new because I need to call the c-function, right? What would the appropriate t
14:25:21FromDiscord<hamidb80> i'm looking for an article about threading in nim
14:35:38FromDiscord<Tigor> I still dont figured out what cause memory leak↵here the project, after few loop iteration your memory keep grow up and do this until loop end
14:35:44FromDiscord<Tigor> https://media.discordapp.net/attachments/371759389889003532/813781140732117002/leak.zip
14:36:14FromDiscord<Tigor> mark and sweep gc make it grow slower
14:45:25FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Qvp
14:45:40FromDiscord<KnorrFG> (edit) "https://play.nim-lang.org/#ix=2Qvp" => "https://play.nim-lang.org/#ix=2Qvq"
14:46:24FromDiscord<Rika> other than one is stack one is heap?
14:47:52FromDiscord<KnorrFG> id say thats a pretty relevant difference
14:47:52FromDiscord<KnorrFG> ty
14:48:36FromDiscord<Rika> well i dont know if you know that difference
14:49:16FromDiscord<KnorrFG> but if the ref version is already on the heap. what is new used for then?
14:52:39FromDiscord<KnorrFG> nvm, found this: https://forum.nim-lang.org/t/3870
14:55:28ForumUpdaterBotNew thread by Geohuz: Need help on getting notifcation message from postgresql, see https://forum.nim-lang.org/t/7550
15:03:53FromDiscord<carpal> In reply to @KnorrFG "but if the ref": maybe reallocate? idk
15:06:55FromDiscord<Rika> new allocation
15:07:05FromDiscord<Rika> no need to use if you use `Type()` notation though
15:07:16FromDiscord<Tigor> sent a long message, see http://ix.io/2QvM
15:07:54FromDiscord<Tigor> (edit) "http://ix.io/2QvM" => "http://ix.io/2QvN"
15:10:13FromDiscord<konsumlamm> ye, sounds right
15:13:41FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2QvP
15:15:21FromDiscord<hamidb80> Error: closure in spawn environment is not allowed
15:15:35FromDiscord<Rika> finalizers are being deprecated, use destructors (i forgot the link wait)
15:15:45FromDiscord<Rika> https://nim-lang.org/docs/destructors.html
15:16:28FromDiscord<Rika> not sure if this will fix the issue
15:16:30FromDiscord<Rika> worth a try tho
15:16:43FromDiscord<KnorrFG> ok, but doesnt that require --gc:arc?
15:17:17FromDiscord<Rika> i believe not
15:17:21FromDiscord<konsumlamm> are you using spawn (or threadpool) anywhere?
15:18:10FromDiscord<hamidb80> In reply to @konsumlamm "are you using spawn": sent a code paste, see https://play.nim-lang.org/#ix=2QvR
15:18:23FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=2QvR" => "https://play.nim-lang.org/#ix=2QvS"
15:21:56FromGitter<gogolxdong> sometimes crashes without stack ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=60351d94a37fc1784c3e33d0]
15:23:36FromDiscord<Rika> In reply to @hamidb80 "yes ```nim import": cant do that, vt has to be in getInput
15:23:46FromDiscord<Rika> thats why the closure error
15:24:30FromDiscord<hamidb80> In reply to @Rika "cant do that, vt": 👍
15:25:21FromDiscord<hamidb80> i think with my Nodejs background it's gonna take time to adapt myself with nim
15:25:58FromDiscord<konsumlamm> In reply to @hamidb80 "yes ```nim import": the error message is telling you exactly what's wrong there, you can't use a closure with spawn
15:26:14FromDiscord<Rika> well they dont know what a closure is prolly
15:26:19FromDiscord<Rika> or why getInput is a closure
15:26:20FromDiscord<konsumlamm> a closure is a function that captures another variable (in this case `vt`)
15:26:48FromDiscord<konsumlamm> (closures also exist in JS btw)
15:27:11FromDiscord<Rika> theyre heavily used in js i believe
15:27:35FromDiscord<hamidb80> In reply to @konsumlamm "(closures also exist in": i know but with js you can write every wired code
15:27:48FromDiscord<Rika> even in node.js?
15:27:54FromDiscord<hamidb80> In reply to @Rika "even in node.js?": yes
15:27:59FromDiscord<Rika> as in for spawning threads
15:28:00FromDiscord<hamidb80> (edit) "wired" => "wierd"
15:28:12FromDiscord<Rika> and its not gonna break?
15:28:21FromDiscord<hamidb80> In reply to @Rika "as in for spawning": i dont know about threading in nodejs
15:28:28FromDiscord<Rika> spawn is threading
15:28:30FromGitter<gogolxdong> https://github.com/Araq/fosdem2020 doesn't compile with latest devel
15:28:34FromDiscord<Rika> thats why you cant use closures
15:28:48FromDiscord<Rika> because it will lead to race conditions and such
15:28:55FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2QvY
15:30:55FromDiscord<konsumlamm> the reason is probably that threads must own the values they use (with the current default GC at least), so you can't reference variables that are possibly in another thread
15:31:22FromDiscord<konsumlamm> In reply to @KnorrFG "if I try this:": you have to use it on the underlying object, yes
15:31:41*waleee-cl joined #nim
15:31:59FromDiscord<konsumlamm> sent a code paste, see https://play.nim-lang.org/#ix=2Qw0
15:32:10FromDiscord<konsumlamm> then you define `=destroy` for `PathObj`
15:32:16FromDiscord<KnorrFG> ok. ty
15:37:46FromDiscord<carpal> araq the boss https://media.discordapp.net/attachments/371759389889003532/813796753328570409/unknown.png
15:38:15FromDiscord<Rika> ?
15:38:52FromDiscord<carpal> I love its english
15:39:18FromDiscord<carpal> it is the unique english I understand without subtitles↵https://www.youtube.com/watch?v=OgutkaymJ-E
15:39:39FromDiscord<carpal> (edit) "unique" => "single"
15:39:58*aenesidemus joined #nim
15:40:17FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Qw7
15:45:53FromDiscord<mratsim> put destroy above
15:46:16FromDiscord<mratsim> new result requires a destructor, it doesn't see one so construct one implictly
15:46:30FromDiscord<mratsim> then you construct one and you end up with 2 destructors for your type.
15:46:37FromDiscord<KnorrFG> ah I see. now it compiles.
15:46:41FromDiscord<KnorrFG> thankk you.
15:46:48FromDiscord<KnorrFG> didnt solve my initial problem though
15:47:09FromDiscord<KnorrFG> it still seems to leak the draw Paths
15:47:18FromDiscord<mratsim> for ref objects use a finalizer
15:47:35FromDiscord<mratsim> there is a plan to merge them with destructors but not sure where we are at
15:48:13FromDiscord<KnorrFG> I initially had a finalzer (can I link my own post?)
15:48:15FromDiscord<mratsim> example: https://github.com/mratsim/Arraymancer/blob/master/src/arraymancer/tensor/backend/opencl_backend.nim#L41-L50
15:48:35*aenesidemus quit (Quit: Leaving)
15:49:10FromDiscord<KnorrFG> initially i had this: https://discord.com/channels/371759389889003530/371759389889003532/813790674343297044
15:49:22FromDiscord<KnorrFG> both versions behave identically
15:49:34FromDiscord<Rika> i thought finalisers were deprecated
15:50:02*ThomasDost quit (Ping timeout: 240 seconds)
15:50:21FromDiscord<Recruit_main707> i didnt know that
15:50:51FromDiscord<mratsim> you can't deprecate them if they don't have a replacement :/
15:52:02FromDiscord<Clyybber> we have a replacement though
15:52:09FromDiscord<Clyybber> destructors replace them
15:52:25FromDiscord<Clyybber> define your destructor on the underlying object type
15:53:01FromDiscord<Clyybber> sent a code paste, see https://play.nim-lang.org/#ix=2Qwf
15:59:12FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Qwl
16:09:00*mfx joined #nim
16:09:54*mfx quit (Client Quit)
16:11:38FromDiscord<Solitude> Path()[]
16:11:56FromDiscord<Solitude> (edit)
16:13:06FromDiscord<KnorrFG> thanks. This compiles again, but still leaks the pointer
16:14:22ForumUpdaterBotNew post on r/nim by miran1: Nim 1.4.4 and 1.2.10 released, see https://reddit.com/r/nim/comments/lqm29y/nim_144_and_1210_released/
16:19:04*teasea quit (Quit: teasea)
16:19:27FromDiscord<Rika> Are you sure the free function is actually working properly
16:20:53FromDiscord<KnorrFG> yes. I first wrote some code only using the c interface, and then started substituting it. so far I havent done much, only this actually. instead of manually creating a Path, using it and then freeing it, I created the class, which should do that automatically
16:21:01FromDiscord<KnorrFG> and the c version worked
16:21:08*teasea joined #nim
16:21:43*teasea quit (Client Quit)
16:22:07*teasea joined #nim
16:23:55FromDiscord<KnorrFG> i added an echo to the destructor
16:24:00FromDiscord<KnorrFG> it seems like it doesnt get called
16:25:21leorize[m]unless you use ARC, `ref`s are lazily freed
16:25:58FromDiscord<Rika> Even when the program ends?
16:26:05FromDiscord<Rika> Shouldn't it be called then
16:26:46FromDiscord<KnorrFG> the clean up that detects the leak probably ran first. running --gc:arc removed the leak
16:27:05FromDiscord<KnorrFG> thank you 🙂
16:27:41FromDiscord<KnorrFG> btw is it the plan that arc or orc become the default gc?
16:28:30FromDiscord<Rika> Orc yes
16:29:56leorize[m]@Rika yes, even when the program ends. Why free memory if the OS will do it for you anyway?
16:35:54FromDiscord<hamidb80> In reply to @konsumlamm "the reason is probably": so why this code is valid? https://media.discordapp.net/attachments/371759389889003532/813811381077147678/Screenshot_at_2021-02-23_20-05-10.png
16:39:30FromDiscord<hamidb80> i', little confused
16:39:34FromDiscord<hamidb80> (edit) "i'," => "i'm"
16:42:49FromDiscord<hamidb80> closures in spawn not allowed
16:43:13FromDiscord<hamidb80> but not in the body of spawned proc
16:44:18FromDiscord<hamidb80> (edit) "closures in spawn ... not" 03added "environment"
16:44:27FromDiscord<hamidb80> (edit) "closures" => ""closures" | "allowed" => "allowed""
16:46:52FromDiscord<hamidb80> this is invalid https://media.discordapp.net/attachments/371759389889003532/813814140442771467/unknown.png
16:47:07FromDiscord<hamidb80> In reply to @hamidb80 "so why this code": but this is valid
16:50:58FromDiscord<hamidb80> any idea?
16:59:36leorize[m]issues in analysis
17:00:27leorize[m]threadpool's spawn is very old and was not updated for a long time
17:08:58FromDiscord<Rika> ?
17:12:32FromDiscord<hamidb80> any idea?
17:13:31leorize[m]@hamidb80 spawn analysis is flawed, that's all
17:15:00leorize[m]CPS should simplify this stuff in the future
17:22:00FromDiscord<mratsim> CPS will have the exact same problem as spawn :p
17:22:19FromDiscord<mratsim> and then you add openarray on top
17:22:38FromDiscord<hamidb80> In reply to @mratsim "CPS will have the": what is cps?
17:23:28FromDiscord<mratsim> continuation passing style
17:23:41FromDiscord<mratsim> transforming everything into a continuation
17:23:44leorize[m]wouldn't Isolated[T] helps?
17:23:53FromDiscord<mratsim> ah right.
17:23:57FromDiscord<mratsim> I have to check that
17:24:31FromDiscord<Avatarfighter> @hamidb80 this paper describes an implementation of cps with C <https://www.irif.fr/~jch/research/cpc-2012.pdf> I found it pretty useful in understanding why cps is cool
17:25:18*PMunch quit (Quit: leaving)
17:27:54FromDiscord<mratsim> this is the one that sparked everything
17:30:04FromDiscord<exelotl> I tried implementing something similar a couple of years ago... but it turned into a buggy mess↵So I ended up using ucontext + nimcoro instead for my use case
17:30:16FromDiscord<exelotl> it works brilliantly
17:34:51leorize[m]the current Nim implementation is at https://github.com/disruptek/cps
17:35:16leorize[m]however disruptek and Zevv has both stopped development afaik
17:38:00FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Qxm
17:40:40FromDiscord<haxscramper> You can't have non-defaulted arguments following defaulted ones
17:41:06FromDiscord<haxscramper> Code block you passed after `:` is set to `fillMode`, withich is not `untyped`
17:41:27FromDiscord<haxscramper> So it undergoes semcheck, but because code in the block relise on injected variable you get error
17:41:32FromDiscord<haxscramper> (edit) "relise" => "relies"
17:41:32FromDiscord<KnorrFG> oh ... ooops. that was actually a pretty stupid question, im sorry
17:42:14FromDiscord<haxscramper> But if you want to have default template arguments and pass code blocks you can try creating overloads that pass arguments, though I'm not sure if it works well in the end
17:42:39FromDiscord<KnorrFG> great idea, ill try
17:43:07FromDiscord<haxscramper> But right now you need to pass all arguments explicitly, or write a macro that accepts something like `letPath (line, fillMode = value)`
17:43:15FromDiscord<haxscramper> Note the space before `(line`
17:43:34FromDiscord<haxscramper> But this is really a hack
17:48:50*vicfred joined #nim
17:49:23FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2Qxs
17:49:34*superbia joined #nim
17:53:11FromDiscord<haxscramper> I wasn't exactly sure if this should work this way, and it looks like you will have to create differently-named templates in the end
17:53:24FromDiscord<KnorrFG> ah too bad 😦
17:53:49FromDiscord<haxscramper> Though I wish it worked this way too
18:16:59*lkjasdf quit (Read error: Connection reset by peer)
18:17:22*lkjasdf joined #nim
18:18:10*superbia quit (Quit: WeeChat 3.0)
18:20:18FromDiscord<konsumlamm> does anyone have some opinion on how to split the `times` module? (see also https://github.com/nim-lang/RFCs/issues/55)
18:28:03FromDiscord<exelotl> my #1 wish is for times to work in Nimscript
18:29:57FromDiscord<exelotl> cause it's extremely limiting not being able to do `fileNewer`, `getLastModificationTime` and such
18:29:59FromDiscord<Tigor> so, anyone?↵https://discord.com/channels/371759389889003530/371759389889003532/813781114799390721
18:41:28*krux02 quit (Ping timeout: 260 seconds)
18:47:29FromDiscord<KnorrFG> if I want to define a list of colors, and want them available as symbols and additionally identifiable via string, like in a sort of dict, what would be the easiest way of achieving that if I dont want to create the string mappings by hand? In python i wouldve used an enum, but it seems in nim there is no string -> enum conversion automatically
18:49:54FromDiscord<treeform> In reply to @XxDiCaprioxX "umm is there a": If you are using zlib1.dll to write new software with zip and unzip stuff take a look at very fast pure nim implementation: https://github.com/guzba/zippy
18:57:49*abm joined #nim
19:03:38FromDiscord<dom96> In reply to @federico3 "<@132595483838251008>: want to add": federico3: you should ping miran
19:05:26FromDiscord<InventorMatt> @KnorrFG you can parse a string into an enum using like this https://play.nim-lang.org/#ix=2Qy9
19:37:05FromDiscord<ache of head> to zadanie jest okropne
19:37:10FromDiscord<ache of head> oh oops wrong channel
19:37:20FromDiscord<ache of head> wrong server entirely 😳
19:43:04liblq-dev@ache can confirm, the task we got on our math test today was horrible
19:44:15FromDiscord<XeroOl> am I missing something, or is zig not a supported c compiler for nim?
19:47:03FromDiscord<dom96> --cc:zig exists afaik https://forum.nim-lang.org/t/5939
19:47:19FromDiscord<XeroOl> https://media.discordapp.net/attachments/371759389889003532/813859550905630760/unknown.png
19:49:12FromDiscord<XeroOl> Does it not work with stable?
19:49:56FromDiscord<Rika> which stable
19:50:04*xet7 joined #nim
19:50:26FromDiscord<XeroOl> I tried 1.4.2 and 1.4.4
19:51:41FromDiscord<dom96> relevant PR https://github.com/nim-lang/Nim/pull/13757
19:51:52FromDiscord<dom96> should be in 1.4
19:52:00FromDiscord<Rika> might have been removed, you can use clang but i forget what options you need other than --cc:clang
19:52:19FromDiscord<Rika> (edit) "but" => "since zig is modeled after it (i think) 'but"
19:52:38FromDiscord<dom96> are you sure you've got 1.4 in your PATH?
19:52:43FromDiscord<dom96> In reply to @Rika "might have been removed,": good point, it does seem to be still in devel though https://github.com/hessammehr/Nim/blob/devel/compiler/extccomp.nim#L142
19:52:43FromDiscord<XeroOl> `nim --version` shows 1.4.4
19:53:15FromDiscord<XeroOl> https://media.discordapp.net/attachments/371759389889003532/813861046547906560/unknown.png
19:53:32FromDiscord<XeroOl> I'm 99.99% sure that I'm running 1.4
19:53:34FromDiscord<dom96> oh wait
19:53:37FromDiscord<dom96> I was on a fork
19:54:05FromDiscord<Rika> its not on devel
19:54:33FromDiscord<dom96> yeah
19:54:33FromDiscord<dom96> https://github.com/nim-lang/Nim/commit/1b2b32169a5d8089a50509136a31b5ceb3773994
19:55:16*tane joined #nim
19:55:55FromDiscord<XeroOl> hmm
19:55:55FromDiscord<Tigor> @dom96 can you check this out if you have any free time please? ↵https://discord.com/channels/371759389889003530/371759389889003532/813781114799390721
19:56:16FromDiscord<dom96> @XeroOl you might be able to still point it at zig via --gcc.exe or --clang.exe https://github.com/nim-lang/Nim/blob/devel/config/nim.cfg#L299
19:56:58FromDiscord<XeroOl> thanks! I'll look into it
19:57:17FromDiscord<dom96> In reply to @Tigor "<@!132595483838251008> can you check": can you put your code on github or gist? Can't really download a zip right now 🙂
20:01:42FromDiscord<XxDiCaprioxX> Hey guys, I could use some help. I want to update nim to 1.4.4 using choosenim but I keep getting the issue "could not load: (libcrypto-1_1-x64|libeay64).dll". does anyone have a clue what is happening?
20:05:08FromDiscord<Unaimend> Does nim have something like c++ string view?
20:05:16*vicfred quit (Ping timeout: 240 seconds)
20:06:47FromDiscord<Tigor> @dom96 shoot you a PM with all the code
20:08:31FromDiscord<Rika> In reply to @Unaimend "Does nim have something": what is that?
20:09:48*hpyc9 quit (Quit: 420)
20:09:56*hpyc9 joined #nim
20:11:30FromDiscord<Unaimend> In reply to @Rika "what is that?": Basically, a reference which points to a continous section of a string
20:12:31FromDiscord<Unaimend> In my application I need a lot of substrings of a specific string, but I dont want to make a lot of copies since this would be slow and cost a lot of memory
20:13:41FromDiscord<Rika> views
20:13:57FromDiscord<Rika> im not sure if they exist
20:14:25FromDiscord<Unaimend> Maybe slices do what I want
20:14:49FromDiscord<Unaimend> (edit) "want" => "want, or is a slice a copy?"
20:15:03FromDiscord<Rika> which slices do you mean
20:15:17*krux02 joined #nim
20:15:51FromDiscord<dom96> [1 .. 5] will copy
20:16:49*lkjasdf quit (Read error: Connection reset by peer)
20:16:54*vicfred joined #nim
20:17:10*lkjasdf joined #nim
20:17:31FromDiscord<XxDiCaprioxX> In reply to @XxDiCaprioxX "Hey guys, I could": I even reinstalled the .dll, but to no avail. any clues?
20:17:42FromDiscord<Unaimend> In reply to @dom96 "[1 .. 5] will": ahh ok, thanks
20:19:09*letto_ quit (Quit: Konversation terminated!)
20:19:20*vicfred quit (Client Quit)
20:19:53*letto joined #nim
20:24:09FromDiscord<haxscramper> In reply to @Unaimend "In my application I": https://play.nim-lang.org/#ix=2Qz5 view types are experimental, but I suppose this could be enough for handing strings
20:24:36FromDiscord<haxscramper> Current implementation is stable enough to for such simple use case
20:25:11FromDiscord<haxscramper> This reminds me I need to PR new release to godbold
20:25:13FromDiscord<haxscramper> (edit) "godbold" => "godbolt"
20:25:55FromDiscord<Unaimend> I try this thank you 🙂
20:27:48*NimBot joined #nim
20:31:44*akky joined #nim
20:32:43*akky quit (Client Quit)
20:33:39FromDiscord<exelotl> Ooh I gotta see if my usecase for views works in 1.4.4 now
20:36:04FromDiscord<exelotl> @Unaimend docs for views are here: https://nim-lang.org/docs/manual_experimental.html#view-types
20:38:36FromDiscord<haxscramper> Pattern matching from fusion is now (finally) available on playground - https://play.nim-lang.org/#ix=2Qzc
20:38:50FromDiscord<exelotl> Oh nice
20:40:10FromDiscord<Unaimend> In reply to @haxscramper "Pattern matching from fusion": looks really nice, reminds me of my haskell days
20:40:42FromDiscord<haxscramper> In reply to @haxscramper "This reminds me I": Created PR with update, so nim `1.4.4` should be on godbolt quite soon
20:41:10FromDiscord<Solitude> In reply to @haxscramper "Pattern matching from fusion": finally, the ultimate fizzbuzz https://play.nim-lang.org/#ix=2Qze
20:41:20*Gustavo6046_ joined #nim
20:41:24*Gustavo6046 quit (Ping timeout: 268 seconds)
20:42:13FromDiscord<exelotl> Wow cool
20:42:23FromDiscord<haxscramper> The onyl thing that triggers me is
20:42:31FromDiscord<haxscramper> > {.experimental: "caseStmtMacros".}
20:43:20*Gustavo6046_ is now known as Gustavo6046
20:44:16FromDiscord<exelotl> Two things that bug me:↵1. "of of"↵2. Table matches aren't optimised to just a single lookup (a la withValue)
20:45:05FromDiscord<haxscramper> Optimizing to single lookup might create copies
20:45:18FromDiscord<haxscramper> If you mean nested tables
20:46:31FromDiscord<exelotl> I mean how↵`if k in tbl: echo tbl[k]`↵does 2 lookups
20:47:06FromDiscord<haxscramper> Yes, but I need to check if the key is in the table anyway instead of raising
20:47:31FromDiscord<haxscramper> Not really sure how it can be done in one lookup
20:47:46FromDiscord<haxscramper> But maybe I'm missing something
20:47:52FromDiscord<exelotl> withValue from the tables library is optimised to just do a single lookup
20:48:36FromDiscord<exelotl> So it could be possible to use that I guess
20:49:14FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Qzk
20:49:42FromDiscord<haxscramper> `contains` also does `rawGet`, and compares it
20:49:58FromDiscord<haxscramper> So `withValue` does two lookups too, it just might look like only one
20:50:15FromDiscord<haxscramper> oh well, wait
20:50:20FromDiscord<haxscramper> ye, it does not lookup
20:51:09FromDiscord<haxscramper> But that is an optimization that relies on implementation-specific detail
20:51:57FromDiscord<exelotl> Yeah, withValue is the only part of the tables lib that does that
20:52:39FromDiscord<exelotl> (edit) "does" => "can be used to do"
20:52:45FromDiscord<haxscramper> The biggest performance hit is actually from implicit copying that might occur during matching, ideally it all should be done via immutable views
20:53:30FromDiscord<haxscramper> And I want to rewrite pattern matching to use them when this feature becomes more stable
20:55:00FromDiscord<exelotl> Ah yeah that'll be good
20:55:31FromDiscord<exelotl> I've been looking forward to views for a long time 😅
21:00:31*robertmeta quit (Ping timeout: 268 seconds)
21:00:54*narimiran quit (Ping timeout: 265 seconds)
21:01:22*haxscramper quit (Remote host closed the connection)
21:02:26*sz0 quit (Ping timeout: 264 seconds)
21:03:01*robertmeta joined #nim
21:04:01*sz0 joined #nim
21:07:41FromDiscord<Unaimend> Could someone tell what I am doing wrong here?↵https://play.nim-lang.org/#ix=2Qzt
21:10:11leorize[m]so there are two issues: the default initializer uses this syntax: `T(field1: value, field2: anotherValue)`, and you didn't specify the fields
21:10:54FromDiscord<Unaimend> In reply to @leorize "https://play.nim-lang.org/#ix=2Qzw": Thank you very much, If I would change the return type of build to DeBruijnGraph without ref, would a call of the procedure produce a copy while returning?
21:11:02leorize[m]the second issue is that `T` should be `ref DeBruijnGraph` because you're creating a ref object
21:11:26*notchris quit (Ping timeout: 264 seconds)
21:11:57FromDiscord<Unaimend> In reply to @leorize "no": Why not? I am comparing it to C structs in my head at the moment
21:12:01*notchris joined #nim
21:12:01leorize[m]Nim automatically rewrite the code into `foo(result: var T)` if the value can't be returned efficiently
21:13:04leorize[m]you can read about it here: https://nim-lang.org/docs/manual.html#procedures-nrvo
21:13:56FromDiscord<Unaimend> Ahh ok, it just does RVO. makes sense
21:20:45FromDiscord<XeroOl> Okay, I've got my cross compilation compiling, but the resulting code is saying `could not load: pcre64.dll`
21:21:46FromDiscord<XeroOl> Am I missing something in the cross compilation process, or is this a dependency that I need to compile separately? I'm not sure what to do to make this work.
21:22:41leorize[m]you need that dll next to the resulting executable
21:23:17FromDiscord<XeroOl> I'm looking into how to build or otherwise obtain it
21:25:24leorize[m]depends on what os are you compiling to
21:26:51FromDiscord<XeroOl> I'm on linux, trying to get something cross compiled so it can run on windows 10
21:27:11leorize[m]you can cross compile/obtain pcre via the conan package manager
21:28:19leorize[m]or you can downloads nim's dlls.zip and copy pcre64.dll from there
21:28:31leorize[m]it's somewhere in Windows' download page iirc
21:29:00FromDiscord<XeroOl> thanks! I'll try that
21:32:06FromDiscord<XeroOl> Yep! that worked! I've just downloaded nim for windows and copied the provided dll.
21:49:34FromDiscord<XxDiCaprioxX> does anyone know what to do against "no SSL/TLS CA certificates found"?
21:50:18FromDiscord<XxDiCaprioxX> I have compiled with "-d:ssl", too
21:52:09FromDiscord<LITeralLANGuage9> What's a good IDE for nim?
21:52:19FromDiscord<XxDiCaprioxX> I use VS Code
21:53:33FromDiscord<Unaimend> So when I try to include a package is just wont work, I even added the .nimble/pkgs path to nim.cfg
21:54:05FromDiscord<XxDiCaprioxX> You need to download it first
21:54:14FromDiscord<Unaimend> (edit) "So when I try to include" => "sent" | "package is just wont work, I even added the .nimble/pkgs path to nim.cfg" => "code paste, see https://play.nim-lang.org/#ix=2QzM"
21:54:20FromDiscord<XeroOl> 1) `nimble install maybe`
21:54:22FromDiscord<Unaimend> In reply to @XxDiCaprioxX "You need to download": already did that
21:54:29FromDiscord<XxDiCaprioxX> Hn good question then
21:54:34FromDiscord<XxDiCaprioxX> Got my own issues with ssl rn
21:54:47FromDiscord<XeroOl> and then you need to add `requires "maybe"` to your .nimble file
21:55:03FromDiscord<XeroOl> (edit) ".nimble" => "nimble"
21:55:07FromDiscord<Unaimend> ahh ok
21:57:01FromDiscord<Unaimend> In reply to @XeroOl "and then you need": Do I have to specify the .nimble in the compile command?
21:57:23FromDiscord<XxDiCaprioxX> sent a code paste, see https://play.nim-lang.org/#ix=2QzO
21:57:39FromDiscord<XeroOl> @Unaimend how are you compiling the program. Are you using `nimble` to compile your project?
21:57:57FromDiscord<Unaimend> no
21:58:15FromDiscord<Unaimend> In reply to @XeroOl "<@!287576619718279178> how are you": nim compile --run src/main.nim
21:58:57FromDiscord<XeroOl> I actually don't know how dependencies work if it's not through nimble
21:59:01FromDiscord<XeroOl> try `nimble run`
21:59:23FromDiscord<XeroOl> (edit) "try `nimble run` ... " 03added "instead of `nim compile --run src/main.nim` ?"
22:00:26FromDiscord<Unaimend> Where can I read more about, how to work with projects and nimble
22:01:39FromDiscord<XeroOl> I'm not exactly sure what the best resource is, but the readme on https://github.com/nim-lang/nimble looks like a good place to start I think
22:02:27FromDiscord<XeroOl> basically, use `nimble init` to make a new project,`nimble build` to build the project, `nimble run` to build/run the project
22:04:20FromDiscord<Unaimend> ok thank you very much 🙂
22:05:25FromDiscord<Unaimend> In reply to @XeroOl "basically, use `nimble init`": I am following the "Nim in Action" book a did not get to the section about nimble(if there is one)
22:08:55ForumUpdaterBotNew thread by XxDiCaprioxX: SSL/TLS certifictae issues with Nim 1.4.4?, see https://forum.nim-lang.org/t/7551
22:09:30FromDiscord<Unaimend> In reply to @XeroOl "I'm not exactly sure": sent a code paste, see https://paste.rs/HOt
22:09:48FromDiscord<Unaimend> (edit) "https://play.nim-lang.org/#ix=2QzV" => "https://play.nim-lang.org/#ix=2QzU"
22:16:54FromDiscord<dom96> In reply to @Unaimend "I am following the": there is, chapter 5
22:17:32FromDiscord<Unaimend> In reply to @dom96 "there is, chapter 5": Hopefully, I can fix this issue after reading it, thank for the tipp
22:18:18FromDiscord<dom96> it looks like this module needs to be imported via `maybe/maybe` https://github.com/superfunc/maybe/tree/master/src
22:18:43FromDiscord<dom96> so try `import maybe/maybe`
22:21:07FromDiscord<Unaimend> In reply to @dom96 "so try `import maybe/maybe`": That worked but the package has compiler errors 😂
22:22:08ForumUpdaterBotNew post on r/nim by XxDiCaprioxX: How did SSL Certification change for Windows?, see https://reddit.com/r/nim/comments/lququb/how_did_ssl_certification_change_for_windows/
22:28:27FromDiscord<Unaimend> In reply to @dom96 "it looks like this": Seems like something with proc `<` doesnt work
22:30:23FromDiscord<dom96> it's an old package, likely needs a fix
22:31:54*krux02 quit (Remote host closed the connection)
22:32:37*krux02 joined #nim
22:35:19*tane quit (Quit: Leaving)
22:37:10*aaron7 joined #nim
22:37:12aaron7/!\ this chat has moved to irc.crimeircd.net #0 /!\
22:37:13*aaron7 quit (K-Lined)
22:37:55FromDiscord<Rika> ah theyre back
22:44:16*interd0memH joined #nim
22:44:19*Boohbah joined #nim
22:44:20*interd0memH quit (Remote host closed the connection)
22:45:05*Boohbah quit (Remote host closed the connection)
22:45:07FromDiscord<XxDiCaprioxX> how can I switch my nim version with choosenim?
22:46:18*dom96 quit (*.net *.split)
22:46:18*Araq quit (*.net *.split)
22:46:19*voidpi quit (*.net *.split)
22:46:43*mikedlr joined #nim
22:46:50*mikedlr quit (K-Lined)
22:46:58FromDiscord<dom96> `choosenim <version>`
22:47:04FromDiscord<XxDiCaprioxX> thanks
22:47:18FromDiscord<ElegantBeef> Dont forget `choosenim update <version>` 😄
22:47:32FromDiscord<dom96> huh, wow, there is a big netsplit on IRC
22:48:06FromDiscord<XxDiCaprioxX> In reply to @ElegantBeef "Dont forget `choosenim update": the new update changed the ssl functionality and nobody can help me figure it out
22:48:20FromDiscord<ElegantBeef> Well maybe the author of choosenim can help 😛
22:48:36FromDiscord<XxDiCaprioxX> It is not the fault of choosenim xD
22:48:39FromDiscord<ElegantBeef> Ah
22:48:55*voidpi joined #nim
22:48:55*dom96 joined #nim
22:48:55*Araq joined #nim
22:48:55FromDiscord<XxDiCaprioxX> The 1.4.4 was specifically to "properly" check for ssl certificates
22:48:58*dimi34ka joined #nim
22:49:19FromDiscord<XxDiCaprioxX> I'd love to choosenim the newest version but I prefer my programs working. thanks though 😛
22:49:31FromDiscord<dom96> hah, what problems are you running into with the new ssl stuff?
22:49:31*dimi34ka quit (Remote host closed the connection)
22:50:14FromDiscord<XxDiCaprioxX> well, I have a discord bot that now refuses to start with the error "no SSL/TLS CA certificates found"
22:50:56FromDiscord<dom96> nice
22:51:21FromDiscord<XxDiCaprioxX> Sooo, I'm staying 1.4.2 until I figure out what the hell
22:51:48FromDiscord<dom96> Yeah, SSL is a PITA :/
22:52:24FromDiscord<XxDiCaprioxX> yupp, so I prefer it not working to it actively trying to sabotage me
22:52:55FromDiscord<XxDiCaprioxX> I much rather focus on working on a FEN reader
22:53:11FromDiscord<XxDiCaprioxX> Anyways, as I ahem ahem "fixed" it, Ima go now, cya!
22:57:31*Vladar quit (Quit: Leaving)
23:02:13*blockedzx joined #nim
23:02:34*blockedzx quit (K-Lined)
23:10:53*LokiCw joined #nim
23:11:12*LokiCw quit (K-Lined)
23:17:29*Nefertiti joined #nim
23:17:43*Nefertiti quit (K-Lined)
23:49:14*aeverr quit (Quit: Konversation terminated!)
23:51:04*aeverr joined #nim
23:55:22FromDiscord<Avatarfighter> @XxDiCaprioxX o/
23:56:35FromDiscord<lithdew> Hello 👋 new here, checking out nim for the first time
23:57:20FromDiscord<Avatarfighter> @lithdew Welcome to the community 🙂 I hope you enjoy your stay ! Don't be afraid to ask questions no matter how dumb they sound, we've all been there
23:57:30FromDiscord<Avatarfighter> Does anyone know of a library where you can encrypt with public/private keys and initialize a public key with a supplied modulus and a derived number?
23:57:32FromDiscord<Avatarfighter> @Rika
23:57:59FromDiscord<lithdew> In reply to @Avatarfighter "Does anyone know of": Supplied modulus; under a curve or just RSA?
23:58:08FromDiscord<Avatarfighter> Just RSA
23:58:52FromDiscord<Avatarfighter> I think I need to wrap a library for this but I am unable to find something that lets me supply a modulus(n) and a derived number(e) I think I'm just bad at google