00:05:16 | * | stkrdknmibalz joined #nim |
01:05:31 | FromDiscord | <gcao> sent a long message, see http://ix.io/3Esc |
01:09:05 | FromDiscord | <Elegantbeef> You can kinda think of dynamic libraries as self contained applications that you interact with their exposed APIs, so if something is supposed to throw an exception you need to propagate that it errored through the API |
01:09:25 | FromDiscord | <Elegantbeef> So for instance you might use an `Option` or a `bool` to indicate it failed and write an error to a buffer |
01:34:41 | FromDiscord | <IsaacPaul> Hmm Interesting.. |
01:46:45 | FromDiscord | <gcao> Thanks @ElegantBeef↵Another question: if I define a type in the dynamic library, or create a sub-type like (type D = ref object of A), D won't be recognized by the main program, right? |
01:47:08 | FromDiscord | <Yardanico> @gcao the thing with shared libraries is that you're interfacing with them by the C FFI |
01:47:18 | FromDiscord | <Elegantbeef> Of course remember dynamic libraries are basically self contained and dont have to be written in Nim |
01:47:21 | FromDiscord | <Yardanico> which doesn't know anything like that, it only knows how to call functions and stuff |
01:47:34 | FromDiscord | <Elegantbeef> We use C as an FFI bridge, so you can imagine everything as a C bridge |
01:48:15 | FromDiscord | <Elegantbeef> So when you have a dynamic library the way you interact with it is limited to C basically, you can wrap it to be more idiomatic, or use things like Genny to make it easier to use |
01:49:56 | FromDiscord | <Elegantbeef> So if you have an error in a library you need to bubble it up through the C bridge, which means you either need to try except then return a ptr to the error which both code bases have access to, use enums or bools |
01:50:26 | FromDiscord | <Elegantbeef> This is why many C libraries/apis take pointers and return an int on error, it's universal |
01:54:40 | FromDiscord | <gcao> ok. seems what I'm trying to do is not going to be very successful. I'm writing a toy dynamic language in Nim, but don't want to build all functionality in the main interpreter, and want to allow the user to write libraries in Nim, compile to dynamic library. I was hoping smooth transitioning between the main interpreter and the libraries |
01:55:46 | FromDiscord | <Elegantbeef> With something like that i'd reason you'd want to have user definable op codes, which you then call and the .dll handles it |
01:57:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3Esk |
01:57:40 | FromDiscord | <Elegantbeef> Which your interpreter calls and uses `initModule` as the entry |
01:58:31 | FromDiscord | <Elegantbeef> Then you have all your types that the dynamic libraries need in a module so they can do `import languagetypes` and you can write the op code logic |
01:58:54 | FromDiscord | <Elegantbeef> And of course you can use overloading fo `addOpCode` for specific overloads you support |
01:59:32 | FromDiscord | <Elegantbeef> You might have a `proc(a, b: Reg): (State, someVal)` and the like |
02:00:17 | FromDiscord | <Elegantbeef> and i suppose `initModule` also needs to be able to provide the logic for what calls this op code |
02:01:02 | FromDiscord | <gcao> I'm not using op codes. I create AST of Expression nodes, and allow the Expr to be sub-typed. But the sub-type defined in dynlib won't be known to the main interpreter |
02:01:24 | FromDiscord | <Elegantbeef> Ah that subtype is going to be an issue |
02:01:45 | FromDiscord | <Elegantbeef> You need to be able to parse the code and have it know where to call them |
02:03:36 | FromDiscord | <Elegantbeef> Hmm with subtypes you need to use runtime information to figure out if they're the same type so i dont pity you 😀 |
02:06:46 | FromDiscord | <gcao> Thanks a lot for the information. I'll go back to the whiteboard to see what I do next 🙂 |
02:07:32 | FromDiscord | <Elegantbeef> No problem, am interest if you find a soluiton |
02:33:51 | * | krux02 quit (Remote host closed the connection) |
02:49:53 | FromDiscord | <evoalg> I see table.values is an iterator, so can't use math's sum do `sum(table.values)` because math's sum doesn't support iterators it seems, so I have to do `sum(toSeq(table.values))` instead.↵I then started readying https://forum.nim-lang.org/t/7299 and it quickly got way over my head. Should I just use the toSeq way? |
02:51:59 | FromDiscord | <Elegantbeef> If you care about memory/performance make a function called sum that takes an `iterable[int or float]` otherwise just use the toseq sum |
02:52:27 | FromDiscord | <evoalg> ok I will use toSeq - thank you! |
02:56:12 | FromDiscord | <Elegantbeef> Ah right i needs a template so it's less fun https://play.nim-lang.org/#ix=3Esu |
02:59:26 | FromDiscord | <evoalg> Thank you! ... have I told you how Elegant you are? |
02:59:37 | FromDiscord | <Yardanico> [haxscramper](https://matrix.to/#/@haxscramper:matrix.org)\: only heard about this now - have you seen https://www.sourcetrail.com/blog/discontinue_sourcetrail/ ? |
02:59:38 | FromDiscord | <Yardanico> quite sad news |
03:01:23 | FromDiscord | <Elegantbeef> Lies are rude↵(@evoalg) |
03:03:08 | FromDiscord | <evoalg> I guess I look at you though the lens of your elegant code.↵Hey so when you say you had to use a template so it's less fun, what fun thing were you hoping to use instead? |
03:03:25 | FromDiscord | <Elegantbeef> It'd be nice if it could be a proc to hide the details |
03:05:18 | FromDiscord | <evoalg> I don't know what that means, but then again I'm not up to templates yet.↵... and seriously, thank you for your nice examples once again |
03:21:11 | FromDiscord | <evoalg> In reply to @Elegantbeef "Ah right i needs": I see you initialize result and also put result as the last line of the template, I'm guessing that even though proc's don't need that, templates do? |
03:22:53 | FromDiscord | <Elegantbeef> Yea templates dont have results |
03:23:38 | FromDiscord | <Elegantbeef> And cause templates are hygenic there is no issue of `result` being aliased |
03:32:17 | FromDiscord | <evoalg> I tried changing it from template to proc, just to see the error, and it seems that proc's don't accept iterables |
03:32:41 | FromDiscord | <Elegantbeef> Yea tht's my point 😀 |
03:33:26 | FromDiscord | <evoalg> gotcha ok I'm slowly getting there 😉 |
04:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:32 | * | supakeen joined #nim |
04:44:24 | * | kayabaNerve quit (*.net *.split) |
04:44:24 | * | mahlon quit (*.net *.split) |
04:44:24 | * | dv^_^ quit (*.net *.split) |
04:44:25 | * | rb quit (*.net *.split) |
04:45:13 | * | dv^_^ joined #nim |
04:45:13 | * | kayabaNerve joined #nim |
04:45:13 | * | mahlon joined #nim |
04:45:13 | * | rb joined #nim |
04:55:26 | FromDiscord | <Seven> Hi |
05:18:31 | FromDiscord | <IsaacPaul> anyway to skip an argument/parameter in importcc ? |
05:20:17 | FromDiscord | <Elegantbeef> I believe you can usue `#1` and etc |
05:22:45 | FromDiscord | <Seven> Why has this discord the best memes? |
05:23:05 | FromDiscord | <Seven> 'Cause you are the best people |
05:23:17 | FromDiscord | <Seven> <3 |
05:41:21 | FromDiscord | <IsaacPaul> In reply to @Elegantbeef "I believe you can": doesnt work :sad: |
05:44:01 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3Et2 |
05:55:03 | * | arkurious quit (Quit: Leaving) |
05:58:19 | * | Jjp137 quit (Quit: Leaving) |
05:58:27 | * | Jjp137 joined #nim |
06:09:18 | * | Aherin left #nim (The Lounge - https://thelounge.chat) |
08:01:38 | * | tiorock joined #nim |
08:01:38 | * | tiorock quit (Changing host) |
08:01:38 | * | tiorock joined #nim |
08:01:38 | * | rockcavera is now known as Guest4410 |
08:01:38 | * | Guest4410 quit (Killed (cadmium.libera.chat (Nickname regained by services))) |
08:01:38 | * | tiorock is now known as rockcavera |
08:18:49 | * | pro joined #nim |
08:45:51 | FromDiscord | <Zoom> Is there anyone using Geany occasionally? Please, test https://github.com/geany/geany/pull/2988 and comment there to get it merged. Thanks. |
09:09:22 | * | PMunch joined #nim |
09:12:11 | * | pro quit (Quit: WeeChat 3.3) |
10:30:48 | PMunch | Hmm, I have a socket based reader that reads and verifies data (think reading a size field and reading that amount of data, I don't know how much data I need to read until I start reading). I also have an async socket that I read data from. What would be the best way to use this reader proc on the socket? |
10:31:53 | PMunch | Currently I have a try/except thing which tries to read from a string stream, and when that throws an exception it reads 10 bytes into it from the socket. |
10:31:59 | PMunch | But this feels a bit.. dirty |
10:32:16 | NimEventer | New thread by Rforcen: MNIST perceptron, see https://forum.nim-lang.org/t/8606 |
10:35:02 | FromDiscord | <ynfle (ynfle)> @evoalg, you can do `a.values.toSeq` in 1.6.0 |
10:39:07 | * | elph joined #nim |
11:06:27 | * | neurocyte0132889 joined #nim |
11:06:27 | * | neurocyte0132889 quit (Changing host) |
11:06:27 | * | neurocyte0132889 joined #nim |
11:11:37 | * | krux02 joined #nim |
11:43:00 | * | stkrdknmibalz quit (Quit: WeeChat 3.0.1) |
12:06:02 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:31 | * | supakeen joined #nim |
12:32:30 | * | xet7 quit (Remote host closed the connection) |
12:39:20 | FromDiscord | <MrOkram> sent a long message, see http://ix.io/3Euh |
12:39:56 | FromDiscord | <MrOkram> My guess is that i'm somehow not utilizing this for loop correctly, if so, please correct me |
12:40:20 | FromDiscord | <geekrelief> `..` is inclusive. You want to use `..<` |
12:40:22 | FromDiscord | <Rika> 0..1 -> 0, 1 |
12:40:23 | FromDiscord | <Rika> yes |
12:40:34 | FromDiscord | <Rika> (edit) "->" => "gives" |
12:44:53 | FromDiscord | <MrOkram> Ohh, thanks, completely missed that... |
13:17:50 | FromDiscord | <Tom> Hi, y'all. What's the best source these days for compiling to wasm with Nim? And what's the smallest size people can usually pull off with it? |
13:23:56 | FromDiscord | <geekrelief> In reply to @Tom "Hi, y'all. What's the": I haven't looked at this closely, but maybe try? https://github.com/treeform/nim_emscripten_tutorial |
13:24:42 | FromDiscord | <geekrelief> You might have better luck asking in #gamedev |
13:31:36 | FromDiscord | <IsaacPaul> Using llvm you can target the generated code to wasm |
13:32:06 | FromDiscord | <IsaacPaul> compile the generated code to the Wasm target |
13:33:35 | FromDiscord | <IsaacPaul> No idea if it will work though without some elbow grease 😜 |
13:34:15 | * | rockcavera quit (Remote host closed the connection) |
13:39:00 | FromDiscord | <Tom> Thanks much for the tips, y'all. |
13:44:10 | * | nixfreak_nim[m] is now known as nixfreaknim[m] |
13:50:41 | NimEventer | New thread by Plgupa: Getting error installing Nimble on Windows 10, see https://forum.nim-lang.org/t/8607 |
14:16:47 | * | ox is now known as oz |
14:30:27 | * | arkurious joined #nim |
15:00:51 | FromDiscord | <IsaacPaul> sent a code paste, see https://paste.rs/b8V |
15:05:54 | FromDiscord | <IsaacPaul> meh it all seems a bit annoying.. I'll just prefix the procs with `ICameraController_` . Problem solved. No trickery. |
15:06:35 | FromDiscord | <Rika> i mean you can automate it with a macro |
15:12:14 | FromDiscord | <IsaacPaul> I think if nim wanted me to have this syntax `Type.staticMethod()` it would have first class support. The more I think about it. It's literally a 1 character difference. `Type_staticMethod()` And the former method could be deceitful to other nim developers as they may assume the typedesc is needed. |
15:12:43 | FromDiscord | <Rika> the point of nim is that as little as possible is first class afaik? |
15:13:06 | FromDiscord | <Rika> and what is a static method in nim anyway, we dont have classes, theyre all simple types |
15:13:22 | FromDiscord | <IsaacPaul> Yea, the goal is just to organize them |
15:13:35 | FromDiscord | <Rika> use the typedesc or generics i guess |
15:13:43 | * | PMunch quit (Quit: Leaving) |
15:13:47 | FromDiscord | <Rika> `init[T: ICa...](...)` |
15:14:45 | FromDiscord | <IsaacPaul> The prefix works too and is simpler 🙂 |
15:15:06 | FromDiscord | <IsaacPaul> I'm just too used to other syntaxes lol |
15:15:07 | FromDiscord | <Rika> your choice |
15:23:08 | NimEventer | New Nimble package! pls - A simple but powerful task runner that lets you define your own commands by editing a YAML configuration file., see https://h3rald.com/pls |
15:24:42 | FromDiscord | <Rika> pls |
15:32:55 | FromDiscord | <dom96> https://h3rald.com/nifty/ |
15:32:59 | FromDiscord | <dom96> how many PMs does Nim have now lol |
15:33:32 | FromDiscord | <Rika> prolly 4? |
15:35:57 | * | xet7 joined #nim |
15:36:46 | FromDiscord | <xflywind> nimble, nifty, nimph, slim, atlas, nimby, Nawabs afaik |
15:50:32 | FromDiscord | <Rika> ah i havent heard of slim and nimby |
15:50:41 | FromDiscord | <Rika> forgot atlas existed, but that isnt for normal use isnt it |
15:51:57 | FromDiscord | <dom96> 7, nice |
16:00:48 | FromDiscord | <hmmm> hayoo nimlies |
16:02:15 | FromDiscord | <hmmm> wtf is wrong with my excel nimlies? if I save this number: 3.4284602583 as csv excel ignores the dot an showes is as 34 billions and counting |
16:02:35 | FromDiscord | <hmmm> get bill gates on the line we going to get the truth about this |
16:06:41 | FromDiscord | <hmmm> jesus apparently the solution is a multi step process involving a legacy wizard and switching decimal and thousands separator |
16:07:02 | FromDiscord | <hmmm> multi billion software development for the win |
16:08:27 | FromDiscord | <hmmm> apparently the lesson here is to use strformat 👀 |
16:10:44 | FromDiscord | <hips> In reply to @hmmm "wtf is wrong with": excel has notation settings |
16:11:26 | FromDiscord | <hips> might be set to use `,` |
16:12:37 | FromDiscord | <hmmm> those are tied to os wide regional settings iirc |
16:13:10 | FromDiscord | <hips> nope |
16:13:25 | FromDiscord | <hmmm> hmm |
16:45:25 | * | Vladar joined #nim |
16:45:29 | FromDiscord | <hmmm> oh shi |
16:45:42 | FromDiscord | <hmmm> I forgot if the replace I use usually is from re or strutils |
16:46:11 | FromDiscord | <hmmm> why do we have two in the first place |
16:46:25 | FromDiscord | <Rika> re is regex strutils is naiive |
16:46:35 | FromDiscord | <hmmm> it was strutils |
17:03:41 | * | stkrdknmibalz joined #nim |
17:04:33 | * | rockcavera joined #nim |
17:04:33 | * | rockcavera quit (Changing host) |
17:04:33 | * | rockcavera joined #nim |
17:16:25 | FromDiscord | <hmmm> the ^1 thingy for the last element of stuff is genius |
17:26:29 | * | xet7 quit (Ping timeout: 264 seconds) |
17:39:11 | * | xet7 joined #nim |
17:41:23 | * | xet7 quit (Client Quit) |
17:50:10 | * | vicecea quit (Remote host closed the connection) |
17:50:40 | * | vicecea joined #nim |
18:28:04 | * | xet7 joined #nim |
18:28:33 | * | xet7 quit (Remote host closed the connection) |
18:31:34 | * | xet7 joined #nim |
18:32:02 | * | xet7 quit (Remote host closed the connection) |
18:53:50 | FromDiscord | <!Drake> Can you turn off the GC in Nim? |
18:56:11 | FromDiscord | <Recruit_main707> compile with `--gc:none`, but 90% of the stdlib needs the gc, `--gc:regions` allows allocating and deallocating objects that would normally be garbage collected, but out of the very few people that dont use the gc, even less use or even know about regions |
18:56:31 | * | asd joined #nim |
18:57:45 | asd | line = "123"; if line[0].isDigit() # is failing for me. seems like line[0] is not longer returning a char. how do i fix this? |
19:00:24 | asd | weird nim playground says otherwise |
19:07:22 | * | xet7 joined #nim |
19:13:46 | * | rockcavera quit (Remote host closed the connection) |
19:14:48 | FromDiscord | <exelotl> In reply to @!Drake "Can you turn off": what is it about the GC that you want to avoid? |
19:17:11 | asd | fixed it nvm |
19:17:15 | * | asd left #nim (#nim) |
19:18:42 | FromDiscord | <exelotl> if you still want to have dynamically allocated objects that get free'd when there are no more references to them, but you want it to be deterministic and apply as soon as the last reference is broken, then you should look at `--gc:arc` |
19:23:41 | FromDiscord | <konsumlamm> (note that `arc` doesn't collect cycles) |
19:24:21 | FromDiscord | <konsumlamm> there's also `--gc:orc` which is based on `arc`, but also collects cycles |
19:24:35 | FromDiscord | <konsumlamm> so it's essentially a full gc |
19:53:13 | * | flynn4 joined #nim |
20:00:45 | * | stkrdknmibalz quit (*.net *.split) |
20:00:47 | * | flynn quit (*.net *.split) |
20:00:47 | * | flynn4 is now known as flynn |
20:01:24 | FromDiscord | <hmmm> boys how do echo only the first n columns of a dataframe in datamancer, I'm getting swarmed |
20:01:39 | FromDiscord | <hmmm> hmm I think I missed an I somewhere |
20:10:33 | FromDiscord | <RattleyCooper> Was looking at the blog post for VSCode's new Notebook API and they mention an extension called "Rainbow Indent". Noticed that Rainbow Indent's extension page on the marketplace has a snippet of Nim code to show as an example 😄 |
20:10:34 | FromDiscord | <RattleyCooper> https://marketplace.visualstudio.com/items?itemName=oderwat.indent-rainbow |
20:19:06 | FromDiscord | <razzlom> For 1 second i think it writed in nim, but it javascript. 🙁 |
20:28:43 | FromDiscord | <IsaacPaul> I'm getting that.. |
20:30:57 | FromDiscord | <IsaacPaul> The notebook api is pretty cool.. it may replace joplin for me.. though much I'd prefer a non-electron notebook app :S aw well |
20:34:14 | * | neurocyte0132889 quit (Quit: The Lounge - https://thelounge.chat) |
20:39:51 | * | neurocyte0132889 joined #nim |
20:39:51 | * | neurocyte0132889 quit (Changing host) |
20:39:51 | * | neurocyte0132889 joined #nim |
20:44:10 | FromDiscord | <tandy> anyone have a good name idea for my nimble package ? |
20:44:13 | FromDiscord | <tandy> its a `jsony` plugin for `union` support |
20:44:56 | FromDiscord | <tandy> i was gna do jsony-union but i rememberd names cant have `-` |
20:46:50 | FromDiscord | <hmmm> jsuniony of course 😆 |
20:47:19 | FromDiscord | <IsaacPaul> Let github generate one for you. Last one I got was 'laughing-archer' lol |
20:47:47 | FromDiscord | <tandy> lol↵(@hmmm) |
20:48:02 | FromDiscord | <tandy> i want it to be at least a bit self descriptive tho↵(@IsaacPaul) |
20:48:21 | FromDiscord | <hmmm> the rebellious jsonyDASHunion will shouw the world people cannot fk with you |
20:48:35 | FromDiscord | <tandy> maybe just uniony |
20:48:46 | FromDiscord | <hmmm> ye uniony it's ok |
20:48:50 | FromDiscord | <hmmm> feels friendly |
20:49:43 | FromDiscord | <IsaacPaul> yea that or union4jsony |
20:50:01 | FromDiscord | <IsaacPaul> honestly not having -'s or some sort of visual break sucks |
20:50:02 | FromDiscord | <hmmm> better yet uniony4jsony |
20:50:13 | FromDiscord | <hmmm> with a pink unicorn icon |
20:51:03 | FromDiscord | <IsaacPaul> In reply to @hmmm "the rebellious jsonyDASHunion will": lmbo |
21:53:54 | FromDiscord | <RattleyCooper> In reply to @razzlom "For 1 second i": Well they have an image with an example in nim 😛 |
21:54:09 | FromDiscord | <RattleyCooper> (edit) "In reply to @razzlom "For 1 second i": Well they have an image with an example ... in" added "of the indent colors" |
22:02:48 | * | rockcavera joined #nim |
22:02:48 | * | rockcavera quit (Changing host) |
22:02:48 | * | rockcavera joined #nim |
22:12:27 | FromDiscord | <evoalg> and it's called nimbench_ex2.nim |
22:34:38 | * | supBros joined #nim |
22:35:16 | * | supBros quit (Client Quit) |
22:52:09 | * | Vladar quit (Quit: Leaving) |
23:41:29 | * | dv^_^ quit (Ping timeout: 244 seconds) |
23:46:13 | * | dv^_^ joined #nim |