<< 11-07-2021 >>

00:00:20*neceve quit (Ping timeout: 255 seconds)
00:53:29*arkurious quit (Quit: Leaving)
01:00:52*MightyJoe joined #nim
01:02:11*cyraxjoe quit (Ping timeout: 252 seconds)
01:04:01*beshr quit (Ping timeout: 246 seconds)
01:04:02*bkay joined #nim
01:30:51*stkrdknmibalz joined #nim
01:32:06*vicfred joined #nim
01:57:59FromDiscord<Rika> In reply to @glasso "I don't like this": Oh man then you’re not gonna like Nim
02:00:06*MightyJoe quit (Ping timeout: 252 seconds)
02:33:52FromDiscord<hamidb80> In reply to @Rika "Oh man then you’re": +1
02:36:27FromDiscord<hamidb80> https://nimble.directory/docs/optionsutils//optionsutils.html↵@ElegantBeef what's this? 😆
02:36:43FromDiscord<ElegantBeef> What's what?
02:36:52FromDiscord<hamidb80> https://media.discordapp.net/attachments/371759389889003532/863609756085387314/unknown.png
02:36:56FromDiscord<hamidb80> optionutils documentations
02:37:15FromDiscord<ElegantBeef> Why would i know why they arent showing
02:37:47FromDiscord<hamidb80> In reply to @ElegantBeef "Why would i know": https://media.discordapp.net/attachments/371759389889003532/863609985463222302/unknown.png
02:38:11FromDiscord<ElegantBeef> I'm not a maintainer, i made a single PR
02:55:39FromDiscord<Bung> @haxscramper how I contruct jsonnode from pnode ?
03:01:39FromDiscord<ElegantBeef> From looking at what was shared you iterate the node based off the expected type and just convert that to the coresponding type
03:04:43FromDiscord<ElegantBeef> I will eventually get to doing what hax suggested, just requires supporting case objects, tuples, objects, and primitives 😄
03:04:50FromDiscord<ElegantBeef> Actually primitives are simple
03:04:59FromDiscord<ElegantBeef> The objects/tuples are the complex stuff
03:21:55*joshbaptiste quit (Ping timeout: 256 seconds)
03:51:48FromDiscord<Bung> `proc fromVm(t: typedesc[JsonNode], node: PNode): string =↵ discard` this is what I have..
04:06:01*supakeen quit (Quit: WeeChat 3.2)
04:06:37*supakeen joined #nim
05:59:11*max22- joined #nim
05:59:29*max22- quit (Remote host closed the connection)
05:59:51*max22- joined #nim
06:08:54*[R] quit (Quit: No Ping reply in 180 seconds.)
06:09:02*[R] joined #nim
06:26:22*max22- quit (Ping timeout: 246 seconds)
06:32:26*max22- joined #nim
06:40:56FromDiscord<haxscramper> In reply to @Bung "<@!608382355454951435> how I contruct": You write a code that converts PNode to JsonNode, there is no built-in support for that. Might want to use treefrom/jsony
06:41:19FromDiscord<haxscramper> If you need to work with a VM json node is not different from any other type
06:42:25FromDiscord<haxscramper> In reply to @ElegantBeef "The objects/tuples are the": If you don't want to implement object declaration unparsing for a millionth time you can use hnimast - it has all the necessary primitives for serialization implementation
06:43:48FromDiscord<haxscramper> https://github.com/haxscramper/nimtraits/blob/867e173e9ff8ff58e6fe1eacfa539b59823a3c0f/src/nimtraits/trait_xml.nim#L81 for XML serialization example
06:44:25FromDiscord<haxscramper> Pnode represents all things as a flat list of ExprEqExpr
06:44:36FromDiscord<haxscramper> ColonExpr
06:44:41FromDiscord<ElegantBeef> Well there is no point for serialization when given the known type and Pnode
06:44:55FromDiscord<ElegantBeef> go from a Pnode to a given generic
06:45:02FromDiscord<ElegantBeef> (edit) "generic" => "type"
06:45:07FromDiscord<haxscramper> Type -> PNode isn't a serialization?
06:45:51FromDiscord<ElegantBeef> Misunderstood the implication
06:46:10FromDiscord<haxscramper> I think it can be called that, the only difference that I generate PNode and not json. Anyway, it's just a matter of terminology
06:48:13FromDiscord<ElegantBeef> But yea i'll see what i can do with it, since i know the type i want/know what it needs to be i can probably just go straight to/from
06:49:46FromDiscord<whyy cant i install choosenim> why does nim have all da libx dependencies
06:58:11FromDiscord<Bung> It looks like need implement every types are not primitive ?
07:07:27FromDiscord<ElegantBeef> Yep, you need to convert the list of `a: b` to objects
07:07:37FromDiscord<ElegantBeef> I will get to it eventually
07:30:42*Vladar joined #nim
07:34:10*max22- quit (Remote host closed the connection)
07:39:06*max22- joined #nim
07:41:28*maxime_ joined #nim
07:43:58*max22- quit (Ping timeout: 246 seconds)
08:12:41FromDiscord<hamidb80> i wish i could change evaluation priority in macros
08:16:30*vicfred quit (Quit: Leaving)
08:19:34FromDiscord<ElegantBeef> Why?
08:25:10FromDiscord<hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3sD0
08:25:26FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3sD0" => "https://paste.rs/Cf9"
08:25:42*nixfreak_nim[m] quit (Quit: Bridge terminating on SIGTERM)
08:25:42*Helios quit (Quit: Bridge terminating on SIGTERM)
08:25:42*happycorsair[m] quit (Quit: Bridge terminating on SIGTERM)
08:25:57FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3sD2" => "https://play.nim-lang.org/#ix=3sD1"
08:26:02FromDiscord<hamidb80> (edit) "https://play.nim-lang.org/#ix=3sD1" => "https://paste.rs/dnP"
08:26:42FromDiscord<hamidb80> i notices this problem also in https://github.com/disruptek/cps
08:26:44fn<R2D299> itHub: 7"Continuation-Passing Style for Nim 🔗"
08:28:03FromDiscord<hamidb80> when the `cps` macro collects all of the enviroment vars into an object
08:29:01FromDiscord<hamidb80> it cant detect other format of variable declaration
08:29:03FromDiscord<hamidb80> like in https://github.com/technicallyagd/unpack
08:29:03*nixfreak_nim[m] joined #nim
08:29:05fn<R2D299> itHub: 7"sequence/object unpacking/destructuring for nim"
08:29:05*Helios joined #nim
08:29:19*happycorsair[m] joined #nim
08:29:27FromDiscord<hamidb80> does it make sense?
08:29:48FromDiscord<hamidb80> (edit) "does it ... make" added "[my opinion]"
08:44:48FromDiscord<Rika> What would the solution be though?
08:48:36*bkay quit (Quit: Leaving)
08:48:52*beshr joined #nim
08:48:52*beshr quit (Changing host)
08:48:52*beshr joined #nim
08:50:19FromDiscord<haxscramper> Accept typed AST, it will expand before being passed to macro
08:50:35FromDiscord<haxscramper> In reply to @hamidb80 "sometimes i need to": It would solve this problem
08:56:54FromDiscord<Bung> Can i get current `ConfigRef` ?
08:59:48FromDiscord<haxscramper> From module graph?
09:00:49FromDiscord<Bung> in template , I want call compiler/options.nim findModule
09:01:49FromDiscord<Bung> sent a code paste, see https://play.nim-lang.org/#ix=3sDh
09:01:59FromDiscord<Bung> this is what am trying to do
09:02:11FromDiscord<haxscramper> Pnode is untyped?
09:02:36FromDiscord<Bung> h is a module name , sym in ast
09:03:53FromDiscord<haxscramper> You can't conflate symbols from compilation time (what you import) and runtime (processed by compiler package)
09:09:40FromDiscord<Bung> so that would be not possible, if I manual handle path it'll only works user not have extro --path specified.
09:10:46FromDiscord<haxscramper> You can, in theory, get instantiation info from module symbol at compile-time
09:11:02FromDiscord<haxscramper> And get source code path
09:11:41FromDiscord<Bung> hmm , thought I just need files from source dir and nimble that will be fine, just need manually handle imports pnode to path.
09:35:36FromDiscord<PressF> sent a code paste, see https://play.nim-lang.org/#ix=3sDt
09:36:39FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=3sDw
09:37:31FromDiscord<vindaar> (often it's clearer to define the procs you want to hand as their own type, e.g. `type FooProcs = proc(x: int)` and then just write `p: FooProcs` in the signature)
09:39:17FromDiscord<PressF> could I use generics for that?
09:39:35FromDiscord<vindaar> sure you can
09:40:18FromDiscord<Rika> you have to be mindful to pass the right arg types in that case
09:41:12FromDiscord<vindaar> ^ yup
09:48:28*neceve joined #nim
09:54:32FromDiscord<PressF> I guess it's time to learn nim generics hahah. Thx
10:01:41FromDiscord<InventorMatt> @PressF you could also do it kind of like this https://play.nim-lang.org/#ix=3sDG
10:02:51FromDiscord<sealmove> Damn I can't get this right. I want to brute force binary data until I find a match. How do I check length-by-length (first '0' then, '1' then '00', then '01') instead of going '0' -> '00' -> '000' -> ... infinity)?
10:04:24FromDiscord<Rika> on NPEG?
10:04:44FromDiscord<sealmove> no, just regular code. let's say the digits are in a string.
10:05:38FromDiscord<Rika> i dont see the issue with just iterating through the string and seeing what the value of the char is
10:05:58FromDiscord<Rika> its not like theres an instance where you backtrack, its only two choices
10:07:42FromDiscord<sealmove> I know, that's why I am surprised I can't get it right. Well, I don't have fixed strings to check. I want to gradually generate all possible combinations and pass each combination to a proc which checks if the sequence is matched based on some criteria.
10:09:08FromDiscord<Rika> "all possible combinations" can only be done if you can constrain the length...
10:09:14FromDiscord<sealmove> really?
10:09:31FromDiscord<sealmove> why can't I check length-by-length?
10:09:32FromDiscord<Rika> i mean wait
10:09:33FromDiscord<Rika> rather
10:09:43FromDiscord<Rika> yes i know
10:09:53FromDiscord<Rika> its possible to "collapse it"
10:10:01FromDiscord<Rika> but as it is its impossible, i was just unclear
10:10:22FromDiscord<Rika> so how would you pass "all combinations" to a proc?
10:11:26FromDiscord<sealmove> my thinking is to check combinations 1-by-1 until a match is found. First check all 1-digit seqs, then all 2-digit seqs, then all 3-digit seqs etc.
10:12:01FromDiscord<Rika> is this criteria basing against the whole data or just each digit?
10:12:08FromDiscord<sealmove> whole data
10:12:47FromDiscord<Rika> ok sorry im trying to understand why you're getting 0 -> 00 -> 000...
10:13:11FromDiscord<sealmove> because I don't know how to generate the combinations in the correct order >_<
10:13:25FromDiscord<Rika> if the data is rejected, remove the last digit and get the next possible digit↵if the data is not rejected, continue
10:13:52FromDiscord<sealmove> but for example 010 might be invalid but 0101 valid
10:13:56FromDiscord<Rika> (edit) "continue" => "add the next digit (initial)"
10:14:00FromDiscord<Rika> hm
10:14:16FromDiscord<Rika> okay let me think more then
10:14:38FromDiscord<sealmove> thanks, surprisingly it's non-trivial...
10:14:55FromDiscord<Rika> i dont think thats possible then, what if 0(a billion 0s later)1 is the only valid value?
10:15:33FromDiscord<Rika> what if a massive amount of 0s is the only valid value?
10:15:39FromDiscord<sealmove> i don't care, I assume a correct value will be of a reasonable length
10:15:57FromDiscord<sealmove> that being said I can't constrain it to a specific length
10:15:58FromDiscord<Rika> okay, so what is the reasonable length?
10:16:59FromDiscord<sealmove> well, I don't want to set a magic value if I don't have to. I assume there is a way to search length-by-length. I don't care if there is chance the program won't stop running.
10:17:28FromDiscord<sealmove> since it's brute-force, it will run until it finds a match
10:18:37FromDiscord<enthus1ast> the issue is that you do not now the "0" padding
10:19:14FromDiscord<enthus1ast> so either\: 00001 or 1 is the valid value
10:19:42FromDiscord<sealmove> no that's not an issue, let's say we work with strings
10:19:50FromDiscord<Rika> ?
10:19:52FromDiscord<sealmove> 00001 is different from 1
10:19:54FromDiscord<Rika> sent a code paste, see https://play.nim-lang.org/#ix=3sDO
10:21:01FromDiscord<sealmove> hmm ok Rika, I'll look into it. Although I am curious of how to generate the permutations myself.
10:21:11FromDiscord<Rika> its also in narimiran's itertools
10:21:19FromDiscord<Rika> actually
10:21:23FromDiscord<Rika> no i dont think itrs permutations you want
10:21:33FromDiscord<Rika> i forgot what exactly the thing is you want
10:21:56FromDiscord<Rika> but its somewhat related but not very similar to permutations
10:22:01FromDiscord<enthus1ast> @sealmove\: yes but when you do not know the zero padding you cannot really bruteforce since it could be any amounth of zeros
10:22:34FromDiscord<sealmove> In reply to @enthus1ast "<@173424250319929344>\: yes but": how is padding relevant?
10:22:49FromDiscord<enthus1ast> "00001" != "01"
10:22:57FromDiscord<sealmove> yes?
10:23:35FromDiscord<Rika> but as said above before, "i don't care, I assume a correct value will be of a reasonable length"
10:25:06FromDiscord<enthus1ast> if you do not know the length then you must also bruteforce the length
10:25:29FromDiscord<sealmove> In reply to @enthus1ast "if you do not": sure
10:25:32FromDiscord<Rika> https://stackoverflow.com/questions/29718294/how-to-get-nth-permutation-when-repetition-is-allowed might help (yes its java but i think this is what you want exactly regarding the permutation part i mentioned in the almost pseudocode)
10:25:48FromDiscord<sealmove> In reply to @enthus1ast "if you do not": hmm, oh, obvious but actually usefull insight maybe
10:26:11FromDiscord<Rika> yeah that's what i did in the code
10:26:14FromDiscord<Rika> `i` is the length
10:26:34FromDiscord<sealmove> i see, ok I think it's more clear now.
10:26:38FromDiscord<Rika> then you get permutations w/ repetition of `0, 1`
10:27:08FromDiscord<Rika> there might be a more smart idea of course
10:31:39FromDiscord<Bung> how I convert string to symbol in template ?
10:32:02FromDiscord<sealmove> what do you mean by 'symbol'?
10:32:31FromDiscord<Bung> like module name I just imported
10:33:42FromDiscord<Rika> strtoast or something i forget the names of procs easily
10:33:51FromDiscord<Rika> might be in the std/macros module
10:33:55FromDiscord<sealmove> there is ident()
10:34:05FromDiscord<sealmove> not sure if this is what you want
10:34:58FromDiscord<Bung> it will throw `Error: undeclared identifier: 'newIdentNode`
10:36:04FromDiscord<Bung> oh , macros need visible in call side..
10:38:01FromDiscord<sealmove> you need to import the macros module
10:38:24*arkurious joined #nim
10:40:07FromDiscord<sealmove> enthus1ast thanks, thanks to your insight I solved the issue.
10:43:09FromDiscord<Bung> well, it convert to NimNode, how to convert it to resolved type ?
10:45:11FromDiscord<sealmove> there are two kinds of macros, typed and untyped. if you are using untyped, then you lose type info and can't resolve it. You are just generating AST and the identifier must be valid after the macro expansion.
10:45:49FromDiscord<sealmove> if you can provide more info about what you are doing so we can helop
10:46:33FromDiscord<Bung> https://play.nim-lang.org/#ix=3sDZ
10:46:40FromDiscord<Bung> see here is what am trying to do
10:47:06FromDiscord<Bung> I tried to change template to macro but I will not get instantiationInfo
10:48:21FromDiscord<Bung> I can push to github if you need full code
10:49:23FromDiscord<haxscramper> Generate a call to macro that accepts `typed` argument
10:49:23FromDiscord<haxscramper> And semcheck will resolve identifiers to types, but as sealmove just said the code must be fully valid
10:49:23FromDiscord<haxscramper> You need to implement it as multistage macro↵(@Bung)
10:51:39FromDiscord<haxscramper> It just hurts to see three intermediate variables for that
10:51:40FromDiscord<haxscramper> For macros you use https://nim-lang.org/docs/macros.html#lineInfoObj%2CNimNode for arguments
10:51:40FromDiscord<haxscramper> Can use \<\> to get location of the arguments\
10:51:52FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3sE0
10:53:03FromDiscord<PsychoClay> how to echo a pointer?
10:53:56FromDiscord<haxscramper> `echo cast[int](<pointer>)` or `echo <pointer>.repr`
10:56:30FromDiscord<Bung> lineInfoObj solve the problem.
10:58:19FromDiscord<Bung> `Error: cannot 'importc' variable at compile time; stderr` compiler.options has `if terminal.isatty(stderr)`
11:03:12FromDiscord<Bung> hmm, so much proc cant call in compile time.
11:04:26FromDiscord<haxscramper> Well, of course you can't use compiler API at compile-time
11:04:32FromDiscord<haxscramper> It is only for C backend
11:09:10*maxime_ quit (Remote host closed the connection)
11:09:27*maxime_ joined #nim
11:09:41FromDiscord<PressF> sent a long message, see http://ix.io/3sEa
11:09:49FromDiscord<Rika> wait wait wait i dont remember what i said
11:09:50FromDiscord<Rika> lmao
11:09:57FromDiscord<Rika> nim doesnt have eval yes
11:10:22FromDiscord<Rika> actually theres prolly a 3rd party lib that can run nimscript on runtime
11:12:05FromDiscord<haxscramper> https://github.com/beef331/nimscripter
11:12:07fn<R2D299> itHub: 7"Quick and easy Nim <-> Nimscript interop"
11:13:43FromDiscord<haxscramper> https://github.com/dsrw/enu
11:13:44FromDiscord<haxscramper> I think enu uses similar approach to what you are trying to do @PressF
11:13:44FromDiscord<haxscramper> https://www.youtube.com/watch?v=AW0PT9j976s
11:13:45fn<R2D299> itHub: 7"A Logo-like DSL for Godot, implemented in Nim"
11:13:47fn<R2D299> outube: 7"Early Enu Demo"
11:15:32*supakeen quit (Remote host closed the connection)
11:15:56*supakeen joined #nim
11:19:04FromDiscord<PressF> In reply to @haxscramper "https://github.com/beef331/nimscripter": Thx. I'll try it
11:52:58FromDiscord<whyy cant i install choosenim> ēnū
12:06:02*supakeen quit (Quit: WeeChat 3.2)
12:06:37*supakeen joined #nim
12:09:38*aeverr quit (Remote host closed the connection)
12:10:06*aeverr joined #nim
12:42:35*maxime_ quit (Ping timeout: 268 seconds)
12:56:27*maxime_ joined #nim
13:14:21FromDiscord<haxscramper> IRC logs is now missing all anchors for message timestamps, or I'm missing something?
13:14:37FromDiscord<haxscramper> For example `https://irclogs.nim-lang.org/18-08-2012.html#21:14:15` does't link to a message
13:15:07FromDiscord<haxscramper> Tried chrome and firefox
13:16:57FromDiscord<haxscramper> Actually no, it only applies to logs from 2021
13:16:57FromDiscord<haxscramper> Actually no, it only applies to logs from 2012
13:17:19FromDiscord<Rika> so is it 2021 or 2012
13:17:29FromDiscord<haxscramper> 12
13:32:15FromDiscord<dom96> yes, old logs are static html
13:32:20FromDiscord<dom96> so timestamps don't work
13:54:39*maxime_ quit (Remote host closed the connection)
14:01:24*maxime_ joined #nim
14:20:21FromDiscord<shadow.> has anyone gotten the nim.nvim plugin working with coc.nvim?
14:20:38FromDiscord<shadow.> i'm currently using coc.nvim with nimlsp as a custom language server but i'm kind of underwhelmed by the performance so i want to try out nim.nvim
14:20:48FromDiscord<shadow.> but i don't wanna install another completion engine just for one plugin
14:23:00*cyraxjoe joined #nim
14:25:47FromDiscord<Bung> I dont unserstand , they both support lsp, then you only need is lsp server
14:26:41FromDiscord<shadow.> In reply to @Bung "I dont unserstand ,": is it the lsp server that's limited then? it just seems like i was able to get a little more functionality on vscode
14:28:02FromDiscord<Bung> I cant say more , I use my fork version nimlsp
14:28:06FromDiscord<shadow.> hmmm it actually seems to be working better now
14:28:12FromDiscord<shadow.> idk then lol
14:28:17FromDiscord<shadow.> thanks anyways
14:30:35FromDiscord<Bung> I know the server implementation, the server will crash when you use nimble package havn't installed, crash when syntax error, it's synchronous server
14:30:47*cyraxjoe quit (Quit: I'm out!)
14:38:10*cyraxjoe joined #nim
14:44:38fn<ForumUpdaterBot99> New thread by Schneiderfelipe: Inlining macro and (probable) problems with HiddenStdConv/HiddenCallConv, see https://forum.nim-lang.org/t/8220
15:09:19*pro joined #nim
15:16:33*supakeen quit (Remote host closed the connection)
15:16:57*supakeen joined #nim
15:33:38*neceve quit (Ping timeout: 255 seconds)
15:57:05*stkrdknmibalz quit (Quit: WeeChat 3.0.1)
16:02:41*cyraxjoe quit (Quit: I'm out!)
16:12:19*cyraxjoe joined #nim
16:13:14FromDiscord<carpal> does nim have an ir?
16:15:59FromDiscord<hugogranstrom> In reply to @carpal "does nim have an": Nim's AST is what's used in the compiler and then it converts it into C/C++/JS
16:16:26FromDiscord<Quibono> There been any talk of a native backend?
16:17:28FromDiscord<hugogranstrom> There's quite a bit of resistance I feel for that
16:17:45FromDiscord<hugogranstrom> There is a separate project that has it though
16:18:08FromDiscord<Quibono> What's that? I've always thought a native backend was a noble (if maybe foolhardy) goal
16:19:04FromDiscord<hugogranstrom> https://github.com/arnetheduck/nlvm
16:19:06fn<R2D299> itHub: 7"LLVM-based compiler for the Nim language"
16:19:45FromDiscord<Quibono> Oh cool.
16:21:01FromDiscord<haxscramper> Especially considering interop with these languages
16:21:01FromDiscord<haxscramper> On the contrary, it is inferior to generating C/C++/Js
16:21:02FromDiscord<haxscramper> It doesn't add any immediate value↵(@Quibono)
16:21:04FromDiscord<hugogranstrom> I think that would be loooong in the future if it happens. There is very much work for not that many advantages. GCC is so optimized and you'd basically have to generate better code than it
16:21:38FromDiscord<Quibono> I mean I think the primary initial benefit is the potential of extremely fast compile times.
16:21:47FromDiscord<Quibono> But again, I said it was potentially foolhardy for a reason.
16:22:14FromDiscord<Quibono> I know V is slowly working on it for that reason, not to compete with optimizing compilers (yet)
16:22:44FromDiscord<haxscramper> Main slowdown for nim compiler is the nim part itself, not a C compilation
16:22:52FromDiscord<haxscramper> That's why we have IC
16:23:00FromDiscord<haxscramper> Going to have IC
16:23:15FromDiscord<Quibono> Gotcha
16:23:30FromDiscord<haxscramper> You can compare time for `nim check` and `nim c`
16:23:45FromDiscord<haxscramper> For a rough estimate
16:26:12*stkrdknmibalz joined #nim
16:30:21FromDiscord<whyy cant i install choosenim> only thing is that it doesnt compile ir link probably
16:30:29FromDiscord<whyy cant i install choosenim> atleast it doesnt seem to call cc
16:30:54FromDiscord<whyy cant i install choosenim> and it also doesnt write anything out
16:31:38FromDiscord<whyy cant i install choosenim> https://media.discordapp.net/attachments/371759389889003532/863819835619934218/Screenshot_2021-07-11-22-01-29.jpeg
16:31:47FromDiscord<whyy cant i install choosenim> smol diff
16:33:44FromDiscord<haxscramper> Yes, that's exactly the point
16:34:00FromDiscord<haxscramper> `nim c` does full compilation, `nim check` only runs nim side of things
16:34:24FromDiscord<whyy cant i install choosenim> and also it gives all da errors🤪
16:48:25FromDiscord<Quibono> Lol so Choosenim doesn't support MacOSX_Arm?
16:54:31*Vladar quit (Remote host closed the connection)
16:59:23FromDiscord<Ayy Lmao> How do I do something like `#define REAPERAPI_IMPLEMENT`? It needs to be before a specific header and when I use the emit pragma it ends up after the header.
17:00:32*neceve joined #nim
17:02:02*cyraxjoe quit (Ping timeout: 258 seconds)
17:06:26FromDiscord<haxscramper> You can control location of the `{.emit` code using `/INCLUDESECTION/`, `/TYPESECTION/` etc. (more in the manual)
17:06:29*cyraxjoe joined #nim
17:07:09FromDiscord<haxscramper> You can also do `header: "#define REAPERAPI_IMPLEMENT\n#include <specific-header>".`
17:07:57FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3sGi
17:08:33FromDiscord<Ayy Lmao> What would be the most idiomatic way to do it? I'm guessing in the header pragma?
17:09:22FromDiscord<haxscramper> Most "idiomatic way" is the one that works
17:10:14FromDiscord<haxscramper> At least when interfacing with C libraries you can expect any sort of hacks to pop up, so there is no "go-to" way
17:10:19FromDiscord<Ayy Lmao> Well the emit pragma seems to be working for me using `/INCLUDESECTION/` and that seems pretty clean to me
17:11:53FromDiscord<Ayy Lmao> I'm trying to make an extension for the audio software Reaper, and in the sdk they say: `Extensions for REAPER/win32 should be written in C++ and compiled using MSVC (pure virtual interface classes are used and as such the C++ ABI must be compatible -- sorry, mingw users).` I'm not that experienced with C++ or C, so can someone help me understand what kind of implications that might have for writing an extension in Nim?
17:12:28FromDiscord<haxscramper> I think you would only need to do `--cc:msvc` or something like that
17:12:34FromDiscord<haxscramper> `nim cpp --cc:msvc`
17:13:07FromDiscord<haxscramper> I don't use windows, so someone who has to deal with it should clarify things
17:13:09FromDiscord<Ayy Lmao> It tells me `unknown C compiler: 'msvc'. Available options are: gcc, switch_gcc, llvm_gcc, clang, bcc, vcc, tcc, env, icl, icc, clang_cl`
17:13:51FromDiscord<hugogranstrom> vcc
17:14:47FromDiscord<Ayy Lmao> That seems to compile, I'll have to see if I can load the extension when I get to that point. Thank you!
17:15:09FromDiscord<Ayy Lmao> So why exactly does the use of pure virtual interface classes invalidate the use of mingw?
17:17:06FromDiscord<haxscramper> some microsoft/migw/reaper implementation detail
17:20:33FromDiscord<Ayy Lmao> Ah so it's a reaper specific thing
17:22:22FromDiscord<Ayy Lmao> sent a code paste, see https://play.nim-lang.org/#ix=3sGn
17:27:40FromDiscord<haxscramper> https://nim-lang.org/docs/manual.html#implementation-specific-pragmas-codegendecl-pragma
17:29:02FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3sGo
17:29:33FromDiscord<haxscramper> To inspect generated code you can set `--nimcache:cache` and look in the generated files
17:29:48FromDiscord<haxscramper> It would create a directory where you ran compiler
17:33:04FromDiscord<Ayy Lmao> Awesome, thanks! That seems to make the generated cpp code look how it's supposed to
17:51:16FromDiscord<shadow.> are there functions for all of the operators?
17:53:10FromDiscord<Quibono> Also it's proc for non mutation and func for mutation?
17:54:25FromDiscord<shadow.> In reply to @Quibono "Also it's proc for": func is pure, proc is not necessarily
17:54:33FromDiscord<Quibono> Ahh
17:54:36FromDiscord<shadow.> so in func no globals, io, etc is allowed
17:54:40FromDiscord<shadow.> (edit) "is" => "are"
17:54:53FromDiscord<Quibono> So do func until the compiler yells at me.
17:58:35FromDiscord<saem> Yeah, keeping it func-y fresh as much as possible is an admirable goal and tends to help the design.
18:03:43FromDiscord<ElegantBeef> Just like const -> let -> var, you should func -> proc -> template -> macro -> throw the program out 😛
18:04:26FromDiscord<Quibono> Hopefully I'll never get to template lol
18:04:35FromDiscord<Quibono> I like simplicity to an extreme.
18:05:14FromDiscord<ElegantBeef> One could argue since templates paste code they're more simple than procedures 😛
18:06:27FromDiscord<haxscramper> Macro can greatly simplify code
18:06:57FromDiscord<haxscramper> Also @ElegantBeef you forgot about TRM
18:07:02FromDiscord<ElegantBeef> Shit
18:07:07FromDiscord<haxscramper> Last step before nuking the PC
18:08:37FromDiscord<Quibono> sent a code paste, see https://play.nim-lang.org/#ix=3sGH
18:08:59FromDiscord<haxscramper> Exported fields
18:09:24FromDiscord<Quibono> So those are externally accessible while the unexported fields are not?
18:09:44FromDiscord<haxscramper> Correct
18:10:24FromDiscord<Quibono> But methods of the function can still access the private fields?
18:10:32FromDiscord<Quibono> (edit) "function" => "object"
18:13:17FromDiscord<haxscramper> These are not private fields, they are exported - the difference is visible only outside the module
18:13:47FromDiscord<haxscramper> So `method` can access unexported fields if it is defined in the same module
18:14:10FromDiscord<haxscramper> Also `method` is not bound to any object specifically, it just dispatches at runtime based on the first argument
18:14:28FromDiscord<haxscramper> There was (is?) `--multimethods:on` that provided dispatching on all arguments
18:15:23FromDiscord<Quibono> Ahh gotcha.
18:41:47*cyraxjoe quit (Quit: I'm out!)
18:45:33*cyraxjoe joined #nim
20:24:46fn<ForumUpdaterBot99> New thread by Gadersd: Can't create sequence with newSeq, see https://forum.nim-lang.org/t/8221
20:49:37FromDiscord<theangryepicbanana> I'm aware that procs and stuff can be overloaded, but can types be overloaded in any way (without macros)?
20:50:07FromDiscord<theangryepicbanana> like `type Thing[T] = ..., Thing[T, U] = ...`
20:50:38FromDiscord<ElegantBeef> Well they're two separate generic instantiations, so they should be, make the most specific then the least specific
20:51:07FromDiscord<theangryepicbanana> In reply to @ElegantBeef "Well they're two separate": wdym by that last part?
20:51:34FromDiscord<ElegantBeef> Ah nvm i'm wrong 😄
20:51:53FromDiscord<Bung> that's not called overload
20:52:12FromDiscord<ElegantBeef> You'll basically need to use procedures to do this
20:52:37FromDiscord<theangryepicbanana> In reply to @Bung "that's not called overload": I'm also hoping that `type Thing[T: A] = ..., Thing[T: B] = ...` would be possible, but it's less likely
20:53:20FromDiscord<ElegantBeef> Best i can think of
20:53:25FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3sHp
20:53:30FromDiscord<theangryepicbanana> nope, need an actual type
20:54:05FromDiscord<theangryepicbanana> it's worth noting that even pascal supports multiple arities for types, so I'm not sure why nim can't have it
20:54:21FromDiscord<Bung> you'd probaly type A[T] type B[T,P] = , then you use Type C = B[T,P], A[C]
20:54:32FromDiscord<theangryepicbanana> I'd prefer for them to have the same name
20:54:56FromDiscord<Bung> guess not possible
20:55:04FromDiscord<theangryepicbanana> dang
20:55:49FromDiscord<theangryepicbanana> completely unrelated question (that I can provide context for if needed), but is it possible to have an object inherit from multiple types?
20:56:14FromDiscord<ElegantBeef> There is no MI
20:56:23FromDiscord<theangryepicbanana> would like to at least have some way of emulating interfaces/protocols/traits/etc seen in some other langs
20:56:26FromDiscord<ElegantBeef> But if you just want to copy fields it's rather simple
20:56:40FromDiscord<theangryepicbanana> well I still need the "is-a" type relationships
20:56:43FromDiscord<ElegantBeef> https://github.com/yglukhov/iface
20:56:44fn<R2D299> itHub: 7"<No Description>"
20:57:05FromDiscord<Bung> ooputils lib
20:57:14FromDiscord<theangryepicbanana> In reply to @ElegantBeef "https://github.com/yglukhov/iface": no like explicit interfaces, not golang interfaces lol
20:57:58FromDiscord<Bung> that acutall create all single type not like other language
20:58:26FromDiscord<theangryepicbanana> In reply to @Bung "ooputils lib": is this in the stdlib or a nimble package?
20:58:56FromDiscord<Bung> !package ooputils
20:59:15FromDiscord<Bung> hmm what's the bot command?
21:00:18FromDiscord<theangryepicbanana> In reply to @Bung "hmm what's the bot": dunno but I found it
21:00:24FromDiscord<theangryepicbanana> does it support interfaces?
21:00:39FromDiscord<theangryepicbanana> I'm basically looking for something like a concept but as a runtime thing
21:00:58FromDiscord<theangryepicbanana> (which is kinda what an interface/protocol is)
21:01:45FromDiscord<Bung> does not like , use that you'll only care about final object
21:01:59FromDiscord<theangryepicbanana> ?
21:02:23FromDiscord<Bung> some like typescript -> js
21:02:53FromDiscord<Bung> type info are striped out
21:02:56FromDiscord<theangryepicbanana> basically I want to be able to support something like `type Thing = a, b: Comparable`
21:03:26FromDiscord<theangryepicbanana> like I'm aware nim isn't exactly oop, but I'm sure it can be emulated somehow
21:05:02FromDiscord<leorize> there are a few attempts at emulating those
21:05:19FromDiscord<theangryepicbanana> I'm looking to bootstrap a language I'm working on by compiling to nim (since nim is the only language with features from my language like distinct types, generic multimethods, and an overall awesome type system), however this is like the one thing I'm stuck on
21:05:19FromDiscord<leorize> an in-language feature was concepts but it's under developed
21:06:17FromDiscord<theangryepicbanana> yeah I love concepts, but they are typeclasses and as a result, aren't runtime types
21:06:31FromDiscord<theangryepicbanana> available at runtime
21:06:50FromDiscord<ElegantBeef> Well the new concepts might help in this regard, but still uncertain what you're after
21:07:23FromDiscord<theangryepicbanana> c++ is the only other language I could use, however it doesn't have distinct types, (virtual) generic multimethods, or recursive concepts
21:08:08FromDiscord<ElegantBeef> https://github.com/beef331/constructor/blob/master/tests/timplements.nim this uses new concepts
21:08:18FromDiscord<ElegantBeef> And gives interface like logic
21:08:46FromDiscord<theangryepicbanana> ok so like for reference, this is the language this is for <https://github.com/ALANVF/star>
21:09:05FromDiscord<theangryepicbanana> `star` and `stdlib` have some example code
21:09:24FromDiscord<theangryepicbanana> you can think of it has a nim + scala hybrid
21:09:31FromDiscord<theangryepicbanana> (edit) "has" => "as"
21:10:02FromDiscord<theangryepicbanana> if you've ever seen nim's compiler, you'll know that typechecking is very complicated
21:10:20FromDiscord<theangryepicbanana> same deal here, which is why I want to use nim's typesystem
21:11:30FromDiscord<theangryepicbanana> In reply to @ElegantBeef "And gives interface like": yeah but it's still a compile time thing (and they're always generic from what I can tell), so I can't use the type at runtime
21:11:42FromDiscord<Bung> oh, cool, write in haxe
21:11:46FromDiscord<theangryepicbanana> (edit) "same deal here, which is why I want to use nim's typesystem ... " added "to bootstrap"
21:12:01FromDiscord<theangryepicbanana> yeah almost chose nim, but haxe allows recursive modules ;)
21:12:15FromDiscord<theangryepicbanana> (edit) "recursive" => "circular"
21:13:24FromDiscord<theangryepicbanana> but yea I basically don't want to write any of the typechecker in haxe (because it's not a very good lang otherwise lol), so I can theoretically compile to nim by only typechecking a little bit on my own
21:13:51FromDiscord<theangryepicbanana> (then ya know, actually rewrite the whole thing in my lang)
21:14:22FromDiscord<theangryepicbanana> it's a weird idea, but I think it'll work. at least easier than c++ lol
21:14:35FromDiscord<Bung> hmm, haxe is also awesome language
21:14:49FromDiscord<theangryepicbanana> yeah but it goes downhill really quickly
21:14:52FromDiscord<Bung> dont know why you choose one then come to another
21:15:03FromDiscord<theangryepicbanana> primarily because macros can't call other macros
21:15:13FromDiscord<theangryepicbanana> oh I'm not writing the lang in nim
21:15:19FromDiscord<theangryepicbanana> I want the lang to compile to nim initially
21:17:06FromDiscord<Bung> oh, so you can just generate code to nim
21:17:46FromDiscord<theangryepicbanana> yeah basically
21:18:00FromDiscord<Bung> you can striped out interface info
21:18:11FromDiscord<Bung> like ts compiler
21:18:15FromDiscord<theangryepicbanana> for some stuff I can
21:18:25FromDiscord<theangryepicbanana> but I still need to allow runtime checks for interfaces
21:18:47FromDiscord<theangryepicbanana> (also uh, star supports multiple inheritance, so that's a bit of an issue but eh)
21:20:06FromDiscord<Bung> you'll map them like dart does I think
21:20:29FromDiscord<Bung> as code I shown
21:20:42FromDiscord<theangryepicbanana> I don't recall what dart does. are they stored as instance fields or something?
21:21:44FromDiscord<Bung> Type A extends B,C,D will be extends b(c,d)
21:22:21FromDiscord<Bung> create some middle types there
21:22:58FromDiscord<theangryepicbanana> huh, I'm not entirely sure how that would work given that you can only inherit from a single type
21:23:43FromDiscord<shadow.> is there a way to make nimlsp lint all the time, not just after saving?
21:24:06FromDiscord<Rika> In reply to @theangryepicbanana "huh, I'm not entirely": A inherits (B inherits (C inherits D)) ?
21:24:16FromDiscord<Bung> In reply to @theangryepicbanana "huh, I'm not entirely": copy their implementations
21:24:27FromDiscord<Rika> but C != C inherits D, B != B i C i D, etc
21:24:30*stkrdknmibalz quit (Ping timeout: 265 seconds)
21:25:01FromDiscord<theangryepicbanana> In reply to @Bung "copy their implementations": I'd still like to have the subtype relationships if possible
21:25:07FromDiscord<Rika> basically "inherits" is an operator on types that returns a new type
21:25:08FromDiscord<Bung> sure, runtime check lie this will not work in this this way
21:25:26FromDiscord<theangryepicbanana> hmm
21:25:51FromDiscord<theangryepicbanana> well I suppose I'll find a workaround for that eventually
21:25:56FromDiscord<theangryepicbanana> is the type overloading thing is still a no?
21:26:00FromDiscord<theangryepicbanana> (edit) removed "is"
21:26:12FromDiscord<Rika> nim? no
21:26:18FromDiscord<theangryepicbanana> dang
21:26:28FromDiscord<theangryepicbanana> that'll probably make HKTs a pain to implement
21:27:37FromDiscord<theangryepicbanana> (higher-kinded types, basically stripGenericParams or genericHead)
21:29:00FromDiscord<Bung> if you can overload `is` or implement your own type check operator ,guess you'll need a BasicType has extro info about its parents.
21:29:59FromDiscord<theangryepicbanana> I guess
21:30:41FromDiscord<theangryepicbanana> thanks for the help though
21:32:01FromDiscord<theangryepicbanana> (still though, types should at least be able to be overloaded by arity)
21:32:04FromDiscord<theangryepicbanana> (edit) "arity)" => "arity at some pointy)"
21:32:05FromDiscord<theangryepicbanana> (edit) "pointy)" => "point)"
21:32:16FromDiscord<Rika> please start working on it then
21:32:43FromDiscord<theangryepicbanana> well I'm not demanding it, I'm just saying it's something that should be considered (because I haven't seen any RFCs for it)
21:33:03FromDiscord<Rika> perhaps you should write it because ive never heard anyone else talk about it
21:33:14FromDiscord<theangryepicbanana> really?
21:33:19FromDiscord<Rika> yeah not that i recall
21:33:22FromDiscord<Rika> (edit) "not" => "none"
21:33:32FromDiscord<theangryepicbanana> huh
21:34:11FromDiscord<theangryepicbanana> it's a thing in like every lang that supports function overloading
21:34:34FromDiscord<theangryepicbanana> well anyways yeah I might
21:36:09FromDiscord<ElegantBeef> What's the line "Features start in the unimplemented state"
21:37:45FromDiscord<Bung> interface mapping to nim backend
21:50:21FromDiscord<vishnumad> sent a code paste, see https://paste.rs/hK4
21:51:21FromDiscord<theangryepicbanana> no, but there's an RFC open for it rn iirc
21:54:28FromDiscord<theangryepicbanana> relevant pr <https://github.com/nim-lang/Nim/pull/18470>
22:05:47FromDiscord<ElegantBeef> Well it is
22:06:13FromDiscord<ElegantBeef> sent a code paste, see https://play.nim-lang.org/#ix=3sHQ
22:06:37FromDiscord<ElegantBeef> Pure makes it so if there are any overlaps you have to specify the "namespace" IE `FooEnum.A`
22:06:56FromDiscord<ElegantBeef> That PR just removes the latter need
22:07:08FromDiscord<ElegantBeef> Since if it can be resolved it removes redundant work
22:10:30*maxime_ quit (Quit: Leaving)
22:11:06FromDiscord<theangryepicbanana> oh lol
22:16:50*neceve quit (Ping timeout: 255 seconds)
22:29:05FromDiscord<codic> can i use a http server like httpbeast and use treeform/ws to upgrade the connection to ws on a certain path?
22:34:06*pro quit (Ping timeout: 265 seconds)
22:39:23*vsantana joined #nim
22:46:03*vsantana quit (Quit: vsantana)
22:47:02*vsantana joined #nim
22:48:06FromDiscord<Bung> @ElegantBeef any news to nimscripter/
22:51:07*vsantana quit (Client Quit)
22:53:25*vsantana joined #nim
22:55:10*vsantana quit (Client Quit)
22:59:06FromDiscord<shadow.> In reply to @shadow. "is there a way": bump if anyone knows
23:00:54FromDiscord<dom96> In reply to @codic "can i use a": yep
23:01:24FromDiscord<Bung> In reply to @shadow. "bump if anyone knows": why is that if your code doesn't change
23:01:35FromDiscord<shadow.> well im not autosaving
23:01:39FromDiscord<shadow.> i just want it to update while im typing
23:01:52FromDiscord<shadow.> but i have to resave every time to get linting which is annoying
23:02:29FromDiscord<dom96> In reply to @codic "can i use a": although not sure ws supports this actually, you can definitely do it with https://github.com/niv/websocket.nim
23:02:30fn<R2D299> itHub: 7"websockets for nim"
23:02:36FromDiscord<dom96> (I use it for one of my projects with httpbeast)
23:02:40FromDiscord<ElegantBeef> @Bung i've started on it
23:02:42FromDiscord<Bung> when you say "linting" it shows what ?
23:03:05FromDiscord<shadow.> https://media.discordapp.net/attachments/371759389889003532/863918342103236628/unknown.png
23:03:09FromDiscord<shadow.> the blue and red messages dont update until i save
23:03:13FromDiscord<shadow.> they do update on every other language server ive used
23:03:17FromDiscord<Bung> @ElegantBeef how is it going /
23:03:18FromDiscord<shadow.> im guessing it's a setting, i just don't know which one
23:04:15FromDiscord<Bung> em, I'll need check the code
23:04:56*stkrdknmibalz joined #nim
23:05:09FromDiscord<shadow.> alrighty
23:05:28FromDiscord<dom96> @codic part of the code from my project showing how to do it with httpbeast: https://gist.github.com/dom96/26c574ec1491ba98181de6c532fa52fc
23:05:35FromDiscord<dom96> I should add this as an example in httpbeast's repo really
23:06:05FromDiscord<Bung> yeah, nimlsp only sync content when it get document changed notification.
23:08:44FromDiscord<codic> if websocket.nim does it ws should too
23:08:47FromDiscord<codic> thanks for the example!
23:10:12FromDiscord<codic> hmm the magical method there seems to be `addPlayer` doing the websocket part
23:10:13FromDiscord<Bung> if you find "Upgrade" in ws repo guess it will work too.
23:12:32FromDiscord<codic> and verifyWebsocketRequest
23:18:21FromDiscord<Bung> @shadow. you need syntax check while you typing ? nimlsp basicly do whole thing , you check your syntax and code error, so while you typing you write uncomplete variable name , it will be report as error.
23:18:37FromDiscord<Bung> (edit) "you" => ""
23:18:39FromDiscord<shadow.> yeah id like linting while im typing
23:18:43FromDiscord<shadow.> im aware of the ramifications
23:19:31FromDiscord<Bung> I can add support to that.
23:20:27FromDiscord<Bung> but that kind of anyoing when message pop up while typing
23:24:37FromDiscord<theangryepicbanana> hmm, apparently "vtable types" were a thing at one point. would've solved my issue from earlier, but they seem to have been removed from the docs since then <https://web.archive.org/web/20171104234508/https://nim-lang.org/docs/manual.html#generics-vtable-types>
23:29:23FromDiscord<cynahc> Might anyone have a suggestion as to how to properly free a `seq` passed to SDL2 with `addr`?
23:29:38FromDiscord<cynahc> This is the offending code with the leak\: https://gist.github.com/chancyk/f8fc70ea55ab61ac25db2df2f1a03c86#file-sdl_texture-nim-L12