00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:00:45 | * | junland joined #nim |
00:01:00 | FromDiscord | <tomck> sent a long message, see http://ix.io/2slX |
00:01:08 | FromDiscord | <tomck> (edit) 'http://ix.io/2slX' => 'http://ix.io/2slY' |
00:02:29 | FromDiscord | <Clyybber> you can define custom nimble tasks |
00:03:30 | FromDiscord | <tomck> how would `nimble test` be defined? |
00:04:12 | FromDiscord | <Clyybber> I think its a builtin task or something, I'm not sure |
00:04:26 | FromDiscord | <Clyybber> but you should be able to make a new task "testMinimal" or something like that |
00:04:38 | FromDiscord | <Clyybber> which only runs your dependencyfree tests |
00:04:40 | disruptek | `nimble test` builds and runs any .nim file in tests that starts with a t. |
00:04:47 | FromDiscord | <Clyybber> ah |
00:04:51 | disruptek | you can redefine it, though. |
00:05:42 | FromDiscord | <tomck> how would I define that though? |
00:05:59 | disruptek | task test, "run some tests": ... |
00:06:00 | FromDiscord | <tomck> Is there some special flags for 'run all files in X directory that start with Y'? |
00:06:03 | disruptek | in your .nimble file |
00:08:03 | FromDiscord | <tomck> brill, got it, ta |
00:23:21 | dulsi | I 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:08 | bung | ptr int32 |
00:34:46 | dulsi | Sorry 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:31 | FromDiscord | <tomck> you can do .addr to get the address of something |
00:35:37 | FromDiscord | <tomck> `foobar(a.addr)` |
00:40:36 | * | krux02_ quit (Remote host closed the connection) |
00:47:33 | FromDiscord | <Clyybber> hah! tracked it down finally |
00:47:41 | disruptek | really? |
00:47:51 | FromDiscord | <Clyybber> yeah, its because proc params get gensymmed |
00:48:03 | FromDiscord | <Clyybber> not sure if that should be changed, or the find proc method |
00:48:14 | FromDiscord | <Clyybber> but I feel like its a bit unneccessary to gensym proc params |
00:48:25 | FromDiscord | <Clyybber> but the tests should tell me |
00:48:31 | disruptek | neat. |
00:48:42 | FromDiscord | <Clyybber> but I need some sleep :D |
00:48:43 | skrylar[m] | gensymmed proc params are derp yes |
00:48:55 | skrylar[m] | i love seeing the autocompleter tell me about parameters like "self88" |
00:49:00 | FromDiscord | <Clyybber> lol |
00:49:01 | disruptek | gn clyybber |
00:49:07 | FromDiscord | <Clyybber> gn8 |
00:49:32 | skrylar[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:37 | silvernode | Good evening from AZ, (20:29) |
03:30:37 | silvernode | Had 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:49 | silvernode | now* |
03:33:42 | silvernode | About 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:23 | FromDiscord | <Rika> sure |
03:38:05 | silvernode | Working on a post now |
03:41:03 | dulsi | Does 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:14 | FromDiscord | <impbox> dulsi: oh? |
03:43:32 | silvernode | dulsi: 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:04 | FromDiscord | <Elegant Beef> Oh i didnt realize you OSS your games impbox 😄 |
03:44:41 | FromDiscord | <impbox> it's a requirement to release source for LD compo |
03:44:47 | FromDiscord | <Elegant Beef> ah |
03:45:11 | FromDiscord | <Rika> ludum dare? |
03:45:15 | FromDiscord | <impbox> yep |
03:45:25 | dulsi | impbox: Sorry for the surprise. I planned on notifying you when I got further along. |
03:45:49 | FromDiscord | <impbox> no problem, sounds cool =) |
03:45:56 | dulsi | I do have some fixes to smalltrek. https://github.com/dulsi/ld38-smalltrek |
03:46:11 | FromDiscord | <impbox> i have plans to rework smalltrek at some point |
03:46:24 | dulsi | Hope to check in some gamerzilla support before Monday. |
03:47:19 | silvernode | Space 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:30 | FromDiscord | <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:49 | FromDiscord | <impbox> but it works quite nice on mobile |
03:48:03 | FromDiscord | <impbox> and i want to make an expanded set of levels with new races |
03:48:24 | FromDiscord | <impbox> too many projects =) |
03:48:55 | silvernode | I have posted this here before, but the game repository is https://github.com/silvernode/space-nim |
03:49:55 | silvernode | dulsi: I doubt your gamerzilla is meant to function with text based games. |
03:50:46 | FromDiscord | <Elegant Beef> I assume it's just event based so it'd be trivial to ujse there |
03:50:49 | FromDiscord | <Elegant Beef> I could be wrong |
03:51:17 | FromDiscord | <Elegant Beef> (edit) 'ujse' => 'use' |
03:51:24 | dulsi | Right 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:05 | dulsi | I have modifications to add support for gamerzilla to GameHub as a game launcher. |
03:55:09 | FromGitter | <gogolxdong> Anyone knows how to set the default nimble path on WSL, to use the same with what's on Windows. |
03:57:57 | FromGitter | <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:57 | FromGitter | <gogolxdong> Is that NIMBLE_DIR ? |
04:09:06 | * | arecacea1 quit (Remote host closed the connection) |
04:09:29 | * | arecacea1 joined #nim |
04:18:03 | shashlick | yep |
04:23:33 | * | aurelius quit () |
04:42:28 | silvernode | Still working on my forum post, I have been meaning to do this for months now. |
05:06:20 | FromDiscord | <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:36 | Zevv[m] | any news disruptek? |
05:40:20 | Zevv[m] | oh I got a ton of mails, right, thats the news |
05:42:14 | Zevv[m] | dude how the hell can for loops work?! |
05:45:13 | FromDiscord | <Avatarfighter> you just gotta believe |
06:04:08 | Zevv[m] | you can't just make that work, where does the state of the iterator go? |
06:05:07 | FromDiscord | <Avatarfighter> it goes to the same place that you cry |
06:05:53 | Zevv[m] | you're not helping man, not helping |
06:06:02 | Zevv[m] | can't you see I'm in distress!! |
06:06:13 | Zevv[m] | my world view is tumbling over |
06:07:18 | * | solitudesf joined #nim |
06:10:35 | * | 07EAAFM9Q quit (Ping timeout: 240 seconds) |
06:11:54 | bung | oh 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:43 | silvernode | Well I have been editing my forum post for like 3 hours now, and I made a quick logo for the game. |
06:40:45 | silvernode | https://raw.githubusercontent.com/silvernode/space-nim/master/src/img/space-nim-logo.png |
06:41:07 | FromDiscord | <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:07 | silvernode | ElegantBeef , 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:12 | silvernode[m] | test from the official matrix client. |
07:08:31 | silvernode | works like a charm |
07:08:46 | FromDiscord | <Elegant Beef> "offical"? |
07:09:51 | silvernode | yeah 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:15 | silvernode | At least according to a podcast which had the co-founder of matrix |
07:10:43 | FromDiscord | <Elegant Beef> Ah, i've been testing element as of late, and it's voip is the only issue i have |
07:10:58 | FromDiscord | <Elegant Beef> If they were to replace jitsi with a p2p voip i'd be happy |
07:11:16 | silvernode | wow really? the voice chat was great in riot so I figured it would be even better now. |
07:11:28 | FromDiscord | <Elegant Beef> They use jitsi for anything aside from 1:1 |
07:11:31 | FromDiscord | <Elegant Beef> and it was terrible imo |
07:11:37 | silvernode | Element uses Jitsi for the voip? |
07:11:44 | FromDiscord | <Elegant Beef> riot did too afaik |
07:12:03 | silvernode | I assumed matrix could just do voice |
07:12:08 | silvernode | hmm |
07:12:08 | FromDiscord | <Elegant Beef> It can |
07:12:11 | FromDiscord | <Elegant Beef> It's in the protocol |
07:12:33 | FromDiscord | <Elegant Beef> maybe it's just free servers that have jitsi, and you can change it |
07:12:47 | FromDiscord | <Elegant Beef> Cause on my freely hosted server it was using jitsi, which was terrible |
07:12:56 | FromDiscord | <Elegant Beef> I like a lot of what it has though |
07:13:10 | silvernode | Ah 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:44 | silvernode | Are you hosting it through them or on your own VPS? |
07:16:00 | FromDiscord | <Elegant Beef> I mean i hosted a community on their free setup |
07:17:10 | FromDiscord | <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:59 | dzamo[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:03 | silvernode | dzamo[m]: synapse is python? |
08:25:51 | ForumUpdaterBot | New 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:23 | FromDiscord | <impbox> @silvernode there's a nim-gamedev channel (or gamedev channel on discord) |
08:30:27 | FromDiscord | <Rika> there it is |
08:31:02 | silvernode | I 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:16 | silvernode | Ah, I didn't know about the gamedev channel. thanks |
08:31:42 | FromDiscord | <impbox> text/curses based game sounds cool |
08:32:26 | silvernode | If 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:52 | FromDiscord | <Elegant Beef> Silvernode checkout projects on github, they'll let you organize your ideas in a way attached to the repo |
08:38:20 | FromDiscord | <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:28 | silvernode | I 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:03 | FromDiscord | <Elegant Beef> Yea silvernode it's more like a trello board than a mindmap |
08:41:03 | FromDiscord | <impbox> if nothing else you can screenshot the mindmap and include that |
08:41:21 | FromDiscord | <impbox> draw.io is pretty nice |
08:41:24 | FromDiscord | <impbox> and web based |
08:44:38 | silvernode | I find mind maps to be great for ideas. It's my first step of learning how to plan out my projects. |
08:44:58 | FromDiscord | <impbox> aye, they're pretty handy |
08:45:05 | FromDiscord | <impbox> i like the visual connected nature of them |
08:45:31 | FromDiscord | <impbox> but surprisingly the tooling still sucks for online collaborative ones |
08:45:35 | FromDiscord | <impbox> from what i've seen |
08:46:05 | FromDiscord | <Rika> i just draw my ideas |
08:46:41 | FromDiscord | <impbox> mmm i do visual mockups and write big text tiles full of ideas |
08:48:02 | FromDiscord | <Varriount> I tend to just write bits of dialogue and ideas (for stories) |
08:49:03 | silvernode | I 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:40 | silvernode | Linking categories to sub trees of ideas is important I think. |
08:49:44 | FromDiscord | <impbox> for sure |
08:50:55 | silvernode | The biggest feature of Vym that I like is the workflow. You can focus on the ideas instead of fightng with the workflow. |
08:51:10 | FromDiscord | <Rika> maybe i should install an infinite-zoom drawing app since i tend to put tiny notes inside my drawings |
08:51:14 | FromDiscord | <impbox> i'll check it out |
08:51:39 | silvernode | you 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:42 | silvernode | As 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:10 | FromDiscord | <impbox> i've been thinking of making my own tool for a long time, maybe i'll eventually get around to it |
08:53:43 | silvernode | Don't get me wrong, there are really nice mind mapping programs around the net but they always fall short on the workflow. |
08:54:03 | FromDiscord | <impbox> i guess i want a cross between mind mapping + task management |
08:54:30 | silvernode | I was reading some people talking about how incredibly difficult it is to make mind map software. |
08:57:14 | FromDiscord | <impbox> seems like vym is a pure tree system |
08:57:21 | FromDiscord | <impbox> can you make links between branches? |
09:00:20 | silvernode | Links between branches? |
09:00:36 | FromDiscord | <impbox> sorry, links between items on different branches |
09:03:00 | silvernode | I do not think so. Once you have a branch, you can only add or link to that branch. |
09:03:08 | silvernode | at 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:17 | FromDiscord | <😬🤣> TIL `let resp = try: readFile(f) except OSError: break` is valid code |
09:28:22 | FromDiscord | <lqdev> yeah most things can be used like that |
09:28:32 | FromDiscord | <lqdev> eg. if and case |
09:28:44 | FromDiscord | <lqdev> also, block |
09:29:52 | FromDiscord | <😬🤣> what got me is the `break` |
09:46:45 | FromDiscord | <Varriount> What does "break" do in that context? |
09:52:12 | FromDiscord | <😬🤣> well, it just breaks you from the loop or the block you're in |
09:56:25 | FromDiscord | <Rika> thats totally valid code even if indented though? |
09:56:52 | FromDiscord | <Rika> break is ok to use in this case because how are you gonna use the variable after anyway? |
10:00:11 | FromDiscord | <Varriount> But what is resp set to? |
10:00:39 | FromDiscord | <Varriount> I thought all execution paths of a statement list had to return the same result |
10:00:52 | FromDiscord | <Rika> its not going to be set |
10:00:55 | FromDiscord | <Rika> it doesnt have to be set |
10:01:00 | solitudesf | if he breaks out of block there is not resp in scope |
10:01:10 | FromDiscord | <Rika> yeah |
10:06:27 | FromDiscord | <Varriount> Poor little variable. All it wants is to have a value |
10:06:56 | FromDiscord | <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:34 | Zevv[m] | I'd love that |
10:25:47 | FromDiscord | <Rika> a programming book without a hint of a letter or a number, only symbols? :thonk: |
10:33:52 | FromGitter | <kdheepak> The Julia BinaryBuilder developers have expressed that they are open to adding Nim as a compiler shard in their BinaryBuilder workflow. |
10:34:09 | FromGitter | <kdheepak> I've opened as issue to track the progress of this here: https://github.com/JuliaPackaging/Yggdrasil/issues/1341 |
10:34:11 | disbot | ➥ Nim compiler shard ; snippet at 12https://play.nim-lang.org/#ix=27eP |
10:36:28 | FromGitter | <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:21 | FromDiscord | <Clyybber> Zevv: I'm sure he's answering you in his sleep |
10:58:27 | * | Vladar joined #nim |
11:20:09 | FromGitter | <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:51 | Zevv[m] | Clybber: sure, sure |
11:20:55 | Zevv[m] | :) |
11:21:11 | FromDiscord | <Clyybber> I'm getting close to the forward decl bug btw :D |
11:21:22 | Zevv[m] | \o/ |
11:21:27 | Zevv[m] | Is there a nim bug open for that as well? |
11:21:32 | FromDiscord | <Clyybber> yeah |
11:21:46 | Zevv[m] | ah found it |
11:22:25 | Zevv[m] | Hm but wait, now I'm confused, that's not related the other crash we see |
11:22:26 | Zevv[m] | ah right |
11:22:33 | FromDiscord | <Clyybber> it is |
11:22:37 | FromDiscord | <Clyybber> the ICE |
11:22:44 | Zevv[m] | yeah, but not the codegen error |
11:22:53 | Zevv[m] | with the missing members |
11:23:01 | FromDiscord | <Clyybber> yeah, thats a different one probably |
11:23:01 | Zevv[m] | or is it |
11:23:09 | Zevv[m] | right |
11:23:30 | Zevv[m] | I just ended up doing auxilary services, making stupid tests etc |
11:23:42 | Zevv[m] | works for me :) |
11:23:48 | FromDiscord | <Clyybber> its good stuff |
11:23:52 | * | krux02 quit (Remote host closed the connection) |
11:23:54 | Zevv[m] | low mental effort, low expectations, no responsibilites |
11:23:59 | FromDiscord | <Clyybber> :D |
11:23:59 | Zevv[m] | the way I love to go through life |
11:28:48 | FromDiscord | <Clyybber> diff3 is a livesaver |
11:35:18 | Zevv[m] | know meld? |
11:35:26 | Zevv[m] | its one of the very few non-terminal apps I use |
11:35:52 | FromDiscord | <Clyybber> oh I think I've seen that once |
11:36:06 | FromDiscord | <Clyybber> never used it tho |
11:38:16 | leorize[m] | why use meld when fugitive 3way vimdiff can do the job better :p |
11:38:34 | Zevv[m] | vimdiff never worked for me, don't know why |
11:38:41 | FromDiscord | <Clyybber> because I don't use vim :p |
11:38:45 | * | Zevv[m] is now known as Zevv |
11:39:15 | FromDiscord | <impbox> vimdiff is awesome, but i can't get it to work as a mergetool on windows =( |
11:39:18 | FromDiscord | <impbox> temp directory issues |
11:40:29 | Zevv | I so hate this telegram thing. Why couldn't that just be an irc thing |
11:40:40 | FromDiscord | <Clyybber> wtf github: https://github.com/ftsf/nico/blob/master/examples/vertex.nim#L73 |
11:40:43 | Zevv | I can't search, Its so inefficient |
11:40:54 | Zevv | so low-density |
11:41:09 | FromDiscord | <Clyybber> use a different telegram client :p |
11:41:17 | FromDiscord | <lqdev> @Clyybber ask @Varriount to fix his sublime text plugin |
11:41:19 | Zevv | They all suck |
11:41:25 | FromDiscord | <lqdev> that's what github uses for syntax highlighting |
11:41:28 | FromDiscord | <impbox> I've created an issue for it |
11:41:55 | FromDiscord | <impbox> https://github.com/Varriount/NimLime/issues/147 |
11:41:56 | disbot | ➥ syntax highlighting incorrect for `1.0'f` literals |
11:43:41 | FromDiscord | <lqdev> @impbox i don't really get why you're using 'f here anyways |
11:43:45 | FromDiscord | <lqdev> 1.0 implies a `float` |
11:44:01 | FromDiscord | <Rika> maybe what's intended is 1.0f32 |
11:44:13 | FromDiscord | <lqdev> 1.0'f32 works fine with syntax highlighting tho |
11:44:43 | FromDiscord | <impbox> because 'f is a float32 literal |
11:44:49 | FromDiscord | <lqdev> is it? |
11:44:52 | FromDiscord | <Clyybber> yeah |
11:45:06 | FromDiscord | <Clyybber> and 'd is float64 |
11:45:06 | FromDiscord | <impbox> FLOAT32_SUFFIX = ('f' | 'F') ['32'] |
11:45:11 | FromDiscord | <lqdev> oh i see |
11:45:16 | FromDiscord | <lqdev> just checked in the manual |
11:45:34 | FromDiscord | <lqdev> i almost never use those because they look bad :P |
11:46:05 | FromDiscord | <impbox> I've been using `'f` instead of just `f` because the vim syntax highlighting doesn't handle `f` =p |
11:47:01 | FromDiscord | <lqdev> !eval echo 1.0f |
11:47:04 | NimBot | 1.0 |
11:47:06 | FromDiscord | <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:14 | FromDiscord | <lqdev> oh cool |
11:47:20 | FromDiscord | <lqdev> didn't know you can omit the apostrophe |
11:47:50 | FromDiscord | <Clyybber> to not burn C/C++ ppl |
11:56:53 | FromDiscord | <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:01 | bung | https://github.com/nim-lang/Nim/issues/8821 |
12:34:03 | disbot | ➥ JS codegen can produce extreme switch statements ; snippet at 12https://play.nim-lang.org/#ix=2pKT |
12:34:15 | bung | how the c codegen solve this ? |
12:45:58 | FromDiscord | <Clyybber> Zevv: Ha! Got it! |
12:46:15 | FromDiscord | <Clyybber> Doesn't fix the ICE though :p |
12:46:28 | FromDiscord | <Clyybber> but at least the reported error |
12:46:55 | FromDiscord | <Clyybber> the ICE is a bit different since because disruptek uses the same sym for the forward decl and the actual definition |
12:47:07 | FromDiscord | <Clyybber> which I need to patch it to deal with |
12:47:58 | * | Ven`` joined #nim |
12:53:51 | FromDiscord | <lqdev> where should I put an nnkCommentStmt if I want to attach it to a const? |
12:59:47 | FromDiscord | <lqdev> damn |
12:59:55 | FromDiscord | <lqdev> is it really only possible to do for procs? |
13:00:10 | FromDiscord | <lqdev> how does `nim doc` detect `const` doc comments then? |
13:00:59 | FromDiscord | <Clyybber> by looking at the comment field probably |
13:01:06 | FromDiscord | <Clyybber> its not accessible by macros tho afaik |
13:01:17 | FromDiscord | <lqdev> i don't want to read it, i want to generate it |
13:01:24 | FromDiscord | <lqdev> is it still not possible? |
13:02:31 | FromDiscord | <Clyybber> no |
13:03:28 | FromDiscord | <Clyybber> I don't think so |
13:04:27 | FromDiscord | <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:30 | bung | Clyybber could you tell me more? not as I imaged pre defined const 1..n right? |
13:27:07 | ForumUpdaterBot | New 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:39 | FromDiscord | <Clyybber> bung: WDYM? Its similar to 1..n in a way yeah |
13:28:55 | FromDiscord | <Clyybber> But really more similar to {1..n} |
13:32:10 | Yardanico | ok time to test those arc fixes from yesterday by 4raq :P |
13:35:36 | * | couven92 quit (Read error: Connection reset by peer) |
13:36:02 | FromGitter | <bung87> hmm maybe just use if i>= int.min <=int.max |
13:36:02 | * | couven92 joined #nim |
13:37:17 | FromDiscord | <dom96> This is a fun bug, getAppFilename will return `/path/to/your/exe (deleted)` if you replace the executable |
13:37:35 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/blob/version-1-2/lib/pure/os.nim#L2956 |
13:39:01 | FromDiscord | <Clyybber> wouldn't call it a bug :p |
13:39:14 | Yardanico | we just need to handle it somehow I guess |
13:39:18 | FromDiscord | <Clyybber> yeah |
13:39:20 | Yardanico | but yeah, I don't think it's neccessarily a bug :P |
13:39:32 | Yardanico | because there's no filename if the binary was deleted |
13:39:34 | Yardanico | or replcaed |
13:39:35 | Yardanico | replaced* |
13:41:27 | FromDiscord | <dom96> Come on, it's definitely a bug |
13:41:39 | FromDiscord | <Clyybber> what do you expect it to return? |
13:41:44 | FromDiscord | <Clyybber> /dev/null ? |
13:41:47 | * | adokitkat quit (Remote host closed the connection) |
13:41:54 | FromDiscord | <dom96> I would expect it to throw an exception |
13:42:08 | FromDiscord | <dom96> anything really than appending `(deleted)` to the file path... |
13:42:33 | FromDiscord | <lqdev> meh https://media.discordapp.net/attachments/371759389889003532/736941526378086420/unknown.png |
13:42:47 | FromDiscord | <Clyybber> stropped? |
13:42:49 | FromDiscord | <lqdev> i'd much rather put it in the consts section, because it doesn't hint at calling it… |
13:42:52 | FromDiscord | <Clyybber> but not stropped. |
13:42:52 | FromDiscord | <lqdev> not stropped |
13:42:53 | FromDiscord | <Clyybber> weird |
13:42:58 | FromDiscord | <lqdev> created with `ident` |
13:43:06 | Yardanico | magic :P |
13:43:13 | FromDiscord | <lqdev> Macro Magic™ |
13:43:20 | Yardanico | @dom96 well, yeah, but for backwards compat it should only do that on nim >=1.3.5 |
13:43:27 | Yardanico | I mean NimVersion and stuff |
13:43:36 | FromDiscord | <Clyybber> @lqdev you want the proc to be in the const section? |
13:43:50 | FromDiscord | <lqdev> no, I want any sort of docs in the const section :P |
13:44:03 | FromDiscord | <Clyybber> haha |
13:44:04 | FromDiscord | <lqdev> just any docs anywhere, ok? |
13:44:09 | Yardanico | ah wait |
13:44:14 | Yardanico | getAppFilename returns "" on error I think |
13:44:15 | FromDiscord | <lqdev> too bad you can't add your own doc sections. that would be so cool |
13:44:17 | Yardanico | just need to document that |
13:44:23 | Yardanico | for windows it seems to return "" on error |
13:44:29 | Yardanico | and handle it for posix |
13:44:32 | FromDiscord | <dom96> Yardanico: lol thanks for conceding that it is a bug. |
13:45:30 | Yardanico | it also returns "" on macos on error |
13:45:39 | FromDiscord | <dom96> Sometimes it feels like no matter what I say here people want to argue over it. 🙂 |
13:46:21 | FromDiscord | <Clyybber> I didn't want to argue against fixing it |
13:46:28 | FromDiscord | <dom96> Anyway, I reported it here #15079 |
13:46:30 | disbot | https://github.com/nim-lang/Nim/issues/15079 -- 3getAppFilename returns (deleted) in the path ; snippet at 12https://play.nim-lang.org/#ix=2siC |
13:46:45 | FromDiscord | <impbox> @dom96 no they don't! |
13:48:03 | FromDiscord | <Clyybber> lol |
13:48:10 | Yardanico | wonder if it's the posix call itself which appends "(deleted)" |
13:48:14 | Yardanico | or some code in stdlib? |
13:48:32 | FromDiscord | <Rika> probably the posix call |
13:48:57 | Yardanico | ah it's linux-specific |
13:49:03 | FromDiscord | <Clyybber> yeah, which is why I argued that it could be considered to not be a bug |
13:49:04 | Yardanico | posix standard doesn't specify this it seems |
13:49:26 | Yardanico | not sure how it behaves when file is deleted on other *nix'es |
13:50:09 | FromDiscord | <Clyybber> I guess we could just error out if its not a valid path |
13:50:18 | FromDiscord | <dom96> What would you consider it then if not a bug? |
13:50:29 | FromDiscord | <Clyybber> an abstraction leak |
13:50:59 | Yardanico | @Clyybber maybe instead return an empty string? which getAppFilename already does for macos/windows in case of an error |
13:51:11 | FromDiscord | <Clyybber> call it a bug if you want; my remark was tongue in cheek :) |
13:51:23 | FromDiscord | <Clyybber> @Yardanico yeah seems fine too |
13:53:12 | * | vicfred joined #nim |
13:54:08 | FromDiscord | <dom96> It is a bug lol |
13:54:19 | Yardanico | after that tuple closure fix - nimsynth with orc |
13:54:20 | Yardanico | https://i.imgur.com/SRdD8Dx.png |
13:54:23 | Yardanico | @impbox ^ :P |
13:54:38 | FromDiscord | <impbox> awesome |
13:54:38 | Yardanico | I launched it in Xephyr so the mouse coords are fine (they seem to be borked with Xwayland directly) |
13:55:02 | Yardanico | but there's certainly sound :P |
13:55:07 | Yardanico | time to follow your video for same music |
13:55:16 | FromDiscord | <dom96> Yay, my servers can now automagically restart for updates. |
13:57:11 | * | jjido joined #nim |
14:03:36 | Yardanico | ok also time to test nimyaml with arc again after https://github.com/nim-lang/Nim/issues/15052 |
14:03:37 | disbot | ➥ [ARC] Crash when modifying a string with mitems iterator ; snippet at 12https://play.nim-lang.org/#ix=2sbY |
14:04:48 | Yardanico | seems like NimYAML uses shallow copy in some places though :/ |
14:04:53 | Yardanico | so 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:15 | Yardanico | ah wait there were some old simplifications left by me |
14:06:36 | * | couven92 quit (Read error: Connection reset by peer) |
14:06:50 | Yardanico | MWAHAHHAHA |
14:06:54 | Yardanico | all NimYAML tests pass with arc |
14:06:58 | Yardanico | and sink inference off |
14:06:59 | * | couven92 joined #nim |
14:07:08 | Yardanico | (sink inference because I didn't want to modify with nosinks) |
14:07:26 | Yardanico | well I had to fix nimyaml a little for devel |
14:07:35 | Yardanico | remove "not nil" from YamlNode |
14:08:00 | Yardanico | and also had to make a custom destructor with another field |
14:08:18 | Yardanico | because before it used two different finalizers, and arc can't currently bind more than one finalizer |
14:08:35 | Yardanico | tests pass with refc as well for same code |
14:08:43 | Yardanico | because nim can map destructors to finalizers |
14:10:46 | Yardanico | basically now the whole patch for arc is https://gist.github.com/Yardanico/b4aaf28ec157c330a7639103d892b9be |
14:10:50 | Yardanico | for nimyaml |
14:11:48 | Yardanico | lets try with sink inference on |
14:12:46 | Yardanico | still all tests pass (after two nosinks insertions), nice |
14:17:24 | FromDiscord | <Clyybber> nice! |
14:17:37 | Yardanico | although valgrind shows 100kb as "definitely lost" |
14:18:00 | Yardanico | and 2mb indirectly lost |
14:18:10 | Yardanico | with -d:useMalloc and --gc:orc |
14:18:35 | * | couven92 quit (Read error: Connection reset by peer) |
14:19:02 | * | couven92 joined #nim |
14:19:17 | Yardanico | not sure what to do about not nil |
14:19:29 | Yardanico | seems like it's broken for newruntime (for seqs at least) |
14:19:33 | Yardanico | /home/dian/Things/Nim/lib/system/seqs_v2.nim(110, 23) Error: cannot prove 'value' is not nil |
14:25:27 | Yardanico | opened https://github.com/flyx/NimYAML/issues/85 so that it doesn't get lost at least |
14:25:28 | disbot | ➥ NimYAML compatibility with ARC/ORC. |
14:32:19 | icyphox | what's a good way to iterate over a seq infintely? |
14:32:27 | Yardanico | https://github.com/narimiran/itertools |
14:32:31 | Yardanico | it has a cycle iterator |
14:32:39 | icyphox | neat |
14:32:49 | Yardanico | its really simple though |
14:32:55 | Yardanico | you can just copy the implementation :P |
14:33:30 | icyphox | ah yeah i might |
14:33:32 | icyphox | saves me a dep |
14:35:39 | Yardanico | Araq: is strictFuncs supposed to work with old runtime (refc)? |
14:37:57 | Yardanico | if yes, then this fails for refc (throws an error with arc though) - https://play.nim-lang.org/#ix=2sm7 |
14:38:08 | Yardanico | I mean it fails the mutability check and successfully compiles with refc |
14:38:27 | icyphox | undeclared identifier yield? is yield in some module? |
14:38:32 | Yardanico | icyphox: no |
14:38:37 | Yardanico | it's a built-in construct |
14:38:40 | Yardanico | only used in iterators |
14:38:41 | icyphox | oh wow |
14:38:45 | icyphox | itertools has a typo |
14:38:47 | icyphox | lol |
14:38:51 | Yardanico | does it? |
14:38:52 | icyphox | it's written as 'yeild' |
14:38:57 | Yardanico | no? |
14:38:59 | Yardanico | I can't find that |
14:39:01 | icyphox | oh wait |
14:39:02 | icyphox | lmao |
14:39:07 | icyphox | i typed that |
14:39:12 | Yardanico | happens :P |
14:39:32 | icyphox | lol |
14:43:38 | FromDiscord | <Clyybber> Yardanico: Is a bug |
14:43:42 | Yardanico | noice |
14:44:45 | Yardanico | credit goes to @sschwarzer on GitHub :P |
14:44:57 | Yardanico | on nim forum* |
14:45:05 | * | antranigv quit (Ping timeout: 240 seconds) |
14:45:50 | FromDiscord | <Clyybber> nice |
14:47:39 | disruptek | Zevv: for loops can't work, obviously, but the alternative is that we cannot call cps procs from inside a for loop, right? |
14:49:49 | disruptek | maybe that's the lesser of two evils. |
14:52:38 | FromDiscord | <Clyybber> disruptek: For loops *can* work, maybe.. |
14:53:08 | FromDiscord | <Clyybber> https://nim-lang.github.io/Nim/macros#getImplTransformed%2CNimNode |
14:53:31 | disruptek | it's untyped, though. |
14:54:21 | FromDiscord | <Clyybber> where did you get that from? |
14:54:44 | disruptek | what? |
14:54:50 | FromDiscord | <Clyybber> do you mean cps? |
14:54:53 | disruptek | yeah. |
14:54:56 | FromDiscord | <Clyybber> oh |
14:55:07 | FromDiscord | <Clyybber> I think it needs to be typed eventually anyways |
14:55:10 | disruptek | but actually, we might be moving in that direction anyway. |
14:55:14 | FromDiscord | <Clyybber> for templates and stuff to work |
14:55:54 | disruptek | the problem is that a `cps foo()` cannot be typed until we have context. |
14:56:10 | disruptek | but it might be time to solve this problem permanently. |
14:59:12 | Yardanico | I always forget those little features we have :P |
14:59:16 | Yardanico | !eval echo var a: 0 .. 5 = 3 |
14:59:17 | Yardanico | !eval echo var a: 0 .. 5 = 6 |
14:59:17 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: undeclared identifier: 'a' |
14:59:19 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: undeclared identifier: 'a' |
14:59:27 | Yardanico | !eval var a: 0 .. 5 = 3 |
14:59:31 | NimBot | <no output> |
14:59:31 | Yardanico | !eval var a: 0 .. 5 = 6 |
14:59:34 | NimBot | Compile failed: /usercode/in.nim(1, 17) Error: conversion from int literal(6) to range 0..5(int) is invalid |
14:59:53 | Yardanico | is this documented btw? |
14:59:59 | disruptek | of course. |
15:00:03 | Yardanico | where? :P |
15:00:10 | disruptek | rtfm range types |
15:00:46 | Yardanico | we only have "subrange types" |
15:01:11 | Yardanico | and even then I can't find that syntax anythere |
15:01:14 | Yardanico | anywhere* |
15:01:33 | disruptek | what syntax? |
15:01:38 | Yardanico | var a: 0 .. 3 = 6 |
15:01:40 | Yardanico | no "range" here |
15:01:46 | disruptek | it's sugar. |
15:02:05 | FromDiscord | <lqdev> lol it even works for types |
15:02:09 | Yardanico | yes |
15:02:12 | FromDiscord | <lqdev> !eval type A = 0..3 |
15:02:14 | FromDiscord | <impbox> never see that |
15:02:17 | NimBot | <no output> |
15:02:17 | FromDiscord | <impbox> (edit) 'see' => 'seen' |
15:02:21 | Yardanico | it also works for type fields |
15:02:25 | Yardanico | like "port: 1 .. 65535" |
15:02:27 | disruptek | look at how i use it for gully. |
15:02:30 | disruptek | !repo gully |
15:02:30 | disbot | https://github.com/disruptek/gully -- 9gully: 11a code comment formatter 15 1⭐ 0🍴 |
15:02:36 | Yardanico | disruptek: but it's not documented at all :P |
15:02:42 | disruptek | sure it is. |
15:02:45 | disruptek | you think i invented it? |
15:02:51 | Yardanico | but where |
15:03:11 | Yardanico | in system .. is only for slices and iterators |
15:03:30 | disruptek | as i said, it's sugar. |
15:03:32 | Yardanico | also you can't go to definition of that .., so it's not a part of system but a part of the language |
15:03:51 | disruptek | it's not .. |
15:03:56 | disruptek | it's range. |
15:04:10 | Yardanico | I'm just saying I can't find documentation for it in the manual |
15:04:48 | disruptek | okay, well, submit a pr i guess. 😉 |
15:09:15 | * | antranigv joined #nim |
15:09:26 | ForumUpdaterBot | New thread by Jasonfi: Error when importing smtp (Nim 1.2.4), see https://forum.nim-lang.org/t/6598 |
15:11:06 | disruptek | Zevv: 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:27 | ForumUpdaterBot | New thread by Jasonfi: Error when compiling with smtp import, see https://forum.nim-lang.org/t/6599 |
15:16:50 | FromDiscord | <jasonfi> I deleting the original thread, I thought I might have fixed it |
15:17:00 | FromDiscord | <jasonfi> smtp just breaks when I import it |
15:19:15 | FromDiscord | <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:16 | FromDiscord | <lqdev> (edit) 'i' => 'it' |
15:19:27 | FromDiscord | <lqdev> (edit) 'it' => 'if' |
15:19:52 | * | nickster joined #nim |
15:19:52 | Yardanico | xd |
15:19:58 | Yardanico | https://i.imgur.com/EfuEFJK.png :P) |
15:20:27 | FromDiscord | <jasonfi> by fix I mean I made a mistake, commenting out code |
15:27:59 | FromDiscord | <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:09 | Yardanico | i didn't blame you sir |
15:28:36 | Yardanico | and added ":P" for a reason |
15:30:56 | FromDiscord | <dom96> I used to use ":P" a lot, I like to think I've grown out of it 😛 |
15:31:04 | Yardanico | 😛😛 |
15:31:13 | FromDiscord | <lqdev> >proceeds to use `:P` |
15:31:29 | FromDiscord | <dom96> ThatsTheJoke.html |
15:32:09 | FromDiscord | <lqdev> i don't use `:P` because it looks weird in ascii form and i'm not gonna use the emoji form |
15:32:19 | FromDiscord | <lqdev> because i don't like emojis. |
15:32:42 | Yardanico | you don't like disruptek then I guess XD |
15:32:46 | FromDiscord | <lqdev> well, there are *some* custom emoticons i use on another private server. |
15:32:54 | Yardanico | but |
15:32:55 | Yardanico | what about |
15:33:03 | FromDiscord | <Yardanico> :nimrawr: |
15:33:38 | FromDiscord | <Rika> :KannaKMS: |
15:33:46 | FromDiscord | <lqdev> it's an *emoticon* but discord calls them emojis anyways. |
15:33:58 | FromDiscord | <lqdev> this is my favorite one https://cdn.discordapp.com/emojis/449225292725092363.png?v=1 |
15:34:12 | FromDiscord | <lqdev> *don't have discord nitro. modern problems require modern solutions |
15:34:23 | FromDiscord | <dom96> Gotta love how Discord charges for premium emojis |
15:34:32 | FromDiscord | <lqdev> ah yes |
15:34:51 | FromDiscord | <lqdev> it's like using a silly image is some prestigious feature for the chosen ones. |
15:35:05 | FromDiscord | <dom96> It's genius to be honest |
15:35:28 | FromDiscord | <dom96> There are far too many people out there with too much money on their hands |
15:35:45 | Yardanico | they're not new for that though |
15:35:48 | Yardanico | twitch did that for years |
15:35:56 | Yardanico | before discord even existed |
15:35:56 | * | outtabwz joined #nim |
15:36:14 | FromDiscord | <lqdev> paying $5 is too much for something that should come for free |
15:36:41 | FromDiscord | <lqdev> it practically doesn't cost them anything to allow for cross-server emoticons. |
15:36:51 | FromDiscord | <lqdev> it's as simple as flipping a flag. |
15:37:09 | Yardanico | but MUH CDN!1111111 |
15:37:13 | FromDiscord | <dom96> To be fair, while that's true they do offer a lot for free |
15:37:49 | FromDiscord | <lqdev> yeah. you're only paying with your data. |
15:39:15 | FromDiscord | <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:23 | Yardanico | so embrace it |
15:39:26 | Yardanico | like telegram does for stickers |
15:40:07 | outtabwz | I nocice nim has a "--noMain" option. Is a procedure named "main" treated specially? |
15:40:11 | Yardanico | no |
15:40:23 | Yardanico | it means that Nim won't generate a main function for the native backends |
15:40:29 | Yardanico | so you'll have to provide your own main function |
15:41:26 | outtabwz | I usually write small command line programs. Should I be writing "proc main" for the entry point? |
15:41:29 | Yardanico | It's also useful with --app:lib when you for example want to make a custom dll attach function |
15:41:45 | Yardanico | outtabwz: well it doesn't really matter, you can have code at global scope level, but it's preferred to modularize stuff :0 |
15:41:47 | Yardanico | :) |
15:41:55 | Yardanico | for small "scripts" it's fine to use global scope |
15:43:26 | outtabwz | So 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:41 | Yardanico | no, sorry, maybe I phrased it wrong |
15:43:53 | Yardanico | Nim itself doesn't have a special notion of a "main" procedure since it allows code at global level |
15:44:04 | Yardanico | but when compiling to native backends like C nim automatically makes the "main" function C expects |
15:44:17 | Yardanico | So you don't need to care about this really :) |
15:44:35 | FromDiscord | <Skaruts> is there any ECS written in Nim? |
15:44:37 | Yardanico | in nim "proc main = stuff" is just a normal proc, you still need to call it |
15:45:57 | outtabwz | I 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:06 | Yardanico | yes |
15:46:20 | outtabwz | Thank you Yardanico |
15:48:25 | FromDiscord | <lqdev> @Skaruts https://github.com/rlipsc/polymorph |
15:48:34 | FromDiscord | <lqdev> https://github.com/b3liever/breakout-ecs/ |
15:48:42 | FromDiscord | <lqdev> and I'm working on one for my engine |
15:50:01 | FromDiscord | <Skaruts> gonna take a look, thank you |
15:50:12 | Zevv | sooo, how's #nim todayA |
15:50:14 | Zevv | ? |
15:50:17 | Yardanico | ! |
15:50:26 | Zevv | everybody happy? |
15:50:35 | Yardanico | Zevv: nimyaml works on devel with orc and passes all tests (with a smol patch) |
15:50:43 | Yardanico | so yeah, everyone's happy |
15:50:49 | Zevv | \o/ |
15:50:53 | outtabwz | I 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:08 | Zevv | pick your own obsessions |
15:51:15 | Yardanico | btw I created https://github.com/nim-lang/Nim/wiki/Nim-features-you-didn%27t-know-you-needed |
15:51:21 | Yardanico | if you have something interesting, feel free to add |
15:51:29 | FromDiscord | <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:31 | Yardanico | basically less-known features |
15:51:52 | FromDiscord | <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:12 | Zevv | Yardanico: looking good, I'll think of one or two! |
15:52:24 | Zevv | data oriented ECS. I have no clue what you're saying |
15:52:49 | FromDiscord | <jasonfi> Python is 30 years old |
15:52:58 | Zevv | oh yeah baby, types and macros, you're in for some fun |
15:53:01 | disruptek | Zevv: i think i know the bug in 16. |
15:53:04 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
15:53:04 | FromDiscord | <jasonfi> a language takes time to reach popularity sometimes |
15:53:08 | Yardanico | @Anuke nim global code runs in NimMain |
15:53:13 | Yardanico | i mean global nim code |
15:53:18 | Zevv | disruptek: cool! |
15:53:24 | Yardanico | I don't really understand your question I think :P |
15:53:25 | FromDiscord | <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:33 | FromDiscord | <lqdev> and that's all you really need to know. :) |
15:53:40 | Zevv | disruptek: I'm kind of blocked by #3 though, a lot of things I want to try out fail at this time |
15:54:03 | Zevv | lqdev: Aah right, I think you mentioned that a long time ago already, i looked it up then |
15:54:06 | Yardanico | i don't understand people like this - https://forum.nim-lang.org/t/6593#40874 |
15:54:09 | Yardanico | :c |
15:54:20 | disruptek | Zevv: i think it's the same bug. |
15:54:21 | Zevv | but 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:25 | Zevv | disruptek: oh is it! |
15:54:31 | outtabwz | True jasonfi |
15:54:38 | disruptek | yeah, we .Cont when we need to cast[Cont] |
15:55:18 | Zevv | Yardanico: yeah well, keep on trollin', right |
15:55:39 | Zevv | disruptek: oh right, that makes sense |
15:58:00 | Zevv | I have not yet ran into to need for boxing |
15:59:01 | Zevv | "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:07 | Zevv | But fortunately, there's a sandwich on the counter, and all the materials used to make it are gone. So you eat it" |
15:59:47 | disruptek | cool story, bro |
16:00:35 | Zevv | yeah I'd love to say I made it up or found some obscure source somewhere |
16:00:44 | Zevv | but its's from the wikipedia page on continuations |
16:02:44 | disruptek | how i did i never see this before? |
16:04:03 | disruptek | we should have our result concept include support for errors. |
16:06:42 | disruptek | maybe we use := like go. |
16:06:51 | disruptek | it's kinda what we want. |
16:07:24 | disruptek | we can call them "noroutines". |
16:07:58 | disruptek | since apparently, continuation is too long a word for you to type. |
16:08:09 | FromDiscord | <lqdev> yes |
16:08:15 | FromDiscord | <lqdev> and instead of the `go` keyword we use `no` |
16:08:29 | FromDiscord | <Rika> what about no |
16:08:32 | disruptek | no is an enum. |
16:08:41 | disruptek | no == off == false |
16:08:59 | FromDiscord | <lqdev> maybe `dont`? |
16:09:12 | disruptek | uhno |
16:09:22 | disruptek | nah |
16:11:52 | disruptek | what about just `goto`? |
16:13:23 | FromDiscord | <exelotl> bro-routines |
16:14:00 | dulsi | Can 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:13 | disruptek | $e |
16:14:33 | Yardanico | dulsi: let mystringofenum = $myenumvalue |
16:14:45 | Yardanico | you can echo because enum has $ defined |
16:14:52 | Yardanico | and echo automatically applies $ to all arguments it was given |
16:16:13 | * | nikita` joined #nim |
16:16:41 | dulsi | Thanks. Probably should find a good intro to nim rather than just jumping in. |
16:17:11 | Yardanico | well there's https://narimiran.github.io/nim-basics/ |
16:17:11 | Yardanico | it doesn't seem to cover enums though :P |
16:17:27 | * | tane joined #nim |
16:20:35 | disruptek | jump in, it's fine. |
16:23:51 | Zevv | wait what getImplTransformed |
16:23:52 | Zevv | wow |
16:23:59 | Yardanico | it was here before |
16:24:21 | Yardanico | wait sorry phrased it wrong |
16:25:02 | Yardanico | ah nvm ignore me |
16:25:06 | Zevv | yes, sir! |
16:25:10 | Yardanico | btw we also have --expandArc in devel |
16:25:26 | Yardanico | which also does what getImplTransformed does |
16:25:35 | Yardanico | but also for destructors (it shows code with destructors injected) |
16:26:22 | Zevv | Laaaalalalalaaala 🙉 |
16:27:53 | Zevv | disruptek: 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:43 | disruptek | i don't follow. |
16:28:57 | Zevv | we don't provide the Cont type, the user provides it, right |
16:29:01 | disruptek | sure. |
16:29:06 | Zevv | but what can I do with that type? |
16:29:15 | disruptek | whatever you do with other types. |
16:29:30 | Zevv | ok, so assume I add a field "thing: string" |
16:29:35 | Zevv | how would I access that from my cps procs |
16:29:53 | Zevv | and why would I do that |
16:29:54 | disruptek | make a cps primitive? |
16:30:11 | disruptek | because you can trade state with the dispatcher. |
16:30:17 | Zevv | Ah - right |
16:30:25 | Zevv | so it's not there for the cps procs, it's for the dispatcher |
16:30:28 | Zevv | fair enough |
16:30:30 | disruptek | right. |
16:30:37 | disruptek | well, for anything that isn't cps. |
16:31:00 | Zevv | right. But it's good. I was afraid you were putting in infrastructure to pass state to and from the cps procs themselves |
16:31:12 | Zevv | but for the primitives it makes perfect sense |
16:31:42 | Zevv | I'm still not at the point where I can think of this stuff and oversee all consequences |
16:31:58 | Zevv | and two times a day I'm trying to follow the code flow of some construct and go "what the hell" |
16:32:12 | Zevv | do you still have that? |
16:32:28 | disruptek | i have this: |
16:32:31 | disruptek | return sleep(cast[Cont](env_16821235(fn: Cont, ms: ms)), ms) |
16:32:47 | disruptek | yeah, it makes no sense to me, either. |
16:32:49 | Zevv | check that shit in |
16:32:56 | disruptek | it breaks your stuff. |
16:33:25 | Zevv | It'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:34 | Zevv | and 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:54 | Yardanico | oh yeah |
16:34:06 | Yardanico | it's when you get it right :) |
16:34:18 | Zevv | yeah but this CPS stuff, it keeps itching my skull |
16:34:49 | Zevv | I've chewed the papers, got some basic implementation running, but I don't feel like i've seen the light |
16:35:51 | disruptek | when you change the stash i cannot fast-forward, chuckles. |
16:36:22 | Zevv | wut |
16:36:30 | Zevv | pullrebase? |
16:36:36 | Zevv | I didn't force any push? |
16:36:44 | disruptek | i think it's the stash. |
16:37:01 | Zevv | it's just a dir |
16:37:03 | Zevv | it's not magic? |
16:37:26 | Zevv | well, you can't ff if you don't rebase first |
16:37:30 | Zevv | that's git for you |
16:37:38 | Zevv | you and I share a branch, that's the price you pay |
16:37:46 | Zevv | My default is `git pull --rebase` |
16:38:06 | disruptek | hmm, we'll see next time. |
16:38:22 | disruptek | anyway, there's a new bug to fix. |
16:38:23 | Zevv | you broke my tests |
16:39:17 | * | leorize quit (Remote host closed the connection) |
16:39:46 | * | leorize joined #nim |
16:46:15 | disruptek | i found it. |
16:46:52 | Zevv | I didn't |
16:47:13 | disruptek | pull --rebase 😉 |
16:47:26 | Zevv | yay |
16:48:03 | Zevv | so, waht did these last 2 commits fix now? |
16:48:19 | disruptek | probably nothing. |
16:48:28 | Zevv | haha |
16:52:28 | disruptek | i need to look at the c i guess. |
16:52:38 | disruptek | first, i have to do some gardening. |
16:52:46 | Zevv | yeah doing that. I just switch to a release build, it's easier to read |
16:53:14 | disruptek | you should use the mangling branch. |
16:53:22 | disruptek | it's pretty damned sexy. |
16:53:27 | Zevv | I love that so much |
16:53:48 | Zevv | like 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:51 | outtabwz | Anyone else uses Emacs? I recommend to disable nimsuggest and install flycheck-nim instead. Nimsuggest was hopelessly broken for me. |
16:54:07 | disruptek | krux02 uses it. |
16:54:37 | outtabwz | I read krux02 bug reports for nim-mode on github. |
16:54:54 | disruptek | yeah? |
16:55:42 | outtabwz | yes well, i was just very frustrated until i disabled nimsuggest and installed flycheck-nim instead. |
16:56:48 | FromDiscord | <lqdev> what's flycheck-nim? |
16:56:49 | disruptek | Zevv: we should put a traceback stack in our testing Cont. |
16:57:51 | outtabwz | flycheck-nim is an Emacs package which enables the flycheck package to interactively check nim code without relying on nimsuggest. |
16:57:59 | disruptek | cpsDebug can just pass the lineinfo during type constr. |
16:58:10 | disruptek | okay, i really have to go plant some crops. bbiab |
16:58:21 | outtabwz | https://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:38 | outtabwz | brb |
17:01:43 | * | outtabwz left #nim (#nim) |
17:01:47 | Oddmonger | if i understand well, foo.bar() can be: |
17:01:59 | Oddmonger | 1) bar() called from module foo.nim |
17:02:08 | Oddmonger | 2) bar(foo) |
17:02:36 | Oddmonger | is this right ? |
17:03:15 | FromDiscord | <lqdev> yes |
17:03:23 | Zevv | I'm thinking hard for 3) |
17:03:26 | FromDiscord | <lqdev> but option 2) takes priorite |
17:03:42 | FromDiscord | <lqdev> Zevv: it can also be a call to a proc stored in a field of `foo` |
17:03:45 | Oddmonger | i've been puzzled by 2) |
17:03:56 | FromDiscord | <lqdev> (edit) 'priorite' => 'priority' |
17:04:09 | Oddmonger | can i block 2) at compilation ? |
17:04:56 | Oddmonger | in Lua there is similar thing, but at least, it's bar:foo() for 2) |
17:06:30 | FromDiscord | <lqdev> you can rename the module while importing: `import foo as qux` |
17:06:48 | FromDiscord | <lqdev> and then call `qux.bar(foo)` |
17:08:28 | Zevv | disruptek: why the cast then, conversion should do? |
17:09:17 | Yardanico | why casts at all? |
17:09:19 | Zevv | right |
17:09:19 | * | leorize quit (Remote host closed the connection) |
17:09:21 | Yardanico | shouldn't cps work without them just fine? |
17:09:23 | Zevv | it feels wrong |
17:09:30 | Yardanico | (otoh, even nim's async does casts) |
17:09:35 | Yardanico | although just for stripping some info |
17:09:45 | Zevv | he just added a cast for a derived type to the base type |
17:09:46 | Yardanico | to trick compiler into thinking that some proc is gcsafe :P |
17:09:47 | Zevv | which seems silly |
17:09:54 | Yardanico | yeah in that case you don't need a cast |
17:10:02 | * | leorize joined #nim |
17:10:02 | Zevv | it was an expression before |
17:10:16 | Zevv | but now he's planting his weed |
17:10:30 | Oddmonger | ah 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:20 | icyphox | i did it boys (and girls, etc.) -- i wrote my websocket proxy in Nim |
17:15:26 | icyphox | with support for multiple clients |
17:15:30 | icyphox | and fully async |
17:15:32 | icyphox | love it |
17:15:53 | outtabwz | you win icyphox |
17:16:07 | Yardanico | icyphox: used treeform's ws? |
17:16:12 | icyphox | yes! |
17:16:25 | icyphox | Yardanico: yes :) |
17:16:28 | Yardanico | nice |
17:16:40 | icyphox | i think i must've really annoyed treeform |
17:16:44 | icyphox | with all my questions |
17:17:09 | icyphox | i wonder if i can open source it |
17:17:13 | icyphox | i will ask my boss |
17:17:16 | icyphox | heh |
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:32 | outtabwz | Is there reason to use c-like function prototypes for nim procs? |
17:22:59 | FromDiscord | <lqdev> wdym? |
17:23:06 | FromDiscord | <lqdev> forward declarations? |
17:23:11 | * | vicfred quit (Quit: Leaving) |
17:23:33 | FromDiscord | <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:07 | disruptek | it has nothing to do with gcsafe. |
17:25:07 | disruptek | gcsafe isn't a thing in cps. 😁 |
17:26:12 | outtabwz | yes i saw an example in the 'official' tutorial of mutually dependent procs, but i may not understand |
17:31:18 | disruptek | it will become clear when you develop the compilation error. |
17:31:26 | Zevv | disruptek: tell my why it is a thing in async then |
17:31:34 | Zevv | after 2.5 years I still have no answer to that question |
17:31:54 | disruptek | something something closure iterators. |
17:32:21 | Zevv | utter bull |
17:32:23 | Zevv | anyway |
17:32:29 | disruptek | well, you can't make this shit up. |
17:32:30 | Zevv | the codegen error has to do with history |
17:33:01 | Zevv | but not sure yet how. I triggered it with a simple test, and it goes away if I remove all preceeding tests |
17:33:10 | Zevv | so something is not unique |
17:33:19 | disruptek | ugh, that's bad. |
17:33:44 | FromGitter | <kdheepak> @sheerluck can you open an issue on the github repository? The binary builder developers are very responsive. |
17:34:51 | FromDiscord | <dom96> Zevv: why is what a thing in async? gcsafe? |
17:35:10 | disruptek | Zevv: can you ix me your c? |
17:35:31 | Zevv | dom96: https://github.com/dom96/nim-in-action-code/issues/6 |
17:35:32 | disbot | ➥ not GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK |
17:35:47 | Zevv | disruptek: isolating |
17:35:58 | disruptek | well, you don't have to sit on my lap. |
17:36:04 | disruptek | just stay where you are and send the source. |
17:36:33 | disruptek | if 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:54 | outtabwz | is there a repl included? |
17:37:18 | disruptek | not officially. |
17:37:21 | disruptek | !repo inim |
17:37:21 | disbot | https://github.com/inim-repl/INim -- 9INim: 11Interactive Nim Shell / REPL / Playground 15 320⭐ 19🍴 |
17:37:34 | FromDiscord | <dom96> Zevv: good question. |
17:37:47 | Oddmonger | and nim --secret |
17:38:00 | Zevv | haha |
17:38:08 | Zevv | and you should also say "arak, please advise" |
17:38:10 | Zevv | disruptek: http://ix.io/2smN |
17:38:13 | Zevv | it's the nim |
17:38:24 | FromDiscord | <dom96> I always hated the gcsafe crap |
17:38:29 | Zevv | both blocks 'when true' is broken |
17:38:39 | * | jjido joined #nim |
17:38:48 | FromDiscord | <dom96> and then we started getting PRs that marked various callbacks with gcsafe |
17:38:49 | Zevv | dom96: I started hacking out .gcsafe. things top down and then it all just worked |
17:38:52 | FromDiscord | <dom96> and now we are where we are |
17:38:54 | Oddmonger | sorry, it is « nim secret » |
17:39:02 | Zevv | and the gcsafes I hacked out came in with commits with messaages like "make tests green again" |
17:39:23 | bung | does `case of` can fallthrough? |
17:39:29 | FromDiscord | <dom96> Have you had a chance to look into the commits that introduced these annotations? |
17:39:31 | Zevv | so 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:41 | Zevv | dom96: ^^ |
17:39:41 | FromDiscord | <dom96> That may give some answers |
17:40:04 | Zevv | see https://github.com/dom96/nim-in-action-code/issues/6#issuecomment-446956468 |
17:40:05 | disbot | ➥ not GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK |
17:40:35 | Zevv | disruptek: you can enable just one "when true" block. Enable both and it goes boom |
17:40:42 | disruptek | okie. |
17:41:19 | Zevv | dom96: 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:46 | Zevv | and 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:47 | disbot | ➥ not GC-safe ; snippet at 12https://play.nim-lang.org/#ix=26qK |
17:41:48 | FromDiscord | <dom96> Zevv: yeah, I think the gcsafe becomes important if you are running an event loop per thread. |
17:41:56 | Zevv | but I don't |
17:42:00 | Zevv | So I don't want that restriction |
17:42:38 | FromDiscord | <dom96> You'd get crashes AFAIK |
17:43:06 | FromDiscord | <dom96> If an HTTP server callback is run on thread #1 and accesses data allocated in thread #0 you'll have crashes |
17:43:16 | FromDiscord | <dom96> this is why the callback was marked with {.gcsafe.} |
17:43:23 | Zevv | sure. But I'm talking asyncHttpServer |
17:43:25 | Zevv | that's *not* threaded |
17:43:44 | FromDiscord | <dom96> yeah |
17:44:05 | Zevv | anyway, I can only hope one day that we get erlang like isolation |
17:44:08 | FromDiscord | <dom96> We should probably remove these annotations 🙂 |
17:44:18 | Zevv | that was my point in 2018 :) |
17:48:48 | * | superbia1 is now known as superbia |
17:49:35 | disruptek | Zevv: the cast code is clearly more correct. |
17:49:41 | Zevv | how so |
17:49:59 | disruptek | well, it doesn't throw away the vars. |
17:50:04 | disruptek | oh, i'm dumb. |
17:50:17 | Zevv | why the heck would you ever need a cast to convert a derived type to its base type? |
17:50:18 | disruptek | we also need to cast it back when we receive it. 🤦 |
17:50:22 | Zevv | yeaaah right |
17:50:28 | Zevv | but don't cast, *convert* |
17:50:36 | Zevv | casting is baaad mkaay |
17:50:45 | disruptek | no, because i don't want the extra var. |
17:51:18 | Zevv | Hm i dunno man, I don't know this code well enough, so I trust you on this one |
17:51:24 | Zevv | but if you start casting, you lose stuff |
17:51:31 | disruptek | no, it's the opposite. |
17:52:11 | disruptek | here, i will give you two files to diff. |
17:52:27 | disruptek | http://ix.io/2smQ/c |
17:52:38 | disruptek | http://ix.io/2smR/c |
17:53:14 | Zevv | ok I have them diffed |
17:53:15 | Zevv | now what |
17:53:25 | disruptek | which do you prefer? |
17:54:14 | Zevv | bad reason |
17:54:33 | Zevv | you want me to say the second one |
17:54:37 | Zevv | right |
17:54:47 | FromDiscord | <dom96> If you can convert you should |
17:54:53 | disruptek | i cannot. |
17:55:25 | Zevv | but these types are close cousins, right? |
17:56:57 | disruptek | only in alabama. |
17:57:04 | disruptek | they are parent and child to the rest of the world. |
17:58:17 | Zevv | but are they not convertable? |
17:58:46 | disruptek | not if the destination is a type that doesn't include the data in the source. |
17:58:59 | * | jeko joined #nim |
18:00:43 | Zevv | let me play with that a bit |
18:00:52 | Zevv | but wait |
18:01:02 | Zevv | you're casting a parent type to a derived type |
18:01:07 | Zevv | that's utter bull |
18:01:27 | Zevv | the object is too short, so the tail will be limbo data |
18:01:44 | disruptek | a cast doesn't change the source. only the conversion does. |
18:01:47 | disruptek | that's the problem. |
18:02:44 | Zevv | I don't get any of this, sorry |
18:03:06 | disruptek | you have an object. it's actually a ref to an object. |
18:03:10 | disruptek | that means it's a pointer. |
18:03:11 | Zevv | it must be |
18:03:13 | Zevv | right |
18:03:15 | disruptek | nim knows all about it. |
18:03:18 | Zevv | sure |
18:03:24 | Zevv | let's call it object of type T1 |
18:03:36 | disruptek | we want nim to accept it for some limited use appropriate for its parent type. |
18:03:45 | disruptek | ie. a shorter, smaller version of itself. |
18:03:45 | Zevv | right |
18:03:47 | Zevv | sure |
18:03:59 | Zevv | but Nim remembers |
18:04:04 | disruptek | we cast it, which means we say "we know what we're doing and we promise... we promise..." |
18:04:14 | disruptek | the pointer passes through cps. |
18:04:24 | disruptek | it comes back to us. now we unwrap it with another cast. |
18:04:35 | disruptek | aha, there is the same memory, right where we left it. |
18:04:54 | Zevv | but why cast? |
18:05:00 | Zevv | you can just pass it as the base type |
18:05:07 | Zevv | when you cast, you lose the original type it once had |
18:05:14 | Zevv | conversion will save that |
18:05:22 | disruptek | because conversion instantiates a new object and copies the value. but only the shorter portion of the type. |
18:05:32 | disruptek | look at the c. |
18:05:36 | Zevv | no, it does not copy because it is a ref |
18:05:41 | disruptek | look at the c. |
18:06:06 | Zevv | then something is wrong |
18:07:30 | disruptek | T2 = &T1->Sup |
18:08:25 | disruptek | Cont = &env_2312312->Cont |
18:08:47 | FromDiscord | <dom96> If copies happen for conversions then that sounds like a bug |
18:08:54 | * | D_ quit (Ping timeout: 244 seconds) |
18:09:02 | disruptek | it's copying the address, not the actual memory. |
18:09:21 | disruptek | but it doesn't matter; it's still not passing the same address. but we can prove this with a test. |
18:09:45 | Zevv | I don't get it. It must be wrong. |
18:10:12 | Zevv | crayons and patience required to get me to understand this I guess |
18:10:53 | disruptek | i hate to say it, but we may have to abandon inheritance. |
18:10:55 | Zevv | I see the C, but I don't understand what Nim thinks its doing here |
18:11:04 | FromDiscord | <dom96> https://github.com/nim-lang/Nim/issues/15079#issuecomment-664013738 |
18:11:06 | disbot | ➥ getAppFilename returns (deleted) in the path ; snippet at 12https://play.nim-lang.org/#ix=2siC |
18:11:17 | FromDiscord | <dom96> le sigh |
18:11:37 | disruptek | is that french? |
18:11:45 | disruptek | nim thinks it's doing us a favor. |
18:11:57 | Yardanico | Araq: 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:11 | Zevv | disruptek: but Sub being the first member, it's the same address, right |
18:13:14 | Zevv | Sup |
18:14:25 | Yardanico | was sup? |
18:16:27 | FromDiscord | <dom96> Cool. 5 instances of Stardust's server using only 20% CPU of a $5/mo DO droplet |
18:16:44 | Yardanico | imagine nodejs |
18:16:47 | Yardanico | OOM |
18:17:41 | FromDiscord | <Yardanico> oh nice dom you have a new avatar in discord |
18:17:49 | FromDiscord | <dom96> Yeah, it was time |
18:18:00 | FromDiscord | <Yardanico> some voxel thing |
18:18:04 | FromDiscord | <dom96> picked some random abstract thing lol |
18:18:39 | Yardanico | i guess i should change too |
18:19:05 | FromDiscord | <dom96> Actually I wonder how nodejs would compare. Been pretty impressed with V8, so nodejs might actually be pretty impressive |
18:19:14 | Yardanico | i mean perf-wise, maybe |
18:19:17 | Yardanico | not sure about memory-wise :) |
18:19:40 | disruptek | they are essentially the same metric. |
18:19:42 | Yardanico | V8 is really -really optimized, that's true |
18:19:45 | FromDiscord | <dom96> hmmm, I actually could probably make a test fairly easily |
18:19:49 | * | couven92 is now known as fredrikhr |
18:19:50 | Yardanico | disruptek: you're contradicting yourself :D |
18:19:53 | FromDiscord | <dom96> since I can compile this code to JS anyway 😮 |
18:20:06 | Yardanico | remember when the base64 bench showed 3.5x less RAM usage for arc, but slower |
18:20:09 | FromDiscord | <dom96> maybe next weekend 😄 |
18:20:17 | Yardanico | and you said something like "we don't care about ram" |
18:20:36 | * | fredrikhr quit (Read error: Connection reset by peer) |
18:20:40 | disruptek | it's memory in node that's expensive. |
18:21:01 | * | fredrikhr joined #nim |
18:21:09 | FromDiscord | <dom96> My servers have been running for 2 weeks non-stop. Memory usage: 32MB |
18:21:18 | disruptek | i don't care about memory usage in arc because it's easy to optimize. |
18:21:28 | FromDiscord | <dom96> We'll see how they fare once they get more requests though |
18:21:52 | disruptek | Zevv: do we have a debug eventqueue yet? |
18:21:56 | FromDiscord | <dom96> But it appears that async memory leaks may be behind us |
18:22:16 | FromDiscord | <Yardanico> ok changed my avatar as well |
18:23:38 | jjido | what is cps? Do you mean CSP? |
18:23:56 | Zevv | disruptek: no, what should it do? I think for 99% of the testing we only need a trampoline |
18:24:24 | jjido | continuation passing style |
18:24:37 | disruptek | i'm going to add a stack trace to the q you hate. |
18:24:42 | jjido | it was me who mixed up the letters haha |
18:24:45 | disruptek | !repo cps |
18:24:46 | disbot | https://github.com/disruptek/cps -- 9cps: 11Continuation-Passing Style for Nim 🔗 15 15⭐ 0🍴 7& 1 more... |
18:24:58 | disruptek | no cutlery here?! |
18:25:01 | Zevv | disruptek: feel free to do whatever you like there. It's *your* queue |
18:25:06 | disruptek | pffbt |
18:25:11 | Zevv | maybe the time has come to go our separate ways |
18:25:16 | disruptek | lol |
18:25:30 | Zevv | We can still share the kids |
18:25:33 | Zevv | but move to our own houses |
18:25:38 | disruptek | i don't want your kids. |
18:25:45 | Zevv | too late |
18:25:57 | Zevv | you adopted a very special kid |
18:26:15 | disruptek | dom96 is yours, remember? |
18:26:21 | disruptek | you said you'd take him. |
18:26:32 | Zevv | yeah aaaand I've lost you again |
18:26:48 | Yardanico | !seen disbot |
18:26:49 | disbot | disbot joined 12#nim-test 102 minutes ago and last spoke 719 weeks ago |
18:27:04 | FromDiscord | <dom96> yay, I've always wanted a daddy ( ͡° ͜ʖ ͡°) |
18:27:13 | Yardanico | uh-oh |
18:28:18 | Zevv | disruptek: back to the cast vs convert |
18:28:24 | Zevv | it takes the address of Sup |
18:28:28 | Zevv | which is the first element of the struct |
18:28:31 | Zevv | so it's at the same address |
18:28:38 | FromDiscord | <dom96> hahah |
18:28:39 | Zevv | so it's just the same address |
18:28:44 | Zevv | so how is that wrong? |
18:29:32 | Zevv | I'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:02 | Zevv | imagine 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:16 | disruptek | you'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:25 | Zevv | nooooo |
18:31:33 | Zevv | that's how this stuff works |
18:31:37 | Zevv | you are soo wrong |
18:31:57 | Zevv | Nim remembers for you |
18:32:00 | Zevv | that's the whole point |
18:32:03 | disruptek | in fact, it doesn't work. 😜 |
18:32:39 | Zevv | then something else is wrong |
18:32:39 | Zevv | http://ix.io/2snc |
18:32:44 | Zevv | How is this wrong |
18:33:42 | Zevv | wow wait |
18:33:52 | Zevv | Nim does not protect against converting to the wrong derived type |
18:34:09 | disruptek | thank you. |
18:34:17 | Zevv | oh it does |
18:34:18 | Zevv | it does |
18:34:21 | Zevv | it's a runtime check |
18:34:24 | Zevv | I was running -d:Danger |
18:34:27 | Zevv | but it throws on my |
18:34:37 | Zevv | see http://ix.io/2sng |
18:34:42 | Zevv | so conversion is all valid |
18:35:24 | Zevv | so tell me what does not work |
18:35:34 | Zevv | because my tests show no difference between your convert and your cast version |
18:36:04 | disruptek | lemme drain this abscess and then i'll look at it closer. |
18:36:27 | Zevv | I hope that's a metahpor for something |
18:36:33 | Yardanico | tape worms? |
18:48:42 | * | Senketsu joined #nim |
18:53:27 | disruptek | bah. |
18:53:35 | Zevv | bah what |
18:53:41 | Zevv | bah zevv you're right? |
18:53:46 | Zevv | or bah now my mirror is covered in pus |
18:54:05 | disruptek | can i pick 2 out of three? |
18:54:25 | Zevv | sure you can |
18:54:32 | disruptek | the claim that the compiler is smarter than me is clearly wrong. |
18:54:47 | disruptek | else it would know statically that .color is bogus. |
18:55:10 | Zevv | sure |
18:55:14 | disruptek | bah: mangling doesn't handle duplicate returns because i need to rebase. 😭 |
18:55:14 | Zevv | but ther's RTTI there somewhere |
18:55:26 | disruptek | fat lot of good it's doing us. |
18:55:29 | disruptek | we're just getting lucky. |
18:56:09 | Zevv | No, the compiler can't know it's bogus |
18:56:11 | disruptek | one thing you learn when you get old is to remove mirrors from your home. |
18:56:13 | Zevv | maybe for this case |
18:56:20 | disruptek | no mirrors in the shower. |
18:56:25 | disruptek | no mirrors on the ceiling. |
18:56:32 | Zevv | But the thing is that you can store all your derived types in a bin of T1's |
18:56:38 | Zevv | Both T2 and T2 fit in seq[T1] |
18:56:46 | Zevv | you take one T1 one, and you can then check with `is` what it was |
18:56:48 | Zevv | and handle it |
18:56:51 | disruptek | blah blah blah ref blah blah |
18:57:04 | Zevv | so, that's a "bah zevv your right" |
18:57:05 | disruptek | show me `is` working? |
18:57:11 | Zevv | one sec |
18:57:28 | disruptek | no, it's "bah this has nothing to do with anything" 😁 |
18:58:44 | Zevv | http://ix.io/2snp |
18:58:49 | Zevv | there is your working is |
18:58:51 | Zevv | Nim remember |
18:58:51 | Zevv | s |
18:59:02 | Yardanico | ? |
18:59:09 | Yardanico | working is nim remeber s? |
18:59:13 | Yardanico | remembmebmer? |
18:59:51 | Zevv | There is your working "is" |
18:59:54 | Zevv | Nim remebers |
19:00:41 | Zevv | so 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:12 | disruptek | something is very fux0red. |
19:05:29 | Zevv | given the nature of the problem you are solving, I am not surprised |
19:05:43 | Zevv | but when was the last time a cast made something actually *better* when something is fux0red |
19:05:59 | Zevv | let ans = 2+2; if ans != 4: ans = 4 |
19:06:02 | disruptek | don't be rude. |
19:06:05 | disruptek | casts are fine. |
19:06:21 | Zevv | not for what you're doing here. and you know it. |
19:06:25 | Zevv | you're just frustrated |
19:06:45 | disruptek | what's frustrating is that this code works, as you found, when run in isolation. |
19:06:59 | Zevv | fun, right |
19:07:13 | Zevv | ok, I read the kids and then dive into it |
19:08:54 | disruptek | i am convinced that the cast is no worse and it may be a tiny bit better whatfer memory reasons. |
19:09:09 | disruptek | but yeah, it seems to be a nim bug in any event. |
19:10:08 | Zevv | ok, 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:16 | Zevv | but then again, it's your code, so you have the last word on this of course :) |
19:10:32 | disruptek | you might be right. |
19:10:53 | disruptek | we can leave the option off by default, but i wanna keep the option. |
19:11:05 | Zevv | sure, be my guest |
19:11:22 | Zevv | ok, 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:20 | Zevv | first time I look at C code of an object hierarchy. First time I understand what RootObj does |
19:32:23 | Zevv | it's the thing holding the RTTI |
19:39:04 | * | Senketsu joined #nim |
19:43:10 | * | lritter joined #nim |
20:04:04 | Zevv | disruptek |
20:04:17 | disruptek | wut |
20:08:09 | Zevv | your AST must be broken |
20:08:20 | Zevv | if I replace the original by the transformed code as printed by cpsDebug |
20:08:22 | Zevv | it's ok |
20:08:56 | disruptek | neat, so what's the fix? |
20:08:59 | Zevv | no clue yet |
20:09:08 | Zevv | I was just wondering if there are rules about that |
20:09:23 | disruptek | yeah, there are. |
20:09:24 | Zevv | nim normally parses nim, makes ast and compiles that. If you make the AST yourself, are there any guarentees?? |
20:09:27 | disruptek | you found it, you fix it. |
20:09:46 | Zevv | I've seen the occasional "ill formed AST" |
20:09:59 | disruptek | not me, no sir. |
20:10:00 | disruptek | not ever. |
20:10:01 | Zevv | but I bet there's tons of things the compiler will happily chew through, generating utter nonsense |
20:13:53 | Prestige | I'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:50 | Yardanico | yes it does |
20:16:11 | Zevv | disruptek: the genSym in makeType*() is not unique |
20:16:27 | Prestige | I don't believe this would have the same effect: https://0x0.st/iw5i.txt |
20:16:54 | disruptek | no? |
20:16:59 | disruptek | what does this mean to me? |
20:17:14 | FromDiscord | <Clyybber> disruptek, Zevv: what bug are you fighting? |
20:17:23 | disruptek | all of them. |
20:17:45 | FromDiscord | <Clyybber> nice |
20:17:50 | disruptek | i think 3 and 16 |
20:17:54 | FromDiscord | <Clyybber> I'm on 3 |
20:18:01 | Zevv | me as well |
20:18:02 | FromDiscord | <Clyybber> but not the invalid C part |
20:18:08 | FromDiscord | <Clyybber> Zevv: Which part? |
20:18:28 | Zevv | http://ix.io/2snM |
20:18:30 | Zevv | this fails |
20:18:34 | Zevv | but if you disable on of the blocks it's fine |
20:18:47 | Zevv | there's only one env_ generated, the other one gets lost |
20:18:57 | Zevv | I just figured out that if I make my own gensym for the env name it's good |
20:19:11 | FromDiscord | <Clyybber> ah ok, but its not forward decls? |
20:19:23 | Zevv | nop |
20:19:26 | FromDiscord | <Clyybber> because thats what I'm fixing rn |
20:19:30 | Zevv | ok. |
20:19:38 | disruptek | that's a separate problem. |
20:19:43 | disruptek | but no less fun! |
20:19:49 | FromDiscord | <Clyybber> :D |
20:20:02 | Zevv | luckily we have clyybber to solve all that sh*t for us |
20:20:07 | disruptek | i am writing the stack trace for cps. |
20:20:15 | Zevv | no |
20:20:25 | Zevv | you're writing a stack trace for your particular eventqueue implementation |
20:20:30 | disruptek | pffbt |
20:20:37 | Zevv | and I wonder how you will make a stack trace |
20:20:38 | Zevv | because |
20:20:44 | * | tane quit (Quit: Leaving) |
20:20:45 | Zevv | because |
20:20:48 | Zevv | THERE IS NO STACK |
20:20:52 | disruptek | sshhh what did i tell you about being rude? |
20:20:54 | FromDiscord | <Clyybber> wheeze |
20:21:09 | Zevv | first you work hard to eliminate the stack, and then you go trace it |
20:21:11 | Zevv | utter bonkers |
20:21:22 | disruptek | yep. but useful for debuggers. |
20:21:37 | Zevv | you want bugs to debug? |
20:21:52 | FromDiscord | <Clyybber> lets make a bug factory |
20:23:20 | Zevv | lets write some java then |
20:23:56 | Zevv | public class BugFactoryGeneratorManager { |
20:26:06 | Zevv | this is weird |
20:26:11 | * | Vladar quit (Remote host closed the connection) |
20:27:18 | Zevv | how does that work. You do a gensym "env", which in Nim-land gives you "env_somenumber" |
20:27:38 | FromDiscord | <Clyybber> yeah |
20:27:46 | Zevv | But in C-land it's envcolonObjectType___manglemangle |
20:27:51 | Zevv | so the somenumber part is gone |
20:28:12 | Zevv | what is put in the mangling there? |
20:28:14 | disruptek | it's mangled to the hash, so that's a problem. |
20:28:17 | FromDiscord | <Clyybber> maybe it skips it if its not needed |
20:28:26 | disruptek | add a field with a rando name to fix the mangle. |
20:28:31 | FromDiscord | <Clyybber> but the gensym part isn't actually in the ident |
20:28:37 | FromDiscord | <Clyybber> its just the renderer being nice |
20:28:40 | Zevv | I did. I just ad a global inclreasing sequence number and its ok |
20:28:50 | Zevv | "nice" |
20:28:51 | disruptek | yeah, nim is trying to be clever. |
20:29:06 | Zevv | if you want to be nice, just start from one and increase. Or give them animal names or colors |
20:29:16 | Zevv | env_dog, env_green, env_apple |
20:29:38 | Zevv | so is this an actual Nim bug, or could this be triggered by questionable AST |
20:30:04 | disruptek | it's a nim bug. |
20:32:23 | * | krux02 joined #nim |
20:32:45 | * | maier joined #nim |
20:33:01 | bung | nim now has bug with implicitly retunning |
20:33:10 | FromDiscord | <Clyybber> nice |
20:33:33 | * | jjido joined #nim |
20:34:44 | bung | I fixed partial of jsgen , cgen not look deep into, due to code base larger than it. |
20:39:13 | bung | https://github.com/nim-lang/Nim/pull/15070 I think this one can be simplely merged |
20:39:14 | disbot | ➥ avoid #8231, bitwise move to mul,div |
20:41:49 | Zevv | so how does one typically benchmark a http server |
20:41:53 | Yardanico | wrk |
20:43:07 | Zevv | and what should the server serve |
20:43:46 | Zevv | hm wrk or ab is about the same |
20:43:47 | Yardanico | hello world |
20:44:01 | Zevv | there's not something that makes nice graphs of concurrent sessions for example |
20:44:16 | disruptek | no one cares about graphs. |
20:44:34 | FromDiscord | <Clyybber> graphs are for humans |
20:44:36 | FromDiscord | <Clyybber> fuck graphs |
20:45:35 | Zevv | ok, lighttpd 30K/sec, first CPS hack 40K/sec |
20:46:12 | Zevv | oh wait, I took out the echo, now its 85k/sec |
20:46:50 | FromDiscord | <Clyybber> damn boi |
20:47:04 | Zevv | 100k sec |
20:47:22 | Yardanico | now add threads :P |
20:47:36 | Zevv | naah that's for sissies |
20:47:40 | * | pbb quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
20:47:41 | Zevv | and this version is still very stupid with its epoll fds |
20:49:00 | * | NimBot joined #nim |
20:49:06 | * | pbb joined #nim |
20:49:42 | disruptek | well, until yourang is finished, this is what we have. |
20:50:19 | disruptek | there's a rust server using liburing iirc. |
20:50:46 | Zevv | I really don't need to squeeze every last bit |
20:50:52 | FromDiscord | <dom96> How does httpbeast compare? |
20:51:01 | Zevv | no idea. What is the simplest way to setup? |
20:51:07 | Zevv | and not fair because of threads of course, this is one thread |
20:51:15 | FromDiscord | <dom96> just compile without --threads:on |
20:51:37 | Zevv | can you whip me up a tiny program serving "hello, there!" on an url |
20:51:38 | disruptek | i already tol' you. |
20:51:44 | disruptek | it's not a fair comparison. |
20:51:52 | FromDiscord | <dom96> https://github.com/dom96/httpbeast/blob/master/tests/benchmark.nim |
20:51:56 | Zevv | fcourse not |
20:52:35 | FromDiscord | <dom96> That's what the techempower benchmarks use |
20:52:40 | disruptek | this dog is such an idiot. |
20:52:47 | Zevv | how do I set the port to be not 8 |
20:52:48 | Zevv | 80 |
20:53:11 | Zevv | dom96: ^ |
20:53:19 | disruptek | he's got acres and acres of wilderness to sniff around in and he wants to sit on my feet under the desk. |
20:53:19 | FromDiscord | <dom96> run(onRequest, Settings(port: ...)) IIRC |
20:53:41 | FromDiscord | <dom96> disruptek: he luvs you |
20:54:00 | FromDiscord | <exelotl> would it be possible (and/or sensible) to add the dynlib pragma to nimscript? |
20:54:00 | disruptek | if i stick him out there and close the door he just barks. |
20:55:14 | FromDiscord | <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:26 | FromDiscord | <Danny Fritz> sent a code paste, see https://play.nim-lang.org/#ix=2snR |
20:56:21 | Zevv | httpbeast 108k vs stupid cps 93k |
20:56:51 | Zevv | 20 concurrent connections |
20:56:56 | * | maier quit (Ping timeout: 265 seconds) |
20:57:02 | disruptek | the techempower list is nuts. |
20:57:15 | disruptek | surely we can move up this list. |
20:57:33 | FromDiscord | <dom96> sure we can. |
20:58:13 | Zevv | disruptek: I can push a stupid workaround for the codegen bug, but then it will never get fixed I guess |
20:58:20 | Zevv | or is clyybber reliable? |
20:58:32 | disruptek | he makes a lot of noise but not too many patches. |
20:58:45 | disruptek | better to just work around it. |
20:58:53 | Yardanico | D: |
20:58:53 | * | Senketsu quit (Read error: Connection reset by peer) |
20:58:53 | Zevv | and if you stick him out there and close the door, he just barks |
20:59:08 | disruptek | well, can you blame him? |
20:59:17 | disruptek | he's not really designed for the wilderness. |
20:59:24 | Yardanico | disruptek: https://cdn.betterttv.net/emote/55028cd2135896936880fdd7/3x |
20:59:57 | disruptek | cps is losing to httpbeast? |
21:00:02 | disruptek | i don't believe it. |
21:00:08 | disruptek | you 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:58 | Zevv | I have 0.91% time spent in nim |
21:07:01 | Zevv | the rest is in the linux kernel |
21:09:43 | FromDiscord | <dom96> Interesting. I didn't think you were expecting it to be faster. |
21:10:10 | Zevv | no that would be kind of rediculous |
21:10:38 | disruptek | sure, sure. |
21:10:40 | Zevv | I expected to be in the same ballpark |
21:11:03 | disruptek | where is your demo? |
21:11:08 | Zevv | the code? |
21:11:10 | Zevv | or the server? |
21:11:17 | disruptek | yeah? |
21:11:27 | Zevv | https://github.com/disruptek/cps/blob/master/stash/standalone_tcp_server.nim |
21:11:30 | FromDiscord | <Clyybber> hey hey |
21:11:31 | Zevv | but it's too stupid to look at |
21:11:34 | FromDiscord | <dom96> I mean, it is a simplified server implementation, right? |
21:11:43 | FromDiscord | <dom96> Like you're probably not reading all the headers etc. |
21:11:47 | FromDiscord | <Clyybber> I don't want to push stuff I don't understand yet :p |
21:11:47 | Zevv | sure not |
21:11:57 | Zevv | I don't read anything. I just send out data after reading a blob |
21:12:01 | Zevv | and hoping it was htp |
21:12:17 | FromDiscord | <dom96> ahh, even more simplified. |
21:12:19 | Zevv | clybber: that's what we do, works fine for me! |
21:12:26 | Zevv | dom96: sure |
21:12:32 | FromDiscord | <dom96> From my testing you can actually cheat wrk |
21:12:43 | FromDiscord | <dom96> by just sending it more data than it asks for |
21:12:47 | Zevv | hehe |
21:12:52 | FromDiscord | <dom96> it'll think you're responding to requests really quickly lol |
21:12:58 | FromDiscord | <Clyybber> counterbenchmark wrk |
21:13:12 | FromDiscord | <dom96> I was really tempted to do that but alas |
21:13:37 | Zevv | dom96: but really, it was just to see if it kind of makes sense to do it like this |
21:13:49 | Zevv | is httpbeast using nim async? |
21:14:01 | Zevv | i believe it is, right |
21:15:20 | * | krux02 quit (Remote host closed the connection) |
21:16:19 | disruptek | compare cpu and memory. |
21:17:01 | Zevv | cpu is 100% |
21:17:16 | Zevv | memory is not fair at all, I do no htp processing wahtsoever |
21:17:22 | Zevv | but c'mon |
21:18:02 | disruptek | surely there's a difference for equal amounts of traffic. |
21:18:17 | Zevv | apples and oranges |
21:18:21 | disruptek | yard did a test and there was no contest. |
21:18:26 | Zevv | ? |
21:18:28 | Yardanico | that's just async overhead |
21:18:33 | Yardanico | Zevv: did you compile them both with refc?> |
21:18:35 | Yardanico | try cps with arc |
21:18:36 | disruptek | exactly. |
21:18:40 | Zevv | both arc |
21:18:42 | Yardanico | uh |
21:18:46 | Yardanico | then it's not fair for httpbeast :D |
21:19:05 | FromDiscord | <dom96> httpbeast works with arc? lol |
21:19:11 | Yardanico | well it will probably work |
21:19:31 | Zevv | ok retrying without arc, just -d:danger |
21:19:52 | Zevv | yay we're twice as fast as httpbeast now |
21:19:59 | Yardanico | but async leaks with arc afaik - https://github.com/nim-lang/Nim/issues/15076 |
21:20:01 | disbot | ➥ Memory leaks with async (closure iterators?) under ORC ; snippet at 12https://play.nim-lang.org/#ix=2snX |
21:20:10 | Zevv | orc then |
21:20:13 | Yardanico | nos |
21:20:13 | disruptek | afaik cps doesn't leak in arc. |
21:20:15 | Yardanico | same with orc |
21:20:17 | FromDiscord | <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:17 | Yardanico | and it's not due to async |
21:20:25 | Yardanico | seems like closure iterators leak even with orc |
21:20:33 | Yardanico | I have a standalone repro in that issue |
21:20:36 | Zevv | then orc is baaaaad |
21:20:57 | FromDiscord | <Clyybber> don't insult an orc |
21:21:04 | disruptek | the first rule of fight club. |
21:21:04 | Zevv | I killed one this afternoon |
21:21:16 | Zevv | the things I do for love |
21:21:28 | Zevv | two were-rats, also |
21:21:34 | Zevv | but one was the blacksmiths son |
21:23:10 | FromDiscord | <Clyybber> what gaem |
21:23:32 | FromGitter | <ynfle> Is there an easy way to inject an space every *x* characters in a string? |
21:24:47 | FromDiscord | <Clyybber> sure, make a for loop |
21:25:21 | FromGitter | <ynfle> I meant like a strutils proc |
21:25:38 | Yardanico | well it's not hard to do manually :P and strutils covers common operations |
21:25:40 | Yardanico | not rare ones |
21:26:11 | Yardanico | if you create a proc like that, you might want to add it to https://nim-lang.org/docs/strmisc.html |
21:26:12 | FromDiscord | <Clyybber> there might be a proc in strutils thats generic enough to accomplish that, maybe some split join thing |
21:26:19 | FromDiscord | <Clyybber> but I don't know :p |
21:26:48 | Zevv | so, is there or is there no expanded-template-thingin macros? |
21:27:08 | Yardanico | getImplTransformed? :P |
21:27:08 | FromDiscord | <Clyybber> what |
21:27:14 | Yardanico | or getAst to just expand a template |
21:27:22 | Yardanico | if you "call" it |
21:27:44 | FromDiscord | <Clyybber> I think cps should be typed |
21:27:57 | FromDiscord | <Clyybber> or at least parts of it |
21:28:15 | Zevv | yeah, that was exactly what caused my earlier attempts to crash |
21:28:23 | Zevv | I needed two passes, one typed, one untyped |
21:28:27 | Zevv | and couldn't do it |
21:28:55 | Zevv | but disruptek was smarter then me |
21:28:56 | Zevv | and cheated |
21:29:14 | FromDiscord | <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:23 | Zevv | :) |
21:29:34 | Zevv | dom96: pulling your leg dude |
21:29:55 | Zevv | I also said "apples and oranges" |
21:30:08 | Zevv | but then again: you might want to redo your testing with arc to see if you can move up the charts a bit! |
21:30:25 | Yardanico | well, first of all - proper arc optimizations are not in stable releases |
21:31:13 | disruptek | it doesn't matter. |
21:31:21 | Yardanico | it does |
21:31:23 | FromDiscord | <Clyybber> depend on devel |
21:31:25 | disruptek | no one can use software that leaks as badly as async. |
21:31:27 | FromDiscord | <Clyybber> live with devel |
21:31:30 | FromDiscord | <Clyybber> die with devel |
21:31:33 | Yardanico | disruptek: it's not async' fault |
21:31:38 | Yardanico | as I already found out in the issue |
21:31:39 | disruptek | i don't care. |
21:31:40 | Yardanico | it's closure iterators |
21:32:04 | Yardanico | you 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:17 | disruptek | even if the memory consumption were stable, it's not the future. |
21:32:26 | FromDiscord | <dom96> In what way does async leak? |
21:32:32 | FromDiscord | <dom96> Do you mean with arc/orc? |
21:32:40 | FromDiscord | <Clyybber> I know I'm perfect, but I'm not bad |
21:32:47 | Yardanico | not async |
21:32:48 | FromDiscord | <slymilano> newish to nim.... is async/asyncdispatch not production ready on Nim? @disruptek |
21:32:51 | Yardanico | it's closure iteratos which leak |
21:32:53 | Yardanico | @slymilano it is |
21:32:58 | Yardanico | it's fully production ready |
21:33:41 | FromDiscord | <Clyybber> Yardanico: Will you make merch? I want "i know X is perfect, but it's not bad" on a tshirt |
21:33:44 | Yardanico | XD |
21:34:23 | FromDiscord | <exelotl> production ready except with arc/orc right (i.e. the problem is that arc/orc aren't production ready) |
21:34:25 | FromDiscord | <dom96> @slymilano async in Nim is quite likely one of the most tested aspects of Nim |
21:34:57 | disruptek | yeah, that's why cps had to be developed. |
21:35:17 | Zevv | nope, that was because iterators don't allow for making coroutines |
21:35:17 | Yardanico | disruptek cmon man |
21:35:36 | Zevv | and i want my corotines |
21:35:55 | disruptek | that's a good reason, too, but it's not the main reason. |
21:36:00 | Zevv | for me it is :) |
21:36:01 | FromDiscord | <exelotl> I'm excited for cps for zevv's reason :D |
21:36:13 | FromDiscord | <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:20 | Yardanico | yes, not yet |
21:36:25 | FromDiscord | <slymilano> aight thank you |
21:36:27 | FromDiscord | <exelotl> exactamundo |
21:36:38 | FromDiscord | <dom96> Zevv: https://nim-lang.org/docs/coro.html 👀 |
21:36:45 | Yardanico | that's kinda meh :P |
21:36:56 | Zevv | yeah, I know, but these have wrong semantics and lie on top of slow primitives |
21:36:57 | disruptek | for 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:10 | Zevv | also there's https://github.com/zevv/nimcoro/ |
21:37:12 | Zevv | which have Lua semantics |
21:37:18 | Zevv | but are also built on slow primitives :) |
21:37:25 | FromDiscord | <dom96> heh sure |
21:37:47 | FromDiscord | <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:53 | Zevv | I think one important promise for CPS would be that it allows for a good marriage between async and threading |
21:38:16 | Zevv | no, we just told the newcomers async is good to go, didn't we :) |
21:38:22 | Yardanico | I did, not disruptek :P |
21:38:27 | FromDiscord | <dom96> indeed |
21:38:31 | disruptek | obviously, cps is not ready. |
21:38:41 | disruptek | i would say arc is beta quality, at best. |
21:38:53 | disruptek | but it's not because the science is unsound. |
21:39:00 | Yardanico | disruptek: 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:11 | Yardanico | because right now every proc seems to need a while loop or something |
21:39:12 | disruptek | just like nim; it's a great idea, but the implementation leaves something to be desired. |
21:39:17 | disruptek | but that doesn't mean we abandon it. |
21:39:32 | Yardanico | and so we can adapt current nim async libs to cps |
21:39:33 | Zevv | Yardanico: Hmm good question |
21:39:35 | Yardanico | without rewriting everything |
21:39:38 | Yardanico | like httpclient |
21:39:40 | oddp | Sorry 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:47 | Yardanico | oddp: var mynewstr = str |
21:39:49 | Zevv | var s = s |
21:39:53 | Yardanico | or that |
21:39:58 | Zevv | it's less typing :) |
21:40:00 | Yardanico | it'll shadow the original variable though :) |
21:40:01 | FromDiscord | <Clyybber> Yardanico: Should be possible to make a translation macro or even make it compatible |
21:40:13 | oddp | Alright, thanks! |
21:40:21 | Yardanico | oddp: strings in nim are value types |
21:40:22 | disruptek | honestly, i think the idioms will be different enough that cps begets new libs. |
21:40:31 | Zevv | Yardanico: my hunch is that it would be possible to build the async api on top of cps |
21:40:45 | Zevv | but you can lose the Future |
21:40:58 | disruptek | pretty much true. |
21:40:58 | Yardanico | i don't want to lose my future |
21:41:07 | Zevv | wait until you're my age |
21:41:09 | disruptek | dude, your future is already toast. |
21:42:40 | FromDiscord | <Clyybber> toasts and parties |
21:48:34 | Zevv | disruptek: are you still working on anything now? |
21:48:49 | dulsi | I've push my smalltrek changes to github. It implements trophies/achievements using my gamerzilla project. |
21:49:03 | dulsi | Here are the achievements in GameHub. |
21:49:06 | dulsi | https://social.freegamedev.net/photo/c6e64ade-c0c9-4f00-aca5-c5b4cc46775f-2.png |
21:49:37 | dulsi | Here are the achievements displayed from web. |
21:49:39 | dulsi | https://social.freegamedev.net/photo/673a38a8-f29b-42c8-9eef-969e19e9a903-2.png |
21:49:53 | FromDiscord | <Clyybber> nice! |
21:50:00 | FromDiscord | <Clyybber> is smalltrek made using nico? |
21:50:11 | disruptek | i'm working on miso. |
21:50:13 | disruptek | what's up? |
21:52:51 | dulsi | Yes it uses nico. |
21:53:13 | FromDiscord | <Clyybber> cool |
21:53:28 | dulsi | Smalltrek is impbox's creation. I'm just modifying it. |
21:53:43 | Zevv | disruptek: not much up, I'm signing off. nice progress dudes |
21:54:03 | FromDiscord | <Clyybber> bb |
22:00:01 | disruptek | peace |
22:00:13 | * | solitudesf quit (Ping timeout: 264 seconds) |
22:01:00 | disruptek | rebuilding 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:46 | FromGitter | <gogolxdong> what is cps, and what's the difference between cps and csp? |
23:17:38 | FromDiscord | <Clyybber> the difference is a typo :p |
23:18:57 | disruptek | i'm confused on how dynamic bindsym is supposed to work. |
23:19:20 | disruptek | seems 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) |