<< 26-07-2020 >>

00:00:02*junland quit (Quit: %ZNC Disconnected%)
00:00:45*junland joined #nim
00:01:00FromDiscord<tomck> sent a long message, see http://ix.io/2slX
00:01:08FromDiscord<tomck> (edit) 'http://ix.io/2slX' => 'http://ix.io/2slY'
00:02:29FromDiscord<Clyybber> you can define custom nimble tasks
00:03:30FromDiscord<tomck> how would `nimble test` be defined?
00:04:12FromDiscord<Clyybber> I think its a builtin task or something, I'm not sure
00:04:26FromDiscord<Clyybber> but you should be able to make a new task "testMinimal" or something like that
00:04:38FromDiscord<Clyybber> which only runs your dependencyfree tests
00:04:40disruptek`nimble test` builds and runs any .nim file in tests that starts with a t.
00:04:47FromDiscord<Clyybber> ah
00:04:51disruptekyou can redefine it, though.
00:05:42FromDiscord<tomck> how would I define that though?
00:05:59disruptektask test, "run some tests": ...
00:06:00FromDiscord<tomck> Is there some special flags for 'run all files in X directory that start with Y'?
00:06:03disruptekin your .nimble file
00:08:03FromDiscord<tomck> brill, got it, ta
00:23:21dulsiI have a C function that takes an int* so that the int value is passed back. How do I specify that in FFI?
00:24:08bungptr int32
00:34:46dulsiSorry for the stupid question but how do I call the function? I have "var a: int32" if I call "foobar(a)" doesn't work because it is int32 not ptr int32.
00:35:31FromDiscord<tomck> you can do .addr to get the address of something
00:35:37FromDiscord<tomck> `foobar(a.addr)`
00:40:36*krux02_ quit (Remote host closed the connection)
00:47:33FromDiscord<Clyybber> hah! tracked it down finally
00:47:41disruptekreally?
00:47:51FromDiscord<Clyybber> yeah, its because proc params get gensymmed
00:48:03FromDiscord<Clyybber> not sure if that should be changed, or the find proc method
00:48:14FromDiscord<Clyybber> but I feel like its a bit unneccessary to gensym proc params
00:48:25FromDiscord<Clyybber> but the tests should tell me
00:48:31disruptekneat.
00:48:42FromDiscord<Clyybber> but I need some sleep :D
00:48:43skrylar[m]gensymmed proc params are derp yes
00:48:55skrylar[m]i love seeing the autocompleter tell me about parameters like "self88"
00:49:00FromDiscord<Clyybber> lol
00:49:01disruptekgn clyybber
00:49:07FromDiscord<Clyybber> gn8
00:49:32skrylar[m]i think in skpostbox i specifically coded it so the parameter names dont get gensymmed
01:20:42*apahl quit (Ping timeout: 260 seconds)
01:21:14*apahl joined #nim
01:23:52*noonien quit (Quit: Connection closed for inactivity)
01:30:34*qwertfisch quit (Ping timeout: 256 seconds)
01:36:18*beatmox quit (Quit: ZNC 1.8.0 - https://znc.in)
01:37:10*beatmox joined #nim
01:43:35*beatmox- joined #nim
01:45:38*beatmox quit (Ping timeout: 246 seconds)
01:46:37*beatmox- quit (Client Quit)
01:47:22*beatmox joined #nim
01:53:44*beatmox quit (Quit: ZNC 1.8.0 - https://znc.in)
01:55:03*qwertfisch joined #nim
01:57:05*beatmox joined #nim
01:57:07*qwertfisch quit (Remote host closed the connection)
02:01:27*qwertfisch joined #nim
02:06:37*qwertfisch quit (Quit: ZNC - http://znc.in)
02:10:37*muffindrake quit (Ping timeout: 260 seconds)
02:11:42*beatmox quit (Quit: ZNC 1.8.0 - https://znc.in)
02:11:42*beatmox- joined #nim
02:12:31*muffindrake joined #nim
02:17:49*beatmox- quit (Quit: ZNC 1.8.0 - https://znc.in)
02:17:57*beatmox joined #nim
02:20:18*qwertfisch joined #nim
02:27:19*altarrel quit (Quit: Konversation terminated!)
02:53:47*endragor joined #nim
02:54:11*lritter_ quit (Ping timeout: 240 seconds)
02:55:01*lritter_ joined #nim
03:25:42*waleee-cl quit (Quit: Connection closed for inactivity)
03:28:08*silvernode joined #nim
03:29:37silvernodeGood evening from AZ, (20:29)
03:30:37silvernodeHad a week off work and go back in 2 nights, so of course I am just not getting on IRC and opening my nim projects. Procrastination at it's finest!
03:30:49silvernodenow*
03:33:42silvernodeAbout to post about my space game on the Nim forums so that maybe people who are interested will join in and I will actually work on the project.
03:36:23FromDiscord<Rika> sure
03:38:05silvernodeWorking on a post now
03:41:03dulsiDoes you space game have an achievement/trophy system? I've been working on gamerzilla, an open source achievement/trophy system. I have been working on adding it to smalltrek.
03:43:14FromDiscord<impbox> dulsi: oh?
03:43:32silvernodedulsi: It is something I would like to support at a later time, but for now the game is in very early alpha (the very beginning). Right now I am working on Code design, concepts and basic functionality.
03:44:04FromDiscord<Elegant Beef> Oh i didnt realize you OSS your games impbox 😄
03:44:41FromDiscord<impbox> it's a requirement to release source for LD compo
03:44:47FromDiscord<Elegant Beef> ah
03:45:11FromDiscord<Rika> ludum dare?
03:45:15FromDiscord<impbox> yep
03:45:25dulsiimpbox: Sorry for the surprise. I planned on notifying you when I got further along.
03:45:49FromDiscord<impbox> no problem, sounds cool =)
03:45:56dulsiI do have some fixes to smalltrek. https://github.com/dulsi/ld38-smalltrek
03:46:11FromDiscord<impbox> i have plans to rework smalltrek at some point
03:46:24dulsiHope to check in some gamerzilla support before Monday.
03:47:19silvernodeSpace Nim, while a text game, is still a very ambitious project for me since I do not consider myself a good programmer and still have a lot to learn. I am probably 5% out of 100 in understanding basic programming concepts.
03:47:20*sagax joined #nim
03:47:30FromDiscord<impbox> at some point i made a fixed up version with android and nice touch support, but i think i lost it on my old pc
03:47:49FromDiscord<impbox> but it works quite nice on mobile
03:48:03FromDiscord<impbox> and i want to make an expanded set of levels with new races
03:48:24FromDiscord<impbox> too many projects =)
03:48:55silvernodeI have posted this here before, but the game repository is https://github.com/silvernode/space-nim
03:49:55silvernodedulsi: I doubt your gamerzilla is meant to function with text based games.
03:50:46FromDiscord<Elegant Beef> I assume it's just event based so it'd be trivial to ujse there
03:50:49FromDiscord<Elegant Beef> I could be wrong
03:51:17FromDiscord<Elegant Beef> (edit) 'ujse' => 'use'
03:51:24dulsiRight now gamerzilla has no overlay when you achieve something. It just records it, uploads it to game launcher, and game launcher uploads it to hubzilla plugin for web display.
03:52:05dulsiI have modifications to add support for gamerzilla to GameHub as a game launcher.
03:55:09FromGitter<gogolxdong> Anyone knows how to set the default nimble path on WSL, to use the same with what's on Windows.
03:57:57FromGitter<gogolxdong> /root/.nimble/pkgs/jester-#head/jester.nim(544, 13) Error: type mismatch: got <FutureBase, int literal(0), CallbackAction>
04:06:02*supakeen quit (Quit: WeeChat 2.8)
04:06:42*supakeen joined #nim
04:08:33*aurelius joined #nim
04:08:57FromGitter<gogolxdong> Is that NIMBLE_DIR ?
04:09:06*arecacea1 quit (Remote host closed the connection)
04:09:29*arecacea1 joined #nim
04:18:03shashlickyep
04:23:33*aurelius quit ()
04:42:28silvernodeStill working on my forum post, I have been meaning to do this for months now.
05:06:20FromDiscord<impbox> Long post!
05:32:13*marnix joined #nim
05:34:31*marnix quit (Read error: Connection reset by peer)
05:35:27*07EAAFM9Q joined #nim
05:36:36Zevv[m]any news disruptek?
05:40:20Zevv[m]oh I got a ton of mails, right, thats the news
05:42:14Zevv[m]dude how the hell can for loops work?!
05:45:13FromDiscord<Avatarfighter> you just gotta believe
06:04:08Zevv[m]you can't just make that work, where does the state of the iterator go?
06:05:07FromDiscord<Avatarfighter> it goes to the same place that you cry
06:05:53Zevv[m]you're not helping man, not helping
06:06:02Zevv[m]can't you see I'm in distress!!
06:06:13Zevv[m]my world view is tumbling over
06:07:18*solitudesf joined #nim
06:10:35*07EAAFM9Q quit (Ping timeout: 240 seconds)
06:11:54bungoh CI all fails when testing GULPF/timezones
06:17:42*lritter_ quit (Ping timeout: 260 seconds)
06:22:20*xet7 quit (Quit: Leaving)
06:33:57*jjido joined #nim
06:35:25*jjido quit (Client Quit)
06:40:43silvernodeWell I have been editing my forum post for like 3 hours now, and I made a quick logo for the game.
06:40:45silvernodehttps://raw.githubusercontent.com/silvernode/space-nim/master/src/img/space-nim-logo.png
06:41:07FromDiscord<Elegant Beef> I still think you could make it vastly nicer using nico and it's imgui 😄
06:41:14*jjido joined #nim
06:43:07silvernodeElegantBeef , yeah I would really like to have an ncurses type of UI going on, but I always get overwhelmed trying to learn a framework at the same time I am learning a language AND how to program in general.
06:50:44*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:07:34*silvernode[m] joined #nim
07:08:12silvernode[m]test from the official matrix client.
07:08:31silvernodeworks like a charm
07:08:46FromDiscord<Elegant Beef> "offical"?
07:09:51silvernodeyeah Riot was the official client but it has been renamed to Element and switch to using the dev version of Riot called Riot-x
07:10:15silvernodeAt least according to a podcast which had the co-founder of matrix
07:10:43FromDiscord<Elegant Beef> Ah, i've been testing element as of late, and it's voip is the only issue i have
07:10:58FromDiscord<Elegant Beef> If they were to replace jitsi with a p2p voip i'd be happy
07:11:16silvernodewow really? the voice chat was great in riot so I figured it would be even better now.
07:11:28FromDiscord<Elegant Beef> They use jitsi for anything aside from 1:1
07:11:31FromDiscord<Elegant Beef> and it was terrible imo
07:11:37silvernodeElement uses Jitsi for the voip?
07:11:44FromDiscord<Elegant Beef> riot did too afaik
07:12:03silvernodeI assumed matrix could just do voice
07:12:08silvernodehmm
07:12:08FromDiscord<Elegant Beef> It can
07:12:11FromDiscord<Elegant Beef> It's in the protocol
07:12:33FromDiscord<Elegant Beef> maybe it's just free servers that have jitsi, and you can change it
07:12:47FromDiscord<Elegant Beef> Cause on my freely hosted server it was using jitsi, which was terrible
07:12:56FromDiscord<Elegant Beef> I like a lot of what it has though
07:13:10silvernodeAh that makes sense, I never hosted my own but I am thinking about it.
07:13:32*arecacea1 quit (Remote host closed the connection)
07:13:54*arecacea1 joined #nim
07:14:23*jjido joined #nim
07:15:44silvernodeAre you hosting it through them or on your own VPS?
07:16:00FromDiscord<Elegant Beef> I mean i hosted a community on their free setup
07:17:10FromDiscord<Elegant Beef> Sorry a room
07:30:30*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
07:34:20*jjido joined #nim
07:44:59dzamo[m]You can kiss 500Mb of RAM goodbye if you run your own matrix-synapse node. I've just spent some hours switching my own to run on PyPy instead of CPython. I guess that was never likely to help with memory usage.
08:00:03silvernodedzamo[m]: synapse is python?
08:25:51ForumUpdaterBotNew thread by Mollusk: [Game] Space Nim: a text based outer space game, loosely based on Trade Wars 2002, see https://forum.nim-lang.org/t/6596
08:30:23FromDiscord<impbox> @silvernode there's a nim-gamedev channel (or gamedev channel on discord)
08:30:27FromDiscord<Rika> there it is
08:31:02silvernodeI have a mind map software called vym and there's a file in the game repo with a bunch of ideas. I should probably convert that to something more accessible.
08:31:16silvernodeAh, I didn't know about the gamedev channel. thanks
08:31:42FromDiscord<impbox> text/curses based game sounds cool
08:32:26silvernodeIf I could find a really simple framework, I will consider using it but so far everything I have found it too confusing to me.
08:34:52FromDiscord<Elegant Beef> Silvernode checkout projects on github, they'll let you organize your ideas in a way attached to the repo
08:38:20FromDiscord<Varriount> Hm, this is tricky. The Windows API tends to share identifiers between enum constants, procedures, and types. How should I handle renaming things when they clash? (I'm generating a wrapper)
08:38:28silvernodeI should have thought of that, I will check it out, Good mind map software is hard to find but if I can use something that integrates into the project directly that would be cool.
08:41:03FromDiscord<Elegant Beef> Yea silvernode it's more like a trello board than a mindmap
08:41:03FromDiscord<impbox> if nothing else you can screenshot the mindmap and include that
08:41:21FromDiscord<impbox> draw.io is pretty nice
08:41:24FromDiscord<impbox> and web based
08:44:38silvernodeI find mind maps to be great for ideas. It's my first step of learning how to plan out my projects.
08:44:58FromDiscord<impbox> aye, they're pretty handy
08:45:05FromDiscord<impbox> i like the visual connected nature of them
08:45:31FromDiscord<impbox> but surprisingly the tooling still sucks for online collaborative ones
08:45:35FromDiscord<impbox> from what i've seen
08:46:05FromDiscord<Rika> i just draw my ideas
08:46:41FromDiscord<impbox> mmm i do visual mockups and write big text tiles full of ideas
08:48:02FromDiscord<Varriount> I tend to just write bits of dialogue and ideas (for stories)
08:49:03silvernodeI used to write txt files but association is not something conveyed well that way. So I got into mind maps which somewhat solves that problem.
08:49:40silvernodeLinking categories to sub trees of ideas is important I think.
08:49:44FromDiscord<impbox> for sure
08:50:55silvernodeThe biggest feature of Vym that I like is the workflow. You can focus on the ideas instead of fightng with the workflow.
08:51:10FromDiscord<Rika> maybe i should install an infinite-zoom drawing app since i tend to put tiny notes inside my drawings
08:51:14FromDiscord<impbox> i'll check it out
08:51:39silvernodeyou just press A to add an idea to whatever you are selected on and it automatically expands out each time you add something.
08:52:42silvernodeAs good as it is, there are some pretty annoying bugs but I deal with those since it is still better overall than any other mind mapping software I have tried.
08:53:10FromDiscord<impbox> i've been thinking of making my own tool for a long time, maybe i'll eventually get around to it
08:53:43silvernodeDon't get me wrong, there are really nice mind mapping programs around the net but they always fall short on the workflow.
08:54:03FromDiscord<impbox> i guess i want a cross between mind mapping + task management
08:54:30silvernodeI was reading some people talking about how incredibly difficult it is to make mind map software.
08:57:14FromDiscord<impbox> seems like vym is a pure tree system
08:57:21FromDiscord<impbox> can you make links between branches?
09:00:20silvernodeLinks between branches?
09:00:36FromDiscord<impbox> sorry, links between items on different branches
09:03:00silvernodeI do not think so. Once you have a branch, you can only add or link to that branch.
09:03:08silvernodeat least from what I can tell
09:04:20*drewr quit (Ping timeout: 244 seconds)
09:05:53*drewr joined #nim
09:13:15*oddp joined #nim
09:15:14*NimBot joined #nim
09:25:17FromDiscord<😬🤣> TIL `let resp = try: readFile(f) except OSError: break` is valid code
09:28:22FromDiscord<lqdev> yeah most things can be used like that
09:28:32FromDiscord<lqdev> eg. if and case
09:28:44FromDiscord<lqdev> also, block
09:29:52FromDiscord<😬🤣> what got me is the `break`
09:46:45FromDiscord<Varriount> What does "break" do in that context?
09:52:12FromDiscord<😬🤣> well, it just breaks you from the loop or the block you're in
09:56:25FromDiscord<Rika> thats totally valid code even if indented though?
09:56:52FromDiscord<Rika> break is ok to use in this case because how are you gonna use the variable after anyway?
10:00:11FromDiscord<Varriount> But what is resp set to?
10:00:39FromDiscord<Varriount> I thought all execution paths of a statement list had to return the same result
10:00:52FromDiscord<Rika> its not going to be set
10:00:55FromDiscord<Rika> it doesnt have to be set
10:01:00solitudesfif he breaks out of block there is not resp in scope
10:01:10FromDiscord<Rika> yeah
10:06:27FromDiscord<Varriount> Poor little variable. All it wants is to have a value
10:06:56FromDiscord<Varriount> Someone should write picture books about programming.
10:09:46*couven92 joined #nim
10:10:42*WilhelmVonWeiner quit (Read error: Connection reset by peer)
10:13:23*waleee-cl joined #nim
10:18:14*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
10:24:34Zevv[m]I'd love that
10:25:47FromDiscord<Rika> a programming book without a hint of a letter or a number, only symbols? :thonk:
10:33:52FromGitter<kdheepak> The Julia BinaryBuilder developers have expressed that they are open to adding Nim as a compiler shard in their BinaryBuilder workflow.
10:34:09FromGitter<kdheepak> I've opened as issue to track the progress of this here: https://github.com/JuliaPackaging/Yggdrasil/issues/1341
10:34:11disbotNim compiler shard ; snippet at 12https://play.nim-lang.org/#ix=27eP
10:36:28FromGitter<kdheepak> There's a two and half hour long video on BinaryBuilder from the JuliaCon workshop this morning: https://www.youtube.com/watch?v=3IyXsBwqll8. The first 30 minutes or so will give anyone interested a quick primer on what BinaryBuilder is.
10:44:15*krux02 joined #nim
10:58:21FromDiscord<Clyybber> Zevv: I'm sure he's answering you in his sleep
10:58:27*Vladar joined #nim
11:20:09FromGitter<sheerluck> @kdheepak I have `CONFIG_USER_NS=y` but `$ julia -e 'using BinaryBuilder; BinaryBuilder.runshell()'` gives me `Warning: Unable to run unprivileged containers on this system! This may be because your kernel does not support mounting overlay filesystems within user namespaces.` :(
11:20:51Zevv[m]Clybber: sure, sure
11:20:55Zevv[m]:)
11:21:11FromDiscord<Clyybber> I'm getting close to the forward decl bug btw :D
11:21:22Zevv[m]\o/
11:21:27Zevv[m]Is there a nim bug open for that as well?
11:21:32FromDiscord<Clyybber> yeah
11:21:46Zevv[m]ah found it
11:22:25Zevv[m]Hm but wait, now I'm confused, that's not related the other crash we see
11:22:26Zevv[m]ah right
11:22:33FromDiscord<Clyybber> it is
11:22:37FromDiscord<Clyybber> the ICE
11:22:44Zevv[m]yeah, but not the codegen error
11:22:53Zevv[m]with the missing members
11:23:01FromDiscord<Clyybber> yeah, thats a different one probably
11:23:01Zevv[m]or is it
11:23:09Zevv[m]right
11:23:30Zevv[m]I just ended up doing auxilary services, making stupid tests etc
11:23:42Zevv[m]works for me :)
11:23:48FromDiscord<Clyybber> its good stuff
11:23:52*krux02 quit (Remote host closed the connection)
11:23:54Zevv[m]low mental effort, low expectations, no responsibilites
11:23:59FromDiscord<Clyybber> :D
11:23:59Zevv[m]the way I love to go through life
11:28:48FromDiscord<Clyybber> diff3 is a livesaver
11:35:18Zevv[m]know meld?
11:35:26Zevv[m]its one of the very few non-terminal apps I use
11:35:52FromDiscord<Clyybber> oh I think I've seen that once
11:36:06FromDiscord<Clyybber> never used it tho
11:38:16leorize[m]why use meld when fugitive 3way vimdiff can do the job better :p
11:38:34Zevv[m]vimdiff never worked for me, don't know why
11:38:41FromDiscord<Clyybber> because I don't use vim :p
11:38:45*Zevv[m] is now known as Zevv
11:39:15FromDiscord<impbox> vimdiff is awesome, but i can't get it to work as a mergetool on windows =(
11:39:18FromDiscord<impbox> temp directory issues
11:40:29ZevvI so hate this telegram thing. Why couldn't that just be an irc thing
11:40:40FromDiscord<Clyybber> wtf github: https://github.com/ftsf/nico/blob/master/examples/vertex.nim#L73
11:40:43ZevvI can't search, Its so inefficient
11:40:54Zevvso low-density
11:41:09FromDiscord<Clyybber> use a different telegram client :p
11:41:17FromDiscord<lqdev> @Clyybber ask @Varriount to fix his sublime text plugin
11:41:19ZevvThey all suck
11:41:25FromDiscord<lqdev> that's what github uses for syntax highlighting
11:41:28FromDiscord<impbox> I've created an issue for it
11:41:55FromDiscord<impbox> https://github.com/Varriount/NimLime/issues/147
11:41:56disbotsyntax highlighting incorrect for `1.0'f` literals
11:43:41FromDiscord<lqdev> @impbox i don't really get why you're using 'f here anyways
11:43:45FromDiscord<lqdev> 1.0 implies a `float`
11:44:01FromDiscord<Rika> maybe what's intended is 1.0f32
11:44:13FromDiscord<lqdev> 1.0'f32 works fine with syntax highlighting tho
11:44:43FromDiscord<impbox> because 'f is a float32 literal
11:44:49FromDiscord<lqdev> is it?
11:44:52FromDiscord<Clyybber> yeah
11:45:06FromDiscord<Clyybber> and 'd is float64
11:45:06FromDiscord<impbox> FLOAT32_SUFFIX = ('f' | 'F') ['32']
11:45:11FromDiscord<lqdev> oh i see
11:45:16FromDiscord<lqdev> just checked in the manual
11:45:34FromDiscord<lqdev> i almost never use those because they look bad :P
11:46:05FromDiscord<impbox> I've been using `'f` instead of just `f` because the vim syntax highlighting doesn't handle `f` =p
11:47:01FromDiscord<lqdev> !eval echo 1.0f
11:47:04NimBot1.0
11:47:06FromDiscord<Clyybber> I prefer `'f32` and `'f64` because it fits better with the fact that double and float are called float{32,64} in nim
11:47:14FromDiscord<lqdev> oh cool
11:47:20FromDiscord<lqdev> didn't know you can omit the apostrophe
11:47:50FromDiscord<Clyybber> to not burn C/C++ ppl
11:56:53FromDiscord<exelotl> its nice being able to type 1f instead of 1'f32. Also familiar having done some C#
12:06:02*supakeen quit (Quit: WeeChat 2.8)
12:06:41*supakeen joined #nim
12:22:26*silvernode quit (Quit: Konversation terminated!)
12:34:01bunghttps://github.com/nim-lang/Nim/issues/8821
12:34:03disbotJS codegen can produce extreme switch statements ; snippet at 12https://play.nim-lang.org/#ix=2pKT
12:34:15bunghow the c codegen solve this ?
12:45:58FromDiscord<Clyybber> Zevv: Ha! Got it!
12:46:15FromDiscord<Clyybber> Doesn't fix the ICE though :p
12:46:28FromDiscord<Clyybber> but at least the reported error
12:46:55FromDiscord<Clyybber> the ICE is a bit different since because disruptek uses the same sym for the forward decl and the actual definition
12:47:07FromDiscord<Clyybber> which I need to patch it to deal with
12:47:58*Ven`` joined #nim
12:53:51FromDiscord<lqdev> where should I put an nnkCommentStmt if I want to attach it to a const?
12:59:47FromDiscord<lqdev> damn
12:59:55FromDiscord<lqdev> is it really only possible to do for procs?
13:00:10FromDiscord<lqdev> how does `nim doc` detect `const` doc comments then?
13:00:59FromDiscord<Clyybber> by looking at the comment field probably
13:01:06FromDiscord<Clyybber> its not accessible by macros tho afaik
13:01:17FromDiscord<lqdev> i don't want to read it, i want to generate it
13:01:24FromDiscord<lqdev> is it still not possible?
13:02:31FromDiscord<Clyybber> no
13:03:28FromDiscord<Clyybber> I don't think so
13:04:27FromDiscord<Clyybber> bung: By using sets afaik
13:06:08*antranigv quit (Ping timeout: 244 seconds)
13:08:08*couven92 quit (Read error: Connection reset by peer)
13:08:34*couven92 joined #nim
13:09:20*couven92 quit (Read error: Connection reset by peer)
13:09:44*couven92 joined #nim
13:10:10*adokitkat joined #nim
13:12:46*vicfred quit (Quit: Leaving)
13:21:30bungClyybber could you tell me more? not as I imaged pre defined const 1..n right?
13:27:07ForumUpdaterBotNew thread by Adilh: Problem building code on macos with nimble, see https://forum.nim-lang.org/t/6597
13:27:38*antranigv joined #nim
13:28:39FromDiscord<Clyybber> bung: WDYM? Its similar to 1..n in a way yeah
13:28:55FromDiscord<Clyybber> But really more similar to {1..n}
13:32:10Yardanicook time to test those arc fixes from yesterday by 4raq :P
13:35:36*couven92 quit (Read error: Connection reset by peer)
13:36:02FromGitter<bung87> hmm maybe just use if i>= int.min <=int.max
13:36:02*couven92 joined #nim
13:37:17FromDiscord<dom96> This is a fun bug, getAppFilename will return `/path/to/your/exe (deleted)` if you replace the executable
13:37:35FromDiscord<dom96> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/os.nim#L2956
13:39:01FromDiscord<Clyybber> wouldn't call it a bug :p
13:39:14Yardanicowe just need to handle it somehow I guess
13:39:18FromDiscord<Clyybber> yeah
13:39:20Yardanicobut yeah, I don't think it's neccessarily a bug :P
13:39:32Yardanicobecause there's no filename if the binary was deleted
13:39:34Yardanicoor replcaed
13:39:35Yardanicoreplaced*
13:41:27FromDiscord<dom96> Come on, it's definitely a bug
13:41:39FromDiscord<Clyybber> what do you expect it to return?
13:41:44FromDiscord<Clyybber> /dev/null ?
13:41:47*adokitkat quit (Remote host closed the connection)
13:41:54FromDiscord<dom96> I would expect it to throw an exception
13:42:08FromDiscord<dom96> anything really than appending `(deleted)` to the file path...
13:42:33FromDiscord<lqdev> meh https://media.discordapp.net/attachments/371759389889003532/736941526378086420/unknown.png
13:42:47FromDiscord<Clyybber> stropped?
13:42:49FromDiscord<lqdev> i'd much rather put it in the consts section, because it doesn't hint at calling it…
13:42:52FromDiscord<Clyybber> but not stropped.
13:42:52FromDiscord<lqdev> not stropped
13:42:53FromDiscord<Clyybber> weird
13:42:58FromDiscord<lqdev> created with `ident`
13:43:06Yardanicomagic :P
13:43:13FromDiscord<lqdev> Macro Magic™
13:43:20Yardanico@dom96 well, yeah, but for backwards compat it should only do that on nim >=1.3.5
13:43:27YardanicoI mean NimVersion and stuff
13:43:36FromDiscord<Clyybber> @lqdev you want the proc to be in the const section?
13:43:50FromDiscord<lqdev> no, I want any sort of docs in the const section :P
13:44:03FromDiscord<Clyybber> haha
13:44:04FromDiscord<lqdev> just any docs anywhere, ok?
13:44:09Yardanicoah wait
13:44:14YardanicogetAppFilename returns "" on error I think
13:44:15FromDiscord<lqdev> too bad you can't add your own doc sections. that would be so cool
13:44:17Yardanicojust need to document that
13:44:23Yardanicofor windows it seems to return "" on error
13:44:29Yardanicoand handle it for posix
13:44:32FromDiscord<dom96> Yardanico: lol thanks for conceding that it is a bug.
13:45:30Yardanicoit also returns "" on macos on error
13:45:39FromDiscord<dom96> Sometimes it feels like no matter what I say here people want to argue over it. 🙂
13:46:21FromDiscord<Clyybber> I didn't want to argue against fixing it
13:46:28FromDiscord<dom96> Anyway, I reported it here #15079
13:46:30disbothttps://github.com/nim-lang/Nim/issues/15079 -- 3getAppFilename returns (deleted) in the path ; snippet at 12https://play.nim-lang.org/#ix=2siC
13:46:45FromDiscord<impbox> @dom96 no they don't!
13:48:03FromDiscord<Clyybber> lol
13:48:10Yardanicowonder if it's the posix call itself which appends "(deleted)"
13:48:14Yardanicoor some code in stdlib?
13:48:32FromDiscord<Rika> probably the posix call
13:48:57Yardanicoah it's linux-specific
13:49:03FromDiscord<Clyybber> yeah, which is why I argued that it could be considered to not be a bug
13:49:04Yardanicoposix standard doesn't specify this it seems
13:49:26Yardaniconot sure how it behaves when file is deleted on other *nix'es
13:50:09FromDiscord<Clyybber> I guess we could just error out if its not a valid path
13:50:18FromDiscord<dom96> What would you consider it then if not a bug?
13:50:29FromDiscord<Clyybber> an abstraction leak
13:50:59Yardanico@Clyybber maybe instead return an empty string? which getAppFilename already does for macos/windows in case of an error
13:51:11FromDiscord<Clyybber> call it a bug if you want; my remark was tongue in cheek :)
13:51:23FromDiscord<Clyybber> @Yardanico yeah seems fine too
13:53:12*vicfred joined #nim
13:54:08FromDiscord<dom96> It is a bug lol
13:54:19Yardanicoafter that tuple closure fix - nimsynth with orc
13:54:20Yardanicohttps://i.imgur.com/SRdD8Dx.png
13:54:23Yardanico@impbox ^ :P
13:54:38FromDiscord<impbox> awesome
13:54:38YardanicoI launched it in Xephyr so the mouse coords are fine (they seem to be borked with Xwayland directly)
13:55:02Yardanicobut there's certainly sound :P
13:55:07Yardanicotime to follow your video for same music
13:55:16FromDiscord<dom96> Yay, my servers can now automagically restart for updates.
13:57:11*jjido joined #nim
14:03:36Yardanicook also time to test nimyaml with arc again after https://github.com/nim-lang/Nim/issues/15052
14:03:37disbot[ARC] Crash when modifying a string with mitems iterator ; snippet at 12https://play.nim-lang.org/#ix=2sbY
14:04:48Yardanicoseems like NimYAML uses shallow copy in some places though :/
14:04:53Yardanicoso some tests fail (but not crash)
14:05:06*couven92 quit (Read error: Connection reset by peer)
14:05:34*couven92 joined #nim
14:06:15Yardanicoah wait there were some old simplifications left by me
14:06:36*couven92 quit (Read error: Connection reset by peer)
14:06:50YardanicoMWAHAHHAHA
14:06:54Yardanicoall NimYAML tests pass with arc
14:06:58Yardanicoand sink inference off
14:06:59*couven92 joined #nim
14:07:08Yardanico(sink inference because I didn't want to modify with nosinks)
14:07:26Yardanicowell I had to fix nimyaml a little for devel
14:07:35Yardanicoremove "not nil" from YamlNode
14:08:00Yardanicoand also had to make a custom destructor with another field
14:08:18Yardanicobecause before it used two different finalizers, and arc can't currently bind more than one finalizer
14:08:35Yardanicotests pass with refc as well for same code
14:08:43Yardanicobecause nim can map destructors to finalizers
14:10:46Yardanicobasically now the whole patch for arc is https://gist.github.com/Yardanico/b4aaf28ec157c330a7639103d892b9be
14:10:50Yardanicofor nimyaml
14:11:48Yardanicolets try with sink inference on
14:12:46Yardanicostill all tests pass (after two nosinks insertions), nice
14:17:24FromDiscord<Clyybber> nice!
14:17:37Yardanicoalthough valgrind shows 100kb as "definitely lost"
14:18:00Yardanicoand 2mb indirectly lost
14:18:10Yardanicowith -d:useMalloc and --gc:orc
14:18:35*couven92 quit (Read error: Connection reset by peer)
14:19:02*couven92 joined #nim
14:19:17Yardaniconot sure what to do about not nil
14:19:29Yardanicoseems like it's broken for newruntime (for seqs at least)
14:19:33Yardanico/home/dian/Things/Nim/lib/system/seqs_v2.nim(110, 23) Error: cannot prove 'value' is not nil
14:25:27Yardanicoopened https://github.com/flyx/NimYAML/issues/85 so that it doesn't get lost at least
14:25:28disbotNimYAML compatibility with ARC/ORC.
14:32:19icyphoxwhat's a good way to iterate over a seq infintely?
14:32:27Yardanicohttps://github.com/narimiran/itertools
14:32:31Yardanicoit has a cycle iterator
14:32:39icyphoxneat
14:32:49Yardanicoits really simple though
14:32:55Yardanicoyou can just copy the implementation :P
14:33:30icyphoxah yeah i might
14:33:32icyphoxsaves me a dep
14:35:39YardanicoAraq: is strictFuncs supposed to work with old runtime (refc)?
14:37:57Yardanicoif yes, then this fails for refc (throws an error with arc though) - https://play.nim-lang.org/#ix=2sm7
14:38:08YardanicoI mean it fails the mutability check and successfully compiles with refc
14:38:27icyphoxundeclared identifier yield? is yield in some module?
14:38:32Yardanicoicyphox: no
14:38:37Yardanicoit's a built-in construct
14:38:40Yardanicoonly used in iterators
14:38:41icyphoxoh wow
14:38:45icyphoxitertools has a typo
14:38:47icyphoxlol
14:38:51Yardanicodoes it?
14:38:52icyphoxit's written as 'yeild'
14:38:57Yardanicono?
14:38:59YardanicoI can't find that
14:39:01icyphoxoh wait
14:39:02icyphoxlmao
14:39:07icyphoxi typed that
14:39:12Yardanicohappens :P
14:39:32icyphoxlol
14:43:38FromDiscord<Clyybber> Yardanico: Is a bug
14:43:42Yardaniconoice
14:44:45Yardanicocredit goes to @sschwarzer on GitHub :P
14:44:57Yardanicoon nim forum*
14:45:05*antranigv quit (Ping timeout: 240 seconds)
14:45:50FromDiscord<Clyybber> nice
14:47:39disruptekZevv: for loops can't work, obviously, but the alternative is that we cannot call cps procs from inside a for loop, right?
14:49:49disruptekmaybe that's the lesser of two evils.
14:52:38FromDiscord<Clyybber> disruptek: For loops *can* work, maybe..
14:53:08FromDiscord<Clyybber> https://nim-lang.github.io/Nim/macros#getImplTransformed%2CNimNode
14:53:31disruptekit's untyped, though.
14:54:21FromDiscord<Clyybber> where did you get that from?
14:54:44disruptekwhat?
14:54:50FromDiscord<Clyybber> do you mean cps?
14:54:53disruptekyeah.
14:54:56FromDiscord<Clyybber> oh
14:55:07FromDiscord<Clyybber> I think it needs to be typed eventually anyways
14:55:10disruptekbut actually, we might be moving in that direction anyway.
14:55:14FromDiscord<Clyybber> for templates and stuff to work
14:55:54disruptekthe problem is that a `cps foo()` cannot be typed until we have context.
14:56:10disruptekbut it might be time to solve this problem permanently.
14:59:12YardanicoI always forget those little features we have :P
14:59:16Yardanico!eval echo var a: 0 .. 5 = 3
14:59:17Yardanico!eval echo var a: 0 .. 5 = 6
14:59:17NimBotCompile failed: /usercode/in.nim(1, 10) Error: undeclared identifier: 'a'
14:59:19NimBotCompile failed: /usercode/in.nim(1, 10) Error: undeclared identifier: 'a'
14:59:27Yardanico!eval var a: 0 .. 5 = 3
14:59:31NimBot<no output>
14:59:31Yardanico!eval var a: 0 .. 5 = 6
14:59:34NimBotCompile failed: /usercode/in.nim(1, 17) Error: conversion from int literal(6) to range 0..5(int) is invalid
14:59:53Yardanicois this documented btw?
14:59:59disruptekof course.
15:00:03Yardanicowhere? :P
15:00:10disruptekrtfm range types
15:00:46Yardanicowe only have "subrange types"
15:01:11Yardanicoand even then I can't find that syntax anythere
15:01:14Yardanicoanywhere*
15:01:33disruptekwhat syntax?
15:01:38Yardanicovar a: 0 .. 3 = 6
15:01:40Yardanicono "range" here
15:01:46disruptekit's sugar.
15:02:05FromDiscord<lqdev> lol it even works for types
15:02:09Yardanicoyes
15:02:12FromDiscord<lqdev> !eval type A = 0..3
15:02:14FromDiscord<impbox> never see that
15:02:17NimBot<no output>
15:02:17FromDiscord<impbox> (edit) 'see' => 'seen'
15:02:21Yardanicoit also works for type fields
15:02:25Yardanicolike "port: 1 .. 65535"
15:02:27disrupteklook at how i use it for gully.
15:02:30disruptek!repo gully
15:02:30disbothttps://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 1⭐ 0🍴
15:02:36Yardanicodisruptek: but it's not documented at all :P
15:02:42disrupteksure it is.
15:02:45disruptekyou think i invented it?
15:02:51Yardanicobut where
15:03:11Yardanicoin system .. is only for slices and iterators
15:03:30disruptekas i said, it's sugar.
15:03:32Yardanicoalso you can't go to definition of that .., so it's not a part of system but a part of the language
15:03:51disruptekit's not ..
15:03:56disruptekit's range.
15:04:10YardanicoI'm just saying I can't find documentation for it in the manual
15:04:48disruptekokay, well, submit a pr i guess. 😉
15:09:15*antranigv joined #nim
15:09:26ForumUpdaterBotNew thread by Jasonfi: Error when importing smtp (Nim 1.2.4), see https://forum.nim-lang.org/t/6598
15:11:06disruptekZevv: let's have the macro produce a trampoline if you pass it an instance.
15:13:31*krux02 joined #nim
15:15:06*nickster quit (Quit: The Lounge - https://thelounge.chat)
15:15:27ForumUpdaterBotNew thread by Jasonfi: Error when compiling with smtp import, see https://forum.nim-lang.org/t/6599
15:16:50FromDiscord<jasonfi> I deleting the original thread, I thought I might have fixed it
15:17:00FromDiscord<jasonfi> smtp just breaks when I import it
15:19:15FromDiscord<lqdev> don't delete threads when you fix something. share the solution so it anyone else runs into the problem, they'll be able to find out how to solve i
15:19:16FromDiscord<lqdev> (edit) 'i' => 'it'
15:19:27FromDiscord<lqdev> (edit) 'it' => 'if'
15:19:52*nickster joined #nim
15:19:52Yardanicoxd
15:19:58Yardanicohttps://i.imgur.com/EfuEFJK.png :P)
15:20:27FromDiscord<jasonfi> by fix I mean I made a mistake, commenting out code
15:27:59FromDiscord<lqdev> Yardanico: look dude, i'm focusing on two things at once. don't blame me for having a stroke while typing english. i'm in nim mode right now.
15:28:09Yardanicoi didn't blame you sir
15:28:36Yardanicoand added ":P" for a reason
15:30:56FromDiscord<dom96> I used to use ":P" a lot, I like to think I've grown out of it 😛
15:31:04Yardanico😛😛
15:31:13FromDiscord<lqdev> >proceeds to use `:P`
15:31:29FromDiscord<dom96> ThatsTheJoke.html
15:32:09FromDiscord<lqdev> i don't use `:P` because it looks weird in ascii form and i'm not gonna use the emoji form
15:32:19FromDiscord<lqdev> because i don't like emojis.
15:32:42Yardanicoyou don't like disruptek then I guess XD
15:32:46FromDiscord<lqdev> well, there are *some* custom emoticons i use on another private server.
15:32:54Yardanicobut
15:32:55Yardanicowhat about
15:33:03FromDiscord<Yardanico> :nimrawr:
15:33:38FromDiscord<Rika> :KannaKMS:
15:33:46FromDiscord<lqdev> it's an *emoticon* but discord calls them emojis anyways.
15:33:58FromDiscord<lqdev> this is my favorite one https://cdn.discordapp.com/emojis/449225292725092363.png?v=1
15:34:12FromDiscord<lqdev> *don't have discord nitro. modern problems require modern solutions
15:34:23FromDiscord<dom96> Gotta love how Discord charges for premium emojis
15:34:32FromDiscord<lqdev> ah yes
15:34:51FromDiscord<lqdev> it's like using a silly image is some prestigious feature for the chosen ones.
15:35:05FromDiscord<dom96> It's genius to be honest
15:35:28FromDiscord<dom96> There are far too many people out there with too much money on their hands
15:35:45Yardanicothey're not new for that though
15:35:48Yardanicotwitch did that for years
15:35:56Yardanicobefore discord even existed
15:35:56*outtabwz joined #nim
15:36:14FromDiscord<lqdev> paying $5 is too much for something that should come for free
15:36:41FromDiscord<lqdev> it practically doesn't cost them anything to allow for cross-server emoticons.
15:36:51FromDiscord<lqdev> it's as simple as flipping a flag.
15:37:09Yardanicobut MUH CDN!1111111
15:37:13FromDiscord<dom96> To be fair, while that's true they do offer a lot for free
15:37:49FromDiscord<lqdev> yeah. you're only paying with your data.
15:39:15FromDiscord<Rika> if they provided it for free, there would be a much more massive influx of "single person servers" and "dead for-emoji-only servers"
15:39:23Yardanicoso embrace it
15:39:26Yardanicolike telegram does for stickers
15:40:07outtabwzI nocice nim has a "--noMain" option. Is a procedure named "main" treated specially?
15:40:11Yardanicono
15:40:23Yardanicoit means that Nim won't generate a main function for the native backends
15:40:29Yardanicoso you'll have to provide your own main function
15:41:26outtabwzI usually write small command line programs. Should I be writing "proc main" for the entry point?
15:41:29YardanicoIt's also useful with --app:lib when you for example want to make a custom dll attach function
15:41:45Yardanicoouttabwz: well it doesn't really matter, you can have code at global scope level, but it's preferred to modularize stuff :0
15:41:47Yardanico:)
15:41:55Yardanicofor small "scripts" it's fine to use global scope
15:43:26outtabwzSo when I do write a program a native executable is generated. Should I depend on "proc main" to be called first at runtime?
15:43:41Yardanicono, sorry, maybe I phrased it wrong
15:43:53YardanicoNim itself doesn't have a special notion of a "main" procedure since it allows code at global level
15:44:04Yardanicobut when compiling to native backends like C nim automatically makes the "main" function C expects
15:44:17YardanicoSo you don't need to care about this really :)
15:44:35FromDiscord<Skaruts> is there any ECS written in Nim?
15:44:37Yardanicoin nim "proc main = stuff" is just a normal proc, you still need to call it
15:45:57outtabwzI see. In that case it seems like the most natural thing is to program top-down and let the compiler work it out.
15:46:06Yardanicoyes
15:46:20outtabwzThank you Yardanico
15:48:25FromDiscord<lqdev> @Skaruts https://github.com/rlipsc/polymorph
15:48:34FromDiscord<lqdev> https://github.com/b3liever/breakout-ecs/
15:48:42FromDiscord<lqdev> and I'm working on one for my engine
15:50:01FromDiscord<Skaruts> gonna take a look, thank you
15:50:12Zevvsooo, how's #nim todayA
15:50:14Zevv?
15:50:17Yardanico!
15:50:26Zevveverybody happy?
15:50:35YardanicoZevv: nimyaml works on devel with orc and passes all tests (with a smol patch)
15:50:43Yardanicoso yeah, everyone's happy
15:50:49Zevv\o/
15:50:53outtabwzI think I may learn to enjoy nim. The industry is currently obsessed with python though, and that's going to last for years to come.
15:51:08Zevvpick your own obsessions
15:51:15Yardanicobtw I created https://github.com/nim-lang/Nim/wiki/Nim-features-you-didn%27t-know-you-needed
15:51:21Yardanicoif you have something interesting, feel free to add
15:51:29FromDiscord<Anuke> related question to `--noMain`: if you use a main proc that a different library provides, when does top-level code get called: before the function, or after it?↵e.g. let's say I put my "main" code in a proc called `glfmMain` (which is called externally by C) - when does the top-level nim code after this proc run?
15:51:31Yardanicobasically less-known features
15:51:52FromDiscord<lqdev> Zevv: working on a data-oriented ECS macro, my day's going pretty good so far. *until i have to do type introspection, dear god please save me* but so far i don't so eh
15:52:12ZevvYardanico: looking good, I'll think of one or two!
15:52:24Zevvdata oriented ECS. I have no clue what you're saying
15:52:49FromDiscord<jasonfi> Python is 30 years old
15:52:58Zevvoh yeah baby, types and macros, you're in for some fun
15:53:01disruptekZevv: i think i know the bug in 16.
15:53:04*waleee-cl quit (Quit: Connection closed for inactivity)
15:53:04FromDiscord<jasonfi> a language takes time to reach popularity sometimes
15:53:08Yardanico@Anuke nim global code runs in NimMain
15:53:13Yardanicoi mean global nim code
15:53:18Zevvdisruptek: cool!
15:53:24YardanicoI don't really understand your question I think :P
15:53:25FromDiscord<lqdev> Zevv: data-oriented entity component system. it's a pattern in game dev which is far superior to more traditional object-oriented approaches
15:53:33FromDiscord<lqdev> and that's all you really need to know. :)
15:53:40Zevvdisruptek: I'm kind of blocked by #3 though, a lot of things I want to try out fail at this time
15:54:03Zevvlqdev: Aah right, I think you mentioned that a long time ago already, i looked it up then
15:54:06Yardanicoi don't understand people like this - https://forum.nim-lang.org/t/6593#40874
15:54:09Yardanico:c
15:54:20disruptekZevv: i think it's the same bug.
15:54:21Zevvbut kind of went out of the back of my brain straight away, as it is somehing I probably never hit in my career
15:54:25Zevvdisruptek: oh is it!
15:54:31outtabwzTrue jasonfi
15:54:38disruptekyeah, we .Cont when we need to cast[Cont]
15:55:18ZevvYardanico: yeah well, keep on trollin', right
15:55:39Zevvdisruptek: oh right, that makes sense
15:58:00ZevvI have not yet ran into to need for boxing
15:59:01Zevv"Say you're in the kitchen in front of the refrigerator, thinking about a sandwich. You take a continuation right there and stick it in your pocket. Then you get some turkey and bread out of the refrigerator and make yourself a sandwich, which is now sitting on the counter. You invoke the continuation in your pocket, and you find yourself standing in front of the refrigerator again, thinking about a sandwich.
15:59:07ZevvBut fortunately, there's a sandwich on the counter, and all the materials used to make it are gone. So you eat it"
15:59:47disruptekcool story, bro
16:00:35Zevvyeah I'd love to say I made it up or found some obscure source somewhere
16:00:44Zevvbut its's from the wikipedia page on continuations
16:02:44disruptekhow i did i never see this before?
16:04:03disruptekwe should have our result concept include support for errors.
16:06:42disruptekmaybe we use := like go.
16:06:51disruptekit's kinda what we want.
16:07:24disruptekwe can call them "noroutines".
16:07:58disrupteksince apparently, continuation is too long a word for you to type.
16:08:09FromDiscord<lqdev> yes
16:08:15FromDiscord<lqdev> and instead of the `go` keyword we use `no`
16:08:29FromDiscord<Rika> what about no
16:08:32disruptekno is an enum.
16:08:41disruptekno == off == false
16:08:59FromDiscord<lqdev> maybe `dont`?
16:09:12disruptekuhno
16:09:22disrupteknah
16:11:52disruptekwhat about just `goto`?
16:13:23FromDiscord<exelotl> bro-routines
16:14:00dulsiCan you get the string of an enum? I know you can echo the enum and see the string value but is there a way to put it in a variable.
16:14:13disruptek$e
16:14:33Yardanicodulsi: let mystringofenum = $myenumvalue
16:14:45Yardanicoyou can echo because enum has $ defined
16:14:52Yardanicoand echo automatically applies $ to all arguments it was given
16:16:13*nikita` joined #nim
16:16:41dulsiThanks. Probably should find a good intro to nim rather than just jumping in.
16:17:11Yardanicowell there's https://narimiran.github.io/nim-basics/
16:17:11Yardanicoit doesn't seem to cover enums though :P
16:17:27*tane joined #nim
16:20:35disruptekjump in, it's fine.
16:23:51Zevvwait what getImplTransformed
16:23:52Zevvwow
16:23:59Yardanicoit was here before
16:24:21Yardanicowait sorry phrased it wrong
16:25:02Yardanicoah nvm ignore me
16:25:06Zevvyes, sir!
16:25:10Yardanicobtw we also have --expandArc in devel
16:25:26Yardanicowhich also does what getImplTransformed does
16:25:35Yardanicobut also for destructors (it shows code with destructors injected)
16:26:22ZevvLaaaalalalalaaala 🙉
16:27:53Zevvdisruptek: what is the use of having a user provide his own continuation type, if there is no explict way to access the passed cont or returned cont from the .cps. procs?
16:28:43disrupteki don't follow.
16:28:57Zevvwe don't provide the Cont type, the user provides it, right
16:29:01disrupteksure.
16:29:06Zevvbut what can I do with that type?
16:29:15disruptekwhatever you do with other types.
16:29:30Zevvok, so assume I add a field "thing: string"
16:29:35Zevvhow would I access that from my cps procs
16:29:53Zevvand why would I do that
16:29:54disruptekmake a cps primitive?
16:30:11disruptekbecause you can trade state with the dispatcher.
16:30:17ZevvAh - right
16:30:25Zevvso it's not there for the cps procs, it's for the dispatcher
16:30:28Zevvfair enough
16:30:30disruptekright.
16:30:37disruptekwell, for anything that isn't cps.
16:31:00Zevvright. But it's good. I was afraid you were putting in infrastructure to pass state to and from the cps procs themselves
16:31:12Zevvbut for the primitives it makes perfect sense
16:31:42ZevvI'm still not at the point where I can think of this stuff and oversee all consequences
16:31:58Zevvand two times a day I'm trying to follow the code flow of some construct and go "what the hell"
16:32:12Zevvdo you still have that?
16:32:28disrupteki have this:
16:32:31disruptekreturn sleep(cast[Cont](env_16821235(fn: Cont, ms: ms)), ms)
16:32:47disruptekyeah, it makes no sense to me, either.
16:32:49Zevvcheck that shit in
16:32:56disruptekit breaks your stuff.
16:33:25ZevvIt's like some forms of recursion. You write the code, it makes perfect sense. You run it on your amazingly complex data structure and it works
16:33:34Zevvand you have no longer a clue how the hell that was able to do the right thing
16:33:43*altarrel joined #nim
16:33:54Yardanicooh yeah
16:34:06Yardanicoit's when you get it right :)
16:34:18Zevvyeah but this CPS stuff, it keeps itching my skull
16:34:49ZevvI've chewed the papers, got some basic implementation running, but I don't feel like i've seen the light
16:35:51disruptekwhen you change the stash i cannot fast-forward, chuckles.
16:36:22Zevvwut
16:36:30Zevvpullrebase?
16:36:36ZevvI didn't force any push?
16:36:44disrupteki think it's the stash.
16:37:01Zevvit's just a dir
16:37:03Zevvit's not magic?
16:37:26Zevvwell, you can't ff if you don't rebase first
16:37:30Zevvthat's git for you
16:37:38Zevvyou and I share a branch, that's the price you pay
16:37:46ZevvMy default is `git pull --rebase`
16:38:06disruptekhmm, we'll see next time.
16:38:22disruptekanyway, there's a new bug to fix.
16:38:23Zevvyou broke my tests
16:39:17*leorize quit (Remote host closed the connection)
16:39:46*leorize joined #nim
16:46:15disrupteki found it.
16:46:52ZevvI didn't
16:47:13disruptekpull --rebase 😉
16:47:26Zevvyay
16:48:03Zevvso, waht did these last 2 commits fix now?
16:48:19disruptekprobably nothing.
16:48:28Zevvhaha
16:52:28disrupteki need to look at the c i guess.
16:52:38disruptekfirst, i have to do some gardening.
16:52:46Zevvyeah doing that. I just switch to a release build, it's easier to read
16:53:14disruptekyou should use the mangling branch.
16:53:22disruptekit's pretty damned sexy.
16:53:27ZevvI love that so much
16:53:48Zevvlike I remarked the other day: I can now read C code without the red haze of the blood running out of my eyes
16:53:51outtabwzAnyone else uses Emacs? I recommend to disable nimsuggest and install flycheck-nim instead. Nimsuggest was hopelessly broken for me.
16:54:07disruptekkrux02 uses it.
16:54:37outtabwzI read krux02 bug reports for nim-mode on github.
16:54:54disruptekyeah?
16:55:42outtabwzyes well, i was just very frustrated until i disabled nimsuggest and installed flycheck-nim instead.
16:56:48FromDiscord<lqdev> what's flycheck-nim?
16:56:49disruptekZevv: we should put a traceback stack in our testing Cont.
16:57:51outtabwzflycheck-nim is an Emacs package which enables the flycheck package to interactively check nim code without relying on nimsuggest.
16:57:59disruptekcpsDebug can just pass the lineinfo during type constr.
16:58:10disruptekokay, i really have to go plant some crops. bbiab
16:58:21outtabwzhttps://github.com/ALSchwalm/flycheck-nim/
16:58:25*superbia quit (Ping timeout: 264 seconds)
16:58:28*superbia1 joined #nim
17:00:06*couven92 quit (Read error: Connection reset by peer)
17:00:30*couven92 joined #nim
17:00:45*xet7 joined #nim
17:01:38outtabwzbrb
17:01:43*outtabwz left #nim (#nim)
17:01:47Oddmongerif i understand well, foo.bar() can be:
17:01:59Oddmonger1) bar() called from module foo.nim
17:02:08Oddmonger2) bar(foo)
17:02:36Oddmongeris this right ?
17:03:15FromDiscord<lqdev> yes
17:03:23ZevvI'm thinking hard for 3)
17:03:26FromDiscord<lqdev> but option 2) takes priorite
17:03:42FromDiscord<lqdev> Zevv: it can also be a call to a proc stored in a field of `foo`
17:03:45Oddmongeri've been puzzled by 2)
17:03:56FromDiscord<lqdev> (edit) 'priorite' => 'priority'
17:04:09Oddmongercan i block 2) at compilation ?
17:04:56Oddmongerin Lua there is similar thing, but at least, it's bar:foo() for 2)
17:06:30FromDiscord<lqdev> you can rename the module while importing: `import foo as qux`
17:06:48FromDiscord<lqdev> and then call `qux.bar(foo)`
17:08:28Zevvdisruptek: why the cast then, conversion should do?
17:09:17Yardanicowhy casts at all?
17:09:19Zevvright
17:09:19*leorize quit (Remote host closed the connection)
17:09:21Yardanicoshouldn't cps work without them just fine?
17:09:23Zevvit feels wrong
17:09:30Yardanico(otoh, even nim's async does casts)
17:09:35Yardanicoalthough just for stripping some info
17:09:45Zevvhe just added a cast for a derived type to the base type
17:09:46Yardanicoto trick compiler into thinking that some proc is gcsafe :P
17:09:47Zevvwhich seems silly
17:09:54Yardanicoyeah in that case you don't need a cast
17:10:02*leorize joined #nim
17:10:02Zevvit was an expression before
17:10:16Zevvbut now he's planting his weed
17:10:30Oddmongerah yes, renaming as mod_foo
17:12:47*outtabwz joined #nim
17:13:07*outtabwz left #nim (#nim)
17:14:36*outtabwz joined #nim
17:15:20icyphoxi did it boys (and girls, etc.) -- i wrote my websocket proxy in Nim
17:15:26icyphoxwith support for multiple clients
17:15:30icyphoxand fully async
17:15:32icyphoxlove it
17:15:53outtabwzyou win icyphox
17:16:07Yardanicoicyphox: used treeform's ws?
17:16:12icyphoxyes!
17:16:25icyphoxYardanico: yes :)
17:16:28Yardaniconice
17:16:40icyphoxi think i must've really annoyed treeform
17:16:44icyphoxwith all my questions
17:17:09icyphoxi wonder if i can open source it
17:17:13icyphoxi will ask my boss
17:17:16icyphoxheh
17:18:43*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:22:06*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
17:22:32outtabwzIs there reason to use c-like function prototypes for nim procs?
17:22:59FromDiscord<lqdev> wdym?
17:23:06FromDiscord<lqdev> forward declarations?
17:23:11*vicfred quit (Quit: Leaving)
17:23:33FromDiscord<lqdev> it's sometimes useful when you have two procs that depend on each other (recursion and all that good stuff)
17:23:35*vicfred joined #nim
17:24:07disruptekit has nothing to do with gcsafe.
17:25:07disruptekgcsafe isn't a thing in cps. 😁
17:26:12outtabwzyes i saw an example in the 'official' tutorial of mutually dependent procs, but i may not understand
17:31:18disruptekit will become clear when you develop the compilation error.
17:31:26Zevvdisruptek: tell my why it is a thing in async then
17:31:34Zevvafter 2.5 years I still have no answer to that question
17:31:54disrupteksomething something closure iterators.
17:32:21Zevvutter bull
17:32:23Zevvanyway
17:32:29disruptekwell, you can't make this shit up.
17:32:30Zevvthe codegen error has to do with history
17:33:01Zevvbut not sure yet how. I triggered it with a simple test, and it goes away if I remove all preceeding tests
17:33:10Zevvso something is not unique
17:33:19disruptekugh, that's bad.
17:33:44FromGitter<kdheepak> @sheerluck can you open an issue on the github repository? The binary builder developers are very responsive.
17:34:51FromDiscord<dom96> Zevv: why is what a thing in async? gcsafe?
17:35:10disruptekZevv: can you ix me your c?
17:35:31Zevvdom96: https://github.com/dom96/nim-in-action-code/issues/6
17:35:32disbotnot GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK
17:35:47Zevvdisruptek: isolating
17:35:58disruptekwell, you don't have to sit on my lap.
17:36:04disruptekjust stay where you are and send the source.
17:36:33disruptekif we're going to be married, we'll have to learn how to give each other space.
17:36:34*Ven`` joined #nim
17:36:54outtabwzis there a repl included?
17:37:18disrupteknot officially.
17:37:21disruptek!repo inim
17:37:21disbothttps://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 320⭐ 19🍴
17:37:34FromDiscord<dom96> Zevv: good question.
17:37:47Oddmongerand nim --secret
17:38:00Zevvhaha
17:38:08Zevvand you should also say "arak, please advise"
17:38:10Zevvdisruptek: http://ix.io/2smN
17:38:13Zevvit's the nim
17:38:24FromDiscord<dom96> I always hated the gcsafe crap
17:38:29Zevvboth blocks 'when true' is broken
17:38:39*jjido joined #nim
17:38:48FromDiscord<dom96> and then we started getting PRs that marked various callbacks with gcsafe
17:38:49Zevvdom96: I started hacking out .gcsafe. things top down and then it all just worked
17:38:52FromDiscord<dom96> and now we are where we are
17:38:54Oddmongersorry, it is « nim secret »
17:39:02Zevvand the gcsafes I hacked out came in with commits with messaages like "make tests green again"
17:39:23bungdoes `case of` can fallthrough?
17:39:29FromDiscord<dom96> Have you had a chance to look into the commits that introduced these annotations?
17:39:31Zevvso it feels as if ther was once some kind of restriction in the lowest layers. That was later fixed, but the layers above that weer also .gcsafe. annotated and never cleared out
17:39:41Zevvdom96: ^^
17:39:41FromDiscord<dom96> That may give some answers
17:40:04Zevvsee https://github.com/dom96/nim-in-action-code/issues/6#issuecomment-446956468
17:40:05disbotnot GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK
17:40:35Zevvdisruptek: you can enable just one "when true" block. Enable both and it goes boom
17:40:42disruptekokie.
17:41:19Zevvdom96: so in the end I was told the gcsafe was put in there for the case if async was ever to be made thread based in the future, some time
17:41:46Zevvand like I said in https://github.com/dom96/nim-in-action-code/issues/6#issuecomment-448362331: you can just roll your own async without any gcsafe restrictions, like we're doing now
17:41:47disbotnot GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK
17:41:48FromDiscord<dom96> Zevv: yeah, I think the gcsafe becomes important if you are running an event loop per thread.
17:41:56Zevvbut I don't
17:42:00ZevvSo I don't want that restriction
17:42:38FromDiscord<dom96> You'd get crashes AFAIK
17:43:06FromDiscord<dom96> If an HTTP server callback is run on thread #1 and accesses data allocated in thread #0 you'll have crashes
17:43:16FromDiscord<dom96> this is why the callback was marked with {.gcsafe.}
17:43:23Zevvsure. But I'm talking asyncHttpServer
17:43:25Zevvthat's *not* threaded
17:43:44FromDiscord<dom96> yeah
17:44:05Zevvanyway, I can only hope one day that we get erlang like isolation
17:44:08FromDiscord<dom96> We should probably remove these annotations 🙂
17:44:18Zevvthat was my point in 2018 :)
17:48:48*superbia1 is now known as superbia
17:49:35disruptekZevv: the cast code is clearly more correct.
17:49:41Zevvhow so
17:49:59disruptekwell, it doesn't throw away the vars.
17:50:04disruptekoh, i'm dumb.
17:50:17Zevvwhy the heck would you ever need a cast to convert a derived type to its base type?
17:50:18disruptekwe also need to cast it back when we receive it. 🤦
17:50:22Zevvyeaaah right
17:50:28Zevvbut don't cast, *convert*
17:50:36Zevvcasting is baaad mkaay
17:50:45disruptekno, because i don't want the extra var.
17:51:18ZevvHm i dunno man, I don't know this code well enough, so I trust you on this one
17:51:24Zevvbut if you start casting, you lose stuff
17:51:31disruptekno, it's the opposite.
17:52:11disruptekhere, i will give you two files to diff.
17:52:27disruptekhttp://ix.io/2smQ/c
17:52:38disruptekhttp://ix.io/2smR/c
17:53:14Zevvok I have them diffed
17:53:15Zevvnow what
17:53:25disruptekwhich do you prefer?
17:54:14Zevvbad reason
17:54:33Zevvyou want me to say the second one
17:54:37Zevvright
17:54:47FromDiscord<dom96> If you can convert you should
17:54:53disrupteki cannot.
17:55:25Zevvbut these types are close cousins, right?
17:56:57disruptekonly in alabama.
17:57:04disruptekthey are parent and child to the rest of the world.
17:58:17Zevvbut are they not convertable?
17:58:46disrupteknot if the destination is a type that doesn't include the data in the source.
17:58:59*jeko joined #nim
18:00:43Zevvlet me play with that a bit
18:00:52Zevvbut wait
18:01:02Zevvyou're casting a parent type to a derived type
18:01:07Zevvthat's utter bull
18:01:27Zevvthe object is too short, so the tail will be limbo data
18:01:44disrupteka cast doesn't change the source. only the conversion does.
18:01:47disruptekthat's the problem.
18:02:44ZevvI don't get any of this, sorry
18:03:06disruptekyou have an object. it's actually a ref to an object.
18:03:10disruptekthat means it's a pointer.
18:03:11Zevvit must be
18:03:13Zevvright
18:03:15disrupteknim knows all about it.
18:03:18Zevvsure
18:03:24Zevvlet's call it object of type T1
18:03:36disruptekwe want nim to accept it for some limited use appropriate for its parent type.
18:03:45disruptekie. a shorter, smaller version of itself.
18:03:45Zevvright
18:03:47Zevvsure
18:03:59Zevvbut Nim remembers
18:04:04disruptekwe cast it, which means we say "we know what we're doing and we promise... we promise..."
18:04:14disruptekthe pointer passes through cps.
18:04:24disruptekit comes back to us. now we unwrap it with another cast.
18:04:35disruptekaha, there is the same memory, right where we left it.
18:04:54Zevvbut why cast?
18:05:00Zevvyou can just pass it as the base type
18:05:07Zevvwhen you cast, you lose the original type it once had
18:05:14Zevvconversion will save that
18:05:22disruptekbecause conversion instantiates a new object and copies the value. but only the shorter portion of the type.
18:05:32disrupteklook at the c.
18:05:36Zevvno, it does not copy because it is a ref
18:05:41disrupteklook at the c.
18:06:06Zevvthen something is wrong
18:07:30disruptekT2 = &T1->Sup
18:08:25disruptekCont = &env_2312312->Cont
18:08:47FromDiscord<dom96> If copies happen for conversions then that sounds like a bug
18:08:54*D_ quit (Ping timeout: 244 seconds)
18:09:02disruptekit's copying the address, not the actual memory.
18:09:21disruptekbut it doesn't matter; it's still not passing the same address. but we can prove this with a test.
18:09:45ZevvI don't get it. It must be wrong.
18:10:12Zevvcrayons and patience required to get me to understand this I guess
18:10:53disrupteki hate to say it, but we may have to abandon inheritance.
18:10:55ZevvI see the C, but I don't understand what Nim thinks its doing here
18:11:04FromDiscord<dom96> https://github.com/nim-lang/Nim/issues/15079#issuecomment-664013738
18:11:06disbotgetAppFilename returns (deleted) in the path ; snippet at 12https://play.nim-lang.org/#ix=2siC
18:11:17FromDiscord<dom96> le sigh
18:11:37disruptekis that french?
18:11:45disrupteknim thinks it's doing us a favor.
18:11:57YardanicoAraq: did you see the thing I sent about strictFuncs + refc? In short - should strictFuncs work with refc?
18:12:04*D_ joined #nim
18:13:11Zevvdisruptek: but Sub being the first member, it's the same address, right
18:13:14ZevvSup
18:14:25Yardanicowas sup?
18:16:27FromDiscord<dom96> Cool. 5 instances of Stardust's server using only 20% CPU of a $5/mo DO droplet
18:16:44Yardanicoimagine nodejs
18:16:47YardanicoOOM
18:17:41FromDiscord<Yardanico> oh nice dom you have a new avatar in discord
18:17:49FromDiscord<dom96> Yeah, it was time
18:18:00FromDiscord<Yardanico> some voxel thing
18:18:04FromDiscord<dom96> picked some random abstract thing lol
18:18:39Yardanicoi guess i should change too
18:19:05FromDiscord<dom96> Actually I wonder how nodejs would compare. Been pretty impressed with V8, so nodejs might actually be pretty impressive
18:19:14Yardanicoi mean perf-wise, maybe
18:19:17Yardaniconot sure about memory-wise :)
18:19:40disruptekthey are essentially the same metric.
18:19:42YardanicoV8 is really -really optimized, that's true
18:19:45FromDiscord<dom96> hmmm, I actually could probably make a test fairly easily
18:19:49*couven92 is now known as fredrikhr
18:19:50Yardanicodisruptek: you're contradicting yourself :D
18:19:53FromDiscord<dom96> since I can compile this code to JS anyway 😮
18:20:06Yardanicoremember when the base64 bench showed 3.5x less RAM usage for arc, but slower
18:20:09FromDiscord<dom96> maybe next weekend 😄
18:20:17Yardanicoand you said something like "we don't care about ram"
18:20:36*fredrikhr quit (Read error: Connection reset by peer)
18:20:40disruptekit's memory in node that's expensive.
18:21:01*fredrikhr joined #nim
18:21:09FromDiscord<dom96> My servers have been running for 2 weeks non-stop. Memory usage: 32MB
18:21:18disrupteki don't care about memory usage in arc because it's easy to optimize.
18:21:28FromDiscord<dom96> We'll see how they fare once they get more requests though
18:21:52disruptekZevv: do we have a debug eventqueue yet?
18:21:56FromDiscord<dom96> But it appears that async memory leaks may be behind us
18:22:16FromDiscord<Yardanico> ok changed my avatar as well
18:23:38jjidowhat is cps? Do you mean CSP?
18:23:56Zevvdisruptek: no, what should it do? I think for 99% of the testing we only need a trampoline
18:24:24jjidocontinuation passing style
18:24:37disrupteki'm going to add a stack trace to the q you hate.
18:24:42jjidoit was me who mixed up the letters haha
18:24:45disruptek!repo cps
18:24:46disbothttps://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 15⭐ 0🍴 7& 1 more...
18:24:58disruptekno cutlery here?!
18:25:01Zevvdisruptek: feel free to do whatever you like there. It's *your* queue
18:25:06disruptekpffbt
18:25:11Zevvmaybe the time has come to go our separate ways
18:25:16disrupteklol
18:25:30ZevvWe can still share the kids
18:25:33Zevvbut move to our own houses
18:25:38disrupteki don't want your kids.
18:25:45Zevvtoo late
18:25:57Zevvyou adopted a very special kid
18:26:15disruptekdom96 is yours, remember?
18:26:21disruptekyou said you'd take him.
18:26:32Zevvyeah aaaand I've lost you again
18:26:48Yardanico!seen disbot
18:26:49disbotdisbot joined 12#nim-test 102 minutes ago and last spoke 719 weeks ago
18:27:04FromDiscord<dom96> yay, I've always wanted a daddy ( ͡° ͜ʖ ͡°)
18:27:13Yardanicouh-oh
18:28:18Zevvdisruptek: back to the cast vs convert
18:28:24Zevvit takes the address of Sup
18:28:28Zevvwhich is the first element of the struct
18:28:31Zevvso it's at the same address
18:28:38FromDiscord<dom96> hahah
18:28:39Zevvso it's just the same address
18:28:44Zevvso how is that wrong?
18:29:32ZevvI'd really like to prevent casting - we are doing 100% valid things and no magic at all, and when we start casting we basically lose the contracts with the compiler and we're on our own
18:30:02Zevvimagine DrNim being able to prove this shit for us one day. But when we get there with our casts DrNim will just give us up and say it's letal
18:30:16disruptekyou're wrong if you think passing something around and calling it Cont when it's actually a larger object... is a validation of any contract.
18:30:21*waleee-cl joined #nim
18:31:25Zevvnooooo
18:31:33Zevvthat's how this stuff works
18:31:37Zevvyou are soo wrong
18:31:57ZevvNim remembers for you
18:32:00Zevvthat's the whole point
18:32:03disruptekin fact, it doesn't work. 😜
18:32:39Zevvthen something else is wrong
18:32:39Zevvhttp://ix.io/2snc
18:32:44ZevvHow is this wrong
18:33:42Zevvwow wait
18:33:52ZevvNim does not protect against converting to the wrong derived type
18:34:09disruptekthank you.
18:34:17Zevvoh it does
18:34:18Zevvit does
18:34:21Zevvit's a runtime check
18:34:24ZevvI was running -d:Danger
18:34:27Zevvbut it throws on my
18:34:37Zevvsee http://ix.io/2sng
18:34:42Zevvso conversion is all valid
18:35:24Zevvso tell me what does not work
18:35:34Zevvbecause my tests show no difference between your convert and your cast version
18:36:04disrupteklemme drain this abscess and then i'll look at it closer.
18:36:27ZevvI hope that's a metahpor for something
18:36:33Yardanicotape worms?
18:48:42*Senketsu joined #nim
18:53:27disruptekbah.
18:53:35Zevvbah what
18:53:41Zevvbah zevv you're right?
18:53:46Zevvor bah now my mirror is covered in pus
18:54:05disruptekcan i pick 2 out of three?
18:54:25Zevvsure you can
18:54:32disruptekthe claim that the compiler is smarter than me is clearly wrong.
18:54:47disruptekelse it would know statically that .color is bogus.
18:55:10Zevvsure
18:55:14disruptekbah: mangling doesn't handle duplicate returns because i need to rebase. 😭
18:55:14Zevvbut ther's RTTI there somewhere
18:55:26disruptekfat lot of good it's doing us.
18:55:29disruptekwe're just getting lucky.
18:56:09ZevvNo, the compiler can't know it's bogus
18:56:11disruptekone thing you learn when you get old is to remove mirrors from your home.
18:56:13Zevvmaybe for this case
18:56:20disruptekno mirrors in the shower.
18:56:25disruptekno mirrors on the ceiling.
18:56:32ZevvBut the thing is that you can store all your derived types in a bin of T1's
18:56:38ZevvBoth T2 and T2 fit in seq[T1]
18:56:46Zevvyou take one T1 one, and you can then check with `is` what it was
18:56:48Zevvand handle it
18:56:51disruptekblah blah blah ref blah blah
18:57:04Zevvso, that's a "bah zevv your right"
18:57:05disruptekshow me `is` working?
18:57:11Zevvone sec
18:57:28disruptekno, it's "bah this has nothing to do with anything" 😁
18:58:44Zevvhttp://ix.io/2snp
18:58:49Zevvthere is your working is
18:58:51ZevvNim remember
18:58:51Zevvs
18:59:02Yardanico?
18:59:09Yardanicoworking is nim remeber s?
18:59:13Yardanicoremembmebmer?
18:59:51ZevvThere is your working "is"
18:59:54ZevvNim remebers
19:00:41Zevvso if you want you can sprinkle your code with `assert t is environ_such_and_such`
19:05:05*krux02 quit (Remote host closed the connection)
19:05:12disrupteksomething is very fux0red.
19:05:29Zevvgiven the nature of the problem you are solving, I am not surprised
19:05:43Zevvbut when was the last time a cast made something actually *better* when something is fux0red
19:05:59Zevvlet ans = 2+2; if ans != 4: ans = 4
19:06:02disruptekdon't be rude.
19:06:05disruptekcasts are fine.
19:06:21Zevvnot for what you're doing here. and you know it.
19:06:25Zevvyou're just frustrated
19:06:45disruptekwhat's frustrating is that this code works, as you found, when run in isolation.
19:06:59Zevvfun, right
19:07:13Zevvok, I read the kids and then dive into it
19:08:54disrupteki am convinced that the cast is no worse and it may be a tiny bit better whatfer memory reasons.
19:09:09disruptekbut yeah, it seems to be a nim bug in any event.
19:10:08Zevvok, i am convinced that a cast does not solve anything here and makes it harder for nim to properly reason about your code.
19:10:16Zevvbut then again, it's your code, so you have the last word on this of course :)
19:10:32disruptekyou might be right.
19:10:53disruptekwe can leave the option off by default, but i wanna keep the option.
19:11:05Zevvsure, be my guest
19:11:22Zevvok, I've minimized the example. Here comes the kid with the book so a little break first
19:11:53*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
19:32:19*Senketsu quit (Read error: Connection reset by peer)
19:32:20Zevvfirst time I look at C code of an object hierarchy. First time I understand what RootObj does
19:32:23Zevvit's the thing holding the RTTI
19:39:04*Senketsu joined #nim
19:43:10*lritter joined #nim
20:04:04Zevvdisruptek
20:04:17disruptekwut
20:08:09Zevvyour AST must be broken
20:08:20Zevvif I replace the original by the transformed code as printed by cpsDebug
20:08:22Zevvit's ok
20:08:56disruptekneat, so what's the fix?
20:08:59Zevvno clue yet
20:09:08ZevvI was just wondering if there are rules about that
20:09:23disruptekyeah, there are.
20:09:24Zevvnim normally parses nim, makes ast and compiles that. If you make the AST yourself, are there any guarentees??
20:09:27disruptekyou found it, you fix it.
20:09:46ZevvI've seen the occasional "ill formed AST"
20:09:59disrupteknot me, no sir.
20:10:00disrupteknot ever.
20:10:01Zevvbut I bet there's tons of things the compiler will happily chew through, generating utter nonsense
20:13:53PrestigeI'm translating some C code to nim, not sure how I'd do the following: https://github.com/avahe-kellenberger/dwm/blob/master/src/dwm.c#L962 atm I have the type Client as a ref object of RootObj, I think this C code is reassigning the reference
20:14:50Yardanicoyes it does
20:16:11Zevvdisruptek: the genSym in makeType*() is not unique
20:16:27PrestigeI don't believe this would have the same effect: https://0x0.st/iw5i.txt
20:16:54disruptekno?
20:16:59disruptekwhat does this mean to me?
20:17:14FromDiscord<Clyybber> disruptek, Zevv: what bug are you fighting?
20:17:23disruptekall of them.
20:17:45FromDiscord<Clyybber> nice
20:17:50disrupteki think 3 and 16
20:17:54FromDiscord<Clyybber> I'm on 3
20:18:01Zevvme as well
20:18:02FromDiscord<Clyybber> but not the invalid C part
20:18:08FromDiscord<Clyybber> Zevv: Which part?
20:18:28Zevvhttp://ix.io/2snM
20:18:30Zevvthis fails
20:18:34Zevvbut if you disable on of the blocks it's fine
20:18:47Zevvthere's only one env_ generated, the other one gets lost
20:18:57ZevvI just figured out that if I make my own gensym for the env name it's good
20:19:11FromDiscord<Clyybber> ah ok, but its not forward decls?
20:19:23Zevvnop
20:19:26FromDiscord<Clyybber> because thats what I'm fixing rn
20:19:30Zevvok.
20:19:38disruptekthat's a separate problem.
20:19:43disruptekbut no less fun!
20:19:49FromDiscord<Clyybber> :D
20:20:02Zevvluckily we have clyybber to solve all that sh*t for us
20:20:07disrupteki am writing the stack trace for cps.
20:20:15Zevvno
20:20:25Zevvyou're writing a stack trace for your particular eventqueue implementation
20:20:30disruptekpffbt
20:20:37Zevvand I wonder how you will make a stack trace
20:20:38Zevvbecause
20:20:44*tane quit (Quit: Leaving)
20:20:45Zevvbecause
20:20:48ZevvTHERE IS NO STACK
20:20:52disrupteksshhh what did i tell you about being rude?
20:20:54FromDiscord<Clyybber> wheeze
20:21:09Zevvfirst you work hard to eliminate the stack, and then you go trace it
20:21:11Zevvutter bonkers
20:21:22disruptekyep. but useful for debuggers.
20:21:37Zevvyou want bugs to debug?
20:21:52FromDiscord<Clyybber> lets make a bug factory
20:23:20Zevvlets write some java then
20:23:56Zevvpublic class BugFactoryGeneratorManager {
20:26:06Zevvthis is weird
20:26:11*Vladar quit (Remote host closed the connection)
20:27:18Zevvhow does that work. You do a gensym "env", which in Nim-land gives you "env_somenumber"
20:27:38FromDiscord<Clyybber> yeah
20:27:46ZevvBut in C-land it's envcolonObjectType___manglemangle
20:27:51Zevvso the somenumber part is gone
20:28:12Zevvwhat is put in the mangling there?
20:28:14disruptekit's mangled to the hash, so that's a problem.
20:28:17FromDiscord<Clyybber> maybe it skips it if its not needed
20:28:26disruptekadd a field with a rando name to fix the mangle.
20:28:31FromDiscord<Clyybber> but the gensym part isn't actually in the ident
20:28:37FromDiscord<Clyybber> its just the renderer being nice
20:28:40ZevvI did. I just ad a global inclreasing sequence number and its ok
20:28:50Zevv"nice"
20:28:51disruptekyeah, nim is trying to be clever.
20:29:06Zevvif you want to be nice, just start from one and increase. Or give them animal names or colors
20:29:16Zevvenv_dog, env_green, env_apple
20:29:38Zevvso is this an actual Nim bug, or could this be triggered by questionable AST
20:30:04disruptekit's a nim bug.
20:32:23*krux02 joined #nim
20:32:45*maier joined #nim
20:33:01bungnim now has bug with implicitly retunning
20:33:10FromDiscord<Clyybber> nice
20:33:33*jjido joined #nim
20:34:44bungI fixed partial of jsgen , cgen not look deep into, due to code base larger than it.
20:39:13bunghttps://github.com/nim-lang/Nim/pull/15070 I think this one can be simplely merged
20:39:14disbotavoid #8231, bitwise move to mul,div
20:41:49Zevvso how does one typically benchmark a http server
20:41:53Yardanicowrk
20:43:07Zevvand what should the server serve
20:43:46Zevvhm wrk or ab is about the same
20:43:47Yardanicohello world
20:44:01Zevvthere's not something that makes nice graphs of concurrent sessions for example
20:44:16disruptekno one cares about graphs.
20:44:34FromDiscord<Clyybber> graphs are for humans
20:44:36FromDiscord<Clyybber> fuck graphs
20:45:35Zevvok, lighttpd 30K/sec, first CPS hack 40K/sec
20:46:12Zevvoh wait, I took out the echo, now its 85k/sec
20:46:50FromDiscord<Clyybber> damn boi
20:47:04Zevv100k sec
20:47:22Yardaniconow add threads :P
20:47:36Zevvnaah that's for sissies
20:47:40*pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.)
20:47:41Zevvand this version is still very stupid with its epoll fds
20:49:00*NimBot joined #nim
20:49:06*pbb joined #nim
20:49:42disruptekwell, until yourang is finished, this is what we have.
20:50:19disruptekthere's a rust server using liburing iirc.
20:50:46ZevvI really don't need to squeeze every last bit
20:50:52FromDiscord<dom96> How does httpbeast compare?
20:51:01Zevvno idea. What is the simplest way to setup?
20:51:07Zevvand not fair because of threads of course, this is one thread
20:51:15FromDiscord<dom96> just compile without --threads:on
20:51:37Zevvcan you whip me up a tiny program serving "hello, there!" on an url
20:51:38disrupteki already tol' you.
20:51:44disruptekit's not a fair comparison.
20:51:52FromDiscord<dom96> https://github.com/dom96/httpbeast/blob/master/tests/benchmark.nim
20:51:56Zevvfcourse not
20:52:35FromDiscord<dom96> That's what the techempower benchmarks use
20:52:40disruptekthis dog is such an idiot.
20:52:47Zevvhow do I set the port to be not 8
20:52:48Zevv80
20:53:11Zevvdom96: ^
20:53:19disruptekhe's got acres and acres of wilderness to sniff around in and he wants to sit on my feet under the desk.
20:53:19FromDiscord<dom96> run(onRequest, Settings(port: ...)) IIRC
20:53:41FromDiscord<dom96> disruptek: he luvs you
20:54:00FromDiscord<exelotl> would it be possible (and/or sensible) to add the dynlib pragma to nimscript?
20:54:00disruptekif i stick him out there and close the door he just barks.
20:55:14FromDiscord<exelotl> I have a library that does low-level image processing, but is intended to be used for one-off scripts. So I was thinking to turn it into a DLL and write a python wrapper for it or something
20:55:26FromDiscord<Danny Fritz> sent a code paste, see https://play.nim-lang.org/#ix=2snR
20:56:21Zevvhttpbeast 108k vs stupid cps 93k
20:56:51Zevv20 concurrent connections
20:56:56*maier quit (Ping timeout: 265 seconds)
20:57:02disruptekthe techempower list is nuts.
20:57:15disrupteksurely we can move up this list.
20:57:33FromDiscord<dom96> sure we can.
20:58:13Zevvdisruptek: I can push a stupid workaround for the codegen bug, but then it will never get fixed I guess
20:58:20Zevvor is clyybber reliable?
20:58:32disruptekhe makes a lot of noise but not too many patches.
20:58:45disruptekbetter to just work around it.
20:58:53YardanicoD:
20:58:53*Senketsu quit (Read error: Connection reset by peer)
20:58:53Zevvand if you stick him out there and close the door, he just barks
20:59:08disruptekwell, can you blame him?
20:59:17disruptekhe's not really designed for the wilderness.
20:59:24Yardanicodisruptek: https://cdn.betterttv.net/emote/55028cd2135896936880fdd7/3x
20:59:57disruptekcps is losing to httpbeast?
21:00:02disrupteki don't believe it.
21:00:08disruptekyou better get on that shit.
21:00:35*FromDiscord quit (Remote host closed the connection)
21:00:51*FromDiscord joined #nim
21:03:10*nikita` quit (Quit: leaving)
21:06:58ZevvI have 0.91% time spent in nim
21:07:01Zevvthe rest is in the linux kernel
21:09:43FromDiscord<dom96> Interesting. I didn't think you were expecting it to be faster.
21:10:10Zevvno that would be kind of rediculous
21:10:38disrupteksure, sure.
21:10:40ZevvI expected to be in the same ballpark
21:11:03disruptekwhere is your demo?
21:11:08Zevvthe code?
21:11:10Zevvor the server?
21:11:17disruptekyeah?
21:11:27Zevvhttps://github.com/disruptek/cps/blob/master/stash/standalone_tcp_server.nim
21:11:30FromDiscord<Clyybber> hey hey
21:11:31Zevvbut it's too stupid to look at
21:11:34FromDiscord<dom96> I mean, it is a simplified server implementation, right?
21:11:43FromDiscord<dom96> Like you're probably not reading all the headers etc.
21:11:47FromDiscord<Clyybber> I don't want to push stuff I don't understand yet :p
21:11:47Zevvsure not
21:11:57ZevvI don't read anything. I just send out data after reading a blob
21:12:01Zevvand hoping it was htp
21:12:17FromDiscord<dom96> ahh, even more simplified.
21:12:19Zevvclybber: that's what we do, works fine for me!
21:12:26Zevvdom96: sure
21:12:32FromDiscord<dom96> From my testing you can actually cheat wrk
21:12:43FromDiscord<dom96> by just sending it more data than it asks for
21:12:47Zevvhehe
21:12:52FromDiscord<dom96> it'll think you're responding to requests really quickly lol
21:12:58FromDiscord<Clyybber> counterbenchmark wrk
21:13:12FromDiscord<dom96> I was really tempted to do that but alas
21:13:37Zevvdom96: but really, it was just to see if it kind of makes sense to do it like this
21:13:49Zevvis httpbeast using nim async?
21:14:01Zevvi believe it is, right
21:15:20*krux02 quit (Remote host closed the connection)
21:16:19disruptekcompare cpu and memory.
21:17:01Zevvcpu is 100%
21:17:16Zevvmemory is not fair at all, I do no htp processing wahtsoever
21:17:22Zevvbut c'mon
21:18:02disrupteksurely there's a difference for equal amounts of traffic.
21:18:17Zevvapples and oranges
21:18:21disruptekyard did a test and there was no contest.
21:18:26Zevv?
21:18:28Yardanicothat's just async overhead
21:18:33YardanicoZevv: did you compile them both with refc?>
21:18:35Yardanicotry cps with arc
21:18:36disruptekexactly.
21:18:40Zevvboth arc
21:18:42Yardanicouh
21:18:46Yardanicothen it's not fair for httpbeast :D
21:19:05FromDiscord<dom96> httpbeast works with arc? lol
21:19:11Yardanicowell it will probably work
21:19:31Zevvok retrying without arc, just -d:danger
21:19:52Zevvyay we're twice as fast as httpbeast now
21:19:59Yardanicobut async leaks with arc afaik - https://github.com/nim-lang/Nim/issues/15076
21:20:01disbotMemory leaks with async (closure iterators?) under ORC ; snippet at 12https://play.nim-lang.org/#ix=2snX
21:20:10Zevvorc then
21:20:13Yardaniconos
21:20:13disruptekafaik cps doesn't leak in arc.
21:20:15Yardanicosame with orc
21:20:17FromDiscord<Clyybber> Araq: Is it intended that this line https://github.com/nim-lang/Nim/blob/devel/compiler/semstmts.nim#L1908 makes gensymmed symbols not get added to the scope?
21:20:17Yardanicoand it's not due to async
21:20:25Yardanicoseems like closure iterators leak even with orc
21:20:33YardanicoI have a standalone repro in that issue
21:20:36Zevvthen orc is baaaaad
21:20:57FromDiscord<Clyybber> don't insult an orc
21:21:04disruptekthe first rule of fight club.
21:21:04ZevvI killed one this afternoon
21:21:16Zevvthe things I do for love
21:21:28Zevvtwo were-rats, also
21:21:34Zevvbut one was the blacksmiths son
21:23:10FromDiscord<Clyybber> what gaem
21:23:32FromGitter<ynfle> Is there an easy way to inject an space every *x* characters in a string?
21:24:47FromDiscord<Clyybber> sure, make a for loop
21:25:21FromGitter<ynfle> I meant like a strutils proc
21:25:38Yardanicowell it's not hard to do manually :P and strutils covers common operations
21:25:40Yardaniconot rare ones
21:26:11Yardanicoif you create a proc like that, you might want to add it to https://nim-lang.org/docs/strmisc.html
21:26:12FromDiscord<Clyybber> there might be a proc in strutils thats generic enough to accomplish that, maybe some split join thing
21:26:19FromDiscord<Clyybber> but I don't know :p
21:26:48Zevvso, is there or is there no expanded-template-thingin macros?
21:27:08YardanicogetImplTransformed? :P
21:27:08FromDiscord<Clyybber> what
21:27:14Yardanicoor getAst to just expand a template
21:27:22Yardanicoif you "call" it
21:27:44FromDiscord<Clyybber> I think cps should be typed
21:27:57FromDiscord<Clyybber> or at least parts of it
21:28:15Zevvyeah, that was exactly what caused my earlier attempts to crash
21:28:23ZevvI needed two passes, one typed, one untyped
21:28:27Zevvand couldn't do it
21:28:55Zevvbut disruptek was smarter then me
21:28:56Zevvand cheated
21:29:14FromDiscord<dom96> > yay we're twice as fast as httpbeast now↵@Zevv[IRC]#0000 of course, if reading a big blob and not doing any processing that is expected.
21:29:23Zevv:)
21:29:34Zevvdom96: pulling your leg dude
21:29:55ZevvI also said "apples and oranges"
21:30:08Zevvbut then again: you might want to redo your testing with arc to see if you can move up the charts a bit!
21:30:25Yardanicowell, first of all - proper arc optimizations are not in stable releases
21:31:13disruptekit doesn't matter.
21:31:21Yardanicoit does
21:31:23FromDiscord<Clyybber> depend on devel
21:31:25disruptekno one can use software that leaks as badly as async.
21:31:27FromDiscord<Clyybber> live with devel
21:31:30FromDiscord<Clyybber> die with devel
21:31:33Yardanicodisruptek: it's not async' fault
21:31:38Yardanicoas I already found out in the issue
21:31:39disrupteki don't care.
21:31:40Yardanicoit's closure iterators
21:32:04Yardanicoyou really seem too negative to stuff which took a long time to implement and works fine for a lot of people :) i know nim async is perfect, but it's not bad
21:32:17disruptekeven if the memory consumption were stable, it's not the future.
21:32:26FromDiscord<dom96> In what way does async leak?
21:32:32FromDiscord<dom96> Do you mean with arc/orc?
21:32:40FromDiscord<Clyybber> I know I'm perfect, but I'm not bad
21:32:47Yardaniconot async
21:32:48FromDiscord<slymilano> newish to nim.... is async/asyncdispatch not production ready on Nim? @disruptek
21:32:51Yardanicoit's closure iteratos which leak
21:32:53Yardanico@slymilano it is
21:32:58Yardanicoit's fully production ready
21:33:41FromDiscord<Clyybber> Yardanico: Will you make merch? I want "i know X is perfect, but it's not bad" on a tshirt
21:33:44YardanicoXD
21:34:23FromDiscord<exelotl> production ready except with arc/orc right (i.e. the problem is that arc/orc aren't production ready)
21:34:25FromDiscord<dom96> @slymilano async in Nim is quite likely one of the most tested aspects of Nim
21:34:57disruptekyeah, that's why cps had to be developed.
21:35:17Zevvnope, that was because iterators don't allow for making coroutines
21:35:17Yardanicodisruptek cmon man
21:35:36Zevvand i want my corotines
21:35:55disruptekthat's a good reason, too, but it's not the main reason.
21:36:00Zevvfor me it is :)
21:36:01FromDiscord<exelotl> I'm excited for cps for zevv's reason :D
21:36:13FromDiscord<slymilano> for retardio's like me: async is prod, but don't compile your apps with arc if you're using async, yes?
21:36:20Yardanicoyes, not yet
21:36:25FromDiscord<slymilano> aight thank you
21:36:27FromDiscord<exelotl> exactamundo
21:36:38FromDiscord<dom96> Zevv: https://nim-lang.org/docs/coro.html 👀
21:36:45Yardanicothat's kinda meh :P
21:36:56Zevvyeah, I know, but these have wrong semantics and lie on top of slow primitives
21:36:57disruptekfor me, i've drunk the arc kool-aid. i've also written plenty of async. i want a better concurrency story. cps promises that.
21:37:10Zevvalso there's https://github.com/zevv/nimcoro/
21:37:12Zevvwhich have Lua semantics
21:37:18Zevvbut are also built on slow primitives :)
21:37:25FromDiscord<dom96> heh sure
21:37:47FromDiscord<dom96> disruptek: sure, let's let all the newcomers to Nim know that they should wait for arc/orc to stabilise, together with cps
21:37:53ZevvI think one important promise for CPS would be that it allows for a good marriage between async and threading
21:38:16Zevvno, we just told the newcomers async is good to go, didn't we :)
21:38:22YardanicoI did, not disruptek :P
21:38:27FromDiscord<dom96> indeed
21:38:31disruptekobviously, cps is not ready.
21:38:41disrupteki would say arc is beta quality, at best.
21:38:53disruptekbut it's not because the science is unsound.
21:39:00Yardanicodisruptek: would cps (when mostly done) require a major rewrite to libs/programs using current nim async?
21:39:05*Ven`` quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
21:39:11Yardanicobecause right now every proc seems to need a while loop or something
21:39:12disruptekjust like nim; it's a great idea, but the implementation leaves something to be desired.
21:39:17disruptekbut that doesn't mean we abandon it.
21:39:32Yardanicoand so we can adapt current nim async libs to cps
21:39:33ZevvYardanico: Hmm good question
21:39:35Yardanicowithout rewriting everything
21:39:38Yardanicolike httpclient
21:39:40oddpSorry to interrupt, but how do I go from string to var string? Is there a clone/dup func that gives me a mutable copy?
21:39:47Yardanicooddp: var mynewstr = str
21:39:49Zevvvar s = s
21:39:53Yardanicoor that
21:39:58Zevvit's less typing :)
21:40:00Yardanicoit'll shadow the original variable though :)
21:40:01FromDiscord<Clyybber> Yardanico: Should be possible to make a translation macro or even make it compatible
21:40:13oddpAlright, thanks!
21:40:21Yardanicooddp: strings in nim are value types
21:40:22disruptekhonestly, i think the idioms will be different enough that cps begets new libs.
21:40:31ZevvYardanico: my hunch is that it would be possible to build the async api on top of cps
21:40:45Zevvbut you can lose the Future
21:40:58disruptekpretty much true.
21:40:58Yardanicoi don't want to lose my future
21:41:07Zevvwait until you're my age
21:41:09disruptekdude, your future is already toast.
21:42:40FromDiscord<Clyybber> toasts and parties
21:48:34Zevvdisruptek: are you still working on anything now?
21:48:49dulsiI've push my smalltrek changes to github. It implements trophies/achievements using my gamerzilla project.
21:49:03dulsiHere are the achievements in GameHub.
21:49:06dulsihttps://social.freegamedev.net/photo/c6e64ade-c0c9-4f00-aca5-c5b4cc46775f-2.png
21:49:37dulsiHere are the achievements displayed from web.
21:49:39dulsihttps://social.freegamedev.net/photo/673a38a8-f29b-42c8-9eef-969e19e9a903-2.png
21:49:53FromDiscord<Clyybber> nice!
21:50:00FromDiscord<Clyybber> is smalltrek made using nico?
21:50:11disrupteki'm working on miso.
21:50:13disruptekwhat's up?
21:52:51dulsiYes it uses nico.
21:53:13FromDiscord<Clyybber> cool
21:53:28dulsiSmalltrek is impbox's creation. I'm just modifying it.
21:53:43Zevvdisruptek: not much up, I'm signing off. nice progress dudes
21:54:03FromDiscord<Clyybber> bb
22:00:01disruptekpeace
22:00:13*solitudesf quit (Ping timeout: 264 seconds)
22:01:00disruptekrebuilding async atop cps might be the best way forward, actually.
22:04:57*apahl quit (Ping timeout: 260 seconds)
22:05:54*apahl joined #nim
22:09:13*cyraxjoe quit (Quit: I'm out!)
22:11:48*cyraxjoe joined #nim
22:13:02*jjido quit (Quit: My MacBook has gone to sleep. ZZZzzz…)
22:34:09*krux02 joined #nim
23:08:11*krux02_ joined #nim
23:10:38*krux02 quit (Ping timeout: 244 seconds)
23:15:46FromGitter<gogolxdong> what is cps, and what's the difference between cps and csp?
23:17:38FromDiscord<Clyybber> the difference is a typo :p
23:18:57disrupteki'm confused on how dynamic bindsym is supposed to work.
23:19:20disruptekseems that it doesn't really matter if i'm in the vm because i'm not in the right scope...
23:35:47*krux02_ quit (Remote host closed the connection)