00:00:02 | * | junland quit (Quit: %ZNC Disconnected%) |
00:01:03 | FromDiscord | <Varriount> How does it know what preprocessor to call? |
00:02:12 | shashlick | It uses CC |
00:02:16 | * | junland joined #nim |
00:04:18 | shashlick | What exactly are you trying to wrap |
00:05:41 | * | couven92 joined #nim |
00:05:54 | * | fredrikhr quit (Disconnected by services) |
00:06:00 | * | couven92 is now known as fredrikhr |
00:07:17 | FromDiscord | <Varriount> So if `$CC` was blank? |
00:07:33 | FromDiscord | <Varriount> Because I'm on Windows, and that's not a standard environment variable? |
00:08:34 | shashlick | But default it calls gcc |
00:08:39 | shashlick | See getters |
00:10:29 | FromDiscord | <Varriount> Well, I set CC to clang, still no change. This is odd |
00:12:58 | shashlick | Ok what's your command line? And what's the output |
00:13:08 | shashlick | Is -d not showing any output |
00:13:24 | FromDiscord | <Varriount> .\toast -d -p ../../winim-contrib/output/UIAutomation.alt.h |
00:13:44 | shashlick | You need -n to generate Nim output |
00:13:47 | * | oddp quit (Ping timeout: 240 seconds) |
00:13:59 | shashlick | That should just print out the preprocessed output |
00:14:05 | * | oculux joined #nim |
00:14:30 | FromDiscord | <Varriount> Well, It's not generating preprocessed output either. Here's the command line and stack trace: https://gist.github.com/Varriount/c3f8a045d816bb09fbc51e3a8a1bd2b9 |
00:15:05 | shashlick | So if you aren't seeing any output with -p there's an issue with preprocessing |
00:16:53 | FromDiscord | <tomck> sent a code paste, see https://play.nim-lang.org/#ix=2s1L |
00:20:02 | FromDiscord | <Varriount> @tomck Put `: untyped` after each parameter declaration in `accessField` |
00:20:20 | FromDiscord | <tomck> same issue |
00:22:29 | FromDiscord | <tomck> ohhhh no that's mb, my template was wrong - untyped works, that's great thanks! |
00:25:29 | shashlick | I need to try this |
00:25:34 | shashlick | Where can I find that header |
00:25:41 | disruptek | tomck: what lang are you coming from? |
00:25:43 | shashlick | That stack trace is useless |
00:26:00 | shashlick | @varriount only suggestion is to give full path to file |
00:27:09 | FromDiscord | <Varriount> shashlick: Found it. I had to change the call to `sanitizePath` in line 322 of getters.nim to `sanitizePath(noQuote=true)` |
00:27:49 | shashlick | Goody |
00:29:04 | FromDiscord | <tomck> disruptek: a mixture haha, zig/terra/rust are the ones i've used with most similar metaprogramming to nim, use c/c++ a lot too ofc, and slowly crush my soul day by day w/ javascript |
00:33:53 | Yardanico | I don't think zig has macros at all though |
00:34:02 | Yardanico | it has compile-time features, yes, but not macros :P |
00:34:21 | Prestige | @Elegant Beef I'm attempting to get the types of arguments of a callback proc and pass them to a hashing function, basically: https://github.com/avahe-kellenberger/EasyECS/blob/macro-testing/src/EasyECS/registry.nim#L68 |
00:35:06 | Prestige | Code doesn't work here, trying to figure out why & how to get around the problem |
00:35:16 | FromDiscord | <Varriount> shashlick: Interesting... I tested it on a header file with COM definitions, and the preprocessor emitted the C definitions rather than the C++ ones. Normally you have to define a specific macro for that to happen. |
00:35:38 | shashlick | That's cause it's running in C mode by default |
00:35:42 | FromDiscord | <tomck> Yardanico: not ast-level, it has constexpr if & (more importantly) a constexpr `for` loop though, which lets you loop over a comptime list & 'generate' a line of code for each value |
00:35:46 | shashlick | Toast doesn't know c++ |
00:35:54 | Prestige | It's the same thing this template is doing: https://github.com/yglukhov/ecs/blob/master/ecs.nim#L73 |
00:36:15 | shashlick | Tree sitter can parse c++ but toast doesn't know what to do with it |
00:37:09 | FromDiscord | <Varriount> Ah, I see. Those blocks are guarded by a `if !defined(__cplusplus)... condition` |
00:38:29 | disruptek | tomck: can you compare nim to those langs for us? |
00:39:09 | Yardanico | disruptek: use @ to ping on discord |
00:39:12 | Yardanico | @tomck ^ :P |
00:39:31 | disruptek | eh.. if you want a ping from me, you'll switch to irc. |
00:39:36 | Yardanico | meh |
00:39:39 | FromDiscord | <Rika> lol |
00:39:46 | Yardanico | don't be so elitist :P |
00:39:58 | disruptek | nothing elitist about it. |
00:40:16 | FromDiscord | <Rika> just disruptek being disruptek i guess |
00:40:36 | FromDiscord | <Varriount> shashlick: Can `symOverride` be used to skip defines that one doesn't need (like header include-once guards)? |
00:42:09 | FromDiscord | <tomck> sent a long message, see http://ix.io/2s1O |
00:42:14 | * | enthus1ast quit (Ping timeout: 256 seconds) |
00:42:44 | FromDiscord | <tomck> definitely check out terra if you haven't already, it's the most interesting one of the 3 |
00:42:53 | FromDiscord | <tomck> http://terralang.org/http://terralang.org/ |
00:43:07 | Yardanico | @tomck I'd have to disagree about rust a bit - proc macros here operate on tokens, not AST nodes, which is quite different IMO |
00:43:24 | FromDiscord | <Varriount> tomk: For zig, what do you mean about compile time introspection? |
00:43:28 | FromDiscord | <tomck> oh, what's the (practical) difference? i haven't used them too much? |
00:43:38 | FromDiscord | <Varriount> Or rather, how does it do it well? |
00:44:08 | FromDiscord | <Rika> tokens arent processed into an ast tree yet i assume |
00:44:28 | Yardanico | yeah, exactly, you have less information about the code you're being given to a macro |
00:44:51 | Yardanico | with AST like in nim you can even inspect the types/procedures - get their definitions, etc |
00:44:56 | Yardanico | I mean with ast macros |
00:45:08 | FromDiscord | <Varriount> But more flexibility I presume, if the compiler supports it. |
00:45:18 | FromDiscord | <tomck> @Varriount like you can run arbitrary zig code at compile time to generate constant values based off of stuff, i haven't used it in a while but you can do stuff like generate an int type with N bits, where N is the number of ordinals in an enum you defined earlier or something silly |
00:45:32 | Yardanico | @tomck that's possible in Nim too of course |
00:45:40 | Yardanico | nim has a VM in the compiler for running Nim at compile-time |
00:45:47 | FromDiscord | <Varriount> tomck: Ah. Nim can do that. I wouldn't call it easy necessarily. |
00:45:58 | FromDiscord | <tomck> you can probably do a similar thing in nim, but it feels better integrated into zig, can label stuff as 'comptime' to enforce that it runs at compile time |
00:45:58 | Yardanico | nim doesn't have arbitrary-size integers, but you can do a lot of stuff with "static" too |
00:46:05 | Yardanico | @tomck "const" in nim :) |
00:46:12 | Yardanico | and {.compileTime.} for procs |
00:46:12 | FromDiscord | <Varriount> It's not that the generation is hard, it's analyzing the AST |
00:46:28 | FromDiscord | <tomck> oh cool, i didn't know that |
00:46:43 | FromDiscord | <Rika> const a = static: if you need a block of code to run statically w/ a return type i assume... |
00:46:51 | Yardanico | most of the stdlib works at compile-time too |
00:46:55 | FromDiscord | <tomck> rust proc macros seem to be able to do pretty bonkers things, i've only ever used them though, they're a huge pain to write |
00:47:00 | Yardanico | e.g. the `json` module |
00:47:12 | FromDiscord | <tomck> ahhhhhhhhhhh interesting, that's super cookl |
00:47:18 | FromDiscord | <Rika> nim macros does a fucktonne of things |
00:47:27 | FromDiscord | <tomck> what happens when nim transitions to arc? does the stdlib break? |
00:47:31 | FromDiscord | <Rika> someone tried to a macro only discord api wrapper in nim afaik lol |
00:47:32 | FromDiscord | <Rika> no |
00:47:33 | Yardanico | @tomck well, nim macros can do literally anything as long as they're given code with valid nim syntax :P |
00:47:37 | disruptek | tomck: interesting. looks like terra runs in a standard luajit binary, is that right? |
00:47:37 | FromDiscord | <Rika> arc should be plug and play |
00:47:53 | Yardanico | @tomck orc will be the default, and stdlib will work just fine |
00:47:59 | FromDiscord | <tomck> b/c i'd use nim for games if it didn't have a gc |
00:48:08 | disruptek | well, it doesn't. |
00:48:09 | FromDiscord | <tomck> will stdlib all work normally with arc? |
00:48:11 | disruptek | --gc:none |
00:48:14 | Yardanico | of course @tomck |
00:48:22 | Yardanico | ORC will become the default and you could always use ARC if you are sure you don't have cycles |
00:48:22 | FromDiscord | <tomck> well yeah, but then you're missing half the lang |
00:48:28 | disruptek | how do you figure? |
00:48:46 | Yardanico | even the default nim GC isn't really bad for games or other stuff IMO |
00:48:50 | FromDiscord | <tomck> like how rust has 'unsafe', but b/c all pointers are basically 'restrict' you hit UB way too quick, so yeah you *can* write unsafe code but not really like in c/c++ |
00:48:52 | Yardanico | it's been tested and optimized for years as well :) |
00:49:33 | FromDiscord | <tomck> yeah nim seems mature enough, don't run into compiler segfaults like you do in zig lol |
00:49:40 | Yardanico | well they are there :P |
00:49:44 | FromDiscord | <Rika> ~~we still run into them~~ |
00:49:44 | disruptek | the default gc isn't a stop-the-world variety, so it's generally workable for games. but arc offers even better latency. |
00:49:46 | FromDiscord | <Rika> just not really often |
00:49:46 | FromDiscord | <tomck> disruptek: it's not a standard luajit binary, so you can't use love2d with terra unforunately |
00:49:58 | FromDiscord | <tomck> (or maybe you can with a bit of faff?) |
00:50:38 | FromDiscord | <tomck> i have no idea about gc's, i just know that stutters in games make me feel sick |
00:50:48 | Yardanico | well refc doesn't really have stutters :P |
00:50:50 | FromDiscord | <Rika> not all gcs add stutter to a game |
00:51:00 | FromDiscord | <tomck> i saw nim has a soft-realtime gc, but its max pause was 2ms, which is... somewhat high for games |
00:51:18 | FromDiscord | <Rika> thats max settable pause |
00:51:25 | FromDiscord | <Rika> you *dont need to* set it that high |
00:51:32 | Yardanico | @tomck you can configure nim gc easily |
00:51:34 | FromDiscord | <tomck> I probably *wouldn't* be a problem, i just don't want to develop an entire game in nim then get fucked when i realise i have to restructure everything to 'tune the gc' |
00:51:39 | Yardanico | e.g. in a game loop let it run when you have free "time" |
00:51:45 | FromDiscord | <tomck> @Rika i thought that was the min pause? |
00:52:01 | FromDiscord | <Rika> you just said it was "max pause" in the message |
00:52:09 | Yardanico | https://nim-lang.org/docs/gc.html see soft realtime support here |
00:52:31 | FromDiscord | <tomck> oh i think it's 1ms, this is what i'm referencing: ↵> Tests show that a 1ms max pause time will be met in almost all cases on modern CPUs |
00:52:52 | FromDiscord | <tomck> which is probably fine, but... eh |
00:52:53 | Yardanico | there's a GC_step which should be very good for games |
00:52:57 | FromDiscord | <Rika> that's still 7 milliseconds of time if you're aiming for 120fps |
00:53:08 | Yardanico | so you can run all your code and then run the GC if you have "free" time left |
00:53:15 | Yardanico | in game loop |
00:53:37 | FromDiscord | <tomck> yardanico: yeah but it still might pause for 1ms |
00:53:59 | FromDiscord | <Rika> are you programming a rhythm game or something |
00:53:59 | disruptek | you wouldn't use --gc:refc for a game, anyway. |
00:54:02 | FromDiscord | <Rika> or a shooter |
00:54:04 | Yardanico | disruptek: you could easily |
00:54:08 | Yardanico | it would work nicely in most cases |
00:54:09 | disruptek | but you wouldn't. |
00:54:13 | Yardanico | @tomck well anyway we have orc |
00:54:21 | Yardanico | (orc is arc with a cycle collector) |
00:54:29 | Yardanico | orc will become the default and everyone will eventually forget about refc :P |
00:54:48 | FromDiscord | <tomck> no, i just hate stutters in games |
00:54:52 | Yardanico | i do too |
00:55:01 | FromDiscord | <tomck> i'd rather 30fps than a stutter |
00:55:07 | FromDiscord | <tomck> ...maybe |
00:55:10 | Yardanico | well GCs aren't really bad for games |
00:55:14 | FromDiscord | <Rika> 30fps is 32 milliseconds of delay afaik |
00:55:24 | Yardanico | e.g. there's a game called osu!, it's far from being graphics-intensive but it's a rhymth game |
00:55:29 | FromDiscord | <tomck> yeah i also dont want 30fps;) |
00:55:32 | Yardanico | and it's written in C# and still runs without stutters |
00:55:40 | FromDiscord | <Rika> 60fps is 16 milliseconds of delay |
00:55:43 | Yardanico | because stuttering in a rhymth game is a no-no |
00:55:47 | FromDiscord | <tomck> 2s kid's calling |
00:55:56 | FromDiscord | <Rika> it has been 2 seconds xd |
00:56:00 | FromDiscord | <Rika> (i kid) |
00:57:09 | Yardanico | @tomck for some info, you can read https://forum.nim-lang.org/t/6549 https://forum.nim-lang.org/t/5734 https://nim-lang.org/docs/destructors.html |
00:57:58 | * | lritter quit (Quit: Leaving) |
01:02:07 | * | disruptek is being spammed by some knucklehead trying to auth as him. |
01:03:25 | FromDiscord | <Rika> lol |
01:03:57 | FromDiscord | <tomck> disruptek: what, you are? who would do that? |
01:04:24 | disruptek | 94.236.236.2 |
01:04:26 | FromDiscord | <tomck> on irc? do people do that? |
01:04:30 | Yardanico | almost never :) |
01:04:33 | disruptek | i guess. |
01:04:34 | FromDiscord | <Rika> 1337 h4xx0r5 |
01:05:30 | FromDiscord | <Rika> ~~regards osu, i'm surprised at the frame times that game can attain like what, 0.35ms on C#?~~ |
01:09:11 | FromDiscord | <tomck> hmm, interesting - how |
01:09:15 | FromDiscord | <tomck> is it using unity? |
01:09:17 | Yardanico | no |
01:09:19 | Yardanico | custom engine |
01:09:29 | Yardanico | and it's being rewritten (open source) to a new version |
01:09:32 | Yardanico | which is still very fast |
01:09:38 | FromDiscord | <tomck> using smth like opengl or xna? |
01:09:41 | Yardanico | OpenTK |
01:10:05 | FromDiscord | <tomck> hmm interesting, @Rika you have a good machine? |
01:10:57 | FromDiscord | <tomck> gotta say when i used to play osu on my trash £100 computer it always seemed very zippy |
01:11:03 | FromDiscord | <Rika> yeah, kinda, ryzen 2700x or smth |
01:11:32 | FromDiscord | <tomck> do we have access to the current source? |
01:11:34 | FromDiscord | <Rika> no |
01:11:41 | FromDiscord | <Rika> it's closed, for stable |
01:11:45 | FromDiscord | <Rika> but lazer is open |
01:12:29 | FromDiscord | <tomck> hmm, do you think they're doing the old 'preallocate everything so the GC never hits & ignore the fact that we should've used c' trick |
01:12:50 | FromDiscord | <tomck> i've heard of a worrying number of people doing that just so they can use c#/java/whatever |
01:12:58 | disruptek | mm just isn't a hard problem, honestly. |
01:12:59 | FromDiscord | <tomck> can only assume it's horrible |
01:13:08 | FromDiscord | <Rika> well if theyre doing that then it's working pretty well |
01:15:43 | FromDiscord | <Elegant Beef> My favourite thing is minecraft benchmarks when talking about GC, you can never see the GC :D https://media.discordapp.net/attachments/371759389889003532/734216847930687528/unknown.png |
01:16:57 | FromDiscord | <Rika> lol |
01:17:34 | FromDiscord | <tomck> does MC do much gc tuning? you'd have to imagine so |
01:17:57 | FromDiscord | <Rika> probably but it'll still be obvious since java 😛 |
01:18:40 | FromDiscord | <tomck> fair, minecraft runs like absolute horse shit, i almost can't believe it's so popular |
01:18:56 | FromDiscord | <tomck> guess people don't care - did it get re-written for consoles? or is it really laggy there too? |
01:18:56 | FromDiscord | <Elegant Beef> i mean it runs at 200+ fps in that benchmark |
01:19:02 | Yardanico | bedrock edition exists @tomck |
01:19:05 | FromDiscord | <Elegant Beef> They use bedrock |
01:19:06 | FromDiscord | <Elegant Beef> which is C++ |
01:19:17 | Yardanico | they have shared MCPE/Windows 10 edition code nowaday |
01:19:18 | Yardanico | s |
01:19:19 | FromDiscord | <tomck> ohhh, and java edition is desktop only? |
01:19:22 | Yardanico | yes |
01:19:28 | Yardanico | you can run bedrock edition on Linux too btw |
01:19:31 | FromDiscord | <Elegant Beef> But the modding scene for bedrock is non existant so isnt popular |
01:19:31 | FromDiscord | <Rika> bedrock is windows only 🙂 |
01:19:34 | Yardanico | it's not |
01:19:35 | FromDiscord | <Rika> wait rly? |
01:19:38 | FromDiscord | <Rika> interesting |
01:19:40 | Yardanico | Well, unofficially, yes |
01:19:43 | FromDiscord | <tomck> can you mod bedrock? |
01:19:48 | Yardanico | basically MCPE has x86 build which is still bedrock |
01:19:53 | Yardanico | and with a custom launcher you can play it |
01:19:56 | FromDiscord | <Rika> lol |
01:19:57 | FromDiscord | <Elegant Beef> Well the linux method is running an android emulator afaik |
01:19:59 | Yardanico | I tried and it works |
01:20:05 | Yardanico | @Elegant no |
01:20:06 | Yardanico | it's native |
01:20:09 | FromDiscord | <Elegant Beef> Ah |
01:20:18 | Yardanico | I even got it to connect my Microsoft account for online play and stuff |
01:20:23 | FromDiscord | <Elegant Beef> I seen someone say "It's running" and their solution was android launcher |
01:20:29 | FromDiscord | <tomck> lol, sounds like it's windows only |
01:20:52 | Yardanico | bedrock? android, ios, windows, linux (unoficially) |
01:20:59 | FromDiscord | <tomck> why does nobody do gamedev for linux in general? |
01:21:03 | FromDiscord | <tomck> is support just a nightmare? |
01:21:07 | Yardanico | because much less market share |
01:21:08 | FromDiscord | <Elegant Beef> Small population |
01:21:19 | Yardanico | "not worth the money" |
01:21:19 | FromDiscord | <Elegant Beef> More tech savy people, who are more likely to make reports |
01:21:35 | FromDiscord | <Elegant Beef> so you get `70% of the reports from 1% of the market` |
01:21:37 | FromDiscord | <tomck> yeah but you can do cross platform dev at seemingly no cost, or is it actually a huge cost once you get into the problems it causes? |
01:21:46 | Yardanico | depends on the engine/etc |
01:21:49 | FromDiscord | <Elegant Beef> I mean bedrock is ported everywhere |
01:21:51 | Yardanico | Linux is very diverse, yes |
01:21:54 | FromDiscord | <tomck> tbf they've probably also got ridiculous setups |
01:21:56 | FromDiscord | <Elegant Beef> You'd have to imagine it'd be simple to port to linux |
01:22:02 | Yardanico | but most linux people still just run ubuntu |
01:22:06 | Yardanico | or arch/manjaro |
01:22:11 | Yardanico | (you can check steam linux stats) |
01:22:39 | FromDiscord | <tomck> i'm running i3, bet you an official port would open in a tiny 32x32 window or something like that |
01:22:45 | Yardanico | not really |
01:22:55 | FromDiscord | <Elegant Beef> Nah that's never the issue |
01:22:57 | Yardanico | I've used tiling WMs for over a year now and native ports work just fine |
01:23:00 | FromDiscord | <tomck> i hear people whining about 'sound on linux is broken' when it comes to gamedev, is that the case? never usedi t |
01:23:11 | FromDiscord | <Elegant Beef> Eh people dislike pulse, and jack is hard |
01:23:11 | Yardanico | well we maybe can go to #nim-offtopic :) |
01:23:14 | Yardanico | #offtopic on IRC |
01:23:14 | FromDiscord | <Rika> not really no |
01:23:16 | Yardanico | on discord* |
01:27:00 | * | apahl quit (Ping timeout: 256 seconds) |
01:27:50 | * | RaycatWhoDat quit (Remote host closed the connection) |
01:28:34 | * | apahl joined #nim |
01:39:32 | ForumUpdaterBot | New thread by Tmsa04: Map change, see https://forum.nim-lang.org/t/6557 |
01:43:40 | FromDiscord | <Rika> That looks like a bug :EyesShaking: |
01:44:31 | Yardanico | well it's not |
01:44:38 | Yardanico | maybe it is, but I think no :P |
01:44:47 | Yardanico | it's a side effect of most procs in options module becoming inline |
01:45:03 | Yardanico | closure proc is incompatible with a inline proc it seems |
01:47:32 | FromDiscord | <Rika> Oof |
02:10:13 | FromDiscord | <Rika> shashlick: okay so i looked at the plugin start code, and (was gonna put code to change here but its long so ill just PR it then i guess T_T) |
02:10:24 | shashlick | Cool |
02:10:36 | FromDiscord | <Rika> (this is with regards the binary monitor thread thing) |
02:13:06 | * | endragor joined #nim |
02:18:05 | * | muffindrake quit (Ping timeout: 272 seconds) |
02:18:43 | * | krux02_ quit (Remote host closed the connection) |
02:19:19 | * | muffindrake joined #nim |
02:20:02 | FromDiscord | <Rika> shashlick: i only need to run `nimble test` to test right, or is there anything else i need to do? |
02:24:57 | voltist | Is anyone here familiar with the workings of the FITS file format? |
02:25:57 | * | skrylar[m] looks up what this is |
02:26:41 | FromDiscord | <Vindaar> @voltist: surprise, surprise I am 😄 really gotta go to bed now |
02:26:53 | FromDiscord | <Vindaar> but there is a nim wrapper I think |
02:27:21 | FromDiscord | <Vindaar> https://github.com/ziotom78/nimcfitsio |
02:27:24 | voltist | Oh well, maybe we can chat about this later then :) |
02:27:25 | skrylar[m] | archival format for scientific data? |
02:27:29 | voltist | I'll have a look at that wrapper |
02:27:50 | skrylar[m] | seems to be very well documented too https://fits.gsfc.nasa.gov/standard40/fits_standard40aa-le.pdf |
02:28:09 | FromDiscord | <Vindaar> @skrylar yeah, mostly used in astronomy though |
02:28:27 | voltist | skrylar[m]: Yeah I'm looking at it for an astronomy use-case |
02:28:57 | FromDiscord | <Vindaar> in any case, good night 🙂 |
02:29:01 | voltist | The documentation is good if the software you use to take images behaves well |
02:29:22 | voltist | @Vindaar You 2 |
02:29:49 | voltist | Fun fact: Most astronomical software doesn't behave well |
02:30:34 | skrylar[m] | of course it doesn't :) |
02:32:25 | voltist | It would be nice if other members of my local astronomical society supported the use of free software, because there are some nice open source alternatives |
02:32:44 | skrylar[m] | have sometimes wondered why software doesn't just rely on dump formats and then give people a txt on how the dump works |
02:33:36 | skrylar[m] | then at least someone who cares enough to do interchange formats properly can do so separately, instead of everyone bungling interchange formats |
02:35:28 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
02:36:43 | FromDiscord | <Rika> shashlick: i think you misremembered when you said -d:binary only opened a thread and closed after running |
02:39:44 | FromDiscord | <Rika> or maybe my code is wrong... |
02:40:06 | * | nikita_ joined #nim |
02:42:46 | FromDiscord | <Rika> ah no yeah the thread still handles loads with -d:binary |
02:43:14 | * | nikita` quit (Ping timeout: 256 seconds) |
02:53:43 | shashlick | Just nimble test yes |
02:53:54 | shashlick | It tests binary mode too |
02:54:27 | shashlick | Maybe if it's not compiled with threads, you force single thread binary mode |
02:55:19 | shashlick | But ya, binary mode doesn't justify using a thread |
02:55:28 | shashlick | Might just call that as a proc |
02:56:28 | FromDiscord | <Rika> well no the issue is that you're handling extra loads (after start) with the monitor proc |
02:56:41 | FromDiscord | <Rika> i dont know how to fix that yet |
03:00:00 | shashlick | But in binary mode it only loads then exits the thread |
03:00:12 | shashlick | So it's pointless to spawn a thread for that |
03:00:38 | shashlick | Anyway, you might be better served to see if the package is useful before trying to improve the binary mode thing |
03:01:43 | FromDiscord | <Rika> i tried removing the thread and had issues with the plugin unload-load in tmain |
03:11:13 | FromDiscord | <Varriount> @Rika What are you working on? |
03:12:15 | shashlick | Ok let me see |
03:12:39 | FromDiscord | <Rika> https://github.com/genotrance/plugins, trying to remove the reliance of threads when -d:binary is defined (since it's not needed) |
03:14:50 | FromDiscord | <Rika> right now i dont know what to do about pload (it works differently to punload which i'd say is weird) |
03:16:53 | FromDiscord | <Varriount> Plugins are hard |
03:17:26 | FromDiscord | <Varriount> Or rather, it's hard to make them seamless, when you're working with a statically compiled language. |
03:17:33 | FromDiscord | <Rika> yeah |
03:20:22 | shashlick | okay so Rika, you basically don't want threads in binary mode right? |
03:20:34 | shashlick | so you will prebuild your dlls |
03:20:52 | FromDiscord | <Rika> yes |
03:21:24 | FromDiscord | <Rika> but loading midway in the program should still be possible i hope? |
03:21:44 | FromDiscord | <Rika> waaaait |
03:21:48 | FromDiscord | <Rika> one moment, idea |
03:22:16 | shashlick | so the way this system works is that it loads the plugins on startup |
03:22:21 | FromDiscord | <Rika> yes |
03:30:49 | shashlick | Rika - it's a minor code change - pushing a branch |
03:31:45 | shashlick | are you okay if we build with threads but don't actually spawn a thread |
03:31:53 | shashlick | cause i can retain the channels |
03:32:05 | shashlick | without threads, will need an alternate way to communicate loading |
03:32:33 | FromDiscord | <Rika> ah yeah channels needs the threads switch |
03:32:34 | FromDiscord | <Rika> hmm |
03:32:48 | FromDiscord | <Rika> dunno what effect that has on my program but sure okay |
03:36:11 | shashlick | i just pushed a branch called binary - it still needs threads but doesn't create a monitoring thread |
03:36:17 | shashlick | quick and lazy |
03:36:35 | shashlick | might need an alternative to communicate dlls to load instead of channels |
03:36:45 | shashlick | to get rid of threads altogether |
03:36:59 | disruptek | rika: what are you working on? |
03:37:20 | FromDiscord | <Rika> ill look into it |
03:37:28 | FromDiscord | <Rika> disruptek: still the manga reading program lol |
03:37:29 | disruptek | you're not sure? |
03:37:31 | disruptek | oh. |
03:37:53 | disruptek | got a link? |
03:38:32 | FromDiscord | <Rika> not open right now, still preparing |
03:38:50 | shashlick | How do you intend using plugins |
03:38:57 | FromDiscord | <Rika> for the sources |
03:39:02 | FromDiscord | <slymilano> @dom96 @Varriount here's the smaller proof of concept that possibly shows a bug with Nim's asyncCheck. It works normally in windows and linux -- but fails on mac: https://github.com/sergiotapia/async-check |
03:42:27 | disruptek | this hax0r is persistent. |
03:43:00 | disruptek | why would anyone want to login to irc as me? |
03:43:10 | disruptek | i can't think of anyone with a worse reputation. |
03:43:39 | disruptek | maybe they want to rehabilitate my irc cred. |
03:45:30 | FromDiscord | <Rika> shashlick: okay so the change you just pushed was basically the same as mine, the issue is that when you call pload, nothing gets loaded and you're stuck at syncPlugins |
03:45:42 | FromDiscord | <Rika> also probably why your CI right now is hanging |
03:46:10 | shashlick | that's cause none of the plugins are compiled so there's nothing loaded |
03:46:27 | shashlick | you need to compile them like the plugin system would |
03:46:53 | FromDiscord | <Rika> let me try understanding this first wait sorry |
03:46:53 | shashlick | nim c --app:lib path/to/plg.nim |
03:46:58 | shashlick | no problem |
03:46:59 | FromDiscord | <Rika> i know |
03:47:05 | FromDiscord | <Rika> theyre already compiled |
03:47:37 | FromDiscord | <Rika> ok so loadPlugins is basically "recompile and load again"? |
03:48:54 | FromDiscord | <Rika> i dont get it wait |
03:49:17 | * | audiophile_ joined #nim |
03:54:13 | FromDiscord | <Rika> ill do something else for now, maybe ill understand if i leave it for now |
03:55:04 | shashlick | i see that the plugins load and run for some time then just hang - will debug that |
03:56:15 | * | apahl quit (Ping timeout: 272 seconds) |
03:56:47 | * | apahl joined #nim |
03:57:35 | shashlick | ah yes - pload won't do anything since there's no background thread anymore |
03:58:17 | shashlick | so binary mode still needs the background thread to load/unload stuff |
03:58:31 | shashlick | it just doesn't monitor nim file for changes or compiles them |
03:58:50 | shashlick | changing binary mode to run everything in a single thread might be non-trivial |
04:01:36 | FromDiscord | <Varriount> @slymilano Thanks! |
04:06:02 | * | supakeen quit (Quit: WeeChat 2.8) |
04:06:31 | FromDiscord | <slymilano> hope it helps, and double hope i'm the one with a typo somewhere lol |
04:06:38 | * | supakeen joined #nim |
04:11:06 | Zevv | Hey mratsim: https://medium.com/swlh/optimizing-ray-tracing-in-haskell-3dc412fff20a |
04:24:41 | * | Zectbumo quit (Remote host closed the connection) |
04:26:09 | FromDiscord | <Rika> shashlick: exactly! thats what i mean |
04:28:01 | shashlick | okay cool |
04:28:31 | * | theelous3 quit (Read error: Connection reset by peer) |
04:28:42 | shashlick | do you expect to unload/load plugins |
04:28:49 | shashlick | or just load in the beginning |
04:29:46 | FromDiscord | <Rika> well, for now, i assume it's only on the beginning so at the binary branch's current state its fine |
04:30:03 | FromDiscord | <Rika> but maybe in the future i will want to load and unload? but that's the future |
04:30:09 | FromDiscord | <Rika> i'll pester you again when i do i guess |
04:30:14 | FromDiscord | <Rika> for now, this is fine i suppose |
04:30:34 | shashlick | okay I'll think about it and see if there's a better way to do this single threaded |
04:30:45 | shashlick | but i still don't get what's the issue with the background thread in your use case |
04:32:11 | shashlick | is there a way to say `xyz = abc` and then wherever xyz shows up, Nim replaces it with abc |
04:33:39 | shashlick | like you can in C with `#define xyz abc` |
04:45:15 | FromDiscord | <Rika> well my concern may be misplaced |
04:45:31 | FromDiscord | <Rika> so maybe dont invest too much time into this because i might be wrong with my concern |
04:45:47 | FromDiscord | <Rika> which is that would this be able to run in a single core computer? |
04:46:43 | shashlick | ya sure why not - the OS should figure out which thread gets to run for how long |
04:48:06 | FromDiscord | <Rika> i see |
04:49:13 | shashlick | and the monitor thread sleeps for the most part so it gives up control |
04:49:55 | FromDiscord | <Rika> okay so there isnt much issue with spawning threads other than "it takes long to spawn one and tear one down"? |
04:50:42 | shashlick | it can be problematic if its done a lot but in this specific case, the monitor thread is spawned at startup and just sits around |
04:51:07 | FromDiscord | <Rika> yeah okay thanks so maybe i shouldnt worry about this then |
04:51:57 | shashlick | i'm open to feedback, see how it goes and let me know |
04:52:25 | shashlick | but i'm much more curious to see if it provides capabilities that make it worth it |
04:52:39 | shashlick | i know it was super useful for feud |
04:53:11 | * | audiophile_ quit (Quit: Default Quit Message) |
04:54:32 | FromDiscord | <Rika> i dont see how it wouldnt; well maybe it might die trying to send megabytes of data from one plugin to another but oh well |
04:55:18 | shashlick | everything is in the same memory space so there really shouldn't need to be much transferring going on |
04:55:25 | shashlick | at least with boehm, no idea what arc requires yet |
04:57:32 | FromDiscord | <Rika> well my program is still far from done so it might take a few months til i give any useful feedback |
04:58:06 | disruptek | months? |
04:58:24 | FromDiscord | <Rika> i'm slow |
04:58:27 | FromDiscord | <Rika> this program is massive |
04:58:35 | disruptek | massive? |
04:58:44 | FromDiscord | <Rika> lol |
04:59:09 | shashlick | disruptek is too prolific to relate to us mere mortals |
04:59:34 | FromDiscord | <Rika> disruptek is super quick at coding, i mean look at where incre-- |
04:59:37 | disruptek | i've been stuck on the same bug all day. |
05:00:19 | disruptek | how big is `massive`, though? |
05:02:33 | FromDiscord | <Rika> idk really, i'm still thinking out the plugin api for my program and all i've finished is the model |
05:04:08 | * | marnix joined #nim |
05:04:43 | shashlick | i've been pseudo stuck as well |
05:04:50 | shashlick | stuff just takes so long to get right |
05:06:46 | FromDiscord | <Rika> sometimes i wonder why i'm a programmer 🙃 |
05:12:09 | disruptek | i wonder that about you daily. |
05:13:01 | FromDiscord | <Rika> oof lol |
05:16:15 | * | narimiran joined #nim |
05:28:45 | * | disruptek <Unknown user (via SASL):94.236.236.2> failed to login to disruptek. There have been 39 failed login attempts since your last successful login. |
05:29:05 | disruptek | holy shit, i know why this is broken. |
05:29:24 | FromDiscord | <Rika> ? |
05:29:38 | * | marnix quit (Ping timeout: 260 seconds) |
05:30:08 | disruptek | i'm copying a proc inside a pragma macro... that is on the same proc. |
05:30:28 | disruptek | merely applying the ast is enough to trigger its evaluation. |
05:30:52 | FromDiscord | <Rika> what are you making? |
05:30:59 | disruptek | bugs. |
05:31:28 | FromDiscord | <Rika> same |
05:32:34 | disruptek | i'm working on cps. |
05:32:56 | disruptek | also trying to guess my irc password. |
05:43:33 | disruptek | i guess that's not the problem. man, it's nuts. |
05:45:52 | * | Zectbumo joined #nim |
05:46:21 | shashlick | It will be nice to work on something easy for a change |
05:47:36 | shashlick | I don't know what convinced me that coding is a fun hobby |
05:48:02 | disruptek | what's easy? |
05:49:09 | FromDiscord | <Rika> hello world |
05:50:00 | disruptek | i'm thinking of making a sailboat with an ai captain. |
05:53:43 | Zevv | disruptek: still chewing on the cps? |
05:53:54 | disruptek | yeah. |
05:53:57 | Zevv | what's new |
05:54:13 | Zevv | does any of my initial stuff hold, or is it all nonsense |
05:54:23 | disruptek | it's bitching at me that i'm redefining a proc and i cannot for the life of me understand how. |
05:54:54 | Zevv | ooh I recall having the same thing. I had to do a nasty workaround because I also didn't understand any of that |
05:55:03 | disruptek | i couldn't find your spam about what wouldn't work. |
05:55:14 | Zevv | but I can't remember the details, sorry |
05:56:08 | Zevv | I'm not totally sure what would or would not work. There's only these papers to go on to start with, which only has some trivial control flow as examples |
05:56:30 | Zevv | The implementation of the C version is not something I can read I'm afraid |
05:56:44 | disruptek | i couldn't find the code. |
05:57:03 | Zevv | it's somewhere on github iirc, lemme check |
05:57:18 | icy | @treeform, so i'm using ws to communicate with an xmpp server, so i'm setting `protocol = "xmpp"` when i initialize a websocket. but i get a type mismatch error: https://termbin.com/1yge |
05:58:16 | Zevv | disruptek: https://github.com/kerneis/cpc |
05:58:32 | Zevv | it never took off, 7 years of mold and dust it seems |
05:58:41 | disruptek | thanks. |
05:59:53 | disruptek | well, i have to crash. i hate to leave this bug but i'm not making progress anymore. |
06:00:02 | Zevv | nightynight |
06:00:05 | disruptek | peace. |
06:00:20 | Zevv | hearts and minds disruptek, hearts and minds! |
06:00:27 | disruptek | ikr |
06:04:07 | * | Vladar joined #nim |
06:09:29 | FromDiscord | <Varriount> So, it turns out the program I've spent the last 4 days on has been made obsolete by Nimteropt |
06:10:22 | FromDiscord | <Varriount> Or mostly obsolete, anyway. |
06:11:06 | Zevv | so something new was added to nimterop today, or did you just work on stuff that nimterop already could do |
06:11:53 | FromDiscord | <Varriount> The latter |
06:12:07 | Zevv | well, that's your own fault then, isn't it :) |
06:13:20 | FromDiscord | <Rika> lol |
06:13:47 | FromDiscord | <Varriount> The only functionality it has that Nimteropt doesn't is the ability to perform regex replacements on the input files before/after preprocessing |
06:14:00 | * | solitudesf joined #nim |
06:14:11 | Zevv | but luckily we can do that with a single line of perl! |
06:14:58 | FromDiscord | <Varriount> And we can generate that line by bashing our heads against keyboards repeatedly. |
06:15:08 | Zevv | sure thing :) |
06:15:15 | FromDiscord | <Rika> given a long amount of time |
06:15:16 | FromDiscord | <Rika> sure |
06:15:52 | Zevv | I use perl a lot. `perl -i -pe 's/this/that/g' *` is the only thing I ever use it for though |
06:16:22 | FromDiscord | <Varriount> Same here. It's a more portable version of sed |
06:16:29 | Zevv | nothing is more portable then sed |
06:16:34 | FromDiscord | <Rika> more portable? why? |
06:16:43 | FromDiscord | <Varriount> Not if you're on OSX or BSD |
06:17:08 | FromDiscord | <Varriount> They have slightly different versions of sed |
06:17:10 | Zevv | no sed on osx or bsd? no way! |
06:17:56 | FromDiscord | <Varriount> They have sed, however it's a different version or implementation. |
06:18:03 | Zevv | oh, right |
06:18:20 | FromDiscord | <Varriount> If I recall correctly, OSX sed lacks a -i option |
06:18:31 | Zevv | which is the whole point |
06:19:02 | FromDiscord | <Rika> imagine if different operating systems also had slightly different versions of programming languages... |
06:19:30 | FromDiscord | <Rika> "oh wait" |
06:26:08 | * | NimBot joined #nim |
06:37:03 | * | marnix joined #nim |
06:39:47 | * | fredrikhr quit (Ping timeout: 240 seconds) |
06:49:23 | * | arecaceae quit (Read error: Connection reset by peer) |
06:50:38 | * | arecaceae joined #nim |
06:50:50 | * | fredrikhr joined #nim |
06:54:01 | shashlick | @varriount that's why I recommend the api instead of the command line |
06:54:19 | shashlick | Sky's the limit with pure Nim |
06:55:51 | shashlick | And now that you have the ability to generate standalone wrappers, it's a no brainer to use it instead of cli plus bash or something |
06:56:30 | shashlick | Look at cimport and build for details |
06:58:01 | shashlick | https://nimterop.github.io/nimterop/cimport.html |
07:15:01 | FromDiscord | <Rika> this may be dumb, but how do you get the nimble version in the package's nim code |
07:17:26 | * | nikita_ is now known as nikita` |
07:21:12 | FromDiscord | <Varriount> shashlick: But cImport is static, right? If I wanted to make an executable utility, it would have to work at runtime. |
07:24:16 | FromDiscord | <Varriount> And forcing every user of a library to generate those files isn't feasible for this use-case. Generating that output file I showed you take about 10-20 seconds (so imagine importing 5 of them) |
07:24:52 | FromDiscord | <Varriount> (edit) 'them)' => 'them - it would be over a minute!)' |
07:29:33 | * | FromDiscord quit (Remote host closed the connection) |
07:29:49 | * | FromDiscord joined #nim |
07:35:07 | FromDiscord | <Elegant Beef> How well does nimterop work with C macros? |
07:36:25 | FromDiscord | <Varriount> @Elegant Beef It utilizes the C preprocessor to expand C code, although I don't know if it translates macros to templates. |
07:36:57 | * | idf31 joined #nim |
07:36:58 | FromDiscord | <Elegant Beef> So that sounds like "Pretty good"? 😄 |
07:57:34 | * | marnix quit (Read error: Connection reset by peer) |
07:57:44 | * | marnix joined #nim |
08:02:15 | * | marnix quit (Ping timeout: 258 seconds) |
08:03:15 | * | marnix joined #nim |
08:15:15 | * | Zectbumo quit (Remote host closed the connection) |
08:18:05 | * | marnix quit (Read error: Connection reset by peer) |
08:26:16 | * | marnix joined #nim |
08:32:59 | * | marnix quit (Ping timeout: 240 seconds) |
08:34:54 | * | nikita` quit (Quit: leaving) |
08:41:09 | * | nikita` joined #nim |
08:51:20 | * | oddp joined #nim |
08:55:52 | * | couven92 joined #nim |
09:11:19 | * | fredrikhr quit (Quit: Client disconnecting) |
09:11:29 | * | couven92 is now known as fredrikhr |
09:11:41 | * | marnix joined #nim |
09:12:19 | * | enthus1ast joined #nim |
09:21:55 | * | bung joined #nim |
09:38:10 | * | arecaceae quit (Remote host closed the connection) |
09:38:34 | * | arecaceae joined #nim |
09:39:32 | * | Senketsu joined #nim |
09:49:38 | * | synthmeat quit (Quit: WeeChat 2.8) |
09:51:00 | * | synthmeat joined #nim |
09:55:21 | Oddmonger | proc modif_seq( pseq: ref seq[int], i:int, v:int): pseq[i]=v # inim says : « Error: type expected » |
09:56:08 | Oddmonger | ah |
09:56:26 | Oddmonger | i see, confusion between ':' and '=' |
09:56:44 | Oddmonger | as ':' is used for loops :/ |
09:59:40 | planetis[m] | Prestige: so what you are trying to create is an AnyMap data structure, right? |
10:00:13 | * | krux02 joined #nim |
10:01:10 | planetis[m] | its kind of a hard topic, I tried too, but at the end I just made a World object just holding seqs of components (of different types) |
10:01:48 | planetis[m] | obviously not suitable for a game engine/framework |
10:02:52 | planetis[m] | also since there is a timezone difference with most of us, could you please post in the forum? |
10:13:59 | FromDiscord | <lqdev> @planetis what's an AnyMap? |
10:14:00 | * | marnix quit (Read error: Connection reset by peer) |
10:14:26 | * | marnix joined #nim |
10:17:23 | * | narimiran quit (Ping timeout: 240 seconds) |
10:48:04 | planetis[m] | stores one value for each type |
10:49:11 | planetis[m] | so you can do ``map[Location]`` and returns a ``seq[Location]`` |
10:50:20 | planetis[m] | its dynamic programming (since it hides types) but useful for an ecs framework |
10:51:38 | FromDiscord | <lqdev> also, what's bad about a World holding seqs of components? feels like a very simple solution that does the job |
10:52:58 | * | leorize quit (Remote host closed the connection) |
10:53:40 | * | leorize joined #nim |
10:53:49 | planetis[m] | sure it is I personally prefer it, but how are you going to make an ecs framework? |
10:54:04 | FromDiscord | <lqdev> through macros, probably |
10:55:32 | planetis[m] | hm, like that I guess: https://github.com/rlipsc/polymorph |
10:56:11 | FromDiscord | <lqdev> yeah |
10:56:17 | FromDiscord | <lqdev> that's one of my inspirations |
10:56:40 | planetis[m] | it's kind of complex, don't you think? |
10:57:22 | FromDiscord | <lqdev> I think I can make it simpler |
10:57:35 | planetis[m] | cool |
10:58:21 | planetis[m] | ...how? |
11:00:18 | * | Senketsu quit (Read error: Connection reset by peer) |
11:00:23 | FromDiscord | <lqdev> you'll have to wait and see. |
11:00:43 | FromDiscord | <lqdev> don't really know how to describe it. |
11:00:56 | FromDiscord | <lqdev> one thing i don't like about polymorph is that it seems to use global state. |
11:04:47 | * | nikita` quit (Quit: leaving) |
11:06:10 | * | Senketsu joined #nim |
11:11:46 | * | Senketsu quit (Read error: Connection reset by peer) |
11:15:14 | planetis[m] | maybe a ``registerComponent`` macro that accepts type section and another ``makeWorld`` called in a world variable declaration after the colon |
11:19:43 | * | fanta1 joined #nim |
11:27:59 | * | waleee-cl joined #nim |
11:34:01 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=2s3F |
11:34:04 | FromDiscord | <lqdev> @planetis ↑ |
11:36:10 | FromDiscord | <lqdev> then you can trigger all of the system interface procs individually, eg. `world.draw(target, graphics, step)` |
11:36:19 | FromDiscord | <lqdev> and they execute for each entity |
11:36:38 | FromGitter | <sealmove> where was that static version of walkDir? I forget. |
11:37:05 | FromDiscord | <lqdev> of course there'll also be `world.newEntity(Transform(position: vec2f(1.0, 1.0)))` |
11:37:20 | FromDiscord | <lqdev> sealmove: does walkDir not work on compile time? |
11:37:30 | FromGitter | <sealmove> it doesn't |
11:37:55 | FromGitter | <sealmove> but I remember there is a proc in some sub-module of stdlib that does work |
11:40:24 | * | hoijui joined #nim |
11:45:28 | Oddmonger | i don't understand how to use ref for a seq (but i guess it will the same problem with everything): https://play.nim-lang.org/#ix=2s3G |
11:48:23 | FromGitter | <sealmove> I don't think `ref` is an operator |
11:49:29 | FromGitter | <sealmove> also if you want a mutable parameter you use `var`, not `ref` in the parameter list |
11:49:57 | FromDiscord | <lqdev> Oddmonger: https://play.nim-lang.org/#ix=2s3H |
11:52:08 | Oddmonger | oh |
11:52:39 | Oddmonger | thank you, i had understood that "var" and "ref" as equivalent, for reference |
11:52:54 | FromDiscord | <lqdev> `ref` means ref-counted |
11:52:59 | FromDiscord | <lqdev> not reference |
11:53:42 | Oddmonger | /o\ |
11:57:11 | FromGitter | <sealmove> hmm this is weird, the module I was talking about is "oswalkdir". Apparently it's deprecated and functionality is moved to "os". The thing is... you can import oswalkdir and use its procs at static context, but not you can't use the same procs from os module. |
11:57:31 | planetis[m] | lqdev: I coded my version in parallel :P https://play.nim-lang.org/#ix=2s3J |
11:59:15 | planetis[m] | hi sealmove! |
11:59:36 | FromGitter | <sealmove> hi! |
12:04:32 | planetis[m] | macrocache is already a thing? awesome https://nim-lang.org/docs/macrocache.html |
12:06:01 | * | supakeen quit (Quit: WeeChat 2.8) |
12:06:43 | * | supakeen joined #nim |
12:13:19 | FromDiscord | <tomck> How can i get the address of a `ref T`? Dumb question but i just can't find it anywhere |
12:14:18 | FromDiscord | <tomck> as in, convert `ref T` to `ptr T` |
12:16:48 | FromGitter | <sealmove> did you try `addr` operator? |
12:18:12 | solitudesf | you can just cast it |
12:25:22 | FromDiscord | <tomck> ohhh its `x[].addr` |
12:25:31 | FromDiscord | <tomck> at least, that seems to work |
12:25:43 | FromDiscord | <tomck> (is that correct?) |
12:26:09 | * | letto_ joined #nim |
12:27:30 | * | idf31 quit (Remote host closed the connection) |
12:27:31 | solitudesf | yep, that works too |
12:28:14 | * | zedeus_ joined #nim |
12:28:40 | * | zama_ joined #nim |
12:29:05 | * | arecacea1 joined #nim |
12:29:48 | FromDiscord | <tomck> brill ta |
12:32:22 | FromGitter | <sealmove> seems correct |
12:32:52 | * | Cthalupa- joined #nim |
12:32:55 | * | arecaceae quit (*.net *.split) |
12:32:56 | * | Cthalupa quit (*.net *.split) |
12:32:56 | * | letto quit (*.net *.split) |
12:32:56 | * | casaca quit (*.net *.split) |
12:32:56 | * | bacterio quit (*.net *.split) |
12:32:56 | * | nisstyre quit (*.net *.split) |
12:33:03 | * | zedeus quit (*.net *.split) |
12:33:03 | * | zama quit (*.net *.split) |
12:33:03 | * | zama_ is now known as zama |
12:40:16 | * | nisstyre joined #nim |
12:40:17 | * | bacterio joined #nim |
13:01:37 | planetis[m] | Is it a good idea to have accessors with typedesc like ``proc `[]`(a: AnyMap, t: typedesc[Position]): seq[Position]`` or make the field names stable or use an enum? |
13:02:42 | planetis[m] | I mean in terms of hidden gotchas and compiler bugs |
13:03:00 | * | Senketsu joined #nim |
13:04:57 | FromDiscord | <Vindaar> if you mean `[]` is a generic, I use that pattern both in nimhdf5 and ggplotnim. works well. If you want to essentially provide overloading via different types, that should also work well |
13:05:23 | FromDiscord | <Vindaar> haven't really encountered any issues |
13:06:15 | * | opDispatch quit (Quit: Konversation terminated!) |
13:06:23 | * | bussller joined #nim |
13:06:44 | bussller | does nim has a run time? |
13:07:05 | bussller | all the gc'ed languages have run times and hence nim has too. |
13:07:09 | bussller | am i right? |
13:08:25 | * | bussller quit (Client Quit) |
13:10:52 | bung | you mean vm ? |
13:11:45 | bung | language has runtime, what language has no run time ? |
13:12:23 | * | marnix quit (Ping timeout: 256 seconds) |
13:13:02 | planetis[m] | Vindaar: `[]` is the arrays/seqs/tables accessor, i don't use generics but the macro im writing will output proc overloads for every possible type, one for get and another for mget |
13:13:29 | solitudesf | bung, https://en.wikipedia.org/wiki/Runtime_system |
13:15:32 | planetis[m] | https://play.nim-lang.org/#ix=2s3J see the commented out code |
13:17:45 | Oddmonger | '$' can be something else than char to string ? |
13:17:52 | Oddmonger | i see it there: https://pragmagic.github.io/godot-nim/v0.7.8/planes.html |
13:18:08 | Oddmonger | (4th proc definition) |
13:19:24 | planetis[m] | seems correct to me |
13:19:53 | FromDiscord | <demotomohiro> It seems `$` is overloaded for `Plane` type. |
13:20:12 | bung | solitudesf I read completed whats your point ? |
13:20:16 | planetis[m] | `$` return type must be a string nothing else |
13:25:24 | planetis[m] | I think I won't use this typedesc thing and access fields directly!? not sure if its any better bc now i will have to provide an api to overwrite the name of the generated fields |
13:26:11 | FromDiscord | <demotomohiro> You can define `$` that does't return string.↵`$` operator returns string is just our convention.↵https://play.nim-lang.org/#ix=2s49 |
13:28:59 | FromDiscord | <juan_carlos> $ can be a template that just overwrites, so I think is Ok. :) |
13:32:06 | FromDiscord | <Vindaar> > [] is the arrays/seqs/tables accessor↵I'm aware of that, but I was wondering if that is going to be generic or not (could just be ```proc `[]`[T](a: AnyMap, t: typedesc[T]): seq[T]``` is what I mean). But for your usecase the overloading is easier I suppose. And that should work, yes |
13:38:31 | * | marnix joined #nim |
13:39:08 | * | Senketsu quit (Read error: Connection reset by peer) |
13:55:06 | Oddmonger | sorry, was watching the logo-godot in nim-conf |
13:55:21 | Oddmonger | so "$" is a valid proc name ? |
13:56:39 | Oddmonger | ah with ``, ok thanks for the sample |
13:57:46 | * | swamptest1[m] joined #nim |
14:07:23 | planetis[m] | one reason not to do this |
14:08:01 | planetis[m] | ...accessors is that Nim might produce a copy of the seq |
14:09:01 | planetis[m] | hopefully not with the latest gc arc and lent / cursor inference |
14:10:05 | FromDiscord | <Vindaar> oh, yeah if you want to just provide access to the seqs with a unified interface without a copy this is of course a problem |
14:10:16 | FromDiscord | <Vindaar> why not just use a template? |
14:11:00 | planetis[m] | yes that would be a solution |
14:22:20 | Oddmonger | what it «is type of (float) and has to be discarded» ? https://play.nim-lang.org/#ix=2r6H |
14:22:38 | * | casaca joined #nim |
14:22:47 | Oddmonger | if i put «discard» in the function, it's ok (but won't return anything) |
14:23:20 | Oddmonger | correct link : https://play.nim-lang.org/#ix=2s4x |
14:23:54 | Oddmonger | well now it works… |
14:26:09 | Oddmonger | i swear it wasn't working 5 minutes ago, and i've changed nothing |
14:26:19 | * | endragor quit (Remote host closed the connection) |
14:26:21 | * | nikita` joined #nim |
14:26:47 | * | endragor joined #nim |
14:27:06 | supakeen | That paste works for you? Because it says `ecoh` :) |
14:31:10 | Oddmonger | yes i messed with that (1st link given was without echo) |
14:31:26 | * | endragor quit (Ping timeout: 260 seconds) |
14:32:18 | Oddmonger | (and was even worst because modified for trying to rid out of the « is type of (float) and has to be discarded » |
14:32:38 | Oddmonger | but nevervmind, blame the heat and the lack of sleep :) |
14:40:32 | disruptek | why would anyone, ever, want to be me? |
14:44:01 | planetis[m] | you mean why would someone be jealous of you? |
14:45:22 | * | endragor joined #nim |
14:46:01 | planetis[m] | you generally don't want / need that, trust me |
14:47:23 | disruptek | some idiot has tried to login to irc as me 96 times. |
14:48:10 | planetis[m] | lol |
14:49:47 | * | hoijui quit (Ping timeout: 260 seconds) |
14:50:39 | solitudesf | sorry, tried to delete your freenode account |
14:50:53 | * | endragor quit (Ping timeout: 258 seconds) |
14:51:59 | * | sschwarzer joined #nim |
14:52:38 | FromDiscord | <dom96> 96 times eh, that's a pretty specific number |
14:53:31 | sschwarzer | If someone of you has a Medium account, you may want to add a comment to that article, https://medium.com/better-programming/a-python-substitute-i-tried-out-the-best-programming-language-youve-never-heard-of-9e29cd1893c0 , that compiling Nim with optimizations switched on will make the runtime a lot faster. :-) I entered a Github issue on that, https://github.com/yakkomajuri/fibonacci-benchmark/issues/1 |
14:53:32 | disbot | ➥ Compile Nim code with optimization |
14:54:04 | sschwarzer | But most people won't look at the Github issues, only read the article. |
14:54:08 | FromGitter | <machineko> Hey guys its possible to do smth like this ⏎ ⏎ ```code paste, see link``` [https://gitter.im/nim-lang/Nim?at=5f145e9018ddba6ef5e3a1fe] |
14:54:35 | FromGitter | <machineko> ? |
14:54:52 | planetis[m] | so it happened while you were identified? |
14:56:19 | planetis[m] | disruptek: ^ |
14:58:41 | disruptek | ~paste |
14:58:42 | disbot | paste: 11a frowned-upon behavior in chat; please use a service such as https://play.nim-lang.org/ or http://ix.io/ or https://gist.github.com/ and supply us a URL instead. -- disruptek |
14:58:42 | planetis[m] | machineko: yes use the when statement https://nim-lang.org/docs/manual.html#statements-and-expressions-when-statement |
15:00:48 | * | krux02 quit (Remote host closed the connection) |
15:08:12 | FromGitter | <machineko> @planetis thanks :) |
15:09:00 | * | kungtotte quit (Read error: Connection reset by peer) |
15:09:17 | * | kungtotte joined #nim |
15:16:23 | FromDiscord | <Vindaar> disruptek, what you on about? gitter code blocks are handled fine |
15:18:51 | * | sschwarzer quit (Quit: leaving) |
15:25:34 | * | marnix quit (Ping timeout: 260 seconds) |
15:27:47 | * | endragor joined #nim |
15:29:05 | * | livcd joined #nim |
15:35:23 | * | endragor quit (Ping timeout: 240 seconds) |
15:56:49 | disruptek | well, people on irc cannot read them. |
15:57:13 | disruptek | they render as a 3-char wide div on my screen. |
15:57:49 | FromDiscord | <Vindaar> it automatically inserts a link to the gitter page though |
15:58:05 | disruptek | yes, this is the problem exactly. |
15:58:11 | disruptek | the gitter page is fucking stupid. |
15:59:01 | FromDiscord | <Vindaar> cause you can't be arsed to open the monstrosity that is gitter for a code paste? |
15:59:40 | disruptek | are you saying you don't believe me that it's stupid, or are you saying that what i say is stupid is something that i don't have right in front of my eyes? |
16:01:13 | FromDiscord | <Vindaar> I'm saying it's stupid to complain about that. gitter might not be ix.io in terms of size, but it's a perfectly fine compromise |
16:01:28 | * | B4s1l3 joined #nim |
16:01:29 | * | B4s1l3 is now known as opDispatch |
16:02:33 | FromDiscord | <lqdev> @Vindaar FYI this is how the gitter page looks when opened on a horizontal split. https://media.discordapp.net/attachments/371759389889003532/734440045456654438/unknown.png |
16:02:59 | disruptek | https://i.imgur.com/ff4y3bU.png |
16:03:38 | * | endragor joined #nim |
16:03:59 | disruptek | i usually don't complain, but at the moment i don't have access to my css styler that fixes it. |
16:04:33 | FromDiscord | <lqdev> holy fuck that is such a thicc sidebar |
16:04:38 | FromDiscord | <lqdev> it's not that terrible on my screen |
16:04:43 | disruptek | it's a perfectly fine compromise for vindaar, but i'll keep my mouth shut and ignore gitter pastes going forward. |
16:06:26 | FromDiscord | <Vindaar> I'm not saying it's perfect, but a) you can click the menu button in the bottom right to make the user list small and b) if the convenience makes it easier for people to ask questions I'm fine with that |
16:08:57 | disruptek | what's nice about ix is that my bot can make sense of it trivially. |
16:09:21 | disruptek | but, as you say, i'm just a stupid programmer. |
16:09:32 | * | theelous3 joined #nim |
16:09:42 | disruptek | i need some macro help if there's anyone clever available. |
16:10:18 | FromDiscord | <Vindaar> > but, as you say, i'm just a stupid programmer.↵@disruptek dude, interpret stuff however you want, I don't care |
16:11:39 | * | lritter joined #nim |
16:12:33 | disruptek | sure. i gave you two opportunities to not call me stupid but you chose a third way. it's no big deal, but don't try to make it sound like you didn't insult me. i don't care either. 😘 |
16:13:41 | disruptek | https://github.com/disruptek/cps |
16:13:48 | disruptek | the test file demonstrates. |
16:14:15 | disruptek | what i want to do is to have my .cps. rewrite a proc and make significant changes to an untyped proc body. |
16:14:52 | disruptek | i want it untyped because i want to allow cps_foo(a, b) to turn into `return cps_foo(c, a, b)` among other things. |
16:15:12 | disruptek | and cps_foo(a, b) is otherwise a compiler error. |
16:16:57 | disruptek | it feels like a compiler bug, in that something is being typed out-of-phase. but it could be that i just don't understand macros. |
16:21:16 | FromDiscord | <tomck> Is there any way to run tests, but not leave the binary in the tests folder? it's a pain for my git repo, hard to ignore - or at least suffix them with .bin? |
16:22:13 | disruptek | you can use --outdir or --out. |
16:22:25 | disruptek | see also the somewhat-hidden `nim --fullhelp` |
16:22:26 | FromDiscord | <lqdev> nim 1.4 is also going to have `nim r` which stores the binaries in nimcache |
16:23:15 | disruptek | also, --outdir="$nimcache" would work. |
16:23:16 | FromDiscord | <tomck> lol --fullhelp |
16:23:54 | FromDiscord | <tomck> that seems to work |
16:23:59 | disruptek | nice. |
16:24:00 | FromDiscord | <tomck> the --outdir="$nimcache" |
16:24:03 | FromDiscord | <tomck> ta |
16:24:06 | FromDiscord | <Vindaar> disruptek, what's the problem you have trying to rewrite the proc body? your macro can just spit out a proc with modified body |
16:24:27 | disruptek | so what should i change? |
16:25:04 | FromDiscord | <Vindaar> as I said, I don't know where it breaks |
16:25:28 | disruptek | sorry, i didn't see where you said that. |
16:25:31 | FromDiscord | <Vindaar> here just modify the body, no? https://github.com/disruptek/cps/blob/master/cps.nim#L537 |
16:26:21 | FromDiscord | <Vindaar> if you don't mind an ugly hack as an example: |
16:26:31 | FromDiscord | <Vindaar> https://github.com/Vindaar/TimepixAnalysis/blob/master/Analysis/ingrid/private/geometry.nim#L24-L28 |
16:26:34 | FromDiscord | <Vindaar> used here: |
16:26:48 | FromDiscord | <Vindaar> https://github.com/Vindaar/TimepixAnalysis/blob/master/Analysis/ingrid/private/geometry.nim#L492 |
16:26:56 | FromDiscord | <Vindaar> but the meat is here: |
16:27:05 | FromDiscord | <Vindaar> https://github.com/Vindaar/TimepixAnalysis/blob/master/Tools/CompareMarlinTpa/UseMarlinRotAngle/geometry.nim#L515-L534 |
16:29:43 | disruptek | that's a solution to one part of the problem but not the other. |
16:30:18 | FromDiscord | <Vindaar> and which part does it not solve? |
16:31:22 | disruptek | when the body turns cps_foo(a, b) into return cps_foo(c, a, b), the compiler gives a type mismatch error. |
16:32:04 | disruptek | it got none -- same as `proc cps_foo() =`. it wanted a proc yielding something, etc. |
16:32:31 | disruptek | it's like the old type is bleeding into the new ast. |
16:34:34 | FromDiscord | <Vindaar> I'm not quite following, but what you describes happens if you leave `nnkSym` anywhere in the ast you re-emit. make sure to replace all symbols by idents |
16:34:37 | disruptek | i thought i would provide two procs and choose which to use at compile-time but maybe i need to just have different implementations at compile-time. |
16:35:06 | disruptek | yeah, that happens if you try to re-use a `.name`, for example. |
16:36:26 | disruptek | hmm, i can't have different impl at compile-time; at least, not without the same signature. |
16:36:57 | * | Jesin quit (Quit: Leaving) |
16:37:42 | disruptek | we really need more edit api for macros. |
16:37:46 | disruptek | this is ridiculous. |
16:38:59 | FromDiscord | <Recruit_main707> I was looking at the wiki, and openarray doesnt seem to need the toOpenArray function, is that outdated? |
16:42:06 | FromDiscord | <Doof Doof> Yo . . . so regarding macros, can we create some like in Haxe where people will convert assets, like images, into statically accessible names in the code? |
16:42:11 | FromDiscord | <Doof Doof> something like* |
16:42:18 | FromDiscord | <lqdev> sure |
16:42:21 | FromDiscord | <Doof Doof> Sweet |
16:42:21 | FromDiscord | <lqdev> check out `slurp()` |
16:42:23 | disruptek | shashlick has a package to do this already. |
16:42:33 | disruptek | !repo author:genotrance assets |
16:42:34 | disbot | no results 😢 |
16:42:39 | disruptek | !repo author:genotrance embed |
16:42:40 | disbot | no results 😢 |
16:42:42 | disruptek | !repo author:genotrance |
16:42:43 | disbot | no results 😢 |
16:42:51 | disruptek | dafuq |
16:42:54 | FromDiscord | <Doof Doof> I'll find it! |
16:43:15 | FromDiscord | <Doof Doof> Thanks nimlings - is that the right name? |
16:43:16 | FromDiscord | <lqdev> I just use `slurp("my-sprite.png")` to embed stuff into my executables, then just load the resources into memory using appropriate APIs at runtime |
16:43:30 | FromDiscord | <lqdev> @Doof Doof we don't really have a name so it's fine :) |
16:43:31 | FromGitter | <sealmove> guys I have a problem which I can't solve for months... I have a NimNode of arbitary Nim expression and I want to infer its type. Can I use the compiler to do this somehow, or do I have to write a proc that iterates the node and does type algebra to figure it out? |
16:44:00 | FromDiscord | <lqdev> sealmove: pass the node to a macro which accepts a `typed` parameter, and in that macro use `getType` |
16:47:48 | FromGitter | <sealmove> signature is `macro infer(e: typed): NimNode` ? |
16:48:38 | FromDiscord | <lqdev> not really |
16:48:50 | FromDiscord | <lqdev> the thing is, you need to generate a call to that macro and pass your NimNode to `e` |
16:48:57 | FromDiscord | <lqdev> so you may need to pass in extra params |
16:49:31 | FromDiscord | <lqdev> it's kind of difficult to explain |
16:49:34 | FromDiscord | <lqdev> hold on a second |
16:49:42 | FromGitter | <sealmove> yes, people tried to explain this to me before :S |
16:50:56 | FromGitter | <sealmove> so I need a macro which generates a macro call? |
16:51:07 | FromDiscord | <Vindaar> yes |
16:51:32 | disruptek | i need to do something similar. |
16:52:13 | FromDiscord | <Vindaar> and trust me, you will probably hit many walls |
16:53:48 | FromGitter | <sealmove> yes, it's scary |
16:54:08 | FromDiscord | <Vindaar> things like: https://github.com/nim-lang/Nim/issues/13913 |
16:54:10 | disbot | ➥ Cannot hand multiple procs to macro using `varargs[typed]` ; snippet at 12https://play.nim-lang.org/#ix=2s5l |
16:54:23 | * | tane joined #nim |
16:54:35 | FromDiscord | <lqdev> sealmove: here's an example https://play.nim-lang.org/#ix=2s5m |
16:54:52 | FromDiscord | <lqdev> macros are a little half-baked. |
16:55:41 | FromDiscord | <Vindaar> and the infamous https://github.com/nim-lang/RFCs/issues/44 |
16:55:42 | disbot | ➥ [RFC] Working with types in macro is difficult. |
16:58:02 | * | Jesin joined #nim |
16:58:09 | * | marnix joined #nim |
16:58:22 | FromGitter | <sealmove> hmmmm |
16:59:11 | FromDiscord | <Vindaar> don't get discouraged. one can usually make it work, but it can be frustrating |
16:59:13 | FromGitter | <sealmove> lqdev: so you bindsymed echo to see the type in screen? I need it as string or NimNode in my program to use in some codegen |
17:02:56 | FromDiscord | <lqdev> well, there isn't really a way to get it back at this point |
17:03:04 | FromDiscord | <lqdev> you need to do any further work in the other macro |
17:03:31 | FromDiscord | <lqdev> I really wish Nim had a proc like `resolveIdent` that would turn idents into syms, but I can only wish… |
17:03:37 | FromDiscord | <lqdev> or open an RFC. |
17:04:23 | FromGitter | <sealmove> wow so it's not possible after all |
17:04:23 | * | leorize quit (Ping timeout: 240 seconds) |
17:06:12 | FromDiscord | <Vindaar> @lqdev well, it technically has. `bindSym` with the experimental "dynamicBindSym" it does just that |
17:06:13 | FromDiscord | <Vindaar> https://nim-lang.github.io/Nim/macros.html#bindSym%2C%2CBindSymRule |
17:06:37 | FromDiscord | <lqdev> no it doesn't. it binds the sym in the macro's scope |
17:06:54 | FromDiscord | <lqdev> but what is really needed is something that binds a sym from the callsite's scope |
17:07:09 | * | leorize joined #nim |
17:08:03 | FromDiscord | <Vindaar> wait, in the callsite's scope it's not really a problem though? |
17:08:16 | FromDiscord | <Vindaar> then you are in compiled nim land |
17:08:45 | FromDiscord | <Vindaar> and you can just construct some `typeof` call or whatever |
17:09:16 | FromDiscord | <Vindaar> but probably I misunderstand you |
17:09:20 | FromDiscord | <lqdev> but you can't get the type of an ident. |
17:09:23 | FromDiscord | <lqdev> you need a sym. |
17:09:54 | FromDiscord | <lqdev> if you're parsing a DSL that refers to some outside data, you need to defer to another macro. there is no way to turn untyped→typed. |
17:10:28 | FromGitter | <sealmove> So basically you need a full-fledged lookup table for your variables I guess |
17:10:50 | FromGitter | <sealmove> At least to track the types |
17:10:52 | leorize[m] | @lqdev bindSym with open scope doesn't work? |
17:11:13 | FromDiscord | <lqdev> with open scope? what does that mean? |
17:11:30 | * | marnix quit (Ping timeout: 260 seconds) |
17:11:34 | leorize[m] | bindSym take an optional parameter |
17:11:50 | leorize[m] | that specify the binding scope |
17:12:51 | leorize[m] | iirc brOpen should be the same as template's "mixin" |
17:13:27 | FromDiscord | <lqdev> ohhhhhh |
17:13:35 | * | marnix joined #nim |
17:13:35 | * | marnix quit (Read error: Connection reset by peer) |
17:13:37 | FromDiscord | <Vindaar> I mean: this works "just fine": https://play.nim-lang.org/#ix=2s5v |
17:13:50 | FromDiscord | <lqdev> sealmove: you're saved |
17:18:31 | shashlick | Doof Doof - nimdeps |
17:19:48 | FromGitter | <sealmove> Ok but an expression can have many things. It can have identifiers or literals. |
17:21:23 | FromDiscord | <Vindaar> exactly, and that's where things become problematic (even if dynamic bindSym wasn't experimental) |
17:23:09 | FromDiscord | <Vindaar> that's why I do all sorts of BS trying to figure out some type info in ggplotnim, here for instance https://github.com/Vindaar/ggplotnim/blob/master/src/ggplotnim/dataframe/arraymancer_backend.nim#L1008-L1075 |
17:23:48 | FromDiscord | <Vindaar> and that already includes a 2 step macro starting at untyped ⇒ typed |
17:26:56 | * | NimBot joined #nim |
17:27:03 | FromGitter | <sealmove> :/ |
17:27:18 | FromGitter | <raydf> Hello everyone |
17:27:41 | FromDiscord | <Vindaar> hey @raydf! |
17:28:55 | * | marnix joined #nim |
17:29:43 | FromGitter | <raydf> is there any example on creating custom blocks for wrapping statements with closures objects? Pseudo example of the usage i'll like: ⏎ ⏎ ```withConnection: ⏎ resp "#S" % [connection] ``` ⏎ ⏎ i want this code to handle the opening and closing of a db connection [https://gitter.im/nim-lang/Nim?at=5f148307724012319bb7f44e] |
17:32:38 | FromDiscord | <Vindaar> you can use a template like so: https://play.nim-lang.org/#ix=2s5B |
17:36:09 | FromGitter | <sealmove> Is it possible to create/manually constructed type NimNodes? |
17:36:22 | FromGitter | <sealmove> typed* |
17:38:11 | FromDiscord | <lqdev> nope, you can only get them via some user input or by using bindSym |
17:38:25 | FromDiscord | <lqdev> but you can create symbols using genSym |
17:46:44 | FromGitter | <raydf> thx @Vindaar, i was looking for the pragmas |
17:52:51 | FromGitter | <raydf> I'm having trouble with the template it opens the connection but the connection.close() is unreachable |
17:54:50 | FromDiscord | <Vindaar> can you show your code? |
18:05:39 | FromGitter | <raydf> of course |
18:07:36 | FromGitter | <raydf> https://play.nim-lang.org/ |
18:08:17 | FromGitter | <raydf> https://play.nim-lang.org/#ix=2s5M |
18:11:13 | FromDiscord | <Doof Doof> anyone know why nim wouldn't be able to link to a dll but another language can to the same exact one? The dll is in the same folder, and in the parent folder, of the nim built exe |
18:12:07 | Prestige | @Vindaar thanks for helping with macros yesterday, I feel like I understand them now. Wrote a few more today |
18:12:10 | FromDiscord | <Doof Doof> Os is Win10 |
18:12:27 | FromGitter | <deech> Is there a way to get Nim doc generation to list types and procs in a module in alphabetical order instead of the order in which they appear in the module? It would make things easier to find. |
18:12:52 | Zevv | +1 |
18:13:47 | FromDiscord | <Vindaar> @Avahe you're welcome! |
18:16:51 | FromDiscord | <Vindaar> @raydf: I can't compile your code, but because of a different issue with `jesterwithplugins` |
18:17:39 | FromDiscord | <Vindaar> in principle this should work though (unless the macros around that tamper with the code generated by the template!) |
18:19:24 | FromGitter | <raydf> i tried with jester and is giving me the same error. I'll keep trying to understand how the jester macros exit before calling the disconnect code. Again, thx for the help |
18:23:01 | FromDiscord | <dom96> Hey guys, I'm working on a IO game called Stardust and would love you to give it a whirl. Give it a go here in your favourite browser: https://stardust.dev/play. And let me know what you think 🙂 |
18:26:13 | FromDiscord | <Doof Doof> Still having trouble with dlls . . . |
18:26:15 | FromGitter | <raydf> @Vindaar found a workaround using a return value and then calling the resp macro. That macro breaks and leave the rest of the code without executing |
18:26:32 | FromDiscord | <Doof Doof> @dom96 I killed you lol, I was `nimling` - but again . . .too easy to be swept from below |
18:27:05 | leorize | @dom96 well you gotta fix the "can be killed during spawn" :P |
18:27:09 | FromDiscord | <Doof Doof> I keep seeing these funny usernames. . . "Implement in rust" Fix nim plz" - "async is broken". What's all this about lol? |
18:27:31 | shashlick | @leorize - did you get to see that plugins crash with arc |
18:28:03 | FromDiscord | <dom96> leorize: pff, it's easy to escape spawn killing |
18:28:07 | leorize | shashlick: yea, it's complicated due to the lack of stacktraces, even in gdb |
18:28:30 | shashlick | ok |
18:28:32 | FromDiscord | <dom96> Yeah, who are these people asking to fix nimble and async? 😛 |
18:28:34 | leorize | it's kinda laggy on my firefox, but then I've like canvasblocker running :P |
18:28:57 | Zevv | "Could not find server / Request failed / Okay" |
18:29:06 | FromDiscord | <dom96> Yeah, performance on FF sucks. |
18:29:08 | FromDiscord | <dom96> Chrome is much better |
18:29:14 | shashlick | dom96: pinged you on discord about https://github.com/dom96/choosenim/pull/201#issuecomment-639774677 |
18:29:15 | disbot | ➥ Fix #199 - missing dlls |
18:29:36 | FromDiscord | <dom96> (If you're on Linux with FF then it's really bad, or at least it was for some) |
18:30:11 | FromDiscord | <dom96> Zevv: hm, browser? region? |
18:30:19 | Zevv | ff nl |
18:30:41 | FromDiscord | <dom96> Can't connect at all? |
18:30:48 | Zevv | Cross0origin request blocked, related? |
18:30:52 | leorize | how does the exploding thingy work? |
18:30:54 | FromDiscord | <dom96> anything interesting in the console? |
18:31:00 | Zevv | "Reason: CORS header accessc-ontrol-allow-origin missing |
18:31:07 | FromDiscord | <dom96> leorize: click to burst and then aim at others |
18:31:30 | FromDiscord | <Doof Doof> lol wth, why "whenfastasync"? |
18:31:44 | FromDiscord | <Doof Doof> all these names are making me think something wrong haha |
18:31:45 | FromDiscord | <dom96> someone trolling lol |
18:32:18 | FromDiscord | <dom96> Someone from Argentina 🤔 |
18:32:56 | FromDiscord | <dom96> > "Reason: CORS header accessc-ontrol-allow-origin missing↵@Zevv[IRC]#0000 can you see which server it's trying to connect to? |
18:32:58 | * | krux02 joined #nim |
18:33:25 | Zevv | "Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://stardust.dev/route/server. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). |
18:34:11 | Zevv | ~Cross-Origin Request Blocked: The Same Origin Policy disallows reading the remote resource at https://stardust.dev/route/server. (Reason: CORS header ‘Access-Control-Allow-Origin’ missing). |
18:34:12 | disbot | no footnotes for `Cross-Origin`. 🙁 |
18:34:14 | FromDiscord | <dom96> But how can that be? It's on the same domain? |
18:34:18 | Zevv | {"url":"wss://fra1.stardust.dev/game/ws"} |
18:34:44 | FromDiscord | <dom96> Oh, so you're getting a response |
18:34:55 | FromDiscord | <dom96> Maybe it cannot connect to FRA1 |
18:35:10 | FromDiscord | <dom96> Does it work in other browsers for you? |
18:35:14 | Zevv | lemme check |
18:35:25 | Zevv | nope |
18:35:25 | FromDiscord | <Doof Doof> so if I have a dll in the same directory as my exe? I'm thinking about just using a full path instead of a dll name. It's getting ridiculous. |
18:35:46 | FromDiscord | <Doof Doof> directory as my exe . . . why can't it load? * |
18:36:27 | leorize | @dom96 I got a ton of mass ejected (as a ring) and become super slow after, why's that? |
18:36:43 | FromDiscord | <dom96> Zevv: can you check the network tab and see what isn't being loaded? |
18:37:04 | FromDiscord | <dom96> leorize: that's by design, just to add a little more nuance to the gameplay 🙂 |
18:37:11 | Zevv | uhm, how do I see what's *not* being loaded? |
18:37:15 | * | couven92 joined #nim |
18:37:19 | * | fredrikhr quit (Disconnected by services) |
18:37:26 | * | couven92 is now known as fredrikhr |
18:37:38 | Zevv | I get the startdust.dev/server request with the wws response, and that's it |
18:37:41 | FromDiscord | <Doof Doof> Yeah . . . even a fullpath isn't connecting the dll. What the heck |
18:37:46 | * | couven92 joined #nim |
18:37:55 | leorize | wrong architecture? |
18:38:35 | FromDiscord | <Doof Doof> From the nim code or the dll? I am using the exact same dll in another language. . . |
18:38:39 | FromDiscord | <dom96> Zevv: here is what it looks like for me when I refresh then click "Play Online" https://media.discordapp.net/attachments/371759389889003532/734479328796082236/unknown.png |
18:38:54 | Zevv | not at all like that |
18:38:58 | Zevv | just one request |
18:38:59 | Zevv | and it stalls |
18:39:24 | FromDiscord | <dom96> Can you show me a screenshot? |
18:40:56 | FromDiscord | <Doof Doof> @leorize |
18:41:16 | FromDiscord | <Doof Doof> (edit) '@leorize' => '@leorize-' |
18:41:30 | leorize | nim --version |
18:41:36 | leorize | what architecture is nim compiled for? |
18:41:58 | FromDiscord | <Doof Doof> i386 |
18:42:08 | leorize | and what architecture is your dll? |
18:43:27 | FromDiscord | <Doof Doof> I'll have to check. I didn't create the dll. But if it helps - I can't load DLL's created by the nim compiler either. |
18:43:42 | leorize | hmm, how are you doing it? |
18:44:24 | FromDiscord | <Doof Doof> For the one's that were created by the nim compiler, I was testing out hot-reloading. It just wouldn't load the dll no matter where I got it from. |
18:44:44 | FromDiscord | <Doof Doof> I'm currently just loading the dll I'm playing with right now using raylib forever, and it looks like it's using "dynlib" |
18:45:04 | FromDiscord | <Doof Doof> `# {.pragma: RLAPI, cdecl, discardable, dynlib: "raylib" & LEXT.}` where lext resolves to .dll |
18:50:42 | * | marnix quit (Ping timeout: 256 seconds) |
18:54:25 | FromDiscord | <Doof Doof> also - building the exe works fine. it's literally just the dll load :/ |
18:54:33 | FromDiscord | <Doof Doof> I don't get why one lang works and another doesn't |
18:55:13 | FromDiscord | <Doof Doof> only thing I've had success with so far in Nim is just some console printing and input |
18:59:31 | * | narimiran joined #nim |
19:05:48 | * | Tlanger quit (Ping timeout: 258 seconds) |
19:11:11 | * | marnix joined #nim |
19:13:46 | * | fredrikhr quit (Ping timeout: 256 seconds) |
19:19:36 | * | fredrikhr joined #nim |
19:23:45 | leorize | hmmm this is weird |
19:23:56 | leorize | my guess is that you're using choosenim? |
19:25:12 | FromDiscord | <Doof Doof> choosenim? |
19:25:59 | FromDiscord | <Doof Doof> no I used the manual installation |
19:29:06 | * | hoijui joined #nim |
19:43:54 | leorize | manual? that's weird, isn't that zip file 64bit... |
19:44:50 | leorize | https://github.com/alaviss/nightlies/releases <- grab the latest nightlies here and test with that |
19:45:17 | * | ForumUpdaterBot quit (Remote host closed the connection) |
19:45:20 | leorize | nim devel have enhanced error message for dll loads, so maybe it will reveal some more issues |
19:45:24 | * | ForumUpdaterBot joined #nim |
19:51:51 | FromDiscord | <dom96> > my guess is that you're using choosenim?↵Wouldn’t happen if choosenim was used 😉 |
19:52:55 | FromDiscord | <Doof Doof> hahaha ^ |
19:53:01 | FromDiscord | <Doof Doof> Okay I'll try both those in a bit |
19:55:46 | leorize | :P was guessing purely on how choosenim prefers 32bit binaries |
20:04:33 | shashlick | it doesn't anymore |
20:04:42 | shashlick | if no gcc is present, it picks 64-bit |
20:04:49 | shashlick | if gcc is present, it uses it whatever it is |
20:05:11 | * | Vladar quit (Quit: Leaving) |
20:06:49 | FromDiscord | <Doof Doof> Okay I ran choosenim, what am I supposed to expect? It says I have stable but nothing really happened . . . |
20:07:44 | * | fanta1 quit (Quit: fanta1) |
20:11:38 | shashlick | trying to figure out what's your issue |
20:14:23 | shashlick | so your nim is not 64-bit - presume gcc -v says the same |
20:14:33 | shashlick | but you don't know what arch the dll is? |
20:15:00 | * | mal`` quit (Quit: Leaving) |
20:15:30 | * | mal`` joined #nim |
20:15:40 | FromDiscord | <Doof Doof> the arch should be 64 |
20:15:53 | FromDiscord | <Doof Doof> That's what the language/compiler I was using prior was |
20:16:00 | FromDiscord | <Doof Doof> so it worked with that architecture |
20:16:33 | shashlick | if nim -v and gcc -v are not 64-bit then it won't work with this dll |
20:16:52 | shashlick | http://www.dependencywalker.com/ is very useful for arch and what the dll depends on |
20:17:02 | shashlick | but ya, did you install gcc separately? |
20:17:47 | FromDiscord | <Doof Doof> yeahhh I did download the 32 bit somehow |
20:18:05 | FromDiscord | <Doof Doof> not sure how I goofed that one up |
20:18:40 | shashlick | no problem, just get rid of nim and gcc, then run choosenim again - it will download the 64-bit gcc |
20:18:52 | shashlick | alternative is to setup gcc yourself |
20:19:18 | leorize | shashlick: does choosenim detect windows native architecture or it just guess? |
20:19:56 | FromDiscord | <slymilano> @dom96 Araq asked me to open a bug report here: https://github.com/nim-lang/Nim/issues/15019 |
20:19:57 | disbot | ➥ asyncCheck works fine on Linux and Windows - not on Mac. ; snippet at 12https://play.nim-lang.org/#ix=2s6h |
20:19:58 | shashlick | it detects cpu arch |
20:20:41 | shashlick | https://github.com/dom96/choosenim/blob/a7b9d24849255509b57a2f4fb7d97d6e79a860e8/src/choosenimpkg/cliparams.nim#L106 |
20:21:31 | FromDiscord | <Doof Doof> i think that actually worked |
20:21:32 | FromDiscord | <Doof Doof> nice |
20:21:34 | FromDiscord | <Doof Doof> let me check |
20:21:53 | FromDiscord | <Doof Doof> dooooooope |
20:22:03 | FromDiscord | <Doof Doof> I see a bouncing ball on my screen and I've never been happier |
20:22:22 | FromDiscord | <Doof Doof> not an exaggeration at all |
20:24:04 | FromDiscord | <Doof Doof> Sorry for the last few bits of spam there . . . but just wanted to thank everyone for their help!! Now it's time to start a potential journey in Nim . . . |
20:24:43 | leorize | shashlick: there's also windows' GetNativeSystemInfo if you want to be 100% correct :P |
20:25:14 | leorize | maybe we can switch to that once microsoft debut their arm windows 10 X tablet |
20:25:39 | shashlick | nift |
20:28:47 | FromDiscord | <dom96> Wow. I was joking about choosenim. Nice that it actually resolved your issue. Maybe now less folks will be negative about it 🙂 |
20:29:17 | skrylar[m] | wasn't aware people were |
20:34:32 | shashlick | @dom96 - that PR is good to go now - ptal - CI is failing for windows since 0.6.0 is broken, not the build that is being tested |
20:35:33 | * | fredrikhr quit (Disconnected by services) |
20:35:39 | * | couven92 is now known as fredrikhr |
20:41:21 | * | idf31 joined #nim |
20:42:47 | * | couven92 joined #nim |
20:49:15 | * | couven92 quit (Quit: Client disconnecting) |
20:58:07 | * | nikita` quit (Quit: leaving) |
20:59:10 | * | marnix quit (Ping timeout: 256 seconds) |
20:59:55 | * | marnix joined #nim |
21:01:24 | FromDiscord | <treeform> @dom96 I only use choosenim now. |
21:11:10 | * | marnix quit (Read error: Connection reset by peer) |
21:12:45 | * | Zectbumo joined #nim |
21:18:08 | FromDiscord | <Avatarfighter> choosenim best nim |
21:19:05 | * | tane quit (Quit: Leaving) |
21:22:24 | * | narimiran quit (Quit: leaving) |
21:40:04 | idf31 | sup bros, some weeks ago I made a game in Nim using the Nico framework for the 8x8 Game Jam 2(were sprites had to be maximum 8x8, fantasy console-esque framework was perfect) and was wondering if you would be interested |
21:40:34 | idf31 | the code could surely be improved and I still have to add more levels, but i will do those after the jam rating period ends for fairness i guess |
21:41:29 | FromDiscord | <Elegant Beef> What do you mean by interested |
21:41:39 | FromDiscord | <Elegant Beef> Also there is a nim gamedev IRC btw |
21:42:00 | idf31 | oh thanks |
21:42:12 | idf31 | by interested i meant if i can post it or something |
21:42:37 | FromDiscord | <Rika> i mean why not |
21:43:01 | FromDiscord | <Elegant Beef> #nim-gamedev for the irc |
21:43:14 | FromDiscord | <Elegant Beef> Yea i mean show off what you made/make is fine here |
21:46:36 | idf31 | https://idf04.itch.io/door-o-bot |
21:48:32 | FromDiscord | <Elegant Beef> Need to not have the music/movement sfx play so loud/often 😄 |
21:48:49 | idf31 | yeah sorry about that |
21:53:27 | FromDiscord | <Doof Doof> Please correct me if I'm wrong - but the whole "style insensitive" typing is not applied to the reserved words? |
21:56:16 | FromDiscord | <Yardanico> It is applied to all symbols |
21:56:25 | FromDiscord | <Yardanico> Including keywords |
21:56:38 | FromDiscord | <Yardanico> There are no exceptions where it's not applied really |
21:56:51 | FromDiscord | <Elegant Beef> Yea it'd be weird to get exceptions for it |
21:56:58 | FromDiscord | <Doof Doof> huh . . . |
21:56:59 | FromDiscord | <Doof Doof> well |
21:57:17 | FromDiscord | <Yardanico> notin is same as not_in or notIn for example |
21:57:20 | FromDiscord | <Doof Doof> I tried capitalizing `Import` and `While` but both resulted in `undeclared identifier` |
21:57:27 | FromDiscord | <Elegant Beef> cause first letter matters |
21:57:31 | FromDiscord | <Elegant Beef> try `iMpoRt` |
21:57:32 | FromDiscord | <Yardanico> no, you didn't read it carefully enough :P |
21:57:42 | FromDiscord | <Yardanico> First letter in Nim is case sensitive |
21:57:44 | FromDiscord | <Yardanico> For all symbols |
21:58:03 | FromDiscord | <Doof Doof> Darn. I was hoping I could write it like I used to write in my favorite language |
21:58:06 | FromDiscord | <Yardanico> That's mainly so you can have types and variables with the same name |
21:58:15 | FromDiscord | <Yardanico> @Doof Doof no one stops you from making templates |
21:58:20 | FromDiscord | <Elegant Beef> just imagine it as removing `_` and doing `toLower()` on all symbols |
21:58:25 | FromDiscord | <Yardanico> Or a macro to transform "your favourite language" to Nim |
21:58:25 | FromDiscord | <Doof Doof> oh well ¯\_(ツ)_/¯ |
21:58:33 | FromDiscord | <Yardanico> What's that "favourite language" by the way? |
21:58:34 | FromDiscord | <Doof Doof> @Yardanico all good! I don't need them to be cap'd |
21:58:34 | FromDiscord | <Elegant Beef> C#? |
21:58:38 | FromDiscord | <Doof Doof> No, Monkey2 |
21:59:08 | FromDiscord | <Elegant Beef> statically typed lua basically? |
21:59:25 | FromDiscord | <Doof Doof> It's closer related to Basic dialects |
21:59:37 | FromDiscord | <Elegant Beef> And yard you though i wrote code weirdly https://media.discordapp.net/attachments/371759389889003532/734529903327707156/HzxfyQ.png |
21:59:43 | FromDiscord | <Elegant Beef> (edit) 'though' => 'thought' |
21:59:53 | FromDiscord | <Doof Doof> Has operator overloading, classes, inheritance, static extensions, and a dead language |
21:59:54 | FromDiscord | <Doof Doof> etc |
22:00:03 | FromDiscord | <Elegant Beef> `( a:int, b:string )` |
22:00:04 | FromDiscord | <Doof Doof> Pretty damn good FFI too |
22:00:21 | FromDiscord | <Elegant Beef> Yea just get use to camelCasing 😛 |
22:00:39 | FromDiscord | <Doof Doof> I'm already used to it - I use Haxe pretty frequently |
22:00:44 | FromDiscord | <Doof Doof> :P |
22:01:04 | FromDiscord | <Rika> rest in peace |
22:01:33 | FromDiscord | <Elegant Beef> I hope it doesnt if that's the typical convention that language needed to die |
22:01:52 | FromDiscord | <Doof Doof> Well let me see . . . |
22:02:04 | FromDiscord | <Doof Doof> It let you FFI with C++ or Java pretty easily |
22:02:15 | FromDiscord | <Doof Doof> Java for android development |
22:02:18 | FromDiscord | <Elegant Beef> i mean nim has C/C++ FFI |
22:02:25 | FromDiscord | <Doof Doof> It also had objective C interfacing |
22:02:32 | FromDiscord | <Doof Doof> I think it was swift actually . . . let me check |
22:02:44 | FromDiscord | <Doof Doof> I could be wrong ¯\_(ツ)_/¯ |
22:02:56 | FromDiscord | <Doof Doof> I haven't used this in over a year for basically anything |
22:03:12 | * | hoijui quit (Ping timeout: 260 seconds) |
22:03:22 | FromDiscord | <Elegant Beef> Well we also do have↵https://github.com/yglukhov/jnim |
22:03:35 | FromDiscord | <Elegant Beef> But out of the box nim does do C/C++/js/objc FFI |
22:03:54 | FromDiscord | <Doof Doof> Nim's got better ffi I think |
22:04:15 | FromDiscord | <Doof Doof> well - almost certainly. Monkey2 was not really more than just for making games to be fair |
22:07:44 | FromDiscord | <Doof Doof> Anyways - all good, I was just double checking earlier about the syntax stuff and I'm still happy anyhow |
22:11:37 | * | solitudesf quit (Ping timeout: 264 seconds) |
22:16:10 | * | idf31 quit (Ping timeout: 256 seconds) |
22:20:23 | * | lainon joined #nim |
22:41:23 | * | aenesidemus joined #nim |
22:46:21 | FromDiscord | <Varriount> I can't recall anyone actually using the Objective C interface recently. |
22:46:40 | FromDiscord | <Varriount> It's one of those "it worked in the past, presumably it still works" features. |
22:48:39 | FromDiscord | <XxDiCaprioxX> I mean if Nim compiles to C it should work |
22:48:48 | FromDiscord | <Yardanico> Objective C is a separate backend |
22:48:51 | FromDiscord | <Yardanico> Well, not take |
22:48:54 | FromDiscord | <Yardanico> Really* |
22:49:09 | FromDiscord | <Yardanico> Objective C "backend" is a part of the C backend |
22:49:12 | FromDiscord | <XxDiCaprioxX> But does it really matter if it is the same language |
22:49:17 | FromDiscord | <Yardanico> It's not |
22:49:25 | FromDiscord | <Yardanico> Objective C has differences from C |
22:50:20 | FromDiscord | <Yardanico> Ah well, it seems to be a superset |
22:50:47 | FromDiscord | <Yardanico> But Nim obj c backend is for allowing you to interface with objective c libraries |
23:00:13 | * | ofelas joined #nim |
23:10:54 | * | ofelas quit (Ping timeout: 256 seconds) |
23:12:02 | * | lainon quit (Ping timeout: 260 seconds) |
23:15:08 | * | krux02_ joined #nim |
23:19:07 | * | krux02 quit (Ping timeout: 265 seconds) |
23:20:52 | * | ofelas joined #nim |
23:33:37 | * | ofelas quit (Ping timeout: 260 seconds) |
23:39:26 | * | lainon joined #nim |
23:43:19 | * | lainon quit (Client Quit) |
23:44:44 | * | fredrikhr quit (Ping timeout: 265 seconds) |
23:48:55 | * | ofelas joined #nim |
23:54:10 | * | oddp quit (Quit: quit) |