<< 22-03-2020 >>

00:00:01*junland quit (Quit: %ZNC Disconnected%)
00:02:45*junland joined #nim
00:05:46*rnrwashere joined #nim
00:08:45*rnrwashere quit (Remote host closed the connection)
00:09:57*rnrwashere joined #nim
00:12:59*sealmove joined #nim
00:16:07FromDiscord<Varriount> Anyone know of a good tutorial/walkthrough for someone who wants to try NixOS?
00:18:08*rnrwashere quit (Remote host closed the connection)
00:23:50*filcuc quit (Ping timeout: 256 seconds)
00:25:40*rnrwashere joined #nim
00:31:49*Trustable quit (Remote host closed the connection)
00:34:13*sealmove quit (Quit: WeeChat 2.7.1)
00:38:35leorizeVarriount: their manual is pretty descriptive
00:39:15leorizedisruptek: I have to sub to look at the vids? :P
00:39:25*krux02_ joined #nim
00:41:52*krux02 quit (Ping timeout: 246 seconds)
00:48:48disruptekleorize: really?
00:49:09leorizeyea it said vid available only to subscribers
00:49:20disruptekthat makes zero sense.
00:49:36leorize"This video is only available to subscribers. Sub now to watch and support disruptek."
00:50:59disruptektry it now?
00:51:24disrupteki just tried toggling a button but it toggled back. might be a ui error.
00:52:11FromDiscord<Recruit_main707> Still there for me
00:52:24disruptekidiotic.
00:52:48leorizesame
00:53:49disruptekmaybe it's not under "Only allow subscribers to watch your past broadcasts" but that would blow my mind.
00:55:41disruptekhttps://www.twitch.tv/videos/572030955
01:05:01*Guest9949 quit (Ping timeout: 264 seconds)
01:06:37*dadada joined #nim
01:07:00*dadada is now known as Guest34533
01:18:33*PMunch quit (Quit: leaving)
01:18:38*sleepyqt quit (Ping timeout: 250 seconds)
01:21:23*rnrwashere quit ()
01:33:34*Guest34533 quit (Ping timeout: 240 seconds)
01:37:02*dadada joined #nim
01:37:25*dadada is now known as Guest76399
01:50:08FromDiscord<Rika> collect is only nim 1.2 or devel?
01:50:13disruptekyep.
01:51:03FromDiscord<Rika> shit
01:51:04FromDiscord<Rika> okay
01:58:07FromDiscord<KingDarBoja> How I can check if some object 'x' is of type 'x'
01:58:18FromDiscord<Rika> x is y
01:58:19FromDiscord<KingDarBoja> Once again, like in Python uses `isinstance`
01:58:25FromDiscord<KingDarBoja> Really?
01:58:26FromDiscord<Rika> i think
01:58:32FromDiscord<KingDarBoja> Let me check
01:59:04FromDiscord<Rika> doesnt seem so
01:59:06FromDiscord<Benumbed> I thought it was ‘of’
01:59:25FromDiscord<Rika> its of
01:59:32disruptekwhen x is SomeType:
01:59:40disruptekof is for inheritance checks.
01:59:54FromDiscord<Benumbed> Ahhhh yep, mb
02:00:00FromDiscord<Rika> eeee
02:00:01FromDiscord<Rika> ok
02:00:05FromDiscord<Benumbed> I've been working with the inheritence stuff a lot of late lol
02:00:26FromDiscord<Rika> `Checks if T is of the same type as S.` this bamboozled me!
02:00:26FromDiscord<KingDarBoja> so let x = type rika
02:00:40*Guest76399 quit (Ping timeout: 250 seconds)
02:00:50FromDiscord<KingDarBoja> y = some_instance_x
02:01:01FromDiscord<KingDarBoja> Check should be: `x is type(y)` ?
02:01:07FromDiscord<Rika> i'm a type now it seems
02:01:16FromDiscord<Rika> x is typeof y
02:01:17FromDiscord<Benumbed> I was wondering if you were going to say something about that lol
02:01:53FromDiscord<Rika> also afaik is works between 2 instances
02:01:55FromDiscord<KingDarBoja> y should be of type `Rika`
02:02:08FromDiscord<Rika> oh wow i really am a type now
02:02:15FromDiscord<KingDarBoja> I got lazy hahaha
02:02:47FromDiscord<Benumbed> imgur.com/a/SzQpWkN
02:03:10FromDiscord<Benumbed> bad paste, bad paste!
02:03:23FromDiscord<Benumbed> https://play.nim-lang.org/#ix=2eUT
02:03:25FromDiscord<KingDarBoja> ```
02:03:25FromDiscord<KingDarBoja> type rika* = object
02:03:25FromDiscord<KingDarBoja> coolness*: int
02:03:26FromDiscord<KingDarBoja> sarcasm*: int
02:03:26FromDiscord<KingDarBoja>
02:03:26FromDiscord<KingDarBoja> let y = initRika(5, 10)
02:03:26FromDiscord<KingDarBoja> y is typeof x
02:03:28FromDiscord<KingDarBoja> ```
02:03:33FromDiscord<KingDarBoja> ```nim
02:03:33FromDiscord<KingDarBoja> type rika* = object
02:03:35FromDiscord<KingDarBoja> coolness*: int
02:03:36FromDiscord<KingDarBoja> sarcasm*: int
02:03:38FromDiscord<KingDarBoja>
02:03:39FromDiscord<KingDarBoja> let y = initRika(5, 10)
02:03:41FromDiscord<KingDarBoja> y is typeof x
02:03:42FromDiscord<KingDarBoja> ```
02:03:43FromDiscord<Rika> RIP irc people
02:03:47FromDiscord<Rika> a multiline paste
02:03:51FromDiscord<Rika> which was also edited
02:03:55FromDiscord<Rika> RIP indeed.
02:04:09FromDiscord<Rika> initRika is not defined 😛
02:04:30*FromDiscord <KingDarBoja> Asume it is
02:05:01FromDiscord<Rika> thats correct yes
02:05:11FromDiscord<Rika> x is not defined :PPP
02:05:50FromDiscord<KingDarBoja> arrr
02:06:00FromDiscord<KingDarBoja> It was actually `y is typeof rika`
02:06:59FromDiscord<Rika> ah
02:06:59*dadada__ joined #nim
02:07:01FromDiscord<KingDarBoja> Nope, doesnt work
02:07:02FromDiscord<Rika> if x is not defined
02:07:03FromDiscord<KingDarBoja> `Error: 'typedesc' metatype is not valid here; typed '=' instead of ':'`
02:07:06FromDiscord<Rika> its just y is rika
02:07:30FromDiscord<KingDarBoja> Ah
02:07:38FromDiscord<Benumbed> @KingDarBoja Like so https://play.nim-lang.org/#ix=2eUT
02:08:48FromDiscord<Benumbed> (I just used a Stream as an example type)
02:09:25FromDiscord<Rika> you sure love your streams
02:09:37FromDiscord<Benumbed> Well I'm using them a lot right now 😄
02:10:09disruptekhttps://play.nim-lang.org/#ix=2eUW
02:10:11FromDiscord<KingDarBoja> And what if I want to check the type by extracting it from another instance?
02:10:16FromDiscord<Benumbed> Writing a network client, so I grab a bunch of data from the socket, shhove it in a stream and that gives me some nice utility functions
02:10:21FromDiscord<Rika> typeof theinstance
02:10:37FromDiscord<Rika> sh hove
02:10:54FromDiscord<KingDarBoja> Nope
02:10:57disruptek`is` is often code smell, though.
02:11:20FromDiscord<Benumbed> disruptek: Sheer curiosity, why add the when?
02:11:38disruptekbecause it's a compile-time operation.
02:11:38FromDiscord<KingDarBoja> Let x and y be of the same type, `Rika`
02:11:57FromDiscord<KingDarBoja> How it should be? `x is typeof y` ? or `x is typeof(y)`
02:12:21FromDiscord<Benumbed> vs something like `if a is Stream` which would be runtime evaluation?
02:12:37disruptekit wouldn't be. that's the point.
02:12:47FromDiscord<Rika> @KingDarBoja same thing
02:13:04FromDiscord<Rika> remember, UFCS
02:13:11FromDiscord<KingDarBoja> UFCS?
02:13:20FromDiscord<Rika> https://en.wikipedia.org/wiki/Uniform_Function_Call_Syntax
02:13:20FromDiscord<Benumbed> Okay I don't understand, but I'm not all here atm anyway
02:13:34disruptek`is` is a compile-time test.
02:13:39FromDiscord<Rika> f(a) == a.f() == a.f == f a
02:13:51FromDiscord<Benumbed> okay but how does that releate to you adding `when`?
02:14:00FromDiscord<Rika> when is a compile-time if
02:14:03disruptekwhen is a compile-time version of `if`.
02:14:10FromDiscord<Rika> you cannot if when you use is
02:14:24FromDiscord<Benumbed> ahhah, thank you both 🙂
02:14:32FromDiscord<KingDarBoja> And now I got confused...
02:14:48FromDiscord<Rika> where are you confused
02:14:52FromDiscord<Rika> what are you confused by
02:14:55FromGitter<awr1> what is nimph?
02:15:03disruptek!repo nimph
02:15:04disbothttps://github.com/disruptek/nimph -- 9nimph: 11Nim package hierarchy manager from the future 🧚 15 54⭐ 3🍴 7& 1 more...
02:15:05FromDiscord<KingDarBoja> Check if two instances have the same type lol
02:15:15FromDiscord<KingDarBoja> So `typeof(x) == typeof(y)` right?
02:15:16FromDiscord<Rika> disruptek is pinged by the mere mention of nimp
02:15:18FromDiscord<Rika> nimph
02:15:30FromDiscord<Rika> i think that works, sure
02:16:06FromDiscord<KingDarBoja> `Error: 'typedesc' metatype is not valid here; typed '=' instead of ':'` wtf?
02:16:07FromDiscord<Rika> it doesnt work
02:16:07FromDiscord<Rika> lmao
02:16:16FromDiscord<Rika> use x is typeof y
02:16:21FromDiscord<Rika> theres no == for typedesc
02:16:23FromDiscord<Rika> it seems
02:17:07FromDiscord<KingDarBoja> Nope doesn't work, same error
02:17:32disruptekwhat is it you are trying to do?
02:17:36FromDiscord<Rika> can you put your code in playground
02:17:40FromDiscord<KingDarBoja> Hold on
02:17:45FromDiscord<Rika> i feel like the error is from some other line
02:18:05disrupteki feel like i need some ointment.
02:18:16FromDiscord<Rika> get some then
02:18:32FromGitter<awr1> ah so nimph is an extended nimble? kind of?
02:19:03disruptekit will be a nimble replacement eventually. i'm working on the compiler at the moment.
02:19:41disruptekthere's stuff you can do with nimph+nim that you cannot do with nimble+nim, basically.
02:19:45FromGitter<awr1> i see
02:20:02disrupteklocal deps, lockfiles, nimblePaths, etc.
02:20:19FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2eV2
02:20:21FromDiscord<Rika> is it stable right now
02:20:32FromDiscord<Rika> because that sounds like something id use
02:20:50disruptekpretty stable, though the compiler may have broken it a little in 1.2.
02:21:18FromDiscord<Rika> isnt check runtime
02:21:23FromDiscord<Rika> is unittest.check runtime?
02:21:30FromDiscord<Rika> ofc it is
02:21:30disruptekyes.
02:21:50FromDiscord<Rika> hmm i wonder what it's doing that's not allowing the code to compule
02:21:53FromDiscord<Rika> compile
02:22:32disruptekwhich code?
02:22:41FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2eV3
02:24:39disruptekhttps://play.nim-lang.org/#ix=2eV6
02:25:24leorizedisruptek: for inheritance there's `as` which is a runtime check
02:25:26FromDiscord<Rika> but the code should work too with typeof no?
02:25:39leorizebut what do you mean by Instance?
02:25:45FromDiscord<KingDarBoja> So I have to export Location too? I expected it to work with typeof
02:25:56disruptekyeah, they're trying to use `is`.
02:26:08FromDiscord<KingDarBoja> Instance is source variable
02:26:09leorizelike "string" != "string" because they point to different addresses or something?
02:26:19FromDiscord<KingDarBoja> Whatever object is created from the initX
02:26:28disruptekSource.locationOffset, then.
02:26:36FromDiscord<KingDarBoja> Yup
02:26:46disruptekso use that. Note the capitalization.
02:27:38FromDiscord<KingDarBoja> Wait what!?
02:27:58FromDiscord<KingDarBoja> `Source` is the type, source is the instance in this case
02:28:09FromDiscord<KingDarBoja> Maybe if I rename it, it would be clear
02:28:13disrupteklook dude, wtf are you trying to accomplish?
02:28:44FromDiscord<Rika> whats wrong with disruptek's solution
02:29:05disruptekit's pointless, but maybe that's the problem.
02:29:06FromDiscord<Rika> and why are you checking the type on runtime
02:29:11FromDiscord<KingDarBoja> I didn't wanted to export the Location type, that's what I mean
02:29:12FromDiscord<Rika> theres no reason to
02:29:20FromDiscord<Rika> the compiler will complain if theyre the wrong type anyway
02:29:24disruptekwhat does the export have to do with anything?
02:29:39FromDiscord<Rika> why do you need to make the check
02:30:05*dadada__ quit (Ping timeout: 246 seconds)
02:30:59FromDiscord<KingDarBoja> just curious about if there is some way to check if two instances have the same type, but maybe as you guys said, it is pointless
02:31:07FromDiscord<KingDarBoja> two objects*
02:31:25FromDiscord<Rika> there is a way, on compile time
02:31:28FromDiscord<Rika> this isnt python
02:31:42FromDiscord<KingDarBoja> I know, that's why I got confused while trying to ask
02:31:44FromDiscord<Rika> you dont usually need to make checks like this
02:31:51FromDiscord<Rika> -
02:31:59FromDiscord<Rika> maybe in python you do but here you dont
02:32:06FromDiscord<Benumbed> Where we're going Marty, we don't need type checks
02:32:20FromDiscord<Benumbed> (I'm sorry I couldn't resist)
02:32:26FromDiscord<Rika> lol
02:32:33FromDiscord<KingDarBoja> I understood that reference lol
02:33:12FromDiscord<Benumbed> I wish Discord would stop chewing CPU time on my laptop
02:33:18FromDiscord<Rika> ikr
02:33:23FromDiscord<Benumbed> it's making things all hot and noisy 😦
02:33:31FromDiscord<Rika> there's Ripcord
02:33:47FromDiscord<Rika> then also the 3rd party cli i think
02:33:48FromDiscord<Rika> dunno the name
02:33:55FromDiscord<Rika> you can also always move to irc
02:34:29FromDiscord<Benumbed> I put my time in, in the IRC trenches, I honestly like the Discord/Slack-style experience more
02:35:22FromDiscord<Benumbed> I say lets bring back ICQ.... /s
02:35:47FromDiscord<Rika> what are you 30 years old
02:36:12FromDiscord<KingDarBoja> lol
02:36:40FromDiscord<Benumbed> Worse Rika, worse
02:36:57*dadada joined #nim
02:37:04FromDiscord<Benumbed> Leading edge of Millienal time-frame :/
02:37:20*dadada is now known as Guest85317
02:37:34FromDiscord<Rika> uh
02:37:35FromDiscord<Rika> dunno that
02:38:27FromDiscord<Benumbed> Millenials are the group that were graduating high-school and moving into the workforce around 2000
02:38:46FromDiscord<Rika> i know millenials i just dont know the time frame
02:38:49FromDiscord<Rika> hmm
02:38:57FromDiscord<Rika> i'm in gen z i think?
02:39:12*chemist69 quit (Ping timeout: 260 seconds)
02:39:15FromDiscord<Benumbed> If you're saying things like 'what are you 30 years old' yeah you're a Zed 😄
02:39:30FromDiscord<Rika> fuck ya
02:39:41FromDiscord<KingDarBoja> Ok used the disruptek solution
02:40:15FromDiscord<KingDarBoja> Once again, not used to think like that, I mean, I forget this language has compiler checks and runtime checks
02:40:24FromDiscord<KingDarBoja> I forgot*
02:40:43*chemist69 joined #nim
02:40:53disruptekif you don't need it, the code will compile and run faster if there is less of it. remove it.
02:41:26FromDiscord<Benumbed> @KingDarBoja Is Nim your first statically-typed language?
02:41:37FromDiscord<KingDarBoja> Does TypeScript counts?
02:42:02FromDiscord<Benumbed> Having never used it, I have no idea haha
02:43:57FromDiscord<KingDarBoja> lol
02:45:22FromDiscord<Rika> typescript semi counts
02:45:24FromDiscord<Rika> not really
02:45:25FromDiscord<KingDarBoja> The problem is that you can confuse the compiler by specifying the type as `any` and that's it, you have no idea if the property has the correct type
02:45:26FromDiscord<Rika> no i dont think so
02:45:44FromDiscord<Rika> you cannot give a variable an "Any" here afai
02:45:45FromDiscord<Rika> afaik
02:46:10FromDiscord<KingDarBoja> Yeah, that's why I got confused at first trying to check the type between instances but screw that
02:46:17FromDiscord<Rika> no need to 😛
02:46:27FromDiscord<Benumbed> oy, `any` gives me flashbacks to boost::any 😦
02:46:41FromDiscord<KingDarBoja> Don't get mad at me 🙈
02:46:55FromDiscord<Rika> @Benumbed nim allows for `auto`, have fun with that
02:46:56FromDiscord<Benumbed> I'm not mad...
02:47:04FromDiscord<KingDarBoja> Just saying lol
02:47:15FromDiscord<Benumbed> I'm ok with `auto`, just `any` gives me hives 😄
02:47:20FromDiscord<Rika> auto isnt AS bad as any, but i still think its horrible
02:47:51FromDiscord<Rika> i came from python to stop guessing types, please no auto ;;
02:47:55FromDiscord<KingDarBoja> By the way, I just created two tests files inside the tests folder and had to specify them at nimble task
02:48:06FromDiscord<KingDarBoja> Looool
02:48:33FromDiscord<Rika> tests must start with `t`
02:48:35disruptekauto gives you a way to use a type that isn't exported.
02:48:43FromDiscord<Rika> if not they wont run when `nimble test`
02:49:01FromDiscord<Rika> disruptek that sounds uh, dangerous
02:49:04FromDiscord<KingDarBoja> I named both `test_a` and `test_b`
02:49:15FromDiscord<Benumbed> disruptek: will nimph support `test` like nimble does? And if so, will it recurse into directories under your test dir?
02:49:23FromDiscord<KingDarBoja> (Got lucky It seems)
02:49:39FromDiscord<Benumbed> Sounds like `auto` works the same way it does in C++
02:49:49disruptekif you want to run nimble's default test methodology, just run `nimble test`. nimph doesn't care.
02:49:56FromDiscord<KingDarBoja> Hey hey that's my current question, it is possible (with nimble) to just discover all tests without having to specify each file?
02:50:00disruptekelse, use testament or testutils if you want to recurse.
02:50:28FromDiscord<Benumbed> testament looked like something I didn't want to spend tons of time on
02:50:29FromDiscord<Rika> ive never needed to specify a test file
02:50:32FromDiscord<KingDarBoja> Currently doing:
02:50:32FromDiscord<KingDarBoja> ```nim
02:50:32FromDiscord<KingDarBoja> task test, "Runs the test suite":
02:50:32FromDiscord<KingDarBoja> exec "nim c -r tests/dirA/test_x"
02:50:33FromDiscord<KingDarBoja> exec "nim c -r tests/dirA/test_y"
02:50:33FromDiscord<KingDarBoja> ```
02:50:35FromDiscord<Benumbed> like it was more for the Nim core devs
02:50:42FromDiscord<Rika> run `nimble test`
02:50:51FromDiscord<Benumbed> Yep King just demonstrated what I'm talking about
02:50:57FromDiscord<Rika> ah its in a dir
02:51:04FromDiscord<Benumbed> nimble does not support subdirs under your tests dir
02:51:04*FromDiscord <KingDarBoja> in a subdir
02:51:14FromDiscord<Rika> testament docs where
02:51:15FromDiscord<KingDarBoja> and there are going to be several of them...
02:51:17FromDiscord<KingDarBoja> WHAT?
02:51:21FromDiscord<Rika> im asking
02:51:27disruptekdocs/contributing.rst
02:51:36disrupteker, doc/ i think.
02:52:40*FromDiscord <KingDarBoja> insert panic meme
02:54:35FromDiscord<Benumbed> Hmm testutils is from Status
02:54:52FromDiscord<Benumbed> That's the third time they've come up
02:55:18FromDiscord<KingDarBoja> Well well well I will stick into specifying all my tests inside subdirs
02:55:22*FromDiscord <KingDarBoja> kill me pls
02:55:32FromDiscord<Rika> i mean Status is the biggest company sponsoring Nim
02:55:49FromDiscord<Benumbed> @KingDarBoja just use testutils, it looks like they recurse
02:55:58FromDiscord<KingDarBoja> Searching, hold on...
02:55:59FromDiscord<Benumbed> among other things, I shall be pulling this down
02:56:04FromDiscord<Benumbed> https://github.com/status-im/nim-testutils
02:56:15disruptekit does. i'm the dude that moved it from chronicles into its own project.
02:56:30FromDiscord<Benumbed> disruptek: Do you work for Status?
02:56:42disrupteki did a bounty for them.
02:56:57FromDiscord<Benumbed> Ahh cool
02:57:37FromDiscord<Rika> chronicles is great
03:00:28*Guest85317 quit (Ping timeout: 250 seconds)
03:01:30FromDiscord<KingDarBoja> Okay just installed it, what now? Does nimble has a specific section on yourproject.nimble file for dev only dependencies? Or it should be added as `requires`
03:01:59disruptekrequires
03:02:12*FromDiscord <KingDarBoja> oh crap
03:02:13FromDiscord<KingDarBoja> Ok
03:02:28FromDiscord<Rika> does nimph have dev only deps?
03:03:12disruptekit supports that via support for sub-packages, but no one can agree on how to do developmental deps.
03:04:51shashlickis it possible to get the AST of some code after it is evaluated
03:05:31disruptekyou mean codegen'd?
03:05:51shashlickyes - like I run a parseStmt("const A = 1") and get the AST of the const
03:06:07shashlickbasically looking at https://github.com/nimterop/nimterop/issues/127
03:06:07disbot[Feature] Option to dump debug in a file
03:06:31shashlickand am thinking of a macro that lets all nimterop ops run and at the end, get the resulting code and dump that to a file
03:06:54*dadada__ joined #nim
03:07:05disruptekyou could do that pretty easily, i think.
03:07:16disruptekjust expandMacros: somemacro: some normal code
03:07:31shashlickthere's getAst() but doesn't do what i want
03:07:40FromDiscord<KingDarBoja> Btw @Benumbed the installed version of testutils is 0.1.1 but the latest on GitHub is 0.2.0
03:09:06*tiorock joined #nim
03:09:06*tiorock quit (Changing host)
03:09:06*tiorock joined #nim
03:09:06*rockcavera is now known as Guest94448
03:09:06*Guest94448 quit (Killed (livingstone.freenode.net (Nickname regained by services)))
03:09:06*tiorock is now known as rockcavera
03:09:32FromDiscord<KingDarBoja> Also ran `testrunner tests` and got `no tests files found` 😢
03:09:36disruptekshashlick: what's the output you want?
03:09:51disruptekking: it uses a .test format that's different. rtfm.
03:10:02*krux02_ quit (Remote host closed the connection)
03:10:29FromDiscord<KingDarBoja> Arrrgh
03:10:33shashlickhttps://play.nim-lang.org/#ix=2eVi
03:10:46shashlickrunning that and looking at the debug output, you just see the parseStmt() as is
03:10:56shashlickinstead, i want to get the const A = 1
03:11:20disruptekoh, as ast?
03:11:44shashlickbasically, I want to create a `cOutput(file: static[string], body: untyped): untyped =` macro that is called at the top of a nimterop file which will write the rendered wrapper to that file
03:12:42disruptekwhat form does the rendered wrapper have?
03:12:50disruptekthis is still running outside of the vm, right?
03:14:51disruptekit sounds like what i do with openapi, but i dunno -- you tend to make this much harder because it's outside the vm...
03:20:32shashlickStill in the vm
03:20:42shashlickToast already can write to file
03:21:04shashlickIt's the cimport part that I want to render and write to file
03:21:14shashlickAlong with any other getHeader code
03:22:40disruptekwhy is it in the form of a string?
03:27:34shashlickWhich part
03:28:13shashlickcImport calls toast which returns the code as a string which is then loaded using parseStmt
03:28:41shashlickI could always just save that but you also need the other stuff around the cimport
03:30:19*dadada__ quit (Ping timeout: 250 seconds)
03:36:56*dadada joined #nim
03:37:19*dadada is now known as Guest73358
03:42:30*dddddd quit (Remote host closed the connection)
03:53:50FromDiscord<KingDarBoja> Last question of the day: How do I check if a error is raised on unittest?
03:54:45disruptekexpect
03:55:30FromDiscord<KingDarBoja> 👍
03:56:53*muffindrake quit (Ping timeout: 246 seconds)
03:59:27*muffindrake joined #nim
03:59:42*sealmove joined #nim
04:00:23*Guest73358 quit (Ping timeout: 246 seconds)
04:02:25*chemist69 quit (Ping timeout: 246 seconds)
04:02:50*chemist69 joined #nim
04:03:27FromDiscord<Winton> I want to develop a chat
04:06:57*dadada__ joined #nim
04:30:08*dadada__ quit (Ping timeout: 246 seconds)
04:36:58*dadada__ joined #nim
04:43:00*tefter joined #nim
04:47:29*rockcavera quit (Remote host closed the connection)
04:55:15*rmt joined #nim
04:59:54*dadada__ quit (Ping timeout: 240 seconds)
05:06:52*dadada joined #nim
05:07:16*dadada is now known as Guest2313
05:30:24*Guest2313 quit (Ping timeout: 250 seconds)
05:36:53*dadada__ joined #nim
05:57:23*gangstacat quit (Quit: Ĝis!)
05:59:54*dadada__ quit (Ping timeout: 240 seconds)
06:01:22*gangstacat joined #nim
06:06:56*dadada joined #nim
06:07:20*dadada is now known as Guest26080
06:09:07*nsf joined #nim
06:16:48rmtHm.. I'm hoping this is simple, but I suspect I have some fundamental misunderstanding.. https://gist.github.com/rmt/ccaffc4e44fa52485c103756974fe16e .. that snippet results in a runtime error: invalid object assignment [ObjectAssignmentError]
06:21:34rmtI suspect that I need to return a ref MidiMsg to instead return a subclass of MidiMsg, as memory was probably pre-allocated for the return time... that it compiles in the first place makes me wonder, though.
06:25:29FromDiscord<Rika> `ref object of` usually works better than `object of` is all i know
06:30:32*Guest26080 quit (Ping timeout: 246 seconds)
06:34:38rmtIndeed, s/object of/ref object of/g makes a difference. Is this a compiler bug (in 1.0.2) that it even compiles?
06:36:57*dadada__ joined #nim
06:37:31leorizermt: it's a future
06:37:34leorizefeature*
06:37:40rmt:)
06:37:52*solitudesf joined #nim
06:40:22*arecaceae quit (Remote host closed the connection)
06:40:45*arecaceae joined #nim
06:42:21leorizedisruptek: I can't seem to find the part of the vid where there's a pragma alignment problem...
06:54:54leorizedisruptek: wait are you complaining about pragma aligning with the '('?
06:55:09leorizethat's always been a feature
06:55:18leorizeguess it finally works this time around :P
06:56:14leorizedisruptek: I just followed NEP-1
06:56:44leorizeso what's your suggestion for this?
07:00:00*gmpreussner quit (Quit: kthxbye)
07:00:17*dadada__ quit (Ping timeout: 246 seconds)
07:01:18*Zevv joined #nim
07:01:27Zevvgm!
07:04:57*gmpreussner joined #nim
07:06:54*dadada joined #nim
07:07:18*dadada is now known as Guest49348
07:15:27*nsf quit (Quit: WeeChat 2.7)
07:23:54FromDiscord<flywind> When I use `jester` to serve static files bigger than 10MB, I got some errors: ERR_RESPONSE_HEADERS_MULTIPLE_CONTENT_LENGTH
07:24:00FromDiscord<flywind> https://github.com/xflywind/test_jester/tree/master
07:30:49*Guest49348 quit (Ping timeout: 250 seconds)
07:37:02*dadada__ joined #nim
07:45:19*couven92 joined #nim
07:49:20*dadada__ is now known as dadada
07:49:35dadadahas anyone used BOLT with Nim?
07:49:37dadadahttps://github.com/facebookincubator/BOLT
07:49:44dadada"Binary Optimization and Layout Tool - A linux command-line utility used for optimizing performance of binaries"
07:53:23FromDiscord<Rika> how does that work
07:53:31*andinus joined #nim
07:53:40dadadait's all written about on that link
07:54:06FromDiscord<Rika> what if i didnt wanna click the link HUH
07:54:08FromDiscord<Rika> i kid
07:54:18*andinus quit (Remote host closed the connection)
07:55:02dadadato be useful the tool depends on the layout of the code in the binary, it does need to follow certain patterns, I've no idea how Nim relates to that
07:57:06dadadahttps://www.phoronix.com/scan.php?page=news_item&px=Facebook-More-LLVM-Devs
07:57:30dadadafacebook is hiring compiler engineers, sadly they don't seem to have catched the Nim bug (yet)
08:19:06*rnrwashere joined #nim
08:25:18FromDiscord<Benumbed> @Rika look what just appeared in my code.... `var value: auto`
08:25:19FromDiscord<Benumbed> >:>
08:25:26FromDiscord<Rika> how dare you
08:25:29FromDiscord<Rika> thats so vague
08:25:35FromDiscord<Benumbed> hahaha
08:25:51FromDiscord<Rika> ive never ever ever EVER used auto
08:26:01FromDiscord<Benumbed> In this case, it's actually really useful because that particular variable is polymorphic and there's no clean way around it
08:26:08FromDiscord<Rika> hmm
08:26:18FromDiscord<Rika> i guess that works
08:30:13FromDiscord<Benumbed> actually NM, I can get rid of it with a variant type
08:30:16FromDiscord<Benumbed> Just for you
08:40:54FromDiscord<Rika> bless
08:49:25*Trustable joined #nim
09:07:13*rnrwashere quit (Remote host closed the connection)
09:27:06sealmovedoes anyone have a tip for how to implement python's @property in Nim?
09:27:57sealmoveI've tried proc field + closure but it seems messy
09:28:20sealmovealso needs overloading of `.` operator which is experimental
09:32:43FromDiscord<Rika> eh? is it not just a regular proc
09:33:06FromDiscord<Rika> proc fieldName(self: Class):returnType = discard
09:33:27FromDiscord<Rika> proc `fieldName=`(self: var Class, val: storeType) = discard
09:33:35FromDiscord<Rika> sealmove ^
09:36:09sealmovethe problem is the syntax `myObj.fieldName` doesn't work when `fieldName` is a proc
09:37:06sealmoveyou can do `myObj.fieldName()`, yes, but I want to homogeneous syntax between value fields and proc fields
09:38:55sealmoveI could turn all fields into procs and always use `myObj.fieldName()` syntax, but that's meh...
09:40:14FromDiscord<Rika> it works...
09:40:22FromDiscord<Rika> ive never had it not work
09:40:48FromDiscord<Rika> oh it wont work if field name is the same as proc name
09:40:58FromDiscord<Rika> otherwise it will work
09:42:55sealmoveoh, wait. are you saying I should make a seperate proc? I was doing something like:
09:43:07sealmovetype myType = object
09:43:22sealmove fieldName: proc(): int
09:43:28FromDiscord<Rika> what
09:43:29FromDiscord<Rika> no
09:43:31FromDiscord<Rika> separate proc
09:43:37FromDiscord<Rika> it will work then
09:43:43sealmoveah I see, that should work yes, thanks!
09:43:59FromDiscord<Rika> just make sure names are different
09:44:13FromDiscord<Rika> because its not gonna be possible to distinguish if they werent
10:06:45sealmoveother question, in C when I want to make an identifier special, I begin its name with an "_". what's a similar practice for Nim?
10:10:13FromDiscord<Rika> i use `pSmth` for private
10:24:35dadadadid you know there's a monkey lang implementation in Nim? https://github.com/Kashiwara0205/monkey-nim
10:24:46FromDiscord<Rika> a what
10:24:47dadadaI don't know for what this would be useful though :-)
10:25:28dadadait's basically a go interpreter with only a limited featureset
10:26:33dadadathere was a book on how to write a small interpreted language using go, and now everyone is copying that design
10:26:56FromDiscord<Kenran> Varriount: yeah, I recommend just installing it somewhere (maybe a VM first). It was actually the most pleasant experience from all the distros I tried with getting a slim (that is, no desktop manager) UI with sound and everything to work. It's also extremely easy to play around with, as you can just roll back on any error.
10:27:42lqdev[m]dadada: that's cool, but not really usable for anything since it uses a tree-walk interpreter
10:27:53lqdev[m]and thus it's veeery slow
10:28:30dadadalqdev[m]: maybe you could use it at compile time
10:28:36FromDiscord<Kenran> I'm quite annoyed at it now, as it was basically an experiment for me but now diving into Nim and trying to do more low-level stuff, I fail at some steps. For instance what Yardanico mentioned. I need to do some "research" to even get what it all means 😄
10:29:16*krux02 joined #nim
10:29:18lqdev[m]dadada: yeah, but that defeats the purpose of a dynamic language altogether :p
10:29:28FromDiscord<Kenran> let alone getting something to run afterwards.
10:29:28FromDiscord<Kenran> maybe being inside a nix-shell for everything works, but there I still have some SSL problems when running nimble... quite a lot to tackle to just run a binary
10:32:33dadadafor what it's worth I've been happy with Fedora for years ...
10:34:18FromDiscord<Kenran> dadada: I used Fedora for quite a while before NixOS 🙂 maybe I'll be going back to it, I really liked it. Lately I had to nixify a lot of projects at work and also use it as a server OS once, so I thought I might give it a try at home.
10:35:01*kenran joined #nim
10:37:20dadadaKenran: why did they choose nix at work?
10:42:05kenrandadada: for one, we use Haskell in some projects where the nix integration is good (you get the benefits of `stack` without having to use it), plus reproducible builds even though some use macOS, others linux flavors
10:43:12kenrandadada: it makes gitlab CI nicer to use as well (just use the nixos/nix base container and do `nix-build ..`)
10:44:21kenran(our Haskell projects often have lots of non-Haskell dependencies which are managed by nix, I should mention)
10:45:03dadadaI've been interested in Haskell for a while, why did your company decide to use it?
10:45:25dadadawhat are the things you can do in Haskell, but couldn't for example get done in Nim or something like it
10:45:54dadadaI'm looking for an answer specific to your company, I know I can google search this and get the generalized answers
10:46:02*filcuc joined #nim
10:46:50dadadaand I think I already did some time ago, but I've never found a project where I needed those specific strengths (yet)
10:46:56Araqsealmove: instead of "special" identifiers use longer ones
10:50:27*filcuc_ joined #nim
10:50:34*filcuc quit (Ping timeout: 256 seconds)
10:50:44kenrandadada: we are a little bit special in that we do FP (nearly) exclusively. Plus I'm an absolute beginner in Nim. I'm reasonably sure you can do everything we do in Nim as well, but there are some things we love Haskell for. Mainly it's great for parsing stuff like a breeze and also creating very expressive DSL's.
10:52:28dadadakenran: what's the best learning resource/book for Haskell?
10:52:56kenrandadada: probably Haskell Programming from First Principles
10:55:03kenrandadada: it's not really necessary to get a book though. I have a love/hate relationship with Haskell btw. In most new projects we also choose Clojure. Haskell's great strength is its type system with which you can model your domain insanely well. But IMHO that's the hardest skill to learn and mostly stems from experience with both the topic and the language.
10:56:34dadadakenran: I think FP is most likely a big part of programming's future, I definitely have already tried to use FP patterns as much as I can, was deeply impressed with a presentation on Haskell that I saw on YouTube a few years ago
10:58:50*JustASlacker joined #nim
11:01:15*sleepyqt joined #nim
11:02:41kenrandadada: There are definitely great talks and great minds in the Haskell community. I have my problems with it, because I hate the ecosystem. It's still a research language, even though it's used in production, and a lot of the library authors jump on every new language feature and break their API all the time in the process.
11:03:26kenranSo trying to use a lib that hasn't been updated since the end of 2018, I have no real hopes of it being compatible with the other libraries in a project by default.
11:04:32kenranAnd I'm with you on the FP part. I've been doing this for 1.5 years only now, but arrived at the same conclusions in my projects before that (Windows stuff with C#) by seeing where we always failed.
11:05:37kenranThat's why I really want to get into Nim! It enables me to use most of those concepts, still be very readable and expressive, and do stuff on a lower level as well. Similar to Rust in its appeal, but Nim just "clicks" more with me :)
11:07:24dadadaI definitely think there's room for Nim to adapt better to FP, I'm not sure if Nim has tail call optimizations, just to name one example
11:09:09kenranI remember googling that before I downloaded nim. Shouldn't clang/gcc do it with the resulting C code?
11:09:12dadadaI read this book on using functional programming patterns in Go, the author made a huge point of criticizing Go for not supporting TCO, but it's definitely something that can get supported when there's enough demand
11:09:43dadadakenran: I thought the same thing, but I never found a proper answer
11:09:58dadadaI'll probably have to do benchmarks on this sometime
11:10:08kenranyeah, we should be able to figure it out :)
11:10:27FromDiscord<Rika> nim has typeclasses btw 😛
11:12:06kenranmaybe I'm calling my NixOS experiment quits today... I can't really figure this stuff out on my own as I'm not even remotely a systems programmer or familiar with the tooling needed to debug this :D Maybe it's time to go back to Arch or Fedora.
11:12:44dadadacan't you experiment with NixOS in a VM inside Arch/Fedora?
11:13:34kenranyeah I could, but I had to re-partition anyway and so I went all the way this time.
11:14:01dadadasomeone recently wrote a text editor in nim (presumably for the console) https://github.com/pseudo-random/editor
11:14:29kenranperhaps that's the way to go next time :) gotta run
11:14:37*kenran quit (Quit: leaving)
11:15:05dadadait looks like a nice start by a very quick glance at the code, it definitely deserves some attention, hence I mention it here
11:19:40*JustASlacker quit (Ping timeout: 250 seconds)
11:28:19*nsf joined #nim
11:33:16*natrys joined #nim
11:36:50*sealmove quit (Quit: WeeChat 2.7.1)
11:37:55dadadawhen I get an error like this:
11:37:57dadadafatal.nim(39) sysFatal
11:37:58dadadaError: unhandled exception: vmgen.nim(941, 10) `t != nil` [AssertionError]
11:38:28dadadais this indicative of there possibly being something wrong with Nim? or should I still assume that my code is shit?
11:38:37FromDiscord<Rika> what did you do?
11:40:06*SebastianM joined #nim
11:43:38lqdev[m]this should be a proper error, report it as a bug
11:47:44*couven92 quit (Quit: Client disconnecting)
11:48:03*couven92 joined #nim
11:51:21*SebastianM left #nim (#nim)
11:53:16*Trustable quit (Remote host closed the connection)
12:00:17FromDiscord<Rika> huh, nimprof does not like my code
12:00:27FromDiscord<Rika> it crashes due to deeply nested calls
12:00:39FromDiscord<Rika> albeit my code not crashing at all normally
12:03:49*dddddd joined #nim
12:04:15*dwdv joined #nim
12:06:40dadadacan't reproduce the bug on play.nim-lang.org yet
12:07:15*JustASlacker joined #nim
12:13:24axionI need help with type parameters again :/
12:17:10krux02axion, what do you need to do with type parameters?
12:17:16axionSo I have 2-4 component vectors parameterized as Vec[N], and 2x2, 3x3, 4x4 square matrices as Mat[N] (Mat[3] is array[9; float32]. Some operations are only valid on Mat3 or Mat4, but with a vector size 1 less than the matrix parameter, so [N: static[int], M: Mat[N], V: Vec[N-1]]. The problem here is that Mat[2], Vec[1] is invalid in this context
12:18:24krux02I need more context
12:18:32krux02is this a proc or a type?
12:18:38axionA bunch of procs
12:18:41krux02ok
12:19:13krux02I need something that I can execute
12:19:44axionSorry this is all on paper, no code yet.
12:20:04axionI would have to read my math texts to figure out the implementation first
12:21:07krux02ok
12:21:27krux02well I can help you to punch things through the nim type system.
12:21:38axionBut this isn't a code problem. It's a signature specification problem
12:21:47krux02But I don't really understand your type constraints that you want to enforce
12:21:57axionOk let me try to be more clear
12:21:58krux02ok
12:23:22krux02why do you need the vector to be size 1 less than the matrix parameter?
12:23:45axionI have a pile of procs that will be the same code for either a Mat3 (9 element array), or Mat4 (16-element array). These must also take in a Vec2 if it's a Mat3, or a Vec3 if it's a Mat4, (so if Mat[N], then Vec[N-1]). THe problem I have is how to constrain the Mat to not accept Mat2 and thus Vec1 which these functions shouldnt exist for
12:24:12krux02I remember I once had a similar problem. The solution to that was, to not use the constraint of N-1 anymore.
12:24:24krux02not sure if it really was that problem
12:24:57axionBecause for example, the translation of a 3x3 transformation matrix is 2 components, and likewise 3 components for a 4x4 transformation matrix.
12:25:33krux02well, you can start of just writing down all implementations (lots of redundancy) and then look afterwards on how to compress that.
12:25:55*JustASlacker quit (Ping timeout: 250 seconds)
12:27:19axionYeah, I see a lot of redundancy either way, because for example a 3x3 matrix can be both a 2D transformation matrix, or a 3D rotation matrix.
12:28:55krux02well I stopped caring about that distinction.
12:29:04krux023x3 matrix is just a 3x3 matrix
12:29:09krux02that is the mathematical part.
12:31:54krux02After all the `3x3` rotation matrix ended up to be much less useful that I thought.
12:32:25axionI can assure you it is incredibly useful for a lot of code. It is a pretty big mathematical error to not have this distinction
12:32:35krux02rotations are stored either in a quaternion, or in 4x4 matrix is part of a trotration/translation object transformation.
12:33:20krux02axion: Well I am not in your code, and maybe you are right, but the solution for me was to not use 3x3 rotation matrices and it worked quite well for my code.
12:33:32axionFair enough
12:33:55krux02what would be much more useful to me would be a coordinate system tag for my coordinates.
12:34:14krux02So that I don't accidentally mix up wordspace cameraspace and objectspace coordinates.
12:34:28lqdev[m]how do I explain to my C++ friend that `'a'.succ` makes more sense than `'a' + 1`
12:34:38lqdev[m]I keep telling him that a char is a char, not a number
12:34:42lqdev[m]so it doesn't make sense to add 1 to it
12:34:51lqdev[m]but he keeps saying that a char is a number
12:35:12krux02lqdev[m], well maybe you have to stop using his c++ terms.
12:35:24krux02but yea it is hard to fix that.
12:36:18krux02it is also hard to tell c programmers that an array is not a pointer because for many of them it is the same thing.
12:36:35krux02It quacks like a duck it looks like a duck, so it is a duck.
12:36:43lqdev[m]that's low level programming for ya.
12:36:58Zevvbut they *are* the same thing!
12:37:05FromDiscord<Rika> tell them that if you remove the computer aspect from it it makes no sense to add a character with a number
12:37:06*Zevv ducks
12:37:11FromDiscord<Recruit_main707> in c/c++ everything is an int or a pointer XD
12:37:39Zevvalmost true
12:37:41Zevvbut not quite
12:37:45axionHmm, and here I thought everything was a pointer or UB
12:37:58Zevvhaha
12:38:05krux02lqdev[m], the only fix for that that I know works is to let him run into a problem because of this non-distinction of char/integer. Make it really painful. Then come with a solution. And he will understand. But he might stop being your friend.
12:38:08Zevvand still it runs the world
12:38:11FromDiscord<Rika> the more stars you add the better
12:38:28FromDiscord<Rika> char \*\****niceVar
12:38:54*EastByte quit (Quit: WeeChat 2.7)
12:40:06*EastByte joined #nim
12:41:13krux02Rika: you cannot tell people to remove hard wired stuff from their brain, and then think about another solution. You first have to break the hard wiring. That is the "let them run into a painful problem" I was talking about.
12:41:46lqdev[m]krux02: lol that's so true
12:41:54FromDiscord<Rika> tell them "but what if it wasnt programming"
12:42:23lqdev[m]idk why he keeps on using C++ after encountering weird problems like having to initialize an std::string explicitly (`std::string a = "";` instead of `std::string a;`)
12:42:50krux02Rika, that will disable his arguments, but it won't convince him.
12:45:34krux02axion, what do you mean with UB?
12:48:41FromDiscord<Rika> undefined behavior
12:56:43FromDiscord<exelotl> Ultra Beast
13:00:54*kungtotte quit (Read error: Connection reset by peer)
13:02:37*kungtotte joined #nim
13:02:53disruptekleorize: your approach is probably the correct one; i dunno. the style i arrived at is to just indent two spaces for the pragma.
13:07:52*rnrwashere joined #nim
13:12:14*rnrwashere quit (Ping timeout: 256 seconds)
13:20:13FromDiscord<clyybber> Well a char is a number
13:20:15FromDiscord<clyybber> fite me
13:20:21*nsf quit (Quit: WeeChat 2.7)
13:20:30FromDiscord<clyybber> And arrays are pointers
13:23:00FromDiscord<clyybber> But their specification doesnt say they must be
13:23:25FromDiscord<clyybber> At least in nim
13:39:36FromDiscord<Recruit_main707> type Matrix3* = object
13:39:36FromDiscord<Recruit_main707> data*: array[3, Vector3]
13:39:36FromDiscord<Recruit_main707> forward*, left*, up*: Vector3
13:39:36FromDiscord<Recruit_main707>
13:39:37FromDiscord<Recruit_main707> inside a constructor...
13:39:37FromDiscord<Recruit_main707> [result.forward, result.left, result.up] = result.data
13:39:39FromDiscord<Recruit_main707> what am i doing wrong? this says it cannot be assigned to
13:39:48disruptekyou're pasting, for one thing.
13:40:08*NimBot joined #nim
13:40:09disruptekthe argument that you "forgot" just doesn't hold weight after the 5th "reminder."
13:40:56FromDiscord<Recruit_main707> i didnt forget, im not that stupid, i just consider it small enough.
13:41:21disruptekit doesn't bother me, but it bothers others and sets a poor example.
13:42:28FromDiscord<Recruit_main707> ok, fine... here you have, much cleaner: https://play.nim-lang.org/#ix=2eXA
13:43:07FromDiscord<Recruit_main707> ill just consider more than 1 line too much from now on
13:43:22FromDiscord<Rika> and it is
13:43:38FromDiscord<Recruit_main707> its all relative :p
13:43:41FromDiscord<Rika> use parentheses not brackets
13:44:06FromDiscord<Recruit_main707> oki, thanks
13:49:22lqdev[m]i don't think you can deconstruct an array like that
13:49:34lqdev[m]it only works for tuples
13:50:06FromDiscord<Recruit_main707> it doesnt throw any errors in the editor
13:50:17FromDiscord<Recruit_main707> ill see
13:50:57FromDiscord<Rika> use `unwrap` module if you really want array deconstructing
13:51:24disruptekobviously, it's for string summation.
13:51:30disruptekwhat else?
13:51:59disruptekthe wallpaper is amazing today. what should i use it on?
13:55:55*lritter joined #nim
14:04:23jkenI have a type defined, Vertex, which has position vec3[float], a normal vec3[float], and texCoord vec2[float]
14:04:33jkenHow in nim do I get the total size of Vertex?
14:04:40jkensizeof(Vertex) returns 8
14:05:36lqdev[m]huh.
14:05:38lqdev[m]interesting
14:05:57lqdev[m]can you show the definitions?
14:05:58jkenI am using vector types from glm
14:06:41disrupteksizeof only measures the size of one type.
14:07:10jkenWhat does that mean?
14:07:24disruptekif that type is a pointer, you'll get the size of a pointer.
14:08:26jkenAre types pointers?
14:08:42krux02no
14:08:45jkenie. sizeof(Vertex) vs sizeof(newVertex())
14:08:46krux02types are types
14:09:21krux02types are for compile time evaluation only.
14:09:30krux02compile time does not have pointers.
14:09:30*solitudesf quit (Read error: Connection reset by peer)
14:09:54jkenhmm okay
14:09:56disruptekcompile time is rude that way.
14:10:02krux02sizeof returns the size in bytes of a type. Basically how much memory it costs to put them in a seq or on a stack.
14:10:03jkensizeof(Vertex()) still give me 8
14:10:43*disruptek sighs.
14:10:47krux02then your Vertex is either a ref type, or it is 8 bytes in size
14:10:58jkenah, it is a ref type
14:11:02jkenref types are pointers than
14:11:03disruptekie. a pointer.
14:11:09jkenthat's what I was missing.
14:11:23krux02yes ref types are pointers
14:11:24disruptekthey are sometimes called "managed pointers" in other languages.
14:11:31FromDiscord<Kenran> why is it that if I compile a project that uses `sdl2` or `nim_sdl`, the binary doesn't have `libSDL2` in its `ldd` output? Is there a way to "get it in there"?
14:11:37jkenMy type probably does not need to be a ref type, but out of curiousity, is there a way to get the size of a ref type?
14:11:46krux02ref are basically a different kind of pointer, but technically identical to pointers.
14:11:56krux02yes
14:12:00krux02unref it with []
14:12:10krux02sizeof(Vertex()[])
14:12:10disruptekkenran: static link?
14:12:21jkenkrux02: gotcha, thanks
14:12:27krux02np
14:13:09disruptekkenran: nim doesn't use the "normal" shared-lib style of linking by default; instead it has its own dynlib machinery that you get to fuck with.
14:13:20krux02btw, you are probably used to ref types from other languages like python C# or Java. But in Nim you shuold used them sparsely.
14:13:35jkenkrux02: is it possible to determine the size of a ref object type without an instance of it?
14:13:49jkenie, no instance to unref
14:13:56krux02Simply because the non ref variant of a type is often all you ware about.
14:14:06krux02yes
14:14:36krux02sizeof(typeof(default(Vertex())[]))
14:15:18krux02but if you care about the size of a type, you probably shouldn't use a ref type.
14:15:32krux02sorry
14:15:42krux02sizeof(typeof(default(Vertex)[]))
14:15:46disruptekthat's still an instance.
14:15:48*solitudesf joined #nim
14:15:58disruptek👍
14:16:14krux02no it is not an instance, because it is in a `typeof` argument.
14:16:15jkenright, so that creates an "instance" with default values and gets the size
14:17:49FromDiscord<Kenran> disruptek: Atm it will compile and complain about libSDL2 missing when I start it. I found a post explaining how to static link against SDL2 but it's not really working yet. I'll have to see if I can get it to do that 🙂
14:17:50krux02``default(Vertex)[]`` would create a nil pointer and unref it. That is basically a segfault. But the code is never executed, what matters in the type of the expression.
14:18:25disruptekkenran: it's fun to try to guess where you need to copy the shared-lib to. usually, adjacent to the binary.
14:18:58krux02Keran: so many people force to static link SDL2. And SDL2 really doesn't want to be statically linked.
14:19:03jkenkenran, I recently had this problem
14:19:04jken{.passL: "-Xlinker -rpath .".}
14:19:14krux02I think eventually SDL2 developers gave up on it and allowed static linking of SDL2.
14:19:20jkenThat in config.nims in your project will make it look for the .so in that dir
14:20:03disruptekthe only experience i have with sdl/opengl is debugging this exact linking issue.
14:20:25jkendisruptek helped me solve that same issue but with imgui rather than sdl2
14:20:38disruptekoh yeah, that's what it was.
14:21:07krux02disruptek, when you are working with opengl you can forget about static linking anyway, so why is it so important to have SDL2 statically linked? I really don't understand it.
14:21:32disrupteki dunno. i didn't read too much into kenran's query, perhaps.
14:21:56disrupteki think it's the normal shared-link issue, though.
14:22:00krux02no he isn't the only one here on IRC who asked for help on static linking SDL2.
14:22:11FromDiscord<Kenran> it's not important to me at all. I would have liked it to "just work" without static linking
14:22:23disrupteki mean, i think the issue comes from the unexpected shared-linking behavior.
14:22:37disruptekit's more like the way windows does it than the way unices do it.
14:22:52FromDiscord<Kenran> It's probably a mix between that and me being on NixOS
14:22:54krux02yea probably.
14:23:02FromDiscord<Kenran> on my mac I get it to run just fine
14:23:11disruptekthe mac uses a similar approach.
14:23:35krux02Keran: I read about the Nix package manager. I wonder if it can be used as a substitution for nimple.
14:23:41krux02nimble I mean.
14:23:57disruptekit's kinda heavyweight, unfortunately.
14:24:02krux02It claims to be just a package manager, and NixOS is the os around that package manager.
14:24:09krux02hmm
14:24:11krux02ok
14:24:23disrupteki was attracted to it, too.
14:24:24FromDiscord<Kenran> is there a good chance this problem is going to just disappear once I switch to another linux distro again (because I'm about to do just that anyway sooner or later)?
14:24:34disrupteknope.
14:24:53disruptekjken nailed it.
14:25:11disruptekbut, i'd put your passL in a .cfg as `--passL:"some shit"` instead.
14:25:18krux02I thought NixOS is one of the most light wight distros out there (never verifiend it though), and then I just expected `Nix` to be lightweiht as well.
14:25:36Yardanicowell it's not really :P
14:25:40Yardanicoit also doesn't follow FHS
14:25:51krux02FHS?
14:26:27disrupteki prefer guix because it's based upon a more mature language.
14:26:30FromDiscord<Kenran> jken, disruptek: I'll need some time to try that out, thanks. So far I've only written < 100 lines of Nim code and I don't feel ready to deal with that 😄
14:27:09FromDiscord<Kenran> it's not lightweight at least in the sense that it uses tons of disk space when used with multiple languages, ecosystems, ...
14:27:38FromDiscord<Kenran> and I don't like the nix language either. guix would be something to try soon 🙂
14:35:15*EastByte quit (Read error: Connection reset by peer)
14:35:24*EastByte joined #nim
14:36:53FromDiscord<Kenran> phew, I can't get it to run, but I'm probably still not grasping your advice properly jken and disruptek. I'm doing this: https://pastebin.com/XLEyZ48a
14:37:51Yardanicowell you need dev files for SDL too
14:37:57Yardanicoand link with sdl
14:38:18FromDiscord<Kenran> oh, it's just missing headers?
14:38:33FromDiscord<Kenran> (the first part I mean)
14:39:36Yardanicowell, not headers
14:39:44Yardanicostatic files .a
14:42:06Yardanicowhy do you want to link statically with SDL though?
14:42:21YardanicoI thought that most of the time people do dynamic linking and store these .so files in the game folder or use the system ones
14:43:12*rockcavera joined #nim
14:43:54FromDiscord<Kenran> oh, I don't want to if I don't have to. it's just that it doesn't run by default (because I probably don't know that I have to pass some options to `nimble build` or `nim c` by default)
14:45:29FromDiscord<Kenran> Yardanico: any advice on how I can do it dynamically is greatly appreciated as well 🙂 I can ofc upload the source, even though there's not much of it there
14:48:52*couven92 quit (Remote host closed the connection)
14:49:14*couven92 joined #nim
15:43:01krux02Yardanico, SDL2 in particular on Linux is usually not shipped.
15:43:09krux02on windows however it is shipped.
15:43:49krux02SDL2 is basically available on Linux. Many programs require it.
15:44:21Yardanicokrux02: well, games ship it anyway, but it can be overriden with LD_PRELOAD_PATH
15:44:38YardanicoI mean proprietary games on linux
15:45:20krux02well on steam games do actually ship SDL2.
15:45:34Yardanicoyeah
15:45:43krux02also GOG games do ship SDL2 as far as I know.
15:46:19krux02yea just checke it. Yes proprietary games do ship SDL2
16:10:16*tane joined #nim
16:16:59*dwdv quit (Ping timeout: 256 seconds)
16:18:07*dwdv joined #nim
16:32:11FromDiscord<Kenran> I checked two other linux systems (fedora and ubuntu) and could just `nimble build` and `./my-app` without problems when the appropriate `-dev` lib was installed. So it seems to be at least kind-of specific to NixOS.
16:32:35FromDiscord<Kenran> Well, time to change - which I wanted to do anyway - and see if it just works there perhaps 😄
16:32:51FromDiscord<Kenran> But I want to take this opportunity to learn something more about this kind of thing first.
16:37:22FromGitter<zetashift> Can't you ask in a Nix related chat?
16:37:35FromGitter<zetashift> Maybe they have an IRC/forum you could ask some pointers about this
16:37:40Yardanicothey do have a lot of chats, yeah
16:37:48Yardanicohttps://nixos.wiki/wiki/Get_In_Touch
16:39:23FromDiscord<Kenran> oh, sorry if that came out wrong: that's what I plan to do before doing the switch. the freenode nix channel is full of helpful people
16:41:05FromGitter<zetashift> Oh nice
16:41:42*dwdv quit (Quit: quit)
16:47:54leorizedisruptek: so... I guess no one realised that the feature exists because it've never worked for complex cases
16:48:07leorizeand I don't get bug reports because no one thought that's a bug :P
16:49:41leorizedisruptek: well if you wanna tweak that logic, it's not hard
16:50:07leorizelook for "lone opening curly" in indent/nim.vim
16:50:33leorizethen change result from `pcol - 1` to `indent(plnum) + shiftwidth()`
16:58:18*couven92 quit (Read error: Connection reset by peer)
16:58:44*couven92 joined #nim
17:10:04FromDiscord<deech> What's a good way of using `nimble` to package NImScript files?
17:10:45FromDiscord<deech> You can get it to copy them to `nimbleDir` but how do I import them in a dependency?
17:11:52shashlickWhy does it have to be nims if you want to import
17:12:16FromDiscord<deech> I'd like to import them into the `.nimble` file.
17:12:24FromDiscord<deech> Essentially a build-time dependency.
17:12:57*andinus joined #nim
17:13:05shashlickWhen you talk of imports, they need to be Nim files don't they
17:13:21shashlickBut is it a config file
17:14:03shashlickIf you mean config.nims then Nim does not load config files from packages
17:14:08FromDiscord<deech> No, I've found that if you do import "someFile.nims" in a "nims" file it will do it.
17:15:05shashlickOk but unless you call Nim directly on someFile as well, you can just name it as a regular Nim file
17:15:41shashlickAnd importing into nimble file should just be relative imports as well
17:15:41FromDiscord<deech> That's true but a lot of OS functions do not work with NimScript.
17:16:16FromDiscord<deech> Oh I get it. You're saying don't use the `.nims` suffix?
17:16:18Yardanicowell yeah because OS functions require FFI and that's a very complicated story with NimScript (Nim VM) :P
17:16:28shashlickAgain, when you import a Nim file into nims, it is still running in the vm so the contents should be vm friendly
17:17:49FromDiscord<deech> I think I understand.
17:20:47FromDiscord<deech> I just tested it with `import httpclient; echo "hello world"` in a NimScript file and `nim e someFile.nims` fails on `nativesockets.nim`.
17:22:50FromDiscord<KingDarBoja> it is possible to create a nim variable of type int with no value?
17:23:08Yardanicovar myNum: int
17:23:12Yardanicobut it'll have a default value of 0 anyway
17:23:16Yardanicobecause that's how computers work :)
17:23:17FromDiscord<KingDarBoja> Arrr
17:23:35Yardanicoif you want it to really have NO default value, use "ref" :P
17:23:39*couven92 quit (Read error: Connection reset by peer)
17:23:49FromDiscord<KingDarBoja> How to achieve `nil` value then?
17:23:51FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2eYV
17:24:03*couven92 joined #nim
17:24:06Yardanicowhy not just have it at 0 ?
17:24:08FromDiscord<KingDarBoja> I don't want to initialize it to zero because the check
17:24:12Yardanicoor -1, idk
17:24:20FromDiscord<KingDarBoja> Oh, could be -1 🤔
17:24:20Yardanicoor create an another bool variable
17:24:53leorizeKingDarBoja: I can see that 0 works just well for you here :p
17:24:57FromDiscord<KingDarBoja> This is the issue while trying to translate python code to nim code at it uses `None` for variable declaration lol
17:25:03leorizeif you move the check a bit, ofc
17:25:14FromDiscord<KingDarBoja> Yeah, was thinking the same
17:25:19Yardanicowell in nim you can replicate it with "ref int" but pls dont
17:25:44FromDiscord<KingDarBoja> I will see how to change th check with the zero
17:26:34disruptekuse the options module.
17:51:11*Jesin quit (Quit: Leaving)
17:55:01FromDiscord<KingDarBoja> https://play.nim-lang.org/#ix=2eZ6 ugh, got closer to what I expected
17:56:41Yardanicodo you know that these functions exist in stdlib?
17:56:46Yardanicounindent for dedentBlockStringValue
17:57:45Yardanicoah nvm
18:02:20FromDiscord<Kenran> Btw @deech: Due to your Nim-related tweets I tried Nim and am now hooked. Thanks I guess 🙂
18:12:54*couven92 quit (Ping timeout: 240 seconds)
18:15:14*tefter quit (Ping timeout: 240 seconds)
18:15:39*tefter joined #nim
18:15:55*andinus quit (Quit: ERC (IRC client for Emacs 26.3))
18:17:14*PMunch joined #nim
18:19:29*bars joined #nim
18:21:11*bars quit (Client Quit)
18:22:51FromDiscord<Tristan> Hey y'all, excuse my ignorance but I'm playing around with c2nim for the first time, attempting to wrap lv2, and already running into problems lol. Any suggestions on how I ought to modify this header? Would this be a good use case for the '#pp' directive https://gist.github.com/TristanCrawford/5768abce2207122afd22d82fd82a2db0
18:24:59leorizelooks like c2nim can't process C string constants
18:25:58*Jesin joined #nim
18:37:34Araqyes
18:37:43Araq(question about #pp directive: yes)
18:40:51axionWill it ever be the case that a const will be able to have the same name as a proc?
18:42:23disruptekwut
18:43:20Araqaxion, no.
18:43:44Araqwhat's the use case? is the world yet again running out of meaningful identifiers?
18:43:50axionI have to get all of Lisps great features out of my workflow
18:43:53disruptekthird time this month.
18:44:39disruptekAraq: i assume i did something wrong; any idea what? error: invalid application of ‘sizeof’ to incomplete type ‘obs_service’
18:45:04disruptektrying to import a type...
18:45:09disruptektrying to importc a type...
18:45:22Araquse .incompleteStruct pragma
18:45:35disruptek... o.O okie, ty
18:46:13disruptekperfect.
18:46:17FromDiscord<Recruit_main707> What does —dynlibOverrideAll to the code?
18:47:01FromDiscord<Recruit_main707> Leorize suggested me it could fix my issue with winim
18:47:12FromDiscord<Recruit_main707> But it throws me an error
18:53:42FromDiscord<Tristan> According to: https://nim-doc.readthedocs.io/en/latest/nimc.html "makes the dynlib pragma have no effect"
18:54:52Yardanicowhy not use https://nim-lang.org/docs/nimc.html or https://nim-lang.github.io/Nim/nimc.html ? :P
18:55:32FromDiscord<Tristan> Honestly just grabbed the first link I found on DDG lol
18:55:38Yardanicoxd
18:55:50Yardaniconim-lang.org contains official docs for latest stable, nim-lang.github.io - for latest devel
18:56:31FromDiscord<Tristan> Schweet, I'll keep that in mind.
18:57:13FromDiscord<Tristan> So... the #pp directives worked out well, but now c2nim seems to not like: "__attribute__((visibility("default")))" above a couple const declarations... what do?
18:57:50Araq#def __attribute__(x)
18:59:46FromDiscord<Tristan> Legend, worked like a charm.
18:59:48FromGitter<kayabaNerve> I need some help with the asyncnet library. While creating a socket, the fcntl call is failing. The resulting OSError isn't catchable and crashes my entire program.
19:00:23FromGitter<kayabaNerve> I had it trigger after a few days of normal use, or after 100k sockets while rapid firing. I'm running it now through strace, yet under strace it isn't triggering (almost 400k in)
19:01:06FromGitter<kayabaNerve> I have a friend who suggested to use strace in the first place; his idea is the way strace is hooking fcntl is causing the bug to not exist (race condition?).
19:01:11FromGitter<kayabaNerve> Anyone have any idea here?
19:01:43FromGitter<kayabaNerve> Oh. I do have a traceback. It's in the future callback for the acceptAddr function. https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/asyncnet.nim#L462
19:02:00FromGitter<kayabaNerve> https://github.com/nim-lang/Nim/blob/version-1-0/lib/pure/nativesockets.nim#L577 is the raising fcntl call.
19:02:50leorizewell what was the error message associated with the exception you got?
19:03:32Araqdisruptek, live stream today?
19:03:57FromGitter<kayabaNerve> ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5e77b69dfa6bd733c7b11256]
19:03:58*andinus joined #nim
19:04:11disrupteki dunno. i think i'm just sitting here mumbling most of the time.
19:04:24disruptekpretty exhausting.
19:04:54disruptekacceptAddr() looks less stupid than i expected. not sure why it would break.
19:05:11FromGitter<kayabaNerve> I'm not complaining the standard lib has this problem 0.001% of the time. I'm looking for a solution because I can't catch it and therefore can't run `continue`
19:05:54FromGitter<kayabaNerve> Happened after a few days of my server running on a VPS, as well as on my home laptop. I've triggered ulimit before and it looked very different.
19:05:55disrupteki know, i gave up on async for these sorts of applications.
19:06:13FromGitter<kayabaNerve> Have a better suggestion? Because I'm about to wrap ASIO :/
19:06:22leorizekayabaNerve: what was the error message associtated with the OSError?
19:06:30FromGitter<kayabaNerve> "Bad file descriptor"
19:06:35FromGitter<kayabaNerve> I included the full traceback above
19:06:45disrupteki would hack it to confirm that you are able to create the socket.
19:06:50FromGitter<kayabaNerve> I think you'd have to click a link to see it from IRC though
19:06:54disruptekthat's something you can catch.
19:07:40FromGitter<kayabaNerve> Yes and no? Maybe?
19:07:47leorizekayabaNerve: try compiling with `--assertions:on`
19:07:57disruptekyeah, make sure that assert is in the runtime.
19:08:27Araqkrux02, awesome work on the bugfixes, many thanks!
19:08:44FromGitter<kayabaNerve> ```code paste, see link``` ⏎ ⏎ Here's my loop. `.accept` is waiting for minutes before it gets a socket and crashes. I can't include a line before it, unless there's a tryAccept. [https://gitter.im/nim-lang/Nim?at=5e77b7bc7d676c4d617050bf]
19:12:44FromGitter<kayabaNerve> Removed my define release, enabled assertions. Killed the strace run after 622k sockets. Now at 90k without strace
19:13:20AraqkayabaNerve: "catchable" assertions are a stdlib bug
19:13:25AraqI mean
19:13:44Araqthe stdlib should raise a proper exception and not use 'assert' that you can catch
19:13:54FromGitter<kayabaNerve> That's not the comment
19:14:02Araqif that's the case, please report it on github
19:14:10FromGitter<kayabaNerve> It's raising an OSError I can't catch because it's under an anonymous function in the async runtime
19:14:29FromGitter<kayabaNerve> The request was I enable assertions to see if one of those shed further light on the problem.
19:14:44disruptekwell, let's first see that the future is finished.
19:16:16Araqok, so who wants to hear yet-another exception handling related thought
19:16:51disruptekoh dear.
19:17:24FromGitter<kayabaNerve> debug + explicitly enabled assertions returns nothing after 270k attempts. The initial crash was after 100k, but I'm not sure how representative that number is. For all I know, it was just extremely early and the strace one would've crashed if run long enough...
19:17:44disruptekthe strace is probably flushing stuff.
19:18:15*JustASlacker joined #nim
19:19:18FromGitter<kayabaNerve> I removed it for the debug + assertions run. Now trying release + assertions, still without strace.
19:20:14leorizeI guess you got a TOCTOU problem
19:20:24leorizebut it's weird that you can't catch it
19:20:33leorizehave you tried an empty `except` branch?
19:21:14FromGitter<kayabaNerve> Every call of mine to newAsyncSocket, accept, or even await is wrapped in try/except Exception.
19:21:23leorizelike `except` instead of `except Exception`?
19:21:55leorizeisn't Exception rooted from Defect and OSError rooted from CatchableError or am I mistaken?
19:22:41FromGitter<kayabaNerve> Haven't tried it, also can't generally. My macro forbids it. That said, I'll disable it for this nexthttps://play.nim-lang.org/#ix=2eZv
19:22:50FromGitter<kayabaNerve> *disable it for this next run.
19:22:56FromGitter<kayabaNerve> I was going to send that, but then i finished https://play.nim-lang.org/#ix=2eZv
19:23:06FromGitter<kayabaNerve> Which shows that except Exception works for OSError
19:23:10FromGitter<kayabaNerve> Crashed on release at 91k
19:23:17FromGitter<kayabaNerve> It doesn't crash with debug or strace
19:23:35FromGitter<kayabaNerve> Seems to be a race condition
19:24:04FromGitter<kayabaNerve> Assertions were on, none tripped
19:24:13disruptekturn the assertion into an `if`.
19:24:48leorizeit's a TOCTOU
19:24:53FromGitter<kayabaNerve> I never wrote an assertion. No one told me to. All that was said was to compile wit assertions on.
19:25:00leorizethe socket might be closed after you got it
19:25:03Yardanico@kayabaNerve try turning flags which release implies one-by-one, or try a different C compiler
19:25:12leorizebut not being able to catch is a bigger problem here
19:25:39FromGitter<kayabaNerve> leorize: Because it's an anon function under the runtime. I do wrap all my calls and traditionally call `continue` on error.
19:26:00FromGitter<kayabaNerve> But yes, if I could catch this, I wouldn't care that it happens.
19:26:14disruptekthere are uncachable exceptions all over async, though.
19:26:19FromGitter<kayabaNerve> Right.
19:26:24disruptekwork the problem.
19:26:27FromGitter<kayabaNerve> Right
19:26:36FromGitter<kayabaNerve> :P I understand my circumstance. I'm trying to work it.
19:26:57FromGitter<kayabaNerve> Yardanico: I can, yet it seems to be about speed in general. strace + release was fine. debug was fine. release wasn't fine.
19:27:26FromGitter<kayabaNerve> So I don't think it will help. I also don't believe I can compile this project with clang. It uses a lot of external C libraries.
19:27:36FromGitter<kayabaNerve> (with custom bindings and compile pragmas)
19:27:58Yardanicowell clang supports most of C out there :P
19:28:25*JustASlacker quit (Ping timeout: 250 seconds)
19:28:41FromGitter<kayabaNerve> Yeah, mainly worried about my compile pragmas. What's the Nim switch to use clang?
19:28:54Yardanico--cc:clang
19:29:22leorizeclang supports 90% of GNU C
19:29:38leorizeI'd say that it will work, assuming that you got a recent enough version of clang
19:29:41FromGitter<kayabaNerve> It's recompiling all my files now.
19:29:56FromGitter<kayabaNerve> Done
19:29:57FromGitter<kayabaNerve> Great
19:30:02FromGitter<kayabaNerve> TIL I support clang
19:30:29FromGitter<kayabaNerve> Alrighty. Probably needs a minute or two to get to 95k sockets (one crashed at 99580, one crashed at 91 something)
19:31:25FromGitter<kayabaNerve> Same error at 22k sockets
19:31:33FromGitter<kayabaNerve> clang seems to be extremely unlucky
19:32:47FromGitter<kayabaNerve> Eh. I should really say clang generated even faster code, as it this bug is a race condition/TOCTOU/something.
19:35:06FromGitter<kayabaNerve> So the immediate fix is to use debug to stop a TOCTOU. The long term fix is... submit an issue to the Nim repository and wait it out?
19:35:41leorizelong term fix is to figure out why can't you catch it :P
19:36:38FromGitter<kayabaNerve> Async runtime
19:37:36FromGitter<kayabaNerve> The async runtime is full of errors which can't be caught because they're macro'd the hell away. At this point in time, I've called runForever. Even if I could try/except runForever, I wouldn't be able to recover the place in code.
19:37:44FromGitter<kayabaNerve> It would exit of everything.
19:39:06disruptekasync won't be fixed.
19:39:56FromGitter<kayabaNerve> I'm not asking to change async. I'm asking to change the newAsyncSocket call to avoid this race condition crashing programs.
19:40:15FromGitter<kayabaNerve> leorize: Oh. If I try/except runForever, I can catch it.
19:40:58Araqyeah but then you lose everything in the event loop, I think
19:41:13FromGitter<kayabaNerve> Exactly. I'm debating now if I can reboot the networking code.
19:41:28FromGitter<kayabaNerve> At that point, it may be better just to ship a manager to reboot the entire app.
19:42:37FromGitter<kayabaNerve> Araq: Would you be cool if I created an error relating to the newAsyncSocket code as it has a potential TOCTOU?
19:42:39disruptekjust copy and fix the event loop. PRs won't be merged.
19:43:02FromGitter<kayabaNerve> I'm not sure how I can copy and fix every single async operation I have going on.
19:43:09FromGitter<kayabaNerve> I'm pretty sure I'd just want to restart the app.
19:43:14AraqkayabaNerve: fine with me
19:43:37FromGitter<kayabaNerve> Will do if I get a MRE
19:43:59*JustASlacker joined #nim
19:45:34Araqdisruptek: PRs will get merged and I might revive your PR
19:45:56disrupteksurprise me. 😉
19:46:20AraqI reviewed async's code so many times now that I might as well maintain it a little
19:46:22Araq:P
19:47:03disrupteki think it's good money after bad what with an arc future. jmo.
19:48:23*rnrwashere joined #nim
19:48:53Araqanyhow here is my idea regarding 'quirky' exceptions: when should you be forced to check for/ignore the error flag? when you call the next proc that might set it. because then you lose information. Consistent
19:49:00Araqwith Nim's 'discard' idea
19:49:14disruptekis there a way to `SomeType[T]` inside a template, ie. strop a generic name composed of an untyped arg?
19:49:41disrupteki like that idea.
19:49:44Araqthis also implies calling a proc that can raise inside a loop has to be annotated
19:51:20disruptekthere's only one flag, right?
19:51:49disruptekso maybe it could be an error to not check it before risking a new call, but not to omit a check prior to same.
19:51:56disruptekcfg can figure that out.
19:52:22Araqyeah, task for the cfg
19:52:52disruptekfirst design is probably better because it moves the test closer to the source.
19:53:32disruptekscope-based exception handling probably a creepy if convenient approach.
19:54:51FromGitter<kayabaNerve> So I can't reproduce it with a minimal brute connect/close. My theory is that it's all the code running in between async calls which is screwing it up 0_o Which means I can't create a MRE.
19:55:29FromGitter<kayabaNerve> But honestly, no idea. As soon as await connect is called, and it trips, I thought everything after that was synchronous which means it shouldn't matter...
19:55:46FromGitter<kayabaNerve> Maybe LMDB/threads? 0_o Anyways. Looks like my solution is to ship in debug for now.
19:57:52*dwdv joined #nim
19:58:04*rnrwashere quit (Remote host closed the connection)
20:21:33*andinus quit (Quit: ERC (IRC client for Emacs 26.3))
20:27:51disrupteklmdb/threads?
20:31:01*clemens3 quit (Read error: Connection reset by peer)
20:31:02*Trustable joined #nim
20:35:05rayman22201what maintenance doe async need? (other than the obvious arc issues?)
20:40:36FromGitter<kayabaNerve> disruptek: I have no idea what about my project could be tripping it up. If I had to pick something, my guess is the thread for my GUI OR LMDB which I believe spawns a threadpool.
20:40:49FromGitter<kayabaNerve> All I know is that my MRE doesn't work despite having a RE.
20:40:54disrupteklmdb doesn't use threads by default, afaik.
20:41:00FromGitter<kayabaNerve> A RE with 20k lines of code...
20:41:00disruptekit does support their use, though.
20:42:22FromGitter<kayabaNerve> Thanks for the heads up
20:43:00disrupteki wonder if you need to tell lmdb it is being used in a threaded context?
20:43:33FromGitter<kayabaNerve> You shouldn't? I'm not even doing any writing here. Just reading, and all my reads may be RAM cached at this point in time...
20:55:50disrupteki guess i will stream a couple more hours of obs/dbus.
20:57:15disruptek~stream
20:57:15disbotstream: 11https://twitch.tv/disruptek (live video/audio) and mumble://uberalles.mumbl.io/ (live voice chat) -- disruptek
20:59:51blackbeard420nice
21:00:11*krux02 quit (Remote host closed the connection)
21:06:51*rnrwashere joined #nim
21:07:08*rnrwashere quit (Remote host closed the connection)
21:07:21*rnrwashere joined #nim
21:08:33*filcuc joined #nim
21:09:13*filcuc_ quit (Ping timeout: 264 seconds)
21:12:49*dadada quit (Ping timeout: 264 seconds)
21:16:30*Deuns joined #nim
21:16:33Deunshello
21:17:10Yardanicohi
21:22:09*dadada joined #nim
21:22:32*dadada is now known as Guest85156
21:26:54Deunseuantor: do you have a solution for https://github.com/nim-lang/Nim/issues/12320 ? I have the same problem with multiple versions (1.0.2 and upper on openbsd 6.6)
21:26:56disbotKoch tools fails on OpenBSD with the 1.0.0 package ; snippet at 12https://play.nim-lang.org/#ix=2f0k
21:28:07euantorDeuns: afraid not. Unsure why the issue was closed as it still fails for me too
21:28:31Deunsok, thank you :)
21:28:47euantorRunning the CI tests also dumps hundreds of errors on OpenBSD, with lots of errors about unable to open file
21:29:39euantorNot yet managed to find the cause, but I’m still trying. I’m trying to get OpenBSD CI working: https://github.com/nim-lang/Nim/pull/12105
21:29:40disbot#12103 - CI for OpenBSD
21:35:40Araqeuantor, I think it was closed because we now have sourcehut support and it's green
21:36:29euantorSourcehut only checks FreeBSD, not OpenBSD. The OpenBSD PR is still open as I have several issues to fix to get it to pass
21:36:56euantorI need to rebase the PR, which I’ll do tonight and we’ll see how it runs now
21:41:21*xet7 quit (Quit: Leaving)
21:41:43*natrys quit (Quit: natrys)
21:43:49*xet7 joined #nim
21:44:03*opal quit (Ping timeout: 240 seconds)
21:44:28*rnrwashere quit (Remote host closed the connection)
21:44:47*rnrwashere joined #nim
21:47:27*opal joined #nim
21:49:25*rnrwashere quit (Remote host closed the connection)
21:50:54Araqok thanks
21:53:40*rnrwashere joined #nim
22:07:00*rnrwashere quit (Remote host closed the connection)
22:07:32*rnrwashere joined #nim
22:08:25*rnrwashere quit (Remote host closed the connection)
22:16:40*clemens3 joined #nim
22:18:22*rnrwashere joined #nim
22:30:38*JustASlacker quit (Quit: Leaving)
22:35:16euantorrebased, CI running. Expecting failures, will create issues for those that warrant them
22:38:03euantorOops, hoped it might get further than that ha! `Error: cannot open file: std/macros`
22:39:38euantorIs there any easy way to debug import errors like that - eg: to print the path(s) that the files were looked for within?
22:41:47*Guest85156 quit (Ping timeout: 246 seconds)
22:47:48*dadada joined #nim
22:47:54*filcuc quit (Ping timeout: 240 seconds)
22:48:11*dadada is now known as Guest67311
22:51:01*PMunch quit (Quit: leaving)
22:51:32*Trustable quit (Remote host closed the connection)
23:00:22*filcuc joined #nim
23:14:20*tane quit (Quit: Leaving)
23:29:50*sleepyqt quit (Ping timeout: 256 seconds)
23:31:25leorizeeuantor: use nim dump to get all the search paths
23:33:03*disrupteq joined #nim
23:41:06*lritter quit (Quit: Leaving)
23:51:14*filcuc quit (Ping timeout: 240 seconds)
23:52:38*krux02 joined #nim
23:58:04FromDiscord<Tristan> It's yer boi, back with more dumb questions. I'm trying to translate a C application to nim, there's an enum where a value is being 'OR'ed based on previous values in the enum. Trying to do the same in nim results in a type mismatch. Any ideas?