00:36:01 | * | qwr joined #nim |
00:51:04 | FromDiscord | <QueenFuckingAdrielle> does nim support inline asm on windows? |
00:51:22 | FromDiscord | <QueenFuckingAdrielle> cant get a simple helloworld to run |
00:52:17 | FromDiscord | <Elegantbeef> It should, if you're not using the GNU assembler you need to include `\n` at the end of lines |
00:52:26 | FromDiscord | <Elegantbeef> Dont know if you're referring to https://nim-lang.org/docs/manual.html#statements-and-expressions-assembler-statement |
00:52:44 | FromDiscord | <QueenFuckingAdrielle> yea thats what im referring to |
00:53:29 | FromDiscord | <QueenFuckingAdrielle> as a test i wrote compiled a helloworld.c to hello.s, denoised and added it via the asm keyword |
00:53:51 | FromDiscord | <QueenFuckingAdrielle> ugh im an idiot |
00:54:05 | FromDiscord | <QueenFuckingAdrielle> ive been flipping back and forth between a vm, i forgot |
00:54:09 | FromDiscord | <QueenFuckingAdrielle> still doesnt work though |
00:54:18 | FromDiscord | <QueenFuckingAdrielle> its an ubuntu vm |
00:54:34 | FromDiscord | <QueenFuckingAdrielle> sent a long message, see http://ix.io/3G7U |
00:55:20 | FromDiscord | <Elegantbeef> Yea i dont know anything about asm so i'm no help here |
00:55:27 | FromDiscord | <QueenFuckingAdrielle> lol kk |
00:55:37 | FromDiscord | <QueenFuckingAdrielle> im definitely playing in dangerous waters |
00:56:13 | FromDiscord | <QueenFuckingAdrielle> trying to see if i can do gcc -S something.c g++ -S something.cpp and inline both aseemblys |
00:56:38 | FromDiscord | <QueenFuckingAdrielle> ies.. |
00:56:57 | FromDiscord | <pyautogui> Sounds very interesting to me, as someone with very little experience with asm. |
00:57:36 | FromDiscord | <QueenFuckingAdrielle> the motivation is to see if i can also do it with ptx assembly (cuda assembly) and then just wrap it all with nim |
00:57:50 | FromDiscord | <QueenFuckingAdrielle> thus avoiding the c/c++ interop barriers |
00:58:05 | FromDiscord | <QueenFuckingAdrielle> probably a stupid idea, but here we are |
01:11:03 | FromDiscord | <QueenFuckingAdrielle> ive read different things about using result vs return. do we prefer using the result variable? i cant see a reason not to. |
01:11:17 | FromDiscord | <QueenFuckingAdrielle> sent a long message, see http://ix.io/3G81 |
01:12:16 | FromDiscord | <QueenFuckingAdrielle> idk why id allocate an extra variable if result is already declared |
01:12:51 | FromDiscord | <QueenFuckingAdrielle> jesus i need a life |
01:13:48 | FromDiscord | <Elegantbeef> We prefer result |
01:13:51 | FromDiscord | <Elegantbeef> Or implicit result |
01:14:09 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3G82 |
01:14:30 | FromDiscord | <Yardanico> @QueenFuckingAdrielle don't use `cast` like that btw, you can just use a type conversion like T(0) |
01:14:58 | FromDiscord | <Elegantbeef> `cast` is a free type cast which reinterprets bit per bit |
01:15:36 | FromDiscord | <Elegantbeef> `cast[int](321321d) != 321321` `int(321321d) == 321321` |
01:19:51 | FromDiscord | <QueenFuckingAdrielle> gotcha |
01:19:59 | FromDiscord | <QueenFuckingAdrielle> thanks both of you guys |
01:20:01 | FromDiscord | <QueenFuckingAdrielle> š |
01:20:45 | FromDiscord | <Yardanico> and yeah, as beef said, `result` is kind of preferred, although it does have some issues (mostly security and bug related), e.g. the fact that it'll be set to the default (zeroed) value of the returning type which might not be desirable |
01:21:13 | FromDiscord | <QueenFuckingAdrielle> ah i see interesting |
01:21:18 | FromDiscord | <Yardanico> and yeah, implicit result is basically - if the value of the last expression in the proc is not used and it has the same type as the proc's return type, use it as the result |
01:21:47 | FromDiscord | <QueenFuckingAdrielle> oh okay, so basically remove "result =" part and itll still pick it up right? |
01:21:58 | FromDiscord | <Yardanico> yes, as long as it's the last expression in the proc |
01:22:04 | FromDiscord | <QueenFuckingAdrielle> kk cool |
01:22:20 | FromDiscord | <Yardanico> you can even mix that with case statements and stuff, as long as they're exhaustive |
01:22:33 | FromDiscord | <QueenFuckingAdrielle> i love it |
01:22:56 | FromDiscord | <QueenFuckingAdrielle> never had any luck with my asm fiddling |
01:23:04 | FromDiscord | <QueenFuckingAdrielle> maybe ill try again later |
01:23:24 | FromDiscord | <QueenFuckingAdrielle> hoping to leverage sve2 and some other stuff that way |
01:23:24 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3G85 |
01:24:17 | FromDiscord | <QueenFuckingAdrielle> thats awesome, gotta admit, at first I want to gripe about readability, but idk i think it looks really clean |
01:25:18 | FromDiscord | <QueenFuckingAdrielle> what is yall's opinion on generating gpu kernel assembly and then inlining in nim? |
01:25:22 | FromDiscord | <QueenFuckingAdrielle> is that insane? |
01:26:32 | FromDiscord | <Elegantbeef> Beyond my knowledge |
01:26:35 | FromDiscord | <QueenFuckingAdrielle> i feel like im going to get stuck by lightning for mentioning it |
01:26:42 | FromDiscord | <QueenFuckingAdrielle> (edit) "stuck" => "struck" |
01:27:24 | FromDiscord | <QueenFuckingAdrielle> oddly enough, i want to decouple my code from the change cuda/opencl/sycl/sve/avx landscape |
01:28:14 | FromDiscord | <QueenFuckingAdrielle> so i figure do a setup_my_gpu_crap.sh and compile .c, cu, etc into assembly and inline that |
01:49:34 | * | xet7 quit (Remote host closed the connection) |
01:50:38 | * | xet7 joined #nim |
02:13:36 | * | lumo_e quit (Quit: Quit) |
02:28:55 | FromDiscord | <demotomohiro> How about to define a C or C++ function that call your gpu kernel on .cu file and create a library file (.lib, .dll, .so etc) from these cu files and link it to nim code?āµOr export C functions from your nim code, build it as library and link it to your cu file.āµI think that is simpler than inlining gpu kernel assembly in nim. |
02:38:28 | FromDiscord | <demotomohiro> If you know how to use OpenGL's compute shader, you might be able to write a code in Nim and run it on GPU.āµhttps://github.com/treeform/shady |
02:38:32 | * | neurocyte0132889 quit (Ping timeout: 240 seconds) |
02:58:40 | * | arkurious quit (Quit: Leaving) |
03:34:46 | nrds | <Prestige99> Anyone know why jester routes use `@` for params instead of `:` ? |
03:35:04 | nrds | <Prestige99> Looking at "/hello/@name" |
03:35:10 | nrds | <Prestige99> https://github.com/dom96/jester#routes |
03:35:44 | FromDiscord | <Rika> Why not? Whatās the issue with that |
03:36:12 | nrds | <Prestige99> just uncommon, everything else I've seen uses `:` |
03:37:41 | * | pch quit (Remote host closed the connection) |
03:39:24 | FromDiscord | <Rika> Probably it was planned to use untyped instead of string so : is a no go there |
03:39:28 | FromDiscord | <Rika> Just a guess though |
03:39:53 | * | pch joined #nim |
03:41:26 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=3G8C |
03:41:52 | FromDiscord | <Anonymous Poet> i want to get the value/type `byte` in the `when T is Vector` clause |
03:42:06 | FromDiscord | <Rika> Canāt you do T.T? |
03:42:32 | FromDiscord | <Anonymous Poet> š® |
03:42:42 | FromDiscord | <Anonymous Poet> how/why does that work? |
03:42:49 | FromDiscord | <Anonymous Poet> (confirmed it works btw, thanks!) |
03:42:57 | FromDiscord | <Rika> Because the generic parameter is a āfake fieldā I guess? |
03:43:10 | FromDiscord | <Anonymous Poet> what do you mean? |
03:43:20 | FromDiscord | <Rika> You can access it like a field but itās not a field |
03:43:24 | FromDiscord | <Anonymous Poet> OH |
03:43:27 | FromDiscord | <Anonymous Poet> i didnt know that |
03:43:43 | FromDiscord | <Rika> Why? Prolly because itās convenient |
03:43:58 | FromDiscord | <Anonymous Poet> so if i renamed the generic in the definition of Vector, say to `type Vector[V] = object...`, id access it as `T.V`? |
03:44:02 | FromDiscord | <Rika> Yes |
03:44:10 | FromDiscord | <Anonymous Poet> ā¤ļø thats awesome, thanks! |
03:44:22 | FromDiscord | <Rika> Thatās why I try to not use single letter names for generic parameters |
03:44:37 | FromDiscord | <Rika> Think itās similar to in C++ |
03:45:12 | FromDiscord | <Anonymous Poet> good to know, thanks |
03:45:14 | FromDiscord | <Elegantbeef> Generic types have generic type params which are accessible from the type |
03:45:43 | FromDiscord | <Rika> I guess they ARE field |
03:45:44 | FromDiscord | <Rika> Field s |
03:45:52 | FromDiscord | <Rika> Just fields of the type descriptor |
03:48:15 | FromDiscord | <Anonymous Poet> thats actually a fantastic phrasing, because i was making a dummy object of that type just to keep the type info |
03:48:20 | FromDiscord | <Anonymous Poet> so that simplifies a bit š |
03:49:13 | FromDiscord | <Rika> You can use it directly too |
03:49:25 | FromDiscord | <Rika> var x: T.V; ⦠|
03:49:43 | FromDiscord | <Anonymous Poet> š® nim gets better and better! |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:32 | * | supakeen joined #nim |
04:36:19 | FromDiscord | <gogolxdong (liuxiaodong)> Is there anyone used nim-web3? |
04:45:44 | * | rockcavera quit (Remote host closed the connection) |
06:46:44 | * | Doraemon joined #nim |
06:49:18 | * | NeoCron quit (Ping timeout: 260 seconds) |
07:28:53 | FromDiscord | <claude> am i the only one who thought `s[a..b] = []` was the way to do it and didnt know `sequtils.delete` existed? is this bad practice? |
07:30:12 | FromDiscord | <Elegantbeef> Comically i've never done a left hand slice š |
07:30:27 | FromDiscord | <Elegantbeef> I guess this would be called a splice |
07:31:11 | FromDiscord | <claude> its been useful a couple of times |
07:32:40 | FromDiscord | <Elegantbeef> Seems like it would be, but yea delete is more clear imo |
07:33:55 | FromDiscord | <claude> it doesnt reallocate if its shrinking apparently |
07:34:06 | FromDiscord | <Elegantbeef> Of course not |
07:34:23 | FromDiscord | <Elegantbeef> Only when you go over capacity would it reallocate |
07:34:49 | FromDiscord | <Rika> Change the capacity with set capacity if you want an explicit reallocation |
07:35:03 | FromDiscord | <Rika> Most of the time people want max speed and not max memory efficiency |
07:35:08 | FromDiscord | <Elegantbeef> There is no set capacity |
07:35:14 | FromDiscord | <Rika> Really? I forget then |
07:35:22 | FromDiscord | <Elegantbeef> there is only `newSeqWithCap` or `ofCap` always forget |
07:35:25 | FromDiscord | <Elegantbeef> you can set len |
07:35:47 | FromDiscord | <Elegantbeef> But for some reason there is 0 ability to fetch the capacity of a sequence |
07:36:25 | FromDiscord | <Rika> Because thatās an implementation detail |
07:42:15 | FromDiscord | <Elegantbeef> You're an implementation detail |
07:42:35 | FromDiscord | <Rika> Ok |
08:17:23 | FromDiscord | <hmmm> rika is core implementation and golden egg mvp :nim1: |
08:19:29 | FromDiscord | <Rika> I wish |
08:22:10 | * | kayabaNerve joined #nim |
09:02:30 | * | advesperacit joined #nim |
09:48:20 | FromDiscord | <konsumlamm> is there a way to specify a local directory as a dependency for a nimble package? |
09:49:14 | FromDiscord | <Rika> Is it a package |
09:49:26 | FromDiscord | <Rika> Or is it just some directory |
09:50:57 | FromDiscord | <Elegantbeef> If it's a nimble package you can do `nimble develop` and it'll symlink it in nimble then you can `requires "packagename"` |
09:53:26 | FromDiscord | <konsumlamm> nice, that seems to work |
09:58:33 | FromDiscord | <konsumlamm> also, i learned that there are no private modules |
10:00:58 | FromDiscord | <tandy> does anyone know how to do sleeps on javascript / emscripten? |
10:09:00 | FromDiscord | <konsumlamm> what is the way to build a nimble library (i.e. check that everything compiles)? `nimble build` doesn't work (it seems to onl be for executables) and `nimble install` just ignores errors for soemreason |
10:11:50 | FromDiscord | <Rika> Test? |
10:12:00 | FromDiscord | <Rika> Check? |
10:13:40 | FromDiscord | <tandy> if you have a nim file where you import al the library modules, just compile thatāµ(@konsumlamm) |
10:14:04 | FromDiscord | <tandy> but @Rika is right, write some tests, then create a nimble test task |
10:14:29 | FromDiscord | <konsumlamm> `nimble test` also runs the tests, i just want to see if the package compiles |
10:14:39 | FromDiscord | <konsumlamm> and `nimble check` just checks the project structure |
10:14:47 | FromDiscord | <tandy> then this |
10:14:57 | FromDiscord | <konsumlamm> i wanna use nimble tho :/ |
10:15:37 | FromDiscord | <Rika> Make a task then |
10:17:05 | FromDiscord | <konsumlamm> so just compiling a library is not a common enough task to have a standard nimble task for it? |
10:18:02 | * | neurocyte0132889 joined #nim |
10:18:02 | * | neurocyte0132889 quit (Changing host) |
10:18:02 | * | neurocyte0132889 joined #nim |
10:18:30 | FromDiscord | <Rika> No |
10:18:36 | FromDiscord | <Rika> Most of the time people make tests |
10:18:52 | FromDiscord | <Rika> Or use Nim and not nimble |
10:18:54 | FromDiscord | <konsumlamm> and most of the time just compiling the lib is way faster than also running the tests |
10:19:02 | FromDiscord | <Rika> I personally never use nimble for anything but package management |
10:19:08 | FromDiscord | <konsumlamm> that's just basic stuff i expect froma package manager |
10:19:31 | FromDiscord | <Rika> Then maybe itās issue or PR time |
10:21:44 | FromDiscord | <5271> it's probably a very dumb question āµbut how do i call a function from another file? |
10:25:23 | FromDiscord | <konsumlamm> you import the other file and then call it |
10:26:00 | FromDiscord | <5271> uhmāµhow do i call a file? |
10:26:10 | FromDiscord | <5271> should i type in the relative or global path |
10:28:55 | FromDiscord | <konsumlamm> `import <name of file>` if it's in the same directory |
10:29:05 | FromDiscord | <konsumlamm> (without the `.nim` extension) |
10:32:06 | FromDiscord | <5271> import on itself doesn't give any errorsāµbut i can't call the functionāµshould i make it public or something? |
10:32:20 | FromDiscord | <konsumlamm> yes |
10:32:37 | FromDiscord | <konsumlamm> you make something public by adding a `` after it |
10:32:43 | FromDiscord | <konsumlamm> it being the name |
10:34:26 | FromDiscord | <5271> oh it works |
10:34:30 | FromDiscord | <5271> thank you :3 |
10:34:37 | FromDiscord | <5271> and sorry for such a dumb question o~o |
10:51:49 | FromDiscord | <runner7mi> this is my first time looking at Nim.. why does it remind me of python |
10:52:22 | FromDiscord | <Rika> Because it has the offside rule and uses : as block starter? |
10:55:01 | FromDiscord | <haoyu> does nim's abnormal information reveal some sensitive information? |
10:55:28 | FromDiscord | <haoyu> https://media.discordapp.net/attachments/371759389889003532/913744760504725514/unknown.png |
10:56:10 | FromDiscord | <haoyu> the whole project path or something |
10:58:06 | FromDiscord | <hotdog> In reply to @haoyu "does nim's abnormal information": Compile with `-d:release` or `--stacktrace:off` |
11:01:13 | FromDiscord | <haoyu> thx bro, perfectly solved this problem |
11:19:43 | FromDiscord | <runner7mi> In reply to @Rika "Because it has the": lack of boiler plate... import modules in the same way.. it's like a wierd wonderful mix of python, javascript and c |
11:21:27 | FromDiscord | <runner7mi> (edit) "wierd" => "weird" |
11:47:31 | * | dv^_^6 joined #nim |
11:48:35 | * | flynn8 joined #nim |
11:48:48 | * | greyrat_ joined #nim |
11:48:48 | * | jkl1337 joined #nim |
11:49:58 | * | fputs3 joined #nim |
11:50:11 | FromDiscord | <dom96> In reply to @nrds "<Prestige> Anyone know why": . |
11:50:35 | FromDiscord | <dom96> Jester uses @ so that access is consistent in the routes. You wouldn't be able to have `var data = :"data"` in Nim |
11:50:54 | * | MightyJoe joined #nim |
11:51:08 | * | rp2 joined #nim |
11:52:20 | * | laintree joined #nim |
11:54:21 | * | madprops_ joined #nim |
11:55:59 | * | madprops quit (Ping timeout: 260 seconds) |
11:55:59 | * | greyrat quit (Ping timeout: 260 seconds) |
11:55:59 | * | rp1 quit (Ping timeout: 260 seconds) |
11:55:59 | * | Amun-Ra quit (Ping timeout: 260 seconds) |
11:55:59 | * | cyraxjoe quit (Ping timeout: 260 seconds) |
11:56:00 | * | dv^_^ quit (Ping timeout: 260 seconds) |
11:56:00 | * | flynn quit (Ping timeout: 260 seconds) |
11:56:00 | * | fputs quit (Ping timeout: 260 seconds) |
11:56:00 | * | lain quit (Ping timeout: 260 seconds) |
11:56:00 | * | jkl quit (Ping timeout: 260 seconds) |
11:56:01 | * | flynn8 is now known as flynn |
11:56:01 | * | fputs3 is now known as fputs |
11:56:02 | * | dv^_^6 is now known as dv^_^ |
12:03:50 | * | Amun-Ra joined #nim |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:06:47 | NimEventer | New thread by Rforcen: Implicit surfaces polygonizer , see https://forum.nim-lang.org/t/8655 |
12:23:27 | FromDiscord | <Rika> Ah so I was almost correct haha |
12:28:46 | * | PMunch joined #nim |
13:04:02 | * | src joined #nim |
13:10:55 | NimEventer | New thread by Jocker: Limit number of running threads, see https://forum.nim-lang.org/t/8656 |
13:20:48 | * | Guest12 joined #nim |
13:21:20 | * | Guest12 quit (Client Quit) |
13:41:23 | * | rockcavera joined #nim |
13:41:23 | * | rockcavera quit (Changing host) |
13:41:23 | * | rockcavera joined #nim |
14:21:45 | arkanoid | exelotl: shouldn't this list already exist and moderated by official team? |
14:32:35 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
14:32:57 | * | dtomato joined #nim |
14:39:11 | PMunch | What list? |
15:38:19 | * | vicecea quit (Remote host closed the connection) |
15:38:49 | * | vicecea joined #nim |
15:53:32 | * | arkurious joined #nim |
16:12:09 | FromDiscord | <exelotl> arkanoid: previously there was "fusion" which was a distribution of recommended packages that shipped with Nim. But it didn't really work out, so this list will be their next approach (probably for Nim 2.0 to fill in for some modules being removed from the stdlib) |
16:14:03 | FromDiscord | <exelotl> (I might not be 100% accurate with this so take my words with a grain of salt) |
16:16:11 | FromDiscord | <exelotl> PMunch: arkanoid was asking about the effects on the ecosystem if the stdlib shrinks, so I pointed him to this comment: https://forum.nim-lang.org/t/8642#56223 |
16:16:24 | FromDiscord | <konsumlamm> (fusion is just a single package, with multiple modules) |
16:16:45 | FromDiscord | <exelotl> ahh right |
16:17:13 | PMunch | Ah I see |
16:24:57 | FromDiscord | <haxscramper> It didn't distribute "recommended" packages, it distributed quasi-experimental things that could as well be added to stdlib |
16:37:25 | * | madprops_ is now known as madprops |
16:37:26 | * | madprops quit (Changing host) |
16:37:26 | * | madprops joined #nim |
16:39:32 | FromDiscord | <Hex08> Hello! I'm just getting started with Nim and I was trying to write something likeāµ`func is_prime(n: Natural): Natural = (2..^n).all_it(n % it != 0)`āµbut I can't figure out how to check that a predicate is true for each element of an iterator. I only find functions that work with open_arrays but I think a lazy approach would be a better fit |
16:40:47 | FromDiscord | <Hex08> Basically I'd like to iterate over all possible divisors using `countup` and stop as soon as one element fails the test instead of allocating a big sequence |
16:43:57 | FromDiscord | <Rika> needs 3rd party lib zero functional i think |
16:44:02 | FromDiscord | <Rika> or make your own proc |
16:45:23 | FromDiscord | <Hex08> Looks good, thank you! |
17:01:43 | FromDiscord | <sjfloat (Steve Jones)> Hi, is anyone here using nimscript as provisioned by nix on MacOS? |
17:02:06 | FromDiscord | <sjfloat (Steve Jones)> `Nim Compiler Version 1.4.8 [MacOSX: amd64]` |
17:02:45 | FromDiscord | <sjfloat (Steve Jones)> I'm trying to use `std/parsopt`, but I'm having trouble. |
17:06:02 | FromDiscord | <sjfloat (Steve Jones)> sent a code paste, see https://play.nim-lang.org/#ix=3GbV |
17:06:37 | FromDiscord | <sjfloat (Steve Jones)> sent a code paste, see https://play.nim-lang.org/#ix=3GbV |
17:07:20 | FromDiscord | <sjfloat (Steve Jones)> sent a code paste, see https://play.nim-lang.org/#ix=3GbW |
17:07:43 | FromDiscord | <sjfloat (Steve Jones)> import std/parseoptāµāµvar p = initOptParser("-ab -e\:5 --foo --bar=20 file.txt")āµGives me `Error: undeclared identifier: 'initOptParser'` |
17:08:26 | FromDiscord | <sjfloat (Steve Jones)> (sorry, I'm perpetually baffled by gitter's editor) |
17:21:12 | FromDiscord | <sjfloat (Steve Jones)> I should add that I'm trying to use that in a nimscript |
17:22:04 | FromDiscord | <sjfloat (Steve Jones)> However, I get the same error compiling. |
17:34:51 | FromDiscord | <QueenFuckingAdrielle> In reply to @demotomohiro "How about to define": I didnt see this yesterday. The whole issue with that is then I'm stuck using only the c++ OR the c backend, am I not? Also opengl is not optimized for that sort of thing, I'd be better off try to write a vulkan shader performance wise. I am mainly interested in using cuda, sve2, and avx. |
17:45:32 | * | pch quit (Remote host closed the connection) |
17:47:00 | * | Colt quit (Remote host closed the connection) |
17:47:39 | * | Colt joined #nim |
17:56:00 | * | Colt quit (Remote host closed the connection) |
17:59:31 | * | Colt joined #nim |
18:07:37 | * | Colt quit (Remote host closed the connection) |
18:08:00 | * | Colt joined #nim |
18:18:05 | * | Figworm joined #nim |
18:19:26 | arkanoid | I'm developing a collection of parsers to decode multiple non-machine-readable native stuff. I'd like to implement it in a plugin fashion, where I can drop a .so/.dll in a plugin folder and nim would use the additional functions there to try parsing the candidate file |
18:19:31 | arkanoid | how would you do this? |
18:35:10 | FromDiscord | <enthus1ast> ah reread you question. |
18:35:42 | FromDiscord | <enthus1ast> I think it depends "what is in charge", so either the loader could search for all the functions and register them, or the module can do this |
18:36:28 | FromDiscord | <enthus1ast> so eg, it can call a "registerProc" provided my you main module |
18:37:19 | FromDiscord | <enthus1ast> then i think it depends what you wanna do or if the modules have a smilar/same interface |
18:37:35 | arkanoid | ok, but how can I load and enumerate nim function from external lib at runtime? |
18:38:23 | FromDiscord | <enthus1ast> as i said, either the loader from you main app loads each function with symAddr, or the loader loads and calls just one function where you register all your stuff |
18:43:29 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/3Gcj |
18:43:39 | arkanoid | sorry, be patient, but I'm not following. I mean, I don't get how this would solve the enumeration problem. with "loadLib" I can load the dll, with symAddr I can bind function name. I guess I can't enumerate the functions in the loaded lib and call them all (given the fact that they share same arguments) |
18:44:40 | FromDiscord | <enthus1ast> no you must either know beforehand how the function is called (the exported name), or the module must know this and tell the loader what it should "register" |
18:45:10 | FromDiscord | <enthus1ast> sent a long message, see http://ix.io/3Gck |
18:45:56 | arkanoid | got it, thanks. What if I enumerate the function as pluginFunction1, pluginFuntion2, ... inside each dll and let main loader "try" in order? |
18:46:12 | FromDiscord | <enthus1ast> sure you can do this |
18:46:27 | FromDiscord | <enthus1ast> then you must decide "what is in charge" |
18:46:31 | FromDiscord | <enthus1ast> the module, or the loader |
18:47:07 | FromDiscord | <enthus1ast> eg when the module registers themself, it can get eg the main apps object as an function parameter |
18:47:24 | FromDiscord | <enthus1ast> but then the module can do all sort of crazy stuff to the app state |
18:48:02 | FromDiscord | <enthus1ast> when the main app is "in charge" you could eg just export functions ala\: "checkFile(path\: string)\: someReturn" |
18:48:40 | FromDiscord | <enthus1ast> then the main app calls these at will, withouth the risk of a module interfere with the internals app state |
18:51:13 | arkanoid | surely the second approach |
18:51:20 | arkanoid | well, thanks! |
19:08:01 | FromDiscord | <hmmm> hey bois there is a nifty utility on github that is exactly the thing I need for my stuffs that is either in bash or perl or php format, what are my chances of gobbling one of them in nim without the hassle of translating them |
19:10:48 | FromDiscord | <enthus1ast> call it from the commanline and parse its output |
19:10:54 | FromDiscord | <enthus1ast> commandline |
19:11:12 | FromDiscord | <hmmm> yea this might be a great idea |
19:11:43 | FromDiscord | <hmmm> last time I did something like that I got stuck at the taking back the output |
19:12:13 | FromDiscord | <enthus1ast> some apps are better suited to this than others, sure |
19:12:31 | FromDiscord | <hmmm> no wait it's not a great idea if I need to share the app I can't assume people roll around with php or perl installed |
19:13:32 | * | qwr i sa bit confused - does hmmm wants to transpile perl/php/bash into nim or what? |
19:14:11 | FromDiscord | <hmmm> hmmm doesn't really know what he wants to do, he is trying to avoid translating by hand perl which he never digested the synthax of |
19:14:53 | FromDiscord | <hmmm> oh the other hand....it's less than 100 lines... |
19:14:59 | FromDiscord | <hmmm> how hard can it be..... |
19:15:02 | FromDiscord | <hmmm> ... |
19:24:10 | qwr | https://github.com/ycbilge/Perl2Python and https://github.com/metacraft-labs/py2nim could do it chained, but i'm somewhat doubtful about the results :) |
19:25:15 | qwr | especially as first seems very incomplete |
19:26:42 | qwr | so you'll probably better off doing it by hand |
19:30:41 | * | terminalpusher joined #nim |
19:32:47 | * | pch joined #nim |
19:34:51 | FromDiscord | <hmmm> haha thanks it seems quite the trip, I'll just take my stab at perl |
20:28:54 | FromDiscord | <evoalg> In reply to @hmmm "haha thanks it seems": What does the Perl script actually do? Aslo, did you say there's a bash version? |
20:41:15 | FromDiscord | <retkid> why would anyone ever just write perl |
20:41:32 | FromDiscord | <retkid> perl is one of my least favorite languages. |
20:41:45 | FromDiscord | <retkid> theres nothing it does that TS cant do |
21:05:53 | FromDiscord | <noow> In reply to @retkid "theres nothing it does": typescript? anyways, the script in question was probably not made in the last few years |
21:31:20 | * | fputs quit (Quit: The Lounge - https://thelounge.chat) |
21:32:23 | * | kayabaNerve quit (Ping timeout: 268 seconds) |
21:33:29 | * | fputs joined #nim |
21:40:00 | * | laintree is now known as lain |
22:25:25 | * | advesperacit quit (Quit: advesperacit) |
22:32:52 | NimEventer | New thread by Bonesinger: Macros: why and/or when to use them?, see https://forum.nim-lang.org/t/8658 |
22:46:42 | * | terminalpusher quit (Remote host closed the connection) |
23:22:21 | * | PMunch quit (Quit: leaving) |