00:13:29 | * | PersonMcGuy joined #nim |
00:14:52 | PersonMcGuy | Hello all. Quick question. Would an async proc referencing a global variable be considered gcsafe if the program running it is single-threaded? |
00:55:22 | * | luis_ quit (Remote host closed the connection) |
01:00:04 | * | PersonMcGuy quit (Quit: Client closed) |
01:35:44 | FromDiscord | <timotheecour> gcsafety depends on whether the type of that variable (int ok, string or seq not ok, IIRC) |
01:35:50 | * | justsomeguy joined #nim |
01:35:59 | FromDiscord | <timotheecour> (edit) "gcsafety depends on whether the type of that variable (int ok, string or seq ... not" added " or ref int" |
01:36:13 | FromDiscord | <timotheecour> (edit) "gcsafety depends on whether the type of that variable ... (int" added "and whether it involves GC" |
01:36:29 | FromDiscord | <timotheecour> (edit) "ok, IIRC)" => "ok)" |
02:49:12 | fn | <ForumUpdaterBot99> New thread by Bung: Integrate with dll's procs that returns gced types, see https://forum.nim-lang.org/t/8210 |
03:25:08 | * | arkurious quit (Quit: Leaving) |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
04:06:38 | * | supakeen joined #nim |
04:59:21 | * | rockcavera quit (Remote host closed the connection) |
06:15:46 | FromDiscord | <RattleyCooper> Anybody know if I can do a binary left shift like `1 << 0` would do in python? |
06:15:58 | FromDiscord | <Elegantbeef> `1 shl 0` |
06:16:04 | FromDiscord | <RattleyCooper> Thanks 😄 |
06:16:18 | FromDiscord | <Elegantbeef> bet you cannot guess what is shift right |
06:16:26 | FromDiscord | <RattleyCooper> shr? |
06:16:32 | FromDiscord | <Rika> Sure it is |
06:16:35 | FromDiscord | <Elegantbeef> Damn you're a rocket scientist |
06:16:39 | FromDiscord | <RattleyCooper> lol |
06:38:58 | FromDiscord | <Bung> @ElegantBeef Nimscripter dont handle import in nims file ? |
06:39:17 | FromDiscord | <Elegantbeef> It's supposed to |
06:42:56 | FromDiscord | <Elegantbeef> Got a sample of what you're doing so i can see what i fucked up? |
06:43:37 | FromDiscord | <Bung> sure |
06:44:59 | FromDiscord | <Bung> https://github.com/bung87/dllgen/blob/scripted/src/dllgen.nim |
06:45:37 | FromDiscord | <Bung> am trying switch my dll gen to nimscripter implement a theme system |
06:46:52 | FromDiscord | <Bung> after fixed problems I still cant get ref T from outside proc's returns |
06:47:22 | FromDiscord | <Bung> that's impossible in theory I guess |
06:49:18 | FromDiscord | <Elegantbeef> I mean you're using the `{.cdecl.}` in the same as a file with `{.exportToNim.}` |
06:49:53 | FromDiscord | <Elegantbeef> Are you using `libcffi`? |
06:51:11 | FromDiscord | <Bung> no, that proc did not used so may not affect anything |
06:52:37 | FromDiscord | <Bung> your loadscript stdpath param why not point to findNimStdLibCompileTime ? |
06:53:03 | FromDiscord | <Elegantbeef> So you can distribute binaries with their own select stdlib |
06:53:43 | FromDiscord | <Bung> I mean you can take it as default value |
06:55:09 | FromDiscord | <Bung> I dont need custom stdlib , I just want to see how it works , so `./stdlib` does not usefull to me |
06:56:31 | FromDiscord | <Elegantbeef> Hmm i really should clean it up |
06:56:43 | FromDiscord | <Elegantbeef> Add more docs in code, remove stupid stuff |
06:58:35 | FromDiscord | <Bung> I think you can do de ref automatically if ref not possible |
06:58:46 | FromDiscord | <Elegantbeef> Dont know what you mean |
06:58:49 | FromDiscord | <Bung> when I call invoke memthod |
06:59:17 | FromDiscord | <Elegantbeef> Well references are not passed as is |
06:59:38 | FromDiscord | <Elegantbeef> They're serialized and reconstructed |
06:59:43 | FromDiscord | <Bung> I mean the invoke method return types |
07:00:19 | FromDiscord | <Elegantbeef> I dont follow |
07:00:41 | FromDiscord | <Bung> the method returns a ref T , in the main program you invoke, you get nil |
07:03:01 | * | sagax quit (Excess Flood) |
07:10:57 | FromDiscord | <Elegantbeef> That doesnt sound right |
07:12:40 | FromDiscord | <Bung> it's same behavior when I call proc from dll proc |
07:14:04 | FromDiscord | <Bung> guess I need wirte a macro transform returns types to object type |
07:14:35 | FromDiscord | <Elegantbeef> Well if you want to use nimscripter no, it's an issue i need to fix |
07:16:08 | FromDiscord | <Elegantbeef> oh your issue is something i did dumb and now just realize how dumb it is |
07:16:25 | FromDiscord | <Elegantbeef> it's `newSubModuleExported` due to my stupidity |
07:17:10 | FromDiscord | <Bung> It supposed to handle returns ref type ? I do some work in dll version, that it has self contained gc process |
07:17:36 | FromDiscord | <Elegantbeef> Yes it's supposed to handle ref types, but it copies them |
07:18:26 | FromDiscord | <Bung> oh, that's sounds good |
07:18:49 | FromDiscord | <Bung> when you fix all tell me, I'll try it |
07:18:53 | FromDiscord | <Elegantbeef> I know it was working at one point with refs, but i may have broke it |
07:19:38 | FromDiscord | <Bung> I looked video , does not show pass arg and return ref types |
07:19:49 | FromDiscord | <Bung> so you may add more test cases. |
07:20:02 | FromDiscord | <Elegantbeef> Well it didnt show it but i know it worked then |
07:22:30 | FromDiscord | <Bung> another thing could it handle import in script related to the script file path or provide a cwd arg I think |
07:23:02 | FromDiscord | <Elegantbeef> Yea so the issue is just that whole "Exported" being appened which i should just handle |
07:23:47 | FromDiscord | <Bung> cool |
07:24:52 | FromDiscord | <Bung> it also not parse export symbol I faced the problem. |
07:25:49 | * | neceve joined #nim |
07:26:06 | FromDiscord | <Elegantbeef> Well i dont know how easily that can be supported since it needs to be serialized between nimscript and nim |
07:26:11 | FromDiscord | <Elegantbeef> But yea i'll have a update out shortly being `0.3.0` |
07:27:35 | FromDiscord | <Elegantbeef> This isnt seamless communication, everything is serialized from one side to the other due to VM limitations i hit |
07:27:55 | FromDiscord | <Elegantbeef> Though i do wonder how @drsw handles it |
07:28:57 | FromDiscord | <Bung> disruptek also have a serialize lib clam handle any type |
07:29:34 | FromDiscord | <Elegantbeef> Except doesnt work in the VM |
07:30:12 | FromDiscord | <Bung> okay, good to know |
07:30:32 | FromDiscord | <Elegantbeef> I originally was going to use frosty but i hit the wall of VM is limited |
07:30:45 | FromDiscord | <Elegantbeef> So until libcffi becomes standard this will persist |
07:33:25 | FromDiscord | <Elegantbeef> Well there you go 0.3.0 just released |
07:33:35 | FromDiscord | <Elegantbeef> So now you dont need to do `yourNimScriptProcExported` |
07:33:44 | FromDiscord | <Elegantbeef> I realize now that was dumber than imaginable |
07:35:54 | FromDiscord | <Bung> I dont get it, my procs in nims did not exported |
07:36:26 | FromDiscord | <Elegantbeef> no they did but my dumbass though it was smart to require programmers to write `"newSubModuleExported"` for the proc name |
07:37:33 | FromDiscord | <Elegantbeef> Look at tests for examples |
07:38:22 | FromDiscord | <Elegantbeef> I really think i need to take a look at nimscripter again and clean it to a fantastic library instead of whatever this is 😛 |
07:39:11 | FromDiscord | <Elegantbeef> I can remove the import order issue and also make it support multiple modules/intepreters but just havent got around to it |
07:44:18 | FromDiscord | <Bung> hmm I still get nil access |
07:45:43 | FromDiscord | <Bung> oh, I commented another proc , it works. |
07:45:54 | FromDiscord | <Elegantbeef> Ah was just about to test it |
07:48:31 | FromDiscord | <Bung> guess you did thought user just feed their old nim file to nimscripter. |
07:50:40 | FromDiscord | <Bung> now am wating for the import things solved. so my theme file just need small changes. |
07:52:10 | FromDiscord | <Bung> it's usefull to be a plugin system. |
07:52:37 | FromDiscord | <Elegantbeef> By import thing do you mean working relative to .nims file? |
07:53:34 | FromDiscord | <Bung> yeah ,atleast if user provide absolute file path |
07:54:03 | fn | <ForumUpdaterBot99> New thread by Halloleo: In the JavaScript backend how to pass a array back as sequence?, see https://forum.nim-lang.org/t/8211 |
07:58:13 | FromDiscord | <Elegantbeef> Not great but presently you can just change the directory before and after loading the interpreter |
08:06:38 | FromDiscord | <Bung> searchPaths add projectFile parent Dir I think |
08:06:59 | * | stkrdknmibalz quit (Ping timeout: 252 seconds) |
08:32:12 | * | PMunch joined #nim |
09:01:24 | * | xet7 quit (Remote host closed the connection) |
09:02:14 | * | xet7 joined #nim |
09:03:02 | * | xet7 quit (Read error: Connection reset by peer) |
09:04:10 | * | xet7 joined #nim |
09:12:11 | * | max22- joined #nim |
09:12:28 | * | max22- quit (Remote host closed the connection) |
09:12:47 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3shF |
09:12:51 | * | max22- joined #nim |
09:18:13 | PMunch | Nim doesn't like {} IIRC |
09:18:26 | PMunch | I seem to remember having issues with it when I was doing genui |
09:18:54 | PMunch | It is overloaded in your code, but the syntax parser struggles with figuring out what you're trying to do |
09:19:26 | FromDiscord | <ElegantBeef> well hax is doing `echo somStuff = y` which is turned into `asgn(echo(somStuff), y)` |
09:19:59 | FromDiscord | <ElegantBeef> But even wrapping with pars has an issue |
09:20:15 | PMunch | Yeah, but try to wrap it in parenthesis and you see what I mean |
09:20:43 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3shH |
09:20:47 | FromDiscord | <haxscramper> Well, I can live with that, so `echo {}=` is probably weird thing anyway |
09:21:23 | PMunch | Well it was broken because you tried to return something from the {}= proc |
09:21:34 | FromDiscord | <ElegantBeef> yea it's broken even with `[]=` |
09:21:57 | FromDiscord | <ElegantBeef> the curlies were not the issue it was the return type really confuses the parser |
09:22:01 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3shI |
09:22:15 | FromDiscord | <haxscramper> parser should have nothing to do with return type |
09:22:36 | FromDiscord | <ElegantBeef> I use terms very loosely |
09:22:38 | FromDiscord | <ElegantBeef> 😛 |
09:22:57 | FromDiscord | <haxscramper> well, anyway, TIL you can overload `from`, `as`, `{}` and `{}=` |
09:23:14 | FromDiscord | <haxscramper> Would be nice if we got `to` operator |
09:23:40 | FromDiscord | <Rika> you can prolly just use a normal proc and mcs it |
09:23:40 | FromDiscord | <Rika> (for now) |
09:31:13 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=3shK |
09:56:59 | FromDiscord | <vindaar> what's the point of that thing [haxscramper](https://matrix.to/#/@haxscramper:matrix.org) ? 😅 reminds me of my first ideas about the ggplotnim formulas, i.e. allowing `~` to be used to construct formulas with untyped identifiers as column references and this kind of stuff. The fun part is that `~` has lower precedence than most things that might appear on the RHS, so I needed to reorder the tree 🤠|
09:57:57 | FromDiscord | <haxscramper> No point, just realized you could do this |
09:58:09 | FromDiscord | <haxscramper> Well, custom `[]<XXX>` operators |
09:58:18 | FromDiscord | <vindaar> ah, I see. It's neat to be able to do this stuff |
10:00:06 | FromDiscord | <vindaar> also the whole matching specific nim nodes in an untyped setting is really nice |
10:02:56 | FromDiscord | <haxscramper> Yes, it is really nice |
10:03:20 | FromDiscord | <haxscramper> The main problem - I almost never reach to it for some reason, and this is not particularly buggy feature either |
10:03:31 | FromDiscord | <vindaar> same here |
10:03:32 | FromDiscord | <haxscramper> All of this TRM-related stuff is very cool |
10:03:48 | FromDiscord | <haxscramper> Even without rewriting macros themselves |
11:19:32 | FromDiscord | <Bung> @haxscramper your pasePNodeStr need update https://github.com/bung87/nimlsp/blob/check/src/nimlsppkg/pnode_parse.nim |
11:20:45 | FromDiscord | <haxscramper> Can you PR a fix? |
11:20:59 | FromDiscord | <haxscramper> Still don't understand why can't just use my library as is |
11:21:25 | FromDiscord | <Bung> ok, then later I'll create PR |
11:21:32 | FromDiscord | <haxscramper> Also, why mImport? |
11:21:41 | FromDiscord | <Bung> yours still install nimble ? |
11:21:50 | FromDiscord | <haxscramper> Doesn't regular import work just fine? |
11:22:22 | FromDiscord | <Bung> you have custom `/` operator |
11:22:49 | FromDiscord | <haxscramper> And? |
11:22:52 | FromDiscord | <Bung> I mean `os.joinPath` |
11:23:25 | FromDiscord | <Bung> mimport is join to explicitSourcePath |
11:23:50 | FromDiscord | <Bung> so I dont install compiler either |
11:24:29 | FromDiscord | <Bung> me dont install nimble and compiler , yours does. |
11:26:09 | FromDiscord | <haxscramper> Anyway, I don't think I need changes like this - `raise` and catch in the same proc and then return error directly, support for nimpretty, hardocded absolute paths to compiler tec. |
11:26:34 | arkanoid | Rika: I've opened an issue on GH and yeah it went down the rabbit hole. I's just way easier to avoid sugar |
11:27:12 | FromDiscord | <Bung> the main point is move up pars.lex.errorHandler = |
11:28:18 | FromDiscord | <haxscramper> Doesn't `openParser` mutate parser in-place? The parsing happens in `parseAll` |
11:31:26 | FromDiscord | <haxscramper> And `parsePnodeStr` is not exactly the thing you should be building logic on, just like `compileString` it is a hack for quick testing |
11:33:01 | FromDiscord | <haxscramper> Do you plan to use submodules?↵(@Bung) |
11:33:17 | FromDiscord | <haxscramper> Git submodules for a compiler instead of installing it |
11:34:02 | FromDiscord | <Bung> sent a long message, see http://ix.io/3si6 |
11:34:55 | FromDiscord | <Bung> openParser will parse first token |
11:35:38 | FromDiscord | <Bung> in this lib , no , I just use it check syntax. |
11:36:36 | FromDiscord | <Bung> feed a tab easily trigger error |
11:49:22 | * | max22- quit (Ping timeout: 240 seconds) |
11:51:33 | * | luis_ joined #nim |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.2) |
12:06:37 | * | supakeen joined #nim |
12:16:47 | * | justsomeguy quit (Quit: WeeChat 3.0.1) |
12:51:14 | * | luis_ quit (Quit: luis_) |
12:58:33 | * | luis_ joined #nim |
13:19:53 | * | arkurious joined #nim |
13:21:30 | FromDiscord | <lqdev> sent a code paste, see https://play.nim-lang.org/#ix=3sio |
13:21:48 | FromDiscord | <lqdev> is there anything extra i need to do before reading from a connected client? |
13:31:48 | * | arkurious quit (Ping timeout: 258 seconds) |
13:34:06 | * | arkurious joined #nim |
13:50:58 | fn | <ForumUpdaterBot99> New thread by JPLRouge: Help Json , see https://forum.nim-lang.org/t/8212 |
13:58:16 | * | luis_ quit (Quit: luis_) |
14:10:45 | * | rockcavera joined #nim |
14:10:46 | * | rockcavera quit (Changing host) |
14:10:46 | * | rockcavera joined #nim |
14:15:08 | * | rockcavera quit (Remote host closed the connection) |
14:22:16 | * | max22- joined #nim |
14:32:58 | * | max22- quit (Ping timeout: 240 seconds) |
14:35:13 | * | fn quit (Remote host closed the connection) |
14:35:26 | * | fn joined #nim |
15:04:19 | * | clemens3 left #nim (WeeChat 2.7) |
15:28:05 | * | max22- joined #nim |
15:30:27 | FromDiscord | <RattleyCooper> I'm getting `nan` value back from some math operations on `float64` values. Looks like docs say to use `complex` module but I'm unsure how to fix this specific problem.. |
15:33:23 | FromDiscord | <Rika> whats the problem |
15:38:15 | FromDiscord | <RattleyCooper> I need to do math that works |
15:38:32 | FromDiscord | <Rika> uh specifics |
15:38:42 | FromDiscord | <Rika> we cant tell what youre doing that results in a nan |
15:39:09 | FromDiscord | <RattleyCooper> `dot = dot + gradient[i] (point[i] - grid_point[i])` |
15:39:25 | FromDiscord | <Rika> nothing here seems like it would give a nan |
15:39:36 | FromDiscord | <RattleyCooper> in a loop where `i` is the index of the 3 `seq[float64]` |
15:40:04 | FromDiscord | <RattleyCooper> That's the operation that results in the `nan` though. When I look at the sequences they're all floats |
15:42:06 | FromDiscord | <vindaar> given that the word `gradient` appears, it seems much more likely that your numerical computation of a gradient before this divides by 0 somewhere |
15:44:08 | FromDiscord | <Rika> or that you somehow stored a nan in either point or grid_point |
15:45:14 | FromDiscord | <RattleyCooper> I checked the sequences I'll check my gradient function as well |
15:45:51 | FromDiscord | <RattleyCooper> For some reason this pc can't find the `guass` function so I'm having to debug on the nim-lang website |
15:45:57 | FromDiscord | <vindaar> I just had to check whether doing math with an `inf` produces a nan. Apparently not directly 😅 |
15:46:28 | FromDiscord | <vindaar> if you mean the `gauss` in the `random` module, it was only added relatively recently↵(@RattleyCooper) |
15:46:49 | FromDiscord | <RattleyCooper> I'm honestly not great at math, I'm trying to port a Perlin noise algorithm to nim |
15:47:12 | FromDiscord | <vindaar> if you can share more of the code, we can help you better though |
15:53:45 | FromDiscord | <vindaar> I suppose you're porting that to learn it rather than to have an implementation, right? Because there's ↵https://github.com/guzba/noisy↵and↵https://github.com/Nycto/PerlinNim |
15:58:54 | FromDiscord | <RattleyCooper> Yeah, just learning |
15:59:21 | FromDiscord | <RattleyCooper> I'm new to nim and trying to get used to using the different types and whatnot. Learn the standard library |
16:01:58 | FromDiscord | <vindaar> (to add to this\: if your `point[i] - grid_point[i]` were 0, you could have `inf 0`, which does produce nan) |
16:03:14 | FromDiscord | <RattleyCooper> Ok, I will do some testing here when I have more time and see if either of those things are happening. |
16:04:21 | FromDiscord | <vindaar> feel free to ping me if I should look over your code or something |
16:07:22 | FromDiscord | <whyy cant i install choosenim> noise generation lol |
16:09:15 | FromDiscord | <RattleyCooper> Cool, I appreciate the help and will take you up on it if I can't figure it out |
16:16:28 | * | stkrdknmibalz joined #nim |
16:17:23 | FromDiscord | <dom96> In reply to @lqdev "i'm trying to make": can you share code? |
16:19:19 | FromDiscord | <lqdev> In reply to @dom96 "can you share code?": i already solved my problem differently, but sure. i do actually want to know why this error occured https://media.discordapp.net/attachments/371759389889003532/862729571379838996/syncserver.nim |
16:21:04 | FromDiscord | <dom96> You're calling `recvLine` on the server not the client |
16:21:17 | FromDiscord | <lqdev> ohhh damn |
16:21:45 | FromDiscord | <lqdev> that was a bit dumb |
16:22:09 | FromDiscord | <lqdev> sometimes you just need a second pair of eyes to look at your code 🙃 |
16:38:09 | FromDiscord | <hamidb80> sent a code paste, see https://play.nim-lang.org/#ix=3sjx |
16:41:59 | FromDiscord | <RattleyCooper> In reply to @vindaar "(to add to this\:": This is at least part of it |
16:42:25 | FromDiscord | <RattleyCooper> (edit) "it" => "the problem." |
16:47:18 | FromDiscord | <RattleyCooper> I also have `nan`s in my gradient |
16:49:12 | FromDiscord | <vindaar> possibly from essentially having 0 / 0 |
16:54:52 | FromDiscord | <RattleyCooper> I'm adding checks for 0. Just taking more time than necessary bc I'm working and also using play.nim-lang.org lol |
16:55:07 | FromDiscord | <vindaar> why are you not just updating your local nim version? |
16:57:00 | FromDiscord | <RattleyCooper> Can I just download the new version and install over the old version? |
16:57:12 | FromDiscord | <vindaar> it kind of depends on how you installed the old version |
16:57:23 | FromDiscord | <vindaar> in general \~yes, if you use the same approach |
16:57:25 | FromDiscord | <RattleyCooper> I don't know tbh. I don't think I used choosenim |
16:57:32 | FromDiscord | <vindaar> otherwise you might run into issues with multiple installations and different paths |
16:57:43 | FromDiscord | <RattleyCooper> Gotcha, I have no clue tbh. |
16:57:44 | FromDiscord | <vindaar> are you on windows or linux? |
16:57:58 | FromDiscord | <RattleyCooper> Might have used VSCode or installed from the exe |
16:58:00 | FromDiscord | <RattleyCooper> windows |
16:58:16 | FromDiscord | <vindaar> then I suppose installing the newest version from the website should work out fine |
16:58:24 | FromDiscord | <vindaar> (will be afk for a bit) |
16:58:36 | FromDiscord | <RattleyCooper> OK, I'll give it a shot. Thanks for all the help! |
17:17:36 | * | Guest28 joined #nim |
17:17:54 | * | Guest28 left #nim (#nim) |
17:25:10 | * | dmu joined #nim |
17:52:01 | FromDiscord | <treeform> I am trying to do very unsafe thing. I get an image array of bytes from openGL, can I manually make it part of a seq? Some thing like seq.intenraldataptr = openGLArrayPointer? |
17:52:41 | FromDiscord | <Rika> I doubt because a seq is garbage collected |
17:52:55 | FromDiscord | <Rika> Just use the unchecked array type |
17:53:08 | FromDiscord | <treeform> I need it on an object that's a seq |
17:53:23 | FromDiscord | <treeform> I can memcopy it but that is slow |
17:53:27 | FromDiscord | <treeform> I know its not safe |
17:53:30 | FromDiscord | <treeform> but I want to try |
17:54:32 | FromDiscord | <vindaar> I'd say you might run into issues that possibly break the GC (or do bad things to the data) |
17:54:33 | FromDiscord | <vindaar> might work better with arc |
17:54:33 | FromDiscord | <vindaar> but also there I've seen weird things |
17:54:33 | FromDiscord | <Rika> Is it a good idea |
17:54:37 | FromDiscord | <vindaar> why do you need a seq specifically though? |
17:56:08 | FromDiscord | <treeform> sent a code paste, see https://play.nim-lang.org/#ix=3sjS |
17:56:42 | FromDiscord | <treeform> I need to know the layout of the seq |
17:56:45 | FromDiscord | <treeform> (using refc for now) |
17:56:58 | FromDiscord | <treeform> I think arc puts the cap and len as first entries in the pointer |
17:57:20 | FromDiscord | <vindaar> I'm confused. Do you need a seq or is such an `UnsafeSeq` fine? |
17:57:47 | FromDiscord | <treeform> well unsafeSeq is seq |
17:57:49 | FromDiscord | <treeform> just casted |
18:18:43 | * | PMunch quit (Quit: leaving) |
18:23:08 | FromDiscord | <JonasL> `proc foo[T](self: T) =` |
18:26:10 | FromDiscord | <JonasL> how do i call proc on generics? e.g. |
18:26:19 | FromDiscord | <JonasL> `proc foo[T](self: T) : Position =↵ result self.getPosition()` |
18:27:30 | FromDiscord | <JonasL> (edit) "`proc foo[T](self: T) : Position =↵ result ... self.getPosition()`" added "=" |
18:32:45 | FromDiscord | <ynfle (ynfle)> What do you mean? |
18:38:56 | FromDiscord | <JonasL> something similar to Rust generics or C++ templates |
18:40:31 | FromDiscord | <Hi02Hi> have you tried `foo[T](arg)` ? |
18:41:32 | FromDiscord | <Hi02Hi> note: nim's type inference means you don't have to put the `[T]` part |
18:44:30 | FromDiscord | <ynfle (ynfle)> What do you want to do? |
18:45:06 | FromDiscord | <konsumlamm> oh, i think they're looking for something like Rust's traits |
18:46:22 | FromDiscord | <konsumlamm> Nim uses SFINAE (like C++), so you can just call functions on generic parameters and only when instantiated with a concrete type, it is type checked |
18:46:31 | FromDiscord | <JonasL> something similar yeah |
18:47:08 | FromDiscord | <konsumlamm> although there are concepts, which let you specify constraints on the generic parameters (like what functions it should support), but they're still experimental |
18:47:30 | FromDiscord | <JonasL> so i have to go the c++ way |
18:47:31 | FromDiscord | <konsumlamm> currently, you usually just use normal generic parameters though |
18:47:37 | FromDiscord | <konsumlamm> ye |
18:47:47 | FromDiscord | <konsumlamm> unless you wanna use concepts |
18:48:43 | FromDiscord | <JonasL> yeah tried it but got an error, but thanks for the advice. Learning by doing i guess |
18:48:44 | FromDiscord | <codic> also there are libraries that simulate it |
18:49:28 | FromDiscord | <codic> like this https://github.com/yglukhov/iface |
18:49:30 | fn | <R2D299> itHub: 7"<No Description>" |
18:49:33 | FromDiscord | <Alea> Would nim be any faster for building a matplotlib point cloud via nimpy? |
18:49:46 | FromDiscord | <Alea> Or would it spend all it's time in python code anyway |
18:50:37 | FromDiscord | <vindaar> how many data points are you talking about and how slow is matplotlib for you? |
18:50:37 | FromDiscord | <vindaar> unless the limiting factor is the generation of the data or something, no. The plotting will take \~the same time↵(@Alea) |
18:52:11 | FromDiscord | <ynfle (ynfle)> @\_discord\_678286491234992178\:t2bot.io What are you trying to do? |
18:53:02 | FromDiscord | <JonasL> In reply to @JonasL "yeah tried it but": works now. Thanks |
18:53:41 | FromDiscord | <ynfle (ynfle)> \:thumbsup\: |
19:02:23 | FromDiscord | <Alea> In reply to @vindaar "how many data points": 2.7M↵It takes a while to read them from xml to the scatter data, but the actual rendering is unusably slow |
19:04:44 | FromDiscord | <vindaar> regular plotting libraries simply aren't built to deal with that kind of data (especially in an interactive way).↵I'd propose to plot using nim, but to be fair, `ggplotnim` isn't really faster than matplotlib to plot a huge number of points. Last time I compared plotting 1 mio. points comparing with matplotlib it was similar in speed |
19:04:46 | FromDiscord | <vindaar> but the thing is, usually you don't want to plot this much data |
19:04:49 | FromDiscord | <vindaar> that's what heatmaps are for |
19:08:51 | FromDiscord | <Alea> Is there a way to do 3d heat maps? |
19:09:17 | FromDiscord | <Alea> Also pretty sure this is some kind of molecular data, so it should be discreet |
19:10:09 | FromDiscord | <vindaar> if you really want to plot such data as a point cloud though, you should probably look into something like vispy\: https://vispy.org/↵↵a heatmap is technically 3D by definition (color is a 3rd dimension) |
19:12:02 | * | neceve quit (Ping timeout: 252 seconds) |
19:17:22 | FromDiscord | <vindaar> an additional problem presents itself if you store plots with that many objects. If you store it as a vector graphic, most viewers will choke on that kind of data tooo |
19:18:29 | FromDiscord | <vindaar> compare these |
19:18:30 | FromDiscord | <vindaar> axion\_image\_2018.png https://media.discordapp.net/attachments/371759389889003532/862774666824908810/axion_image_2018.png |
19:18:31 | FromDiscord | <vindaar> xy\_2018.png https://media.discordapp.net/attachments/371759389889003532/862774668914065408/xy_2018.png |
19:20:20 | FromDiscord | <vindaar> that's \~750,000 points in that point cloud. The two aren't exactly the same, because the latter one is weighted by something. The input data is the same aside from that. Converting the scatter plot from a PDF to png took inkscape... 80 s |
19:21:10 | FromDiscord | <Vindaar> (on the discord side it's the former plot... the heatmap that is weighted) |
19:26:04 | FromDiscord | <haxscramper> Close but I think not exactly correct (part about SFINAE) - nim considers all overload candidates at once in `pickBestCandidate` https://github.com/nim-lang/Nim/blob/devel/compiler/semcall.nim#L76 that iterates through all overloads. So it is functionally similar, since you can write `[T: not proc]` and `[T]`, and it would choose by going through alternatives↵(@konsumlamm) |
19:27:22 | FromDiscord | <haxscramper> Though it is mostly terminological difference I suppose |
19:46:58 | * | SebastianM joined #nim |
19:47:13 | * | SebastianM quit (Client Quit) |
19:47:13 | * | neceve joined #nim |
19:55:53 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3skm |
20:09:07 | FromDiscord | <Bung> is it about neovim or nimlsp server, if server you need clone nimlsp run `nimble debug` see what happens |
20:17:15 | FromDiscord | <Bung> how to convert utf16 to utf8 ? |
20:19:31 | FromDiscord | <Bung> fond iconv.`convert(original, "utf-16", "utf-8")` |
21:16:51 | FromDiscord | <System64 ~ Flandre Scarlet> Is it normal I don't have the stacktrace? https://media.discordapp.net/attachments/371759389889003532/862804365822394408/unknown.png |
21:17:57 | FromDiscord | <dom96> did you build in release/danger mode? |
21:19:44 | FromDiscord | <System64 ~ Flandre Scarlet> just did nim compile -r myprogram.nim |
21:22:56 | FromDiscord | <RattleyCooper> Are you trying to access an object attribute that doesn't have a value? I get that same error when I create a ref object of RootObj and then try to access an attribute that hasn't been set. |
21:24:08 | FromDiscord | <System64 ~ Flandre Scarlet> it crashes at random times↵Sometime directly after the boot, sometime 1 minute after, sometime 10 seconds after, ... |
21:30:49 | FromDiscord | <Bung> guess you'll need import segfaults module |
21:40:00 | FromDiscord | <System64 ~ Flandre Scarlet> weird, I don't have any problems with the danger flag |
21:42:33 | FromDiscord | <Bung> @ElegantBeef have you thought make nimscripter no compiler package dependency and no `stdlib` dir ? |
21:46:37 | FromDiscord | <System64 ~ Flandre Scarlet> well my theory is the garbage collector collects something it shouldn't collect |
21:49:14 | FromDiscord | <Bung> write some GC_ref might help |
21:54:31 | FromDiscord | <System64 ~ Flandre Scarlet> what's that? |
21:56:41 | FromDiscord | <Bung> https://nim-lang.org/docs/system.html#GC_ref%2Cref.T |
21:59:43 | FromDiscord | <System64 ~ Flandre Scarlet> the problem is I dunno what's deleted, will inspect that |
22:00:52 | FromDiscord | <ElegantBeef> In reply to @Bung "<@!145405730571288577> have you thought": Considering the compiler has the VM no, and no i want to enable a redistributable environment and removing that will ruin the purpose |
22:01:16 | FromDiscord | <ElegantBeef> Say you are pmunch and want to enable a config using nims without the shippable stdlib, you now have to have Nim installed, it just makes it silly |
22:01:38 | FromDiscord | <ElegantBeef> If you dont like those two ideas might i suggest a fork? |
22:03:49 | FromDiscord | <ElegantBeef> afaik if i dont use the compiler package i'd have to use `nim e` which puts a reliance on having nim installed |
22:05:44 | * | neceve quit (Ping timeout: 252 seconds) |
22:05:46 | FromDiscord | <Bung> I dont get the idea, redistributable in what format ? you still need nim and nimble right ? |
22:05:54 | FromDiscord | <Bung> https://github.com/bung87/rehighlite/blob/master/src/rehighlite/pnode_parse.nim |
22:05:57 | FromDiscord | <ElegantBeef> Not if you build a program |
22:06:22 | FromDiscord | <ElegantBeef> If you make a binary you can redistribute it without `nim` or `nimble` installed |
22:06:34 | FromDiscord | <ElegantBeef> You ship an authored stdlib you want to enable |
22:06:45 | FromDiscord | <ElegantBeef> And there you go now a safeish environment for your evaluation |
22:07:52 | FromDiscord | <Bung> for that purpose you dont need them. |
22:08:05 | FromDiscord | <ElegantBeef> And that's the purpose of nimscripter |
22:08:23 | FromDiscord | <ElegantBeef> Nim <-> Nimscript interop for a portable environment |
22:09:46 | FromDiscord | <ElegantBeef> Relying on Nim being installed is completely against my view of nimscripter |
22:10:39 | FromDiscord | <ElegantBeef> At that point i'd probably just use Nim and use some IPC to communicate between the "plugin" and main file |
22:16:34 | * | xet7 quit (Ping timeout: 246 seconds) |
22:29:29 | * | xet7 joined #nim |
22:29:33 | * | supakeen quit (Remote host closed the connection) |
22:29:57 | * | supakeen joined #nim |
22:34:20 | FromDiscord | <Bung> I've forked https://github.com/bung87/nimscripter/tree/slim I dont need them for what purpose. |
22:36:20 | * | max22- quit (Remote host closed the connection) |
22:36:27 | FromDiscord | <talaing> https://media.discordapp.net/attachments/371759389889003532/862824481285603358/MXpv3YC5.png |
22:36:34 | FromDiscord | <talaing> How can I fix this? |
22:36:47 | FromDiscord | <talaing> It just happened, I haven't used nimble for a while but I remember it worked before. |
22:37:22 | fn | <ForumUpdaterBot99> New thread by Niminem: How to export a prefix to an ref object type? (JSFFI), see https://forum.nim-lang.org/t/8213 |
22:42:30 | FromDiscord | <ElegantBeef> Windows defender may have removed it, so you can reinstall using choosenim |
22:46:39 | FromDiscord | <talaing> In reply to @ElegantBeef "Windows defender may have": Yes, that might be the issue, windows defender really often removes my stuff, sometimes even during coding (it just deletes the compiled .exe file). How can I do so? |
22:46:59 | FromDiscord | <talaing> `choosenim` command seems to work properly |
22:48:17 | FromDiscord | <ElegantBeef> well you can try `choosenim remove stable` then `choosenim stable` |
22:48:30 | FromDiscord | <talaing> https://media.discordapp.net/attachments/371759389889003532/862827510185459713/HnwoJQO3.png |
22:48:38 | FromDiscord | <talaing> translation: "Couldn't find requested file" |
22:49:15 | FromDiscord | <talaing> Should I disable windows defender for now? |
22:51:52 | FromDiscord | <ElegantBeef> Atleast add nim's software to the "allowed software list" |
22:52:17 | FromDiscord | <talaing> I disabled windows defender entirely. Nothing changed, still the same issue |
22:52:19 | FromDiscord | <System64 ~ Flandre Scarlet> sent a long message, see http://ix.io/3skQ |
22:54:29 | FromDiscord | <ElegantBeef> Well you'll have to reinstall |
22:54:36 | FromDiscord | <talaing> Alright |
22:54:45 | FromDiscord | <talaing> Is there any uninstaller for nim? |
22:54:53 | FromDiscord | <ElegantBeef> Well you dont need one 😄 |
22:55:10 | FromDiscord | <talaing> oh |
22:55:18 | FromDiscord | <ElegantBeef> Remember all the important files were removed by your antivirus |
22:55:30 | FromDiscord | <ElegantBeef> So just download the choosenim file from the github and run it again |
22:55:44 | FromDiscord | <talaing> from here? https://github.com/dom96/choosenim/releases |
22:56:36 | FromDiscord | <talaing> Yeah there's instruction on the main page https://github.com/dom96/choosenim |
22:56:38 | fn | <R2D299> itHub: 7"Tool for easily installing and managing multiple versions of the Nim programming language." |
22:56:43 | FromDiscord | <@bracketmaster-5a708063d73408ce4> I want to create a repl for my program that lets you issue commands and do operations |
22:56:49 | FromDiscord | <@bracketmaster-5a708063d73408ce4> is there any nim tooling for this? |
22:58:59 | FromDiscord | <ElegantBeef> You could use IPC, or your favourite scripting language(include nimscript) |
23:01:04 | FromDiscord | <talaing> https://media.discordapp.net/attachments/371759389889003532/862830671185051688/LCm2AMPB.png |
23:01:45 | FromDiscord | <ElegantBeef> Uhh |
23:01:54 | FromDiscord | <ElegantBeef> No clue then |
23:02:27 | FromDiscord | <talaing> Okay, thanks for help though |
23:02:29 | FromDiscord | <talaing> I'll figure this out |
23:03:40 | FromDiscord | <Bung> @ElegantBeef I think I need api check method exists |
23:07:51 | FromDiscord | <ElegantBeef> `selectRoutine` is it but it returns nil if overloaded or if it doesnt exist |
23:09:32 | FromDiscord | <Bung> oh , that can be wraped as a api with proc name + postfix |
23:09:55 | * | rockcavera joined #nim |
23:09:55 | * | rockcavera quit (Changing host) |
23:09:55 | * | rockcavera joined #nim |
23:10:51 | FromDiscord | <ElegantBeef> Yea like i said i probably will have a significant rewrite of nimscripter soon |
23:10:51 | FromDiscord | <ElegantBeef> If you keep bugging me really soon 😄 |
23:18:42 | FromDiscord | <Bung> who knows any other problem will occurs while using nimscripter , guess I'll archive my goal very soon. |
23:28:10 | FromDiscord | <RattleyCooper> I'm messing with generating perlin noise to learn standard library and types better. Is there an image library that makes it easy to create a png? |
23:28:17 | FromDiscord | <ElegantBeef> pixie! |
23:28:18 | FromDiscord | <RattleyCooper> I want to see if my noise tiles like I want it to |
23:28:25 | FromDiscord | <RattleyCooper> Sweet, thanks Beef! |
23:30:45 | FromDiscord | <ElegantBeef> https://nimdocs.com/treeform/pixie/pixie/images.html#%5B%5D%3D%2CImage%2Cint%2Cint%2CSomeColor rather simple api |
23:30:46 | FromDiscord | <RattleyCooper> Oh wow yeah that looks dead simple |
23:30:46 | FromDiscord | <RattleyCooper> I'll find a way to f@! it up |
23:30:47 | FromDiscord | <ElegantBeef> then you can just do `writeFile(yourImage, "name.png")` |
23:30:52 | FromDiscord | <RattleyCooper> niiccceeeee |
23:30:53 | FromDiscord | <ElegantBeef> (edit) ""name.png")`" => ""name.png", ffPng)`" |
23:31:14 | FromDiscord | <ElegantBeef> Pixie is a full drawing api though so tons of stuff in it |
23:31:21 | FromDiscord | <ElegantBeef> Image handling is one small part of it 😛 |
23:33:23 | FromDiscord | <RattleyCooper> I see that on the github. Looks awesome! Def gonna use this for something |
23:34:09 | FromDiscord | <RattleyCooper> It can even handle drawing svgs? That's dope af |