00:12:26 | FromDiscord | <Bung> @ElegantBeef hmm it cant marshal jsonnode.. |
00:13:13 | FromDiscord | <ElegantBeef> Yea that makes sense dont have variant support |
00:13:21 | FromDiscord | <ElegantBeef> I do wonder if i can just use frosty in place of my marshalling |
00:13:33 | FromDiscord | <ElegantBeef> Ok time for big ol'd rewrtie |
00:14:40 | FromDiscord | <Bung> 😆 finally |
00:16:31 | * | rockcavera quit (Remote host closed the connection) |
00:18:37 | FromDiscord | <ElegantBeef> But why are you marshalling a jsonnode just send the string |
00:20:56 | FromDiscord | <Bung> hmm that will make the nims proc only accept arg1:string arg2:string .. |
00:24:58 | * | rockcavera joined #nim |
00:24:58 | * | rockcavera quit (Changing host) |
00:24:58 | * | rockcavera joined #nim |
00:32:21 | FromDiscord | <ElegantBeef> Well serialization is hard for the NimVM so i'm all for trying to make it better |
00:32:40 | FromDiscord | <ElegantBeef> Afterall the way this presently works is nimscript calls nim to convert the data into a string |
00:38:58 | FromDiscord | <Bung> so this will not get quick fixed ? |
00:39:26 | FromDiscord | <ElegantBeef> Well the serializer needs to handle case objects |
00:39:53 | FromDiscord | <ElegantBeef> I'm first going to rewrite the macros since they're more concerning to me, then go to the serializer since i want try to put more thought into it |
00:40:16 | FromDiscord | <ElegantBeef> A big issue is that the VM cannot use frosty/flatty directly due to using low level operations |
00:45:30 | FromDiscord | <Bung> ok, maybe I need find another solution, after dll and nimscripter. |
00:45:47 | FromDiscord | <ElegantBeef> What was the issue with the dll, GC'd memory? |
00:47:31 | FromDiscord | <Bung> depends how program compiled , some case returns nil when dll proc returns ref T, some case get nil access in dll proc's loop |
00:48:21 | FromDiscord | <ElegantBeef> Well you're using refs across program barriers that's bound to cause issues if you dont care for it |
00:50:55 | FromDiscord | <Bung> so the easy solution maybe still use dll gen way, using a pragma transform return type to object T |
00:51:40 | FromDiscord | <ElegantBeef> Probably |
00:58:10 | FromDiscord | <Bung> okay, I create the second PR to nimscripter. |
01:17:37 | fn | <ForumUpdaterBot99> New thread by Scotpip: Help with object serialization please!, see https://forum.nim-lang.org/t/8214 |
01:30:18 | * | cyraxjoe quit (Quit: I'm out!) |
01:32:16 | * | cyraxjoe joined #nim |
01:34:31 | FromDiscord | <aleclarson> is there a pragma that tells the compiler "this proc always raises an exception" |
01:41:49 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3slB |
01:57:32 | FromDiscord | <Rika> In reply to @aleclarson "is there a pragma": not really, theres a `{.raises: [].}` pragma that tells what the proc CAN raise |
02:03:21 | FromDiscord | <aleclarson> anyone know why `if foo == nil: raise` doesn't prove `foo` is non-nil after the `if` statement? https://play.nim-lang.org/#ix=3slM |
02:09:11 | FromDiscord | <aleclarson> found a related thread: https://forum.nim-lang.org/t/6301#38854 |
02:10:53 | FromDiscord | <ElegantBeef> You may want the `devel` `strictNotNil` |
02:12:24 | FromDiscord | <ElegantBeef> Ah probably doesnt change anything |
02:13:09 | FromDiscord | <aleclarson> i guess i'll just fork this library i'm using and remove the `notnil` usage |
02:13:42 | FromDiscord | <aleclarson> or is there a way to tell the compiler to ignore a specific error? |
02:15:40 | FromDiscord | <ElegantBeef> Warnings can be turned into errors but not vice versaa |
02:25:07 | FromDiscord | <aleclarson> In reply to @Rika "not really, theres a": Are you aware of `{.noreturn.}`? |
02:27:12 | FromDiscord | <aleclarson> Is there ever a reason to use `{.inline.}` instead of a `template`? |
02:29:12 | FromDiscord | <shadow.> In reply to @aleclarson "Is there ever a": templated arent typed are they? |
02:29:30 | FromDiscord | <shadow.> (edit) "templated" => "templates" |
02:29:37 | FromDiscord | <shadow.> or can they be typed? it's been too long lol |
02:29:40 | FromDiscord | <ElegantBeef> They can be typed |
02:31:43 | FromDiscord | <ElegantBeef> templates are guaranteed to by inlined but have some semantics you may not want for a call |
02:31:56 | FromDiscord | <ElegantBeef> like `fmt` will not work as intended |
02:46:26 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3slW |
02:50:58 | FromDiscord | <Rika> In reply to @aleclarson "Are you aware of": I don't see how it relates to exception raising |
02:52:12 | FromDiscord | <Rika> In reply to @aleclarson "anyone know why `if": Because there's not much of a prover |
02:53:04 | FromDiscord | <Rika> In reply to @Rika "I don't see how": It can mean the proc raises or that the proc quits the application I believe |
02:59:39 | * | arkurious quit (Quit: Leaving) |
03:01:24 | FromDiscord | <ajusa> In reply to @ajusa "Managed to get a": jk lol nothing works and I have no idea how dynamic dispatch works in Nim |
03:13:44 | FromDiscord | <ajusa> Can someone explain why https://play.nim-lang.org/#ix=3smb doesn't work? I would expect the method for VNString to be called here rather than the base method, but for some reason that isn't the case... |
03:14:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> right now, the nim marshal saves to json... what if nim marshall simply save to a nim file |
03:14:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> then you could later import that nim file |
03:14:33 | FromDiscord | <@bracketmaster-5a708063d73408ce4> at compiletime, not runtime |
03:16:10 | FromDiscord | <ElegantBeef> > /usercode/in.nim(24, 1) Warning: generic methods are deprecated [Deprecated] |
03:18:01 | FromDiscord | <ajusa> In reply to @ElegantBeef "> /usercode/in.nim(24, 1) Warning:": Sure but it doesn't work even if I remove the generic methods. |
03:18:53 | FromDiscord | <ElegantBeef> I dont even get how the constructors are not erroring so i'm missing something |
03:20:05 | FromDiscord | <Rika> probably something to do with multiple dispatch |
03:20:14 | FromDiscord | <ajusa> In reply to @ElegantBeef "I dont even get": what do you mean? Also simpler example here: https://play.nim-lang.org/#ix=3smf |
03:20:35 | FromDiscord | <ElegantBeef> you're doing `VNString(a + b)` |
03:20:39 | FromDiscord | <ElegantBeef> that's not valid Nim |
03:20:51 | FromDiscord | <ElegantBeef> Oh nvm |
03:20:55 | FromDiscord | <ajusa> that's a cast |
03:20:55 | FromDiscord | <ElegantBeef> I'm dumb that's converting |
03:21:06 | FromDiscord | <ElegantBeef> I was reading it as a constructor since i dont touch the OOP much |
03:21:29 | FromDiscord | <Rika> xd |
03:22:55 | FromDiscord | <ElegantBeef> Oh the reason this happens is you're causing it to convert to the base type |
03:23:20 | FromDiscord | <Rika> the first issue is that ↵`method(VNType, VNType): VNType`↵only matches other methods with ↵`method(VNSubType, VNType): VNType` |
03:23:26 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3smg |
03:23:30 | FromDiscord | <Rika> aka the other parameters + the return type must be the same |
03:24:00 | FromDiscord | <ajusa> In reply to @Rika "the first issue is": Wait only the first parameter can be a subtype? Not the second? |
03:24:02 | FromDiscord | <Rika> @ElegantBeef `/usercode/in.nim(19, 8) Warning: use {.base.} for base methods; baseless methods are deprecated [UseBase]` |
03:24:20 | FromDiscord | <Rika> In reply to @ajusa "Wait only the first": the second type must be the same as the second on the base method |
03:25:28 | FromDiscord | <ElegantBeef> Just like in most other OOP languages you cannot override a method with a more specific override |
03:25:28 | FromDiscord | <ajusa> In reply to @Rika "the second type must": ah... is there any way around that? |
03:25:49 | FromDiscord | <Rika> make a base method with each other type? |
03:25:50 | FromDiscord | <Rika> idk |
03:25:53 | FromDiscord | <Rika> i dont oop |
03:25:55 | FromDiscord | <ElegantBeef> You dont need to get around that |
03:26:18 | FromDiscord | <Rika> https://nim-lang.org/docs/manual.html#methods-multiminusmethods |
03:26:23 | FromDiscord | <Rika> this is "deprecated" |
03:26:37 | FromDiscord | <ajusa> In reply to @ElegantBeef "You dont need to": Well the issue is that these types will eventually be stored in a Table[string, VNType] so it'll all get converted to a VNType in the end |
03:26:49 | FromDiscord | <ElegantBeef> Sure but you can just handle that in your addition logic |
03:28:24 | FromDiscord | <ajusa> In reply to @Rika "this is "deprecated"": This also doesn't seem to change the output of my code 😢 probably because it is deprecated |
03:28:51 | FromDiscord | <ajusa> In reply to @ElegantBeef "Sure but you can": What do you mean? Not sure I follow |
03:29:01 | FromDiscord | <ElegantBeef> Giving an example now |
03:31:00 | FromDiscord | <ElegantBeef> https://play.nim-lang.org/#ix=3smr |
03:32:10 | FromDiscord | <ajusa> Ah got it, that's a pretty decent option actually. Thanks for all the help! |
03:32:21 | FromDiscord | <ElegantBeef> But still dont get why you're using oop here |
03:32:31 | FromDiscord | <ElegantBeef> Unless you want users to be able to add types |
03:32:41 | FromDiscord | <ajusa> because I have to type too much with variant objects |
03:32:57 | FromDiscord | <ElegantBeef> It's about the same |
03:33:14 | FromDiscord | <ajusa> (edit) "because I have to type too much ... with" added "(explicitly generate every single interaction)" |
03:33:49 | FromDiscord | <ajusa> well I'm trying both to compare them lol, and variant objects are definitely more work since you can't really do generic procs with them. |
03:35:25 | FromDiscord | <Rika> methods have larger runtime costs than variants |
03:52:56 | FromDiscord | <ajusa> Well after spending another 20 minutes wrestling with multimethods, I'm now more inclined towards the variant option. Guess I'll write templates to avoid duplicating logic 🙂 |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:41 | * | supakeen joined #nim |
05:00:05 | fn | <ForumUpdaterBot99> New thread by Stu002: Order of concept implementations and functions is significant?, see https://forum.nim-lang.org/t/8216 |
06:22:54 | * | ozzz quit (Ping timeout: 265 seconds) |
06:35:18 | FromDiscord | <Varriount> @dom96 Is there a way to download an archive of all #nim's IRC logs? Other than manually crawling the website? |
06:51:47 | FromDiscord | <haxscramper> In reply to @Yardanico "updated sqlite db of": @Varriount yardanico has a sqlite db with all messages, but it is not frequently updated |
06:53:19 | FromDiscord | <haxscramper> In reply to @ajusa "I asked something similar": You can write a macro that would do all the lifting for your - you would only need to write a mapping |
06:55:23 | FromDiscord | <haxscramper> I think you don't even need to have a DSL, just accept `static[openarray[tuple[inPair: (BoxKind, BoxKind), outRes: BoxKind]]` and write `liftImpl({(kindInt, kindInt): kindInt})` |
06:56:04 | FromDiscord | <haxscramper> At least I think you can do static openarray, otherwise `@{ ... }` will give you static tuple |
06:56:53 | FromDiscord | <haxscramper> I'd you don't want to hardcode all kind -> field mappings in the implementation you can also accept `static[array[BoxKind, string]]` mapping |
06:58:00 | FromDiscord | <haxscramper> So for variant types it is mostly correct approach, but it does add some boilerplate, so having lift macro would be important |
06:58:56 | FromDiscord | <haxscramper> Actually you can lift any n-ary procedure if you use `seq[BoxKind]` and unpack fields |
06:59:12 | FromDiscord | <haxscramper> Not just operators |
07:00:29 | FromDiscord | <Stuffe> Is there a way to define global scope constants that can be used to compile different versions, like: when defined(release) |
07:00:57 | FromDiscord | <haxscramper> `const test = true` |
07:01:25 | FromDiscord | <haxscramper> Or `const test {.booldefine.} = true` to override from command line |
07:01:34 | * | PMunch joined #nim |
07:02:06 | FromDiscord | <Stuffe> Oh I see. My bad for not trying that |
07:08:39 | FromDiscord | <ElegantBeef> Well so far the nimscripter rewrite is nice, though my sanity will soon flee with supporting descriminant objects 😄 |
07:20:47 | * | rockcavera quit (Remote host closed the connection) |
07:25:22 | PMunch | You're re-writing NimScripter? |
07:26:11 | FromDiscord | <ElegantBeef> Well some parts making it have less edge cases |
07:26:59 | FromDiscord | <ElegantBeef> Ever since understanding the macro cache it's something i've wanted to use to clean it up which it does a bit |
07:27:42 | PMunch | Macro cache? |
07:28:24 | FromDiscord | <ElegantBeef> It's a module for storing AST across module boundaries |
07:28:41 | FromDiscord | <ElegantBeef> And the ast can be typed which is what's important here |
07:29:14 | FromDiscord | <stanleyvessel> the x86_64 button at download page is broken, i tried to click the button and it says "this website cant be reached". |
07:29:26 | * | Vladar joined #nim |
07:38:07 | * | max22- joined #nim |
07:38:24 | * | max22- quit (Remote host closed the connection) |
07:38:47 | * | max22- joined #nim |
07:40:44 | PMunch | @stanleyvessel, which one? Seems to work fine for me |
07:57:45 | FromDiscord | <Bung> I fails on dll gen way, I get nil access stil. |
08:06:52 | FromDiscord | <stanleyvessel> this https://media.discordapp.net/attachments/371759389889003532/862968031037620264/df.PNG |
08:08:28 | FromDiscord | <stanleyvessel> and just turn out like this https://media.discordapp.net/attachments/371759389889003532/862968432807247882/sf.PNG |
08:08:53 | FromDiscord | <stanleyvessel> the x86 button works fine when i clicked. |
08:14:54 | FromDiscord | <ElegantBeef> Tested here and it works |
08:15:09 | PMunch | Yeah works fine here as well |
08:15:18 | PMunch | Some sort of AV scan interference? |
08:17:47 | FromDiscord | <stanleyvessel> nvm i use sha256 |
08:18:11 | FromDiscord | <stanleyvessel> thx for help |
08:57:33 | * | max22- quit (Remote host closed the connection) |
08:59:51 | * | max22- joined #nim |
09:09:10 | * | max22- quit (Remote host closed the connection) |
09:10:02 | * | max22- joined #nim |
09:19:45 | FromDiscord | <talaing> Hey, how can I access the "target" field? |
09:19:55 | FromDiscord | <talaing> https://media.discordapp.net/attachments/371759389889003532/862986411682693130/2HNswvP5.png |
09:20:22 | FromDiscord | <talaing> sent a code paste, see https://play.nim-lang.org/#ix=3spF |
09:42:10 | * | neceve joined #nim |
09:42:42 | FromDiscord | <talaing> I figured it out 👍 |
10:45:40 | FromDiscord | <planetis> does Option[var T] work? |
10:46:04 | FromDiscord | <dom96> In reply to @Varriount "<@132595483838251008> Is there a": There isn’t. But yeah, yardanico’s db is the best source right now. |
10:50:29 | FromDiscord | <konsumlamm> In reply to @planetis "does Option[var T] work?": iirc it doesn't currently |
11:11:51 | * | xet7 quit (Remote host closed the connection) |
11:13:08 | * | xet7 joined #nim |
11:21:43 | FromDiscord | <planetis> well sheep |
11:47:17 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
12:01:17 | * | max22- quit (Ping timeout: 252 seconds) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:37 | * | supakeen joined #nim |
12:17:44 | FromDiscord | <talaing> What is equivalent of Java's `DataOutputStream` in Nim?↵I want to write bytes to socket. |
12:20:49 | FromDiscord | <talaing> sent a code paste, see https://play.nim-lang.org/#ix=3sr4 |
12:49:15 | * | max22- joined #nim |
13:02:05 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srj |
13:03:28 | FromDiscord | <willyboar> I think you are missing a parenthesis |
13:04:33 | FromDiscord | <willyboar> Nope my bad |
13:09:19 | FromDiscord | <ajusa> yeah it's a fusion/matching thing, says redefinition of `it`. |
13:16:00 | FromDiscord | <haxscramper> Can you show the full code |
13:16:55 | FromDiscord | <haxscramper> In reply to @haxscramper "Number of git commits": A little more cleaned up version with nim release dates https://media.discordapp.net/attachments/371759389889003532/863046056232222730/res2.png |
13:17:48 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srr |
13:18:08 | FromDiscord | <haxscramper> with imports etc. |
13:18:39 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srt |
13:20:57 | FromDiscord | <ajusa> https://play.nim-lang.org/#ix=3sru has everything along with the compile error. What I'm basically trying to do here is have the pattern matching fill in `val1` and `val2` based on the kind field. |
13:21:40 | FromDiscord | <haxscramper> It works for my installation but not in playground |
13:21:51 | FromDiscord | <haxscramper> Consider updating to newer fusion |
13:22:00 | FromDiscord | <haxscramper> I did some fixes recently, so it might be the reason |
13:22:11 | FromDiscord | <haxscramper> Works for my fusion version |
13:22:11 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srv |
13:22:39 | FromDiscord | <ajusa> Huh okay I'll try updating it then directly from git? |
13:23:24 | FromDiscord | <haxscramper> I suppose you need can do `nimble install fusion`, but @timotheecour should know better how you are supposed to update fusion |
13:24:10 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srw |
13:24:22 | * | max22- quit (Remote host closed the connection) |
13:24:24 | * | redj quit (Quit: No Ping reply in 180 seconds.) |
13:25:21 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3srx |
13:25:56 | * | redj joined #nim |
13:27:36 | FromDiscord | <ajusa> Got it working, thanks! |
13:28:16 | * | blackbeard420 quit (Quit: ZNC 1.8.2 - https://znc.in) |
13:28:26 | * | blackbeard420 joined #nim |
13:30:04 | FromDiscord | <haxscramper> In reply to @ajusa "Well I tried doing": But that's not exactly what I meant |
13:30:54 | FromDiscord | <haxscramper> What I suggested is probably closre to multiple dispatch tree |
13:31:11 | FromDiscord | <haxscramper> that you generate at compile-time |
13:31:30 | FromDiscord | <ajusa> yeah I'm still not entirely sure what you were recommending lol. A bunch of if statements generated at compile time? |
13:32:39 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=3sry |
13:32:40 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srz |
13:32:40 | FromDiscord | <haxscramper> or construct sequence of kinds |
13:32:40 | FromDiscord | <haxscramper> and compare it like `kindSeq == [tkInt, tkInt]: <rebox things>` |
13:33:45 | * | arkurious joined #nim |
13:57:58 | fn | <ForumUpdaterBot99> New thread by LemongrabThree: Is There a Guard Pragma for Procs or Something That Would Work Like That?, see https://forum.nim-lang.org/t/8217 |
14:03:20 | FromDiscord | <haxscramper> @ajusa https://wandbox.org/permlink/kjUlIRg0aDbY3gs6 |
14:03:34 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srL |
14:03:43 | FromDiscord | <haxscramper> It is not the fastest solution, but it works for n-ary types |
14:04:05 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srM |
14:04:07 | FromDiscord | <haxscramper> To lift `-` operator |
14:04:42 | FromDiscord | <haxscramper> Since arguments are `static` you can save common operator parameters in const |
14:05:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srN |
14:06:10 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srO |
14:06:54 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srP |
14:07:21 | FromDiscord | <haxscramper> and so on |
14:07:23 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3srQ |
14:08:06 | FromDiscord | <haxscramper> In reply to @haxscramper "It is not **the**": It does allocate `seq[TypeKind]` |
14:08:10 | FromDiscord | <haxscramper> hmm |
14:09:06 | FromDiscord | <haxscramper> https://wandbox.org/permlink/mrJNEa4bBDSJho1w |
14:09:30 | FromDiscord | <haxscramper> that one does't use it |
14:10:29 | * | beshr quit (Remote host closed the connection) |
14:12:44 | FromDiscord | <System64 ~ Flandre Scarlet> Is that normal? https://media.discordapp.net/attachments/371759389889003532/863060104248164392/unknown.png |
14:13:30 | FromDiscord | <haxscramper> Not it isn't, but I don't know how to fix it exactly |
14:14:20 | FromDiscord | <System64 ~ Flandre Scarlet> ah, thanks anyways |
14:19:20 | FromDiscord | <haxscramper> In reply to @haxscramper "https://wandbox.org/permlink/mrJNEa4bBDSJho1w": I think I've seem something similar somewhere |
14:21:07 | FromDiscord | <haxscramper> And it it linear in the number of combinations, while case implementation only slows down based on number of argument |
14:25:10 | * | PMunch quit (Quit: leaving) |
14:25:32 | FromDiscord | <ajusa> Hm, okay. I'll try out some of these suggestions. Thank you so much for taking the time to figure this out, I really appreciate it @haxscramper |
14:28:14 | * | rockcavera joined #nim |
14:49:36 | * | def- quit (Quit: -) |
14:49:55 | * | def- joined #nim |
15:03:43 | federico3 | developer meeting starting now at https://meet.jit.si/NimDevMeet |
15:13:50 | FromDiscord | <System64 ~ Flandre Scarlet> does someone else knows how I can fix that please? |
15:15:24 | FromDiscord | <pointystick> hg is associated with Mercurial (a version control system, like git is), so I guess you might be able to install Mercurial on whatever OS you're using |
15:16:26 | FromDiscord | <vindaar> I think the `hg` error also appears in some circumstances if the url isn't correct anymore or something |
15:16:37 | FromDiscord | <pointystick> having said that, BitBucket dropped support for Mercurial ages ago and the following link suggests anything left there isn't accessible now:↵https://bitbucket.org/blog/sunsetting-mercurial-support-in-bitbucket |
15:16:44 | FromDiscord | <pointystick> "[Update July 1, 2020] Today, mercurial repositories, snippets, and wikis will turn to read-only mode. After July 8th, 2020 they will no longer be accessible." |
15:17:01 | FromDiscord | <vindaar> indeed the link it tries to download from\: https://bitbucket.org/BitPuffin/nim-portaudio is broken |
15:17:09 | FromDiscord | <vindaar> the error message just sucks |
15:22:09 | FromDiscord | <aleclarson> where does the `{.header: "foo.h".}` pragma look for the header? |
15:22:21 | FromDiscord | <aleclarson> (edit) ""foo.h".}`" => ""<foo.h>".}`" |
15:23:59 | FromDiscord | <dom96> In reply to @haxscramper "A little more cleaned": That pre-1.0 spike. Interesting |
15:24:30 | * | kots left #nim (#nim) |
15:30:12 | FromDiscord | <aleclarson> In reply to @aleclarson "where does the `{.header:": found a clue by searching Nim's repo. it uses `dlopen` from `<dlfcn.h>` |
15:37:07 | FromDiscord | <aleclarson> no wait, that's not right. `dlopen` isn't for headers \:) |
15:37:17 | FromDiscord | <haxscramper> In reply to @dom96 "That pre-1.0 spike. Interesting": I get it - people were fixing things for new version |
15:37:29 | FromDiscord | <haxscramper> I just was confused by this |
15:55:17 | FromDiscord | <chancyk (Chancy Kennedy)> Could anyone make a suggestion as to how to perform a non-blocking read from stdio in Nim? |
16:02:05 | FromDiscord | <dom96> stdio being what? |
16:04:14 | FromDiscord | <chancyk (Chancy Kennedy)> Oops, stdin I mean, typo. |
16:06:56 | FromDiscord | <dom96> Most portable: https://github.com/dom96/nim-in-action-code/blob/master/Chapter3/ChatApp/src/client.nim#L39 |
16:11:09 | Amun-Ra | hmm, I found a bug in 1.4.2, I'll file a pr in a day or so |
16:12:13 | FromDiscord | <pointystick> The latest stable is 1.4.8 so it might be a good idea to see if the issue is fixed in there |
16:13:00 | Amun-Ra | hmm |
16:14:03 | Amun-Ra | hmm, it's 1.4.8 |
16:16:22 | Amun-Ra | I'll try to reduce test size to the minimum, https://dpaste.com/9RQTU7YBN |
16:17:42 | Amun-Ra | what's funny: I have an array of objects and adding discard thetable[0] produces that error |
16:19:08 | FromDiscord | <gogolxdong (liuxiaodong)> How come tauri is more popular than nimx , even if nimx had already officially support so many platform? |
16:20:26 | FromDiscord | <gogolxdong (liuxiaodong)> https://github.com/tauri-apps/tauri |
16:20:29 | fn | <R2D299> itHub: 7"Build smaller, faster, and more secure desktop applications with a web frontend." |
16:28:34 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @pointystick "hg is associated with": So how can I install PortAudio? |
16:32:34 | fn | <ForumUpdaterBot99> New thread by Christianschoe: Misleading error message from startProcess(), see https://forum.nim-lang.org/t/8218 |
16:44:21 | FromDiscord | <vindaar> @System64 ~ Flandre Scarlet\: you probably can't unless you manually find that nim library somewhere else |
16:44:50 | FromDiscord | <System64 ~ Flandre Scarlet> ah I'm in trouble then :/ |
16:45:41 | FromDiscord | <vindaar> maybe use this one? https://github.com/Psirus/nordaudio |
16:45:43 | fn | <R2D299> itHub: 7"A wrapper around PortAudio" |
16:46:00 | FromDiscord | <System64 ~ Flandre Scarlet> Oh nice! Is it stable? |
16:46:13 | FromDiscord | <vindaar> no idea, literally just found it on google 😅 |
16:46:20 | FromDiscord | <whyy cant i install choosenim> you dont have much option it seems |
16:46:46 | FromDiscord | <vindaar> but Psirus seems to be active, so you can probably raise an issue if you have problems |
16:46:55 | FromDiscord | <System64 ~ Flandre Scarlet> yeah I can try |
16:58:04 | * | stkrdknmibalz joined #nim |
17:14:32 | FromDiscord | <chancyk (Chancy Kennedy)> @dom96 Got it working, thanks! |
17:18:05 | FromDiscord | <treeform> In reply to @ElegantBeef "Well the serializer needs": jsony/flatty serializers both handle case objects. |
17:20:33 | FromDiscord | <treeform> In reply to @ElegantBeef "A big issue is": jsony is tested in the VM, it uses `when vm` to run special code for vm or js case. |
17:21:13 | FromDiscord | <treeform> Let me know if you have issues using jsony/flatty in the vm or js, or with case objects. I'll fix it. |
17:25:20 | * | pro joined #nim |
17:27:09 | FromDiscord | <System64 ~ Flandre Scarlet> WTF gcc yells on me https://media.discordapp.net/attachments/371759389889003532/863109028741644318/unknown.png |
17:28:37 | FromDiscord | <System64 ~ Flandre Scarlet> I guess I need to provide the header but where??? |
17:29:38 | FromDiscord | <whyy cant i install choosenim> probably install libportaudio? |
17:29:41 | FromDiscord | <whyy cant i install choosenim> smg like that? |
17:30:07 | FromDiscord | <System64 ~ Flandre Scarlet> I need to install the C lib? |
17:31:16 | FromDiscord | <whyy cant i install choosenim> pulseaudio-dev |
17:31:19 | FromDiscord | <whyy cant i install choosenim> as in alpine |
17:31:31 | FromDiscord | <whyy cant i install choosenim> windoze? |
17:32:26 | FromDiscord | <whyy cant i install choosenim> (edit) "pulseaudio-dev" => "portaudio-dev" |
17:33:31 | FromDiscord | <whyy cant i install choosenim> there are no paxkages called portaudio in windose |
17:33:59 | FromDiscord | <System64 ~ Flandre Scarlet> Windows? |
17:34:16 | FromDiscord | <whyy cant i install choosenim> time to compile |
17:34:24 | FromDiscord | <whyy cant i install choosenim> <https://github.com/PortAudio/portaudio> |
17:35:03 | FromDiscord | <whyy cant i install choosenim> why is a heloworld application umusing portaudio btw🧐 |
17:35:18 | FromDiscord | <System64 ~ Flandre Scarlet> I called it that |
17:35:22 | FromDiscord | <whyy cant i install choosenim> (edit) "umusing" => "using" |
17:36:03 | FromDiscord | <System64 ~ Flandre Scarlet> That's my code https://media.discordapp.net/attachments/371759389889003532/863111273210183680/message.nim |
17:36:41 | FromDiscord | <vindaar> @System64 ~ Flandre Scarlet\: what do you actually need? |
17:37:24 | FromDiscord | <System64 ~ Flandre Scarlet> I need to output audio |
17:37:50 | FromDiscord | <System64 ~ Flandre Scarlet> but ``discard gmePlay(cast[ptr MusicEmu](userdata), 1024.cint,cast[ptr cshort](outputBuffer)) `` fills a buffer |
17:49:02 | FromDiscord | <System64 ~ Flandre Scarlet> What should I do? |
17:53:16 | FromDiscord | <vindaar> I'm not an audio person. There's probably easy ways to play audio that are available on windows. But I'm no help here \:/ |
17:57:40 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @vindaar "maybe use this one?": And the weird thing is it seems it doesn't interact with a dll |
17:58:28 | FromDiscord | <System64 ~ Flandre Scarlet> but maybe I got wrong |
18:22:52 | FromDiscord | <System64 ~ Flandre Scarlet> Where does it search the lib? https://media.discordapp.net/attachments/371759389889003532/863123048584183838/unknown.png |
18:29:35 | * | pro quit (Ping timeout: 252 seconds) |
18:32:33 | * | supakeen quit (Remote host closed the connection) |
18:32:56 | * | supakeen joined #nim |
18:32:57 | FromDiscord | <RattleyCooper> Have you checked out https://github.com/treeform/slappy and https://github.com/treeform/openal ? |
18:33:00 | fn | <R2D299> itHub: 7"3d sound api for nim." |
18:34:42 | * | al1ranger joined #nim |
18:36:59 | * | pro joined #nim |
18:41:16 | FromDiscord | <System64 ~ Flandre Scarlet> They're audio lib ? |
18:57:03 | FromDiscord | <RattleyCooper> I haven't used them before but it looks like it. Not sure if it exposes low level api but it says they're there to play audio |
19:01:12 | FromDiscord | <System64 ~ Flandre Scarlet> I'll check that |
19:05:54 | * | al1ranger quit (Quit: Leaving) |
19:10:14 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3stG |
19:11:32 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3stH |
19:15:56 | FromDiscord | <System64 ~ Flandre Scarlet> In reply to @RattleyCooper "Have you checked out": seems they doesn't support callbacks |
19:19:05 | * | cyraxjoe quit (Ping timeout: 255 seconds) |
19:19:26 | * | MightyJoe joined #nim |
19:23:06 | FromDiscord | <@bracketmaster-5a708063d73408ce4> How can I inspect the current address of an object a variable points to? |
19:23:07 | FromDiscord | <@bracketmaster-5a708063d73408ce4> and then perhaps echo that address? |
19:44:35 | FromDiscord | <System64 ~ Flandre Scarlet> Does it search a dll? https://media.discordapp.net/attachments/371759389889003532/863143616141590548/unknown.png |
20:02:08 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/liu |
20:02:40 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3stY |
20:03:47 | FromDiscord | <haxscramper> you actually need `echo cast[int](addr tmp)` |
20:06:13 | * | rockcavera quit (Remote host closed the connection) |
20:13:25 | * | MightyJoe quit (Read error: Connection reset by peer) |
20:17:14 | * | cyraxjoe joined #nim |
20:22:06 | FromDiscord | <System64 ~ Flandre Scarlet> SIGSEGV: Illegal storage access. (Attempt to read from nil?)SIGSEGV: Illegal storage access. (Attempt to read from nil?)↵↵Same thing as NilAccessDefect exception? |
20:33:39 | FromDiscord | <haxscramper> Yes |
20:33:58 | FromDiscord | <RattleyCooper> Is there a list of special operators like ``[]=``? |
20:34:07 | * | pro quit (Quit: WeeChat 3.2) |
20:34:12 | FromDiscord | <haxscramper> `{}`, `[]`, `[]=`, `{}=` |
20:34:21 | FromDiscord | <haxscramper> The list if fixed |
20:34:27 | FromDiscord | <RattleyCooper> Ok cool, thank you 😄 |
20:35:19 | FromDiscord | <RattleyCooper> Do you know what the syntax is for `[]` operator when creating custom operator? |
20:35:26 | FromDiscord | <RattleyCooper> Like the `proc` arguments? |
20:35:46 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3su3 |
20:35:48 | FromDiscord | <RattleyCooper> Oh wow, easy enough, thanks! |
20:35:53 | FromDiscord | <haxscramper> Second and all subsequent arguments go to `[]` |
20:36:04 | FromDiscord | <haxscramper> With `[]=` last argument goes to `= <last argument>` |
20:36:35 | FromDiscord | <haxscramper> Under what circumstances `{.deprecated: "XXXX".}` might not work? I'm running compilation as `nim c --skipUserCfg --skipProjCfg --skipParentCfg '--warning[Deprecated]:on' make_wrap.nim` and it does not output expected deprecation warnings. |
20:38:54 | FromDiscord | <haxscramper> I have no `{.warning[Deprecated]: off.}` anywhere |
20:39:39 | FromDiscord | <haxscramper> And I also added explicit `{.warning[Deprecated]:on.}` in the code |
20:41:48 | FromDiscord | <haxscramper> Alright, I had to put `{.warning[Deprecated]:on.}` literally on top of the function I've deprecated and now it works |
20:42:14 | FromDiscord | <haxscramper> Is there any way to debug things like this? Like what warnings are turned on/off and where |
20:47:25 | * | pro joined #nim |
20:47:36 | FromDiscord | <haxscramper> No, now I need to enable it per-module |
20:52:44 | * | cyraxjoe quit (Ping timeout: 268 seconds) |
21:02:48 | FromDiscord | <System64 ~ Flandre Scarlet> is it possible to have the classic for loop in Nim? |
21:03:08 | FromDiscord | <System64 ~ Flandre Scarlet> the C-style for |
21:03:44 | FromDiscord | <ElegantBeef> i mean `for x in 0..y` is the "classic" |
21:03:55 | FromDiscord | <ElegantBeef> alternatively `countUp` and `countDown` |
21:04:01 | fn | <ForumUpdaterBot99> New thread by Sixte: New concepts, visibility and mount points , see https://forum.nim-lang.org/t/8219 |
21:04:05 | FromDiscord | <ElegantBeef> Otherwise a while loop works |
21:13:22 | FromDiscord | <ElegantBeef> @treeform yea i'll give flatty a try though it's a pretty large api i need to get in nimscript so going to be tedious |
21:17:31 | * | Vladar quit (Remote host closed the connection) |
21:19:12 | FromDiscord | <System64 ~ Flandre Scarlet> ``int sample_nr = user_data;`` in C, supposing user_data is a pointer↵That's the same thing as ``var sample_nr = cast[ptr cint](userdata)`` in Nim right? |
21:19:30 | FromDiscord | <ElegantBeef> `userdata.addr` |
21:19:55 | FromDiscord | <System64 ~ Flandre Scarlet> ah thanks |
21:20:30 | FromDiscord | <System64 ~ Flandre Scarlet> it says expression has no address |
21:23:33 | FromDiscord | <treeform> In reply to @ElegantBeef "<@!107140179025735680> yea i'll give": Not sure what you mean, don't you just import a file? |
21:24:11 | FromDiscord | <treeform> I though when you said nim script you meant some thing like `static data: string = foo.toFlatty()` |
21:24:18 | FromDiscord | <ElegantBeef> Nope |
21:24:32 | FromDiscord | <treeform> that runs flatty in "nimscript" |
21:24:35 | FromDiscord | <treeform> during the compiler phase |
21:24:39 | FromDiscord | <ElegantBeef> Yea i know |
21:24:55 | FromDiscord | <treeform> I though that is what you meant |
21:25:10 | FromDiscord | <ElegantBeef> Nope i'm running a nim vm from a nim program, and communicating between the two |
21:25:24 | FromDiscord | <ElegantBeef> If it works in the nim vm it might be as simple as getting people to include flatty in their nimscript stdlib |
21:25:25 | FromDiscord | <treeform> Yeah I have not done that. So flatty is not tested there. |
21:25:34 | FromDiscord | <ElegantBeef> Well it's still the NimVm |
21:25:44 | FromDiscord | <treeform> yeah in theory it should just import and work |
21:28:22 | FromDiscord | <treeform> you might combine flatty.nim and objvar.nim into a single file to make it easier include in the vm |
21:28:42 | FromDiscord | <treeform> I feel like objvar.nim should be part of std/typetraits or some thing... |
21:32:11 | FromDiscord | <ElegantBeef> Oh yay `Error: internal error: environment misses: a` |
21:33:02 | FromDiscord | <haxscramper> @ElegantBeef have you considered converting objects from nim side to PNode in the nimscript? It is used internally for object representation, so it might be the fastest |
21:33:17 | FromDiscord | <haxscramper> Since any other deserialization would have to be converted to PNode anyway |
21:33:33 | FromDiscord | <ElegantBeef> Dont quite follow what you mean |
21:34:55 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/rgM |
21:34:55 | FromDiscord | <haxscramper> It is a tree repr of the VM data |
21:35:11 | FromDiscord | <haxscramper> I have an example for this, if I could find it |
21:35:26 | FromDiscord | <ElegantBeef> Doesnt that require so much more serialization logiic |
21:36:00 | FromDiscord | <haxscramper> https://github.com/haxscramper/hack/blob/master/testing/nim/compilerapi/test3.nim |
21:36:27 | FromDiscord | <haxscramper> In reply to @ElegantBeef "Doesnt that require so": Yes, and? Any other way the VM would have to do it in the end |
21:36:56 | FromDiscord | <haxscramper> So if you are passing sequence of ints for example, with flatty you would encode it, then decode in the VM, and then VM would construct an object |
21:37:03 | FromDiscord | <haxscramper> That would be represented as PNode |
21:37:25 | FromDiscord | <haxscramper> In reply to @haxscramper "https://github.com/haxscramper/hack/blob/master/tes": You can dump different things, like enums etc |
21:37:32 | FromDiscord | <haxscramper> To see what is going on |
21:38:49 | FromDiscord | <haxscramper> hnimast is needed for treeDump of the PNode, otherwise you can use astalgo/dump |
21:39:03 | FromDiscord | <Bung> cant see how it works from your link |
21:39:27 | FromDiscord | <Bung> you feed static code data |
21:40:18 | FromDiscord | <ElegantBeef> So in this case i'd override the vm procedures with the parsing of pnodes? |
21:40:59 | FromDiscord | <haxscramper> No. You should somehow just pass PNode and directly cast inside of a VM, or somehow trick compiler into thinking |
21:41:17 | FromDiscord | <haxscramper> So you create VM data manually |
21:41:26 | FromDiscord | <haxscramper> And then convince it is the real deal |
21:41:28 | FromDiscord | <ElegantBeef> then how does nimscript call Nim code |
21:41:46 | FromDiscord | <haxscramper> We are talking about passing data? |
21:41:56 | FromDiscord | <ElegantBeef> Well it's both |
21:42:02 | FromDiscord | <haxscramper> And optimizing it |
21:42:25 | FromDiscord | <ElegantBeef> I'm trying to understand how your suggestion would work |
21:44:15 | FromDiscord | <haxscramper> I think I need to make an example, probably not going to explain it good enough |
21:44:48 | FromDiscord | <Bung> it looks to me it need give a PNode for data structure and the data in memory , then use them deserialize ? |
21:44:51 | FromDiscord | <haxscramper> Certainly not now, with 30% brainpower remaining |
21:44:51 | FromDiscord | <ElegantBeef> Well i understand you get the pnodes directly then convert to/from, but i dont see how the interop is going to happen them |
21:45:03 | FromDiscord | <ElegantBeef> (edit) "them" => "then" |
21:45:34 | FromDiscord | <haxscramper> Maybe I'm missing something, I will make an example tomorrow |
21:47:12 | FromDiscord | <ElegantBeef> Well flatty doesnt work in the nimVm it lacks `copyMem` |
21:59:35 | * | pro quit (Ping timeout: 252 seconds) |
22:01:07 | * | cyraxjoe joined #nim |
22:01:08 | * | cyraxjoe quit (Client Quit) |
22:02:55 | * | cyraxjoe joined #nim |
22:04:20 | * | cyraxjoe quit (Client Quit) |
22:06:01 | * | cyraxjoe joined #nim |
22:40:54 | FromDiscord | <garett> I'm trying to figure out how to use `hasCustomPragma`, and it is not working as I expect it to↵Here is what I'm trying: https://play.nim-lang.org/#ix=3suy |
22:41:33 | FromDiscord | <garett> I want my `test` macro to be able to find the `{.swizzle.}` custom pragma attached to the `proc r` |
22:43:20 | FromDiscord | <garett> Anyone here familiar with using `hasCustomPragma` in a macro? |
22:48:22 | FromDiscord | <garett> sent a code paste, see https://play.nim-lang.org/#ix=3suC |
22:52:23 | FromDiscord | <Bung> https://github.com/bung87/scorper/blob/devel/src/scorper/http/routermacros.nim |
22:52:43 | FromDiscord | <Bung> I have this one |
22:54:23 | FromDiscord | <Bung> well, you check on proc call, it should check on proc def |
22:55:28 | FromDiscord | <garett> When you say def, is that accessible by `getType`, `getTypeInst`, or `getTypeImpl`? |
22:56:03 | FromDiscord | <Bung> am not familar with getType family apis. |
22:56:06 | FromDiscord | <garett> I see you're doing this in a template, I wonder whether it cannot be done in a macro? |
22:56:36 | FromDiscord | <Bung> maybe you try procSym.getTypeImpl.hasCustomPragma |
22:58:52 | FromDiscord | <garett> I tried it and discovered that `hasCustomPragma` can only operate on `{nnkSym, nnkBracketExpr, nnkDotExpr, nnkCheckedFieldExpr, nnkTypeOfExpr}` |
23:00:05 | * | jkl quit (Quit: ZNC 1.8.2 - https://znc.in) |
23:01:32 | FromDiscord | <Bung> weird, not including procTy |
23:02:46 | FromDiscord | <garett> looks like you can check `hasCustomPragma` only at runtime, not at compile time |
23:02:52 | FromDiscord | <garett> This is pretty disappointing 🙂 |
23:25:02 | FromDiscord | <treeform> In reply to @System64 "seems they doesn't support": What kind of callbacks do you need? |
23:32:30 | * | aeverr joined #nim |
23:35:18 | * | aeverr_ quit (Ping timeout: 265 seconds) |