<< 24-12-2019 >>

00:01:19disruptekwe have that data at compile-time, why can't we stash it any way we want then? it's not like it's changing at runtime.
00:03:22*azed quit (Read error: Connection reset by peer)
00:10:57*Hideki joined #nim
00:11:20*Hideki is now known as Guest91994
00:15:18*Guest91994 quit (Ping timeout: 260 seconds)
00:38:36FromDiscord<Clyybber> disruptek: Ugh, turns out optimus/nvidia prime doesn't work with wayland ๐Ÿ˜ฆ
00:47:24shashlickdisruptek: not about wanting, it's just about what the compiler can do today and leveraging that vs. writing some new code
00:47:52disruptekfair enough.
00:48:02disruptekremind me what optimus/nvidia prime is.
00:48:25FromDiscord<Clyybber> its when you have an nvidia card and an intel integraded gpu
00:48:34disruptekoh right.
00:48:46FromDiscord<Clyybber> and nvidia in general doesn't work in wayland, or at least wlroots
00:48:58disruptekso what's the problem? are your balls getting steamy?
00:49:29*endragor joined #nim
00:49:40FromDiscord<Clyybber> cant launch shit on the nvidia gpu
00:50:05disruptekbut you were running wayfire earlier...
00:50:13disruptekonly on intel?
00:50:13FromDiscord<Clyybber> yeah
00:50:20FromDiscord<Clyybber> apparently
00:50:34disruptekwhy aren't you running nouveau? you get better performance AND sweaty balls.
00:50:40*leorize quit (Quit: WeeChat 2.6)
00:50:41disruptekit's, like, the best of both worlds.
00:50:41FromDiscord<Clyybber> "better"
00:51:01FromDiscord<Clyybber> I don't think they support my gpu, but I was about to try it a few days ago
00:51:07disruptekwhich gpu?
00:51:12FromDiscord<Clyybber> But afaik it doesn't support vulkan
00:51:15shashlickdisruptek: any other crucial nimterop items?
00:51:15*endragor quit (Read error: Connection reset by peer)
00:51:21FromDiscord<Clyybber> disruptek: GTX 850M
00:51:24shashlickdisruptek: i'm slacking off on the hard issues
00:51:24disruptekshashlick: no, it's dynamite.
00:51:26FromDiscord<mfiano> Hello, can anyone help? I'm following a tutorial and `add_item` on a seq is not defined.
00:51:34disruptektry `add`.
00:51:49*endragor joined #nim
00:52:03disruptek850M sounds like something that should be supported.
00:52:06FromDiscord<mfiano> type mismatch
00:52:14disruptekbut, maybe not with vulkan. why is that important?
00:52:23disruptekaside from the obvious wrt your vulkan lib work.
00:52:40FromDiscord<Clyybber> aside from that: not much
00:52:43disruptekmfiano: use a horse of a different color.
00:52:55disrupteks/horse/seq/ s/color/type/
00:52:57FromDiscord<Clyybber> but nouveau is also pretty dead afaict
00:53:11disruptekWorks For Me โ„ข
00:53:15FromDiscord<mfiano> Well I'm just trying to follow a tutorial riught now. I don't know what is available yet
00:53:19FromDiscord<mfiano> Well I'm just trying to follow a tutorial right now. I don't know what is available yet
00:53:50*Hideki joined #nim
00:53:57disrupteki do hate nvidia but, yeah, it's what i have atm.
00:54:14*Hideki is now known as Guest3940
00:54:21disruptekcuda etc.
00:55:08FromDiscord<Clyybber> you can have cuda on amd
00:55:09FromDiscord<Clyybber> too
00:55:17FromDiscord<mfiano> `add_item` is being called at the end here: https://xmonader.github.io/nimdays/day01_dmidecode.html
00:55:20FromDiscord<Clyybber> brb gonna try nouveau
00:56:43*tane quit (Quit: Leaving)
00:58:11FromDiscord<Clyybber> nevermind, actually can't give up vulkan support
00:59:22disruptekthey say once star trek gets its hooks in you, you just can't escape.
01:03:43*Guest3940 quit (Remote host closed the connection)
01:05:26FromDiscord<Clyybber> https://www.phoronix.com/scan.php?page=news_item&px=NVIDIA-Open-Source-GTC-20
01:05:34*Hideki joined #nim
01:05:58*Hideki is now known as Guest1583
01:09:59*Guest1583 quit (Ping timeout: 258 seconds)
01:11:14*endragor quit (Remote host closed the connection)
01:30:49*endragor joined #nim
01:31:50FromDiscord<slymilano> I have a type with a DateTime field, and it's failing to compile. I read you need to create a default value using a constructor, but I'm not sure how to do that. How do I set a constructor for my custom type?
01:32:02FromDiscord<slymilano> ```
01:32:02FromDiscord<slymilano> import times
01:32:02FromDiscord<slymilano>
01:32:03FromDiscord<slymilano> type
01:32:03FromDiscord<slymilano> Torrent* = object
01:32:03FromDiscord<slymilano> name*: string
01:32:03FromDiscord<slymilano> uploaded_at*: DateTime
01:32:05FromDiscord<slymilano> ```
01:32:29disruptekproc newTorrent(): Torrent = result = Torrent(uploaded_at: now())
01:32:43*sealmove joined #nim
01:34:08FromDiscord<slymilano> Ah so newTorrent is like a reserved function for constructor
01:34:08FromDiscord<slymilano> I see
01:34:09FromDiscord<slymilano> thx
01:34:24disruptekit's just convention.
01:35:17*endragor quit (Ping timeout: 258 seconds)
01:36:27FromDiscord<slymilano> hm.. .I'm still getting that compilation error. https://pastebin.com/YZstN6Tp
01:36:55FromDiscord<slymilano> Here's how I'm calling my type: https://pastebin.com/vAnNsvFW
01:37:29disruptekhttps://play.nim-lang.org/#ix=25iY works fine here.
01:38:27FromDiscord<slymilano> Am I initializing wrong then? `var torrent: Torrent = Torrent()`
01:38:37disruptekyes.
01:38:51disruptekvar torrent = newTorrent()
01:39:13disruptekie. the field needs to be initialized when it is instantiated.
01:39:19disrupteksome fields are grumpy like that.
01:39:22disruptekfickle beasts.
01:39:49FromDiscord<slymilano> Nice
01:39:56FromDiscord<slymilano> So it's not auto-called. I need to literally call newFoobar
01:39:57FromDiscord<slymilano> gotcha
01:39:58FromDiscord<slymilano> thank you!
01:40:17disrupteki mean, you can just Torrent(uploaded_at: whatever...) instead.
01:40:32disruptekit's just a nim convention that initializers are named thusly.
02:02:54*dddddd quit (Remote host closed the connection)
02:14:45*rockcavera quit (Remote host closed the connection)
02:18:22*jonafato quit (Ping timeout: 265 seconds)
02:20:42*rockcavera joined #nim
02:22:08FromGitter<deech> Why are `IndexError`'s uncatchable? https://nim-lang.org/docs/system.html#IndexError
02:22:19disruptekbecause they are defects.
02:24:16FromGitter<deech> Yes I see that but why? I can see reasons to catch them ... as an example a quick-and-dirty find in a collection with a default: โŽ โŽ ``` try: โŽ collection.filterIt(...)[0] โŽ except: โŽ defaultValue``` [https://gitter.im/nim-lang/Nim?at=5e0176d08897197969e9e8ce]
02:24:41disruptekbut doesn't it make more sense to implement that as hasKey()?
02:25:02FromGitter<deech> `hasKey` works on `seq`'s?
02:25:03disruptekattempting to access an index that doesn't exist seems like an error to me.
02:25:24disruptekno, but you know what i mean.
02:25:36disruptekyou have .low. it tells you what the lowest index is.
02:31:14sealmoveit makes more sense to ensure there won't be index out of bound, that to allow it happen and then catch it
02:31:28disruptekclearly.
02:31:39disruptekoh, i wrote low. i meant high.
02:32:01disrupteklow will be 0 (usually) but high will be -1 when the seq is empty.
02:32:12sealmovewell, low helps too with that, but yeah, it's rarely not 0
02:33:08disruptekenums are frequently nonzero for .low, but yeah. most people start with zero seqs and go from there as they mature.
02:33:16disrupteki mean, grow.
02:35:17disrupteksealmove has suffered with this more than anyone, most likely.
02:35:51sealmovemm?
02:36:04sealmovewhat makes you say so?
02:36:13disruptekdidn't you have 132 tests yielding index errors?
02:38:16sealmovethey yield various kinds of errors. i use the official kaitai struct tests which are written in a special syntax which is easily transpilable to almost any language. so i made the transpiler and have 132 tests while my project is still in early development.
02:38:43sealmovei need to re-write it from scratch btw
02:38:50disruptekyou're kidding.
02:38:59sealmovegoing to use new npeg feature to seperate lexing and parsing phase
02:38:59disruptekthe tests? or the whole thing?
02:39:05sealmovethe whole thing
02:48:56FromDiscord<slymilano> How can I tell my function to not return anything? `proc foobar*(): discard =` errors out...
02:49:57disruptekremove the : and the discard
02:50:02disruptekfoo() = discard
02:50:31disruptekie. no type following the proc arguments definition.
02:50:38FromDiscord<slymilano> ty ๐Ÿ˜„
02:53:10*couven92 quit (Ping timeout: 265 seconds)
03:02:42FromDiscord<slymilano> According to the docs this should work: `echo &"[database] Saving torrent: {torrent.canonical_url}"` but I'm getting an error: `Error: type mismatch: got <string>`
03:02:56FromDiscord<slymilano> `canonical_url` is a string in my `Torrent` type ๐Ÿค”
03:02:58*endragor joined #nim
03:03:30*endragor_ joined #nim
03:03:37disruptekyou imported `strformat`?
03:05:19FromDiscord<slymilano> that was it, the compiler error wasn't helpful
03:05:21FromDiscord<slymilano> thanks!
03:07:23*endragor quit (Ping timeout: 260 seconds)
03:15:16*muffindrake quit (Ping timeout: 248 seconds)
03:17:24*muffindrake joined #nim
03:21:45skrylar[m]isn't & the concatenation operator by default?
03:26:40FromDiscord<mfiano> How does Nim solve "the expression problem"?
03:28:01sealmovewhat's the expression problem?
03:29:36Tangerhttps://en.wikipedia.org/wiki/Expression_problem
03:32:29FromDiscord<slymilano> I think I found a bug with the xmltree parser? https://pastebin.com/ZNfXEh72
03:35:15FromDiscord<mfiano> Given a type, and a set of methods on that type, is it easy to add both more fields, and more methods? Unlike Java for example, which requires you to rewrite everything for the interface when adding a new method.
03:35:26FromDiscord<mfiano> How does Nim work around that?
03:37:26skrylar[m]fields take priority over methods in dot notation IIRC since you can always flip it around and use method(items) instead of items.method
03:48:25FromDiscord<slymilano> Hm.. .stuck with this cdata not parsing ๐Ÿ˜ฆ
03:58:31sealmovemfiano: Nim doesn't have methods in this sense
03:59:13sealmoveyou have normal procedures which take your object as first argument
04:00:03sealmoveand thanks to ufcs you can write myObj.myProc() as if it was a method
04:07:22TangerGenerics also help with that, I think. You can cover most cases with generic functions and then cover in the edge cases
04:31:47Tangerslymilano What's your inputs for that error?
04:33:33FromDiscord<slymilano> I have more details here: https://forum.nim-lang.org/t/4106
04:33:47FromDiscord<slymilano> (not for the CDATA error, I moved on to something else to keep momentum going)
04:41:08*chemist69 quit (Ping timeout: 248 seconds)
04:41:50FromDiscord<slymilano> Well I put in my three hours tonight, I'm going to bed - hopefully you guys know what's up with my code there in the forums, I'm probably making a mistake somewhere ๐Ÿ˜ฆ have a good night everyone
04:41:59*chemist69 joined #nim
04:51:32*chemist69 quit (Ping timeout: 260 seconds)
04:53:13*chemist69 joined #nim
04:59:32Tangerslymilano: I think you may be calling .text on the wrong element. Check out these examples, which compile against 1.04 https://pastebin.com/vUfh6wpE
04:59:39Tanger(This is for your cData issue)
05:00:53TangerWhen you're calling .child in your example, you're getting the XmlNode element that is <torrent:magnetURI>, but the cData is an inner element
05:02:21TangerMaybe try asserting that the element you're calling .text on is actually an xnCData type (just echo node.kind to see what kind of element it is)
06:08:59*nsf joined #nim
06:31:33FromDiscord<slymilano> Ah sonofabitch so c.items[0].text!
06:31:54FromDiscord<slymilano> Damn, I'll get better and scoping out these types in the docs. Appreciate your help! I will try it out tomorrow
06:38:21*gour joined #nim
06:38:23*mwbrown quit (Ping timeout: 250 seconds)
06:39:45*rockcavera quit (Remote host closed the connection)
06:40:47*mwbrown joined #nim
06:53:58*gmpreussner quit (Quit: kthxbye)
06:54:17*gmpreussner joined #nim
07:03:03yumaikashttps://www.junglecoder.com/blog/tabulaScriptaFirstThoughts
07:03:12yumaikasSomething that I'm building in Nim
07:14:47*Kaynato quit (Quit: Leaving)
07:31:50*solitudesf joined #nim
07:32:16*gangstacat quit (Quit: ฤœis!)
07:33:31*gangstacat joined #nim
07:41:16*sealmove quit (Quit: WeeChat 2.6)
07:47:41*silvernode joined #nim
07:59:36*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
08:00:00*gmpreussner quit (Quit: kthxbye)
08:05:03*gmpreussner joined #nim
08:13:44*Vladar joined #nim
08:30:07FromDiscord<Milerius> Hey the logging module seem's unstable on windows when using thread.
08:31:11FromDiscord<Milerius> Always failing an assertion that a sequence size changed while iterating, but i did nothing just calling the log stuff
08:31:42FromDiscord<Milerius> it's fails here: `assert(len(a) == L, "the length of the seq changed while iterating over it")`
08:35:36FromDiscord<Milerius> When using echo everything is going well
08:37:29FromDiscord<Milerius> I'm forced to use it like:
08:37:31FromDiscord<Milerius> https://gist.github.com/Milerius/85166cfaeceff11302f12aee39604d1d
08:37:55FromDiscord<Milerius> i don't know if this is normal @araq ?
08:43:38lqdev[m]I don't know if that'd help, but maybe try using a lock?
08:44:44lqdev[m]@mratsim is the one that knows the most about multithreading here
08:45:44FromDiscord<funcmike> Its sad 5 years without this fixed: https://github.com/nim-lang/Nim/issues/1837
08:45:46disbotโžฅ mysql wrapper doesn't support row with NULL column. ; snippet at 12https://play.nim-lang.org/#ix=25kg
08:48:30Zevvsealmove: you here?
09:11:29FromDiscord<kelly> isn't there too many open bugs
09:12:17FromDiscord<mratsim> @mfiano, Nim doesn't really have an expression problem because you don't have interfaces so no constraints.
09:12:17FromDiscord<mratsim>
09:12:18FromDiscord<mratsim> However if we ever had those, you can metaprogrammed you way out, in this repo: https://github.com/mratsim/compute-graph-optim/blob/master/arraymancer_discussion_347.md#semantic-pass-and-the-extension-problem I have implemented the following techniques that solves the expression problem: object algebras, Tagless Final.
09:12:18FromDiscord<mratsim>
09:12:22FromDiscord<mratsim> In the end, for my own DSL compiler where this is a problem, I choose to combine shallow and deep embeddings. I.e. fixed ADT for the deep embeddings and the extensibility is provided by shallow embedding (function) which are translated to the deep embedding.
09:13:20*Vladar quit (Quit: Leaving)
09:13:28FromDiscord<mratsim> and at the root of the repo you can see my multiple experimentations: https://github.com/mratsim/compute-graph-optim
09:16:18FromDiscord<mratsim> @Milerius this is my threadsafe logging module ๐Ÿ˜„ https://github.com/mratsim/weave/blob/master/weave/instrumentation/loggers.nim#L12-L14
09:17:08FromDiscord<mratsim> @kelly I think it's OK. A programming language is a complicated piece of software
09:17:43FromDiscord<mratsim> also unlike many other popular project, we can't just have a bot that closes issue that had no updates for 90 days ๐Ÿ˜›
09:24:24Zevvwe should!
09:25:14FromDiscord<mratsim> I get a cloudflare error on the playground
09:34:25federico3I updated the RFC aroung the logging tree https://github.com/nim-lang/RFCs/issues/146
09:34:25disbotโžฅ logging tree support
09:49:00*Tongir joined #nim
09:57:19*nsf quit (Quit: WeeChat 2.6)
10:12:55*couven92 joined #nim
10:14:02*zyklon joined #nim
10:15:51*uvegbot quit (Ping timeout: 258 seconds)
10:25:31*zyklon quit (Quit: Konversation terminated!)
10:25:48*zyklon joined #nim
10:37:32*Trustable joined #nim
11:07:26*couven92 quit (Ping timeout: 268 seconds)
11:18:02*nsf joined #nim
11:19:12FromDiscord<Milerius> There is a problem with the current logging module for me, for example let's say you need to log into a function that have been spawned through spawn from threadpool, you will need to set the handlers inside the function because handlers are thread local etc. But on windows it's leads somehow to crash after 4-5 minutes of an application launched with different various bug (assertion in a sequence that change len) (non destroying of the log
11:19:35FromDiscord<Milerius> In my case i would like to use just echo, but i need to keep a track of all the logs into a file + rotating
11:19:53FromDiscord<Milerius> The logging module was perfect for that, but i'm unable to get it working correctly on windows + llvm 9.0
11:20:44FromDiscord<Milerius> basically the workflow will look like: spawn -> initHandler (for the current task) -> log -> task end -> handler is destroyed ?
11:22:19FromDiscord<Milerius> One of my favorite logging library is this one: https://github.com/emilk/loguru . Ofc i can import it in nim and use it, but for me one of the good specs of this logging is that you just need to set the thread name into the current thread and then you can immediatly log the same way from all the thread/main thread
11:23:55FromDiscord<Milerius> After, on OSX, and Linux I have no problem with the logging module, but on Windows without going through mingw it is really very unstable. I really think that as nim released its first stable version we should have a logger that works everywhere without crashing.
11:26:29FromDiscord<mratsim> So it's MSVC only?
11:40:20FromDiscord<Milerius> llvm-clang
11:40:24FromDiscord<Milerius> + msvc
11:40:34FromDiscord<Milerius> all compiler that follow windows convention
11:45:33*tane joined #nim
11:46:17*uu91 joined #nim
11:49:45federico3did you open an issue?
11:52:09FromDiscord<Milerius> not yet, still investigating on my computer
11:52:27FromDiscord<Milerius> May i ask if the unit tests of the whole default library use MSVC or clang ?
11:52:29FromDiscord<Milerius> on windows ?
11:52:40FromDiscord<Milerius> where can i check that ?
11:53:56FromDiscord<mratsim> in appveyor.yml and azure-pipelines.yml
11:54:12FromDiscord<mratsim> Otherwise for logging try: https://github.com/status-im/nim-chronicles/
11:54:52FromDiscord<Milerius> ouch it's not tested
11:55:03FromDiscord<Milerius> it's tested only with gcc
11:55:42FromDiscord<Milerius> https://github.com/nim-lang/Nim/blob/devel/azure-pipelines.yml#L100
11:57:14FromDiscord<Milerius> and also here: https://github.com/nim-lang/Nim/blob/devel/azure-pipelines.yml#L137
12:05:57FromDiscord<Milerius> I understand now
12:06:10FromDiscord<Milerius> @mratsim You are using mingw on windows ?
12:08:34*Vladar joined #nim
12:12:54FromDiscord<mratsim> yes
12:13:46FromDiscord<mratsim> I did try running my multithreading runtime on with MSVC this weekend
12:14:05FromDiscord<mratsim> but I don't remember if it worked, because I tried running third-party code that for sure didn't work
12:14:50FromDiscord<mratsim> I yes I remember now, have to open an issue, MSVC fences are different than GCC, API-incompatible
12:15:16FromDiscord<Milerius> Yeah
12:15:20FromDiscord<Milerius> especially for calling convention
12:15:23FromDiscord<Milerius> we will be in big trouble
12:15:43FromDiscord<Milerius> I can help setup a github actions if you want @mratsim ?
12:15:51FromDiscord<Milerius> for the nim lang repo
12:16:07FromDiscord<Milerius> (i'm really good with github actions i don't know other CI stuff)
12:16:51FromDiscord<Milerius> Basically the workflow is:
12:16:51FromDiscord<Milerius>
12:16:52FromDiscord<Milerius> - Download clang for windows or use MSVC
12:16:52FromDiscord<Milerius> - Preparing with Koch
12:16:52FromDiscord<Milerius> - Running tests
12:16:52FromDiscord<Milerius>
12:16:52FromDiscord<Milerius> We agree ?
12:17:22FromDiscord<mratsim> Clang is done through appveyor and azure pipelines so only MSVC is needed
12:17:31FromDiscord<Milerius> clang on windows is really different
12:17:41FromDiscord<Milerius> Clang from mingw != clang from windows
12:17:53FromDiscord<Milerius> you probably want to try with the real LLVM clang windows from scoop
12:18:22FromDiscord<Milerius> https://github.com/rivy/scoop.bucket.scoop-main/blob/master/llvm.json
12:19:05FromDiscord<mratsim> ah I see
12:19:16FromDiscord<Milerius> Basically on windows is just:
12:19:16FromDiscord<Milerius>
12:19:16FromDiscord<Milerius> ```powershell
12:19:17FromDiscord<Milerius> iex (new-object net.webclient).downloadstring('https://get.scoop.sh')
12:19:17FromDiscord<Milerius> scoop install ninja llvm --global
12:19:17FromDiscord<Milerius> if ("${{ matrix.compiler }}" -eq "clang") {
12:19:19FromDiscord<Milerius> echo "::set-env name=CC::clang"
12:19:21FromDiscord<Milerius> echo "::set-env name=CXX::clang++"
12:19:22FromDiscord<Milerius> } else {
12:19:24FromDiscord<Milerius> echo "::set-env name=CC::${{ matrix.compiler }}"
12:19:26FromDiscord<Milerius> echo "::set-env name=CXX::${{ matrix.compiler }}"
12:19:27FromDiscord<Milerius> }
12:19:29FromDiscord<Milerius> & .github\workflows\vsenv.bat -arch=x64 -host_arch=x64
12:19:29FromDiscord<Milerius> ```
12:19:31FromDiscord<Milerius> little powershell script that do the job.
12:19:40*rockcavera joined #nim
12:19:55FromDiscord<mratsim> I can't followup on this before the weekend, but open a PR
12:19:57*tane quit (Quit: Leaving)
12:20:10FromDiscord<Rika> how can i trigger the compiler within nim?
12:20:18FromDiscord<Milerius> nim.cfg @Rika ?
12:20:22FromDiscord<Milerius> You mean change the compiler ?
12:20:25FromDiscord<Rika> no
12:20:30FromDiscord<Rika> compile a file within nim
12:20:42FromDiscord<Milerius> nim c / nim cpp file ?
12:20:42FromDiscord<Rika> i run a nim program which compiles a nim file
12:20:47FromDiscord<Milerius> Ah
12:20:58FromDiscord<Milerius> Just use exec
12:21:01FromDiscord<Milerius> + nim c / nim cpp ?
12:21:16FromDiscord<Rika> i guess that's one way, i was wondering if there were others
12:21:26FromDiscord<Milerius> I mean it's not a bad way to do that.
12:21:35FromDiscord<Rika> exec is only within nims files though
12:21:41FromDiscord<Rika> im doing it within a nim file
12:22:07FromDiscord<Milerius> If you want to compile a whole project you can probably call nimble too from a single exec
12:22:30FromDiscord<Rika> no no
12:22:44FromDiscord<Rika> im doing some logic then compiling a file depending on logic
12:22:58FromDiscord<Rika> execProcess seems like the only way...?
12:23:01FromDiscord<Rika> that's fine
12:23:06FromDiscord<Rika> it's good enough
12:23:08FromDiscord<Milerius> you have a short cmd
12:23:10FromDiscord<Milerius> like
12:23:12FromDiscord<Milerius> execCmd(=
12:23:13FromDiscord<Milerius> execCmd()
12:23:16FromDiscord<Milerius> smth like that
12:24:11FromDiscord<Rika> that's what im looking for it seems
12:31:01FromDiscord<Milerius> https://nim-lang.org/docs/osproc.html#execCmd%2Cstring @Rika
12:31:11FromDiscord<Rika> i found it
12:31:12FromDiscord<Rika> i know
12:31:28FromDiscord<Rika> i was at the page when i mentioned `that's what im looking for it seems`
12:34:28*nsf quit (Quit: WeeChat 2.6)
12:41:34*MarderIII joined #nim
12:45:47*MarderIII quit (Client Quit)
12:46:04*gour quit (Remote host closed the connection)
12:46:41*MarderIII joined #nim
12:46:50*gour joined #nim
12:48:41*gour quit (Remote host closed the connection)
12:51:46TongirHey, is krux02 on irc? The ast pattern matching library that he developed is unbelievably amazing.
12:53:10TongirI just wanted to thank him, it makes macro creation a cinch
12:54:13*silvernode joined #nim
12:56:30silvernodeSo python and bash have spoiled me and now it's causing me problems in Nim. Basically I'd like to call a function within another function that has an if block. Clearly this is way out of scope but I don't know the Nim way to work around this.
12:57:24silvernodeIn bash I could just call any function from anywhere at any time which is probably not a good thing for multiple reasons.
12:57:38Tongirsilvernode, Can you pastebin me an example of the kind of call you're trying to make?
12:58:09silvernode@Tongir, sure give me a minute and I'll get that to you
13:05:08*russellb joined #nim
13:05:41*russellb left #nim (#nim)
13:06:36silvernodeTongir: https://pastebin.com/HfmNCFB9
13:19:51*gour joined #nim
13:27:50*endragor_ quit (Remote host closed the connection)
13:28:58*MarderIII quit (Quit: Leaving)
13:36:31silvernodeHave a good night everyone
13:36:35*silvernode quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.)
13:38:58FromDiscord<Rika> silvernode, what's the issue?
13:41:57FromDiscord<Rika> oh rip, i think i missed him
13:45:56FromGitter<zacharycarter> PBR materials in -
13:45:59FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/3xhh/image.png)
13:46:20FromGitter<zacharycarter> now I just need to combine this with the rendering code I had before and hopefully I have some kickass looking maps
13:46:29*luis_ joined #nim
13:48:18*luis_ quit (Client Quit)
13:49:15*luis_ joined #nim
13:52:30*luis_ quit (Client Quit)
13:53:26*luis_ joined #nim
14:06:37*disruptek quit (Ping timeout: 258 seconds)
14:06:53*disbot quit (Ping timeout: 268 seconds)
14:07:21*luis_ quit (Quit: luis_)
14:10:07*disbot joined #nim
14:10:37*disruptek joined #nim
14:13:57*Trustable quit (Remote host closed the connection)
14:20:26*dddddd joined #nim
14:27:31FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/Al3s/image.png)
14:27:48FromGitter<zacharycarter> added back in procedural stochastic texturing and triplanar mapping
14:32:55*uvegbot joined #nim
14:33:40*zyklon quit (Ping timeout: 248 seconds)
14:34:29*uvegbot quit (Client Quit)
14:34:48*uvegbot joined #nim
14:42:30FromDiscord<mfiano> Is it safe to turn runtime bounds checking off?
14:47:10FromGitter<zacharycarter> as long as you don't access invalid memory
14:55:54*luis_ joined #nim
15:00:08*luis_ quit (Client Quit)
15:00:44*luis_ joined #nim
15:05:19*ng0_ joined #nim
15:05:59*ng0 quit (Disconnected by services)
15:06:14*ng0_ quit (Client Quit)
15:06:30*ng0 joined #nim
15:06:30*ng0 quit (Changing host)
15:06:30*ng0 joined #nim
15:08:46*endragor joined #nim
15:28:30*luis_ quit (Quit: luis_)
15:31:32*fanta1 joined #nim
15:45:30*luis_ joined #nim
15:50:48*luis_ quit (Quit: luis_)
15:51:28*luis_ joined #nim
15:55:24*luis_ quit (Client Quit)
15:55:51*luis_ joined #nim
16:04:15FromGitter<zacharycarter> okay - this looks much better
16:04:29FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/B7Vf/image.png)
16:05:57*endragor quit (Remote host closed the connection)
16:30:42FromDiscord<slymilano> Good morning fellas
16:30:50FromDiscord<slymilano> Merry Christmas!!!
16:33:58FromDiscord<slymilano> Anyone Have any thoughts on this?
16:34:01FromDiscord<slymilano> https://forum.nim-lang.org/t/4106
16:34:11*dwdv joined #nim
16:45:19Zevvyou're free to implement any `%` converters as suit you
16:45:38ZevvThere is no standard way to format a date/time in json, so the only one who knows how to do this for you is you
17:11:47*smitop joined #nim
17:12:37skrylar[m]rfc3339 is pretty common tho.
17:15:48*luis_ quit (Quit: luis_)
17:27:52*luis_ joined #nim
17:30:07*casaca joined #nim
17:31:21*chemist69 quit (Ping timeout: 252 seconds)
17:32:27*chemist69 joined #nim
17:37:57Zevvtrue, but not standard
17:38:17Zevvjson does not describe this
17:46:25*luis_ quit (Quit: luis_)
17:50:01*luis_ joined #nim
17:51:21*luis_ quit (Client Quit)
17:52:25*luis_ joined #nim
17:53:30FromDiscord<Rika> someone reply to sergio in that post that he can implement it himself xd dont wanna make an account to just use it once
17:56:47*NimBot joined #nim
18:02:34skrylar[m]the forum doesn't seem to honor password resets
18:03:38skrylar[m]i reset it twice and it says i can now log in, but then says the new password is invalid.
18:03:39FromDiscord<snluu> most popular json serializers just use ISO 8601 for date in json?
18:04:29skrylar[m]@dom96 fix your code >:C
18:06:50skrylar[m]https://stackoverflow.com/questions/522251/whats-the-difference-between-iso-8601-and-rfc-3339-date-formats hmm
18:07:38skrylar[m]someone did once ask for a converter between rfc and nim date objects
18:09:42*luis__ joined #nim
18:10:02*luis_ quit (Ping timeout: 240 seconds)
18:11:43*luis__ quit (Client Quit)
18:12:30*luis__ joined #nim
18:21:25FromDiscord<Milerius> how we copy a file at compile time in nim?
18:21:29*luis__ quit (Quit: luis__)
18:22:47*nsf joined #nim
18:24:49shashlickYou can readFile and writeFile
18:25:27shashlickBut here's what I do - https://github.com/nimterop/nimterop/blob/master/nimterop/build.nim#L133
18:29:50skrylar[m]this is really more a job for your build scripts...
18:44:08FromDiscord<slymilano> Is this really the best way to avoid collisions of same function names in different Nim files? https://pastebin.com/mZU6f0AC - https://narimiran.github.io/2019/07/01/nim-import.html says that `from foobar import nil` is an anti-pattern in Nim but honestly it feels like best option as it's extremely explicit about what file the function youre calling is coming from.
18:48:27*fanta1 quit (Quit: fanta1)
18:51:10shashlickI just import normally and qualify when there's a collision
18:51:19shashlickHow often does it happen anyway
18:52:59FromDiscord<slymilano> \> qualify - can you show me an example? trying to learn idiomatic Nim
18:54:06solitudesfit shows in the miran's blogpost
18:54:15solitudesfprefix symbol with module name
18:58:42*fanta1 joined #nim
19:00:26*fanta1 quit (Client Quit)
19:17:13*nsf quit (Quit: WeeChat 2.6)
19:19:47FromDiscord<exelotl> i have the problem in my game where the `player` module exposes a lot of top-level variables. So you'll be writing some enemy AI and you'll accidentally write `vel.x` instead of `self.vel.x`, and whoops you moved the player
19:19:47*natrys joined #nim
19:24:31*skrylar[m] laughs.
19:25:49FromDiscord<exelotl> one solution would be to move all the player properties into some self contained datatype, but that makes the player module itself way more annoying to read and write. Plus I feel more comfortable using loose variables on the GBA for this sort of thing where possible
19:26:29FromDiscord<exelotl> so yeah I've ended up using the `from x import nil` pattern when accessing the player from other modules
19:27:09*azed joined #nim
19:28:31skrylar[m]you can use function level templates to get around that in some cases by the way
19:28:49skrylar[m]template pvx = player.velocity.x
19:30:18*natrys quit (Ping timeout: 260 seconds)
19:31:38FromDiscord<exelotl> oh yeah that's true
19:32:21FromDiscord<exelotl> only recently discovered that when I was looking at Zevv's aoc code x)
19:33:58*Zevv gave up on that
19:40:29skrylar[m]i discovered it by "wonder if this works" because of gnarly array code
19:40:42skrylar[m]sometype.whatever[index].subobject nonsense
19:41:03*smitop quit (Quit: Connection closed for inactivity)
19:41:39*Tongir quit (Ping timeout: 258 seconds)
19:46:15*natrys joined #nim
19:47:07FromGitter<deech> Nim appears to allow trailing commas in seqs, eg, `@[1,2,3,]`, this is great! But unfortunately that seq can't be printed ( at least in the VM ), so doing `echo @[1,2,3,]` fails with: โŽ โŽ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e026b3b8dfce538b501bc76]
19:56:45Zevvhttps://play.nim-lang.org/#ix=25nS no problem?
19:57:04Zevv!eval echo @[1,2,3,]
19:57:07NimBot@[1, 2, 3]
19:57:17Zevv!eval static: echo @[1,2,3,]
19:57:20NimBot<no output>
19:57:21FromDiscord<slymilano> So someone said I'm free to implement my own `%` converters for DateTime object fields. Where can I read up on this?
19:57:26FromDiscord<slymilano> > <Zevv> you're free to implement any % converters as suit you
20:00:12solitudesflook at examples https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/json.nim#L292
20:01:20Zevv~proc `%`*(dt: DateTime): JsonNode = newJString $dt
20:01:22FromDiscord<slymilano> Dumb question but I just plop this anywhere?
20:01:22FromDiscord<slymilano>
20:01:22FromDiscord<slymilano> ```
20:01:22FromDiscord<slymilano> proc `%`*(s: DateTime): JsonNode =
20:01:22FromDiscord<slymilano> result = someConverter(s)
20:01:23FromDiscord<slymilano> ```
20:02:10Zevvjust anywhere in your code base should do
20:02:24Zevvcomplete example: http://ix.io/25nU
20:03:01FromDiscord<slymilano> Thank you your help is priceless to me as a starter
20:03:09skrylar[m]@slymilano i assume you just write proc `%`*(...)
20:03:16skrylar[m]oh, was answered
20:03:46skrylar[m]i have a nimble package that will output and parse these for you tho :3
20:04:11skrylar[m]https://github.com/Skrylar/rfc3339
20:04:49FromDiscord<slymilano> Much appreciated but trying as much as humanly possible to not reach out for packages - keep things tight
20:04:51*luis__ joined #nim
20:05:01FromDiscord<slymilano> something very zen about writing Nim code
20:05:30luis__Hey everyone is there a web scraper for nim, which I can use to get latest proxies from "https://thepiratebay-proxylist.org/"?
20:05:47luis__similar to find_url_list() from pythons beautifulsoup?
20:06:10skrylar[m]i think we have an xml parser
20:06:32FromDiscord<slymilano> Yeah check my example here Luis
20:06:51FromDiscord<slymilano> https://github.com/sergiotapia/torrentinim/blob/master/src/crawlers/leetx.nim
20:07:01luis__thanks!
20:07:18FromDiscord<slymilano> Specifically nimquery for the familiar css query selectors.
20:07:21FromDiscord<slymilano> !repo nimquery
20:07:22disbothttps://github.com/GULPF/nimquery -- 9nimquery: 11Nim library for querying HTML using CSS-selectors (like JavaScripts document.querySelector) 15 46โญ 1๐Ÿด 7& 1 more...
20:15:06luis__<slymilano> pageUrls is from which module?
20:16:32luis__oh, sorry, you define it at the beginnig...
20:19:24*chemist69 quit (Ping timeout: 246 seconds)
20:20:41*chemist69 joined #nim
20:22:24Zevv[ANN] NPeg 0.22.0 was just released; biggest change is parsing of sequences of any type. Also did a nice refactoring to get rid of nasty stuff that stalled new developments, so things are moving again.
20:22:35ZevvAnd merry christmas to all of #nim
20:23:54FromDiscord<slymilano> yep luis its my own thing
20:29:53FromDiscord<slymilano> It's alive my dudes! Reached a major milestone for my first Nim project ๐Ÿ˜„
20:29:53FromDiscord<slymilano> https://cdn.discordapp.com/attachments/371759389889003532/659130644475019296/Screen_Shot_2019-12-24_at_3.29.05_PM.png
20:35:49FromDiscord<Clyybber> silvernode: You are missing a `let`
20:37:43FromDiscord<Clyybber> merry christmas
20:39:14*luis__ quit (Quit: luis__)
20:44:02*gour quit (Remote host closed the connection)
20:51:21*Vladar quit (Quit: Leaving)
21:07:53muffindrakeWhat would the equivalent to a function pointer structure field be in nim?
21:09:21*xet7 quit (Quit: Leaving)
21:12:22*xet7 joined #nim
21:12:58FromGitter<bung87> `fieldA:proc(b:string):string`
21:14:12skrylar[m]^ also check to make sure if you need something like {.cdecl.} in there, because you can put annotations on function field types
21:14:14FromDiscord<demotomohiro> https://nim-lang.org/docs/manual.html#types-procedural-type
21:16:49muffindrakeAh, similar to a forward declaration then. Thanks.
21:17:58*nsf joined #nim
21:34:22*luis__ joined #nim
21:34:51AraqMerry Christmas!
21:35:01AraqI was able to merge my ARC improvements
21:35:15*luis__ quit (Client Quit)
21:35:46*luis__ joined #nim
21:39:10*luis__ quit (Remote host closed the connection)
21:40:14*luis_ joined #nim
21:41:11FromGitter<alehander92> happy Christmas!!
21:41:57FromGitter<alehander92> rest bitt
21:45:02FromDiscord<treeform> Merry Christmas!
21:50:20*tyler569 quit (Quit: leaving)
21:53:48*natrys quit (Ping timeout: 260 seconds)
21:56:10*rockcavera quit (Remote host closed the connection)
22:02:36FromGitter<deech> Merry Christmas!
22:04:23FromGitter<zetashift> merry christmas y'all
22:06:46*natrys joined #nim
22:07:27skrylar[m]so it turned out the function to convert time was.. one line of code. hah
22:08:20*casaca quit (Ping timeout: 265 seconds)
22:08:38FromGitter<deech> Zevv, maybe it's just in NimScript but I can repro it in a Nimble file.
22:09:44*casaca joined #nim
22:12:01*Tyresc joined #nim
22:19:43luis_What am I doing wrong in the exerpt:
22:19:50luis_https://i.imgur.com/Zov4vIL.png
22:20:05luis_It gives Error: type expected
22:21:46FromDiscord<Milerius> do we have a function to open an url in the main webbrowser of our os ?
22:22:39Araqluis_: use '=' for named arguments like in Python
22:22:49luis_thanks
22:22:57Araq':' is only for object constructors (yes, I know it's a bit confusing)
22:23:14AraqMilerius: browsers module in the stdlib
22:26:02FromDiscord<Milerius> Thanks Araq
22:26:13FromDiscord<Milerius> Did you read my message before about clang/msvc with nim ?
22:26:25FromDiscord<Milerius> We have probably tons of stuff broken using clang msvc on windows with stdlib.
22:26:44FromDiscord<Milerius> I absolutely need to run all the tests from the stdlib with clang or msvc to verify some stuff
22:27:17FromDiscord<Milerius> logging module crash directly on windows with threads when using a compiler that have windows function call convention (clang, msvc)
22:28:31FromDiscord<Milerius> also this is rly weird: https://gist.github.com/Milerius/f5ec59c6c35d36748e5fe4c16cfc6ede
22:28:38FromDiscord<Milerius> i suspect a wrong code generation
22:29:01Araqthat's a known problem but not invalid C code
22:29:08FromDiscord<Milerius> yeah
22:29:25FromDiscord<Milerius> but we need a CI for windows compiler that are not gcc
22:29:40FromDiscord<Milerius> I spend 2 days thinking it's was my fault
22:29:49FromDiscord<Milerius> before switching to gcc and see that everything go very well.
22:30:14Araqagreed but please consider that the installers ask for a mingw for a reason
22:31:04FromDiscord<Milerius> Yeah i understand perfectly, but my personnal opinion (i really hate MSVC) but clang generate a really good assembly code nowadays
22:31:11Araqand it's expensive all these OS,CPU,C environment combinations
22:31:18Araq*to support
22:31:18skrylar[m]more specifically, MSVC. OpenWatcom is a bit of a corpse and Clang is highly compatib with GCC ;)
22:31:47FromDiscord<Milerius> also what do you think about having this by default for example: https://nuwen.net/mingw.html
22:32:02FromDiscord<Milerius> and also: https://github.com/mstorsjo/llvm-mingw someone tried it ?
22:32:45FromDiscord<Milerius> clang on windows (not mingw) follow windows call convention / MSVC rules, so sometimes is hard as MSVC
22:33:46AraqI routinely use MSVC fwiw
22:33:47FromDiscord<Milerius> I suspect a lot of function generated by nim to not respect: https://docs.microsoft.com/en-gb/cpp/build/x64-calling-convention?view=vs-2019 and being rewritten with wrong/unwanted value leading to some crash
22:34:06FromDiscord<Milerius> (or maybe it's just threading stuff problem=
22:34:08FromDiscord<Milerius> (or maybe it's just threading stuff problem)
22:34:28AraqI suspect it just works as I'm an expert on calling conventions
22:34:31Araq:P
22:34:34FromDiscord<Milerius> ๐Ÿ˜›
22:34:41FromDiscord<Milerius> I trust you, but as i tell you
22:34:47Araqno really, I know these things quite well
22:34:49FromDiscord<Milerius> I write a real application for the company in nim
22:34:55Araqbut threading is always tricky
22:35:06FromDiscord<Milerius> it's was crashing with clang on windows, switched to gcc now it's work
22:35:17FromDiscord<Milerius> But i'm sure your goal is that all nim code run everywhere every compiler
22:35:26FromDiscord<Milerius> so we should be concerned
22:36:15Araqmy ultimate goal is 1. 1 CPU, 1 OS, 1 native Nim backend, 1 memory management strategy.
22:36:26FromDiscord<Milerius> gc arc ? ๐Ÿ˜„
22:36:53FromDiscord<Milerius> where is my christmas gc arc ๐Ÿ˜›
22:37:18Araqit's there, see https://forum.nim-lang.org/t/5734
22:37:31FromDiscord<Milerius> ๐Ÿ˜ฎ
22:37:37FromDiscord<Milerius> Do we have a newsletter ?
22:37:41FromDiscord<Milerius> so i don't miss stuff like that
22:37:53Araqiirc there is an RSS feed
22:37:57FromGitter<deech> Is there any way to specify build time dependencies in Nimble? For instance I want to use 'nimarchive' to unpack stuff at build time but don't need it for library code.
22:39:10FromDiscord<Milerius> Congratulation for arc araq !
22:40:44*luis_ quit (Quit: luis_)
22:41:38FromGitter<deech> Yeah, congrats!
22:43:02Araqthanks :-)
22:43:39skrylar[m]i'm always amazed when i see rss feeds still existing
22:43:57Araqdeech: "build time deps"? I don't think so, I would use regular deps
22:49:29*solitudesf quit (Ping timeout: 258 seconds)
22:50:55FromDiscord<Fern & Simula (They/Them)> i'm looking into wrapping a C single header library. one of the functions takes a `uint64_t*`. Would I just wrap that as an openarray of type int64?
22:51:47Araqif it is followed by a long int length
22:52:12FromDiscord<Fern & Simula (They/Them)> also congrats araq :)
22:52:32FromDiscord<Fern & Simula (They/Them)> it's followed by a `uint32_t` named size, which I assume is the length
22:54:14Araqtoo risky to map it to openarray, you are better off with ptr UncheckedArray[uint64]
22:54:38FromDiscord<Fern & Simula (They/Them)> awesome, thanks! very new to the C ffi haha
22:56:42FromDiscord<slymilano> Hey guys, how can I convert scientific notation to decimal notation in Nim? Here's how in Ruby: https://stackoverflow.com/questions/8586357/how-to-convert-a-scientific-notation-string-to-decimal-notation
22:57:09*mwbrown quit (Ping timeout: 265 seconds)
22:57:41FromGitter<zacharycarter> thoughts?
22:57:50FromGitter<zacharycarter> (https://files.gitter.im/nim-lang/Nim/LWfG/image.png)
22:59:19*mwbrown joined #nim
23:01:29*natrys quit (Quit: natrys)
23:05:40Araqtoo dark and too abstract
23:06:13Araqslymilano: maybe $parseFloat(x)
23:06:56dom96ooh, that's a nice thread about arc
23:07:01dom96thanks for writing it up Araq
23:08:09FromGitter<bung87> anyone can provide a job to me?
23:08:18FromDiscord<slymilano> doesn't seem to work: https://pastebin.com/9LrmZwyi
23:10:30FromDiscord<slymilano> I want `1.024e-12` to be a string `"0.000000000001024"`
23:11:01dom96deech: what you are after is something we've considered and will still likely implement (there is an issue for it somewhere), for now we just have one kind of deps. Please be more clear about what you mean by "build-time" deps though, if I understand what you're after then it doesn't really apply to Nimble libraries (remember, they are only built at the very end).
23:16:27FromGitter<deech> dom96, I'm after being able to having an executable available in a `task`. For now I'm just doing it ad-hoc, compiling it directly but was wondering if there was a more supported approach.
23:19:14Araqslymilano: formatFloat(parseFloat(x), ...)
23:22:32dom96deech: ahh, not right now, this will be solved by task-level deps: https://github.com/nim-lang/nimble/issues/482
23:22:33disbotโžฅ Feature: Task-level dependencies
23:31:37*nsf quit (Quit: WeeChat 2.6)
23:36:36FromGitter<zacharycarter> Araq: yeah - I'm going to re-add the rest of the materials and then a bunch of lighting
23:58:11*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
23:58:24zedeusAraq: very exciting post, congrats on the progress!
23:58:45*pbb joined #nim
23:59:03zedeusI came across another memory corruption that seems to be caused by methods, but it's in the nim-markdown library which has a lot of code so I couldn't easily make a minimal example