00:02:41 | FromDiscord | <JSONBash> I am trying to get an arm64 linked dynmaic library, and i can only get an x86_64, i am using `--cpu:arm64` and result is `Mach-O 64-bit dynamically linked shared library x86_64` |
00:03:21 | FromDiscord | <JSONBash> sent a code paste, see https://play.nim-lang.org/#ix=3PIP |
00:03:22 | FromDiscord | <JSONBash> is my nim.cfg file |
00:39:13 | arkanoid | here it says to initialize FutureVar[string] to 46. How can I pre-allocate a value in a FutureVar[T]? https://nim-lang.org/docs/asyncnet.html#recvFrom%2CAsyncSocket%2CFutureVar%5Bstring%5D%2Cint%2CFutureVar%5Bstring%5D%2CFutureVar%5BPort%5D |
00:40:28 | arkanoid | `value` of Future[T] is not exported either |
01:19:46 | arkanoid | solved with some convoluted code |
01:29:47 | FromDiscord | <treeform> In reply to @JSONBash "I am trying to": we are able to do this with this commands: https://github.com/treeform/pixie/blob/master/pixie.nimble#L25-L27 |
01:30:55 | FromDiscord | <treeform> then we use lipo to glue them together to form a super dylib that works everywhere |
01:40:08 | arkanoid | how to stop/conclude nimble develop? |
01:44:42 | NimEventer | New post on r/nim by Ether-naut: Processing a sequence on multiple threads, see https://reddit.com/r/nim/comments/stjljr/processing_a_sequence_on_multiple_threads/ |
01:46:59 | FromDiscord | <JSONBash> In reply to @treeform "we are able to": That worked like a charm! thanks so much! |
01:47:08 | FromDiscord | <JSONBash> I can finally sleep lol |
01:50:07 | FromDiscord | <auxym> In reply to @arkanoid "how to stop/conclude nimble": My undersanding is `nimble uninstall` |
01:50:33 | arkanoid | auxym, it deletes the one in .nimble folder, not the local one |
01:51:41 | FromDiscord | <auxym> not sure I follow, nimble develop creates a symlink in .nimble that points to some local copy of a library, no? So nimble uninstall deletes the symlink |
01:54:47 | * | arkurious quit (Quit: Leaving) |
02:08:43 | * | krux02 quit (Quit: Leaving) |
02:12:02 | * | keyehzh_ joined #nim |
02:18:52 | * | xet7 quit (Remote host closed the connection) |
02:22:45 | * | xet7 joined #nim |
02:47:34 | * | Gustavo6046 quit (Quit: Leaving) |
02:57:22 | FromDiscord | <Rika> nimble uninstall package@#head |
03:04:55 | * | ox is now known as oz |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
04:06:31 | * | supakeen joined #nim |
04:15:09 | * | slowButPresent joined #nim |
04:56:23 | FromDiscord | <ajusa> Anyone know a good package to implement reading and writing binary data structures? I know of binary lang, curious if there are others |
05:00:31 | rockcavera | ajusa https://github.com/treeform/flatty |
05:01:35 | FromDiscord | <ajusa> Hm, not sure how good it is for certain schemas, but I'll check it out, thanks! |
05:16:47 | * | keyehzh_ quit (Remote host closed the connection) |
05:24:16 | FromDiscord | <Elegantbeef> It's only really good for Nim serialization of objects |
05:41:25 | FromDiscord | <ajusa> yeah, I'm trying to use varints (want to do some minecraft protocol stuff) |
05:41:53 | FromDiscord | <ajusa> it looks like flatty and frosty are good, but they both store length prefixes as normal ints, so I'd probably need to fork or modify the libraries in some way |
05:46:25 | FromDiscord | <ajusa> any other ideas or libraries I could consider? |
05:46:45 | FromDiscord | <Rika> What’s wrong with what you just said |
05:48:55 | FromDiscord | <ajusa> absolutely nothing, just wondering if there are better options lol. flatty has a really solid API I could extend for the Minecraft data types |
05:49:25 | FromDiscord | <Rika> If there was no issue then what would constitute as “better”? |
05:51:01 | FromDiscord | <ajusa> hm, I guess an existing library that supports the varint format? or some sort of macro magic I'm unaware of? |
05:55:20 | FromDiscord | <Elegantbeef> Making your own is another alternative 😜 |
05:56:02 | FromDiscord | <haolian9 (高浩亮)> @leorize\:envs.net thanks, i thought so; as i did not see any doc on TArg, i can not be sure when i ask. |
05:56:07 | FromDiscord | <Rika> Making beef make one for you is another |
05:56:13 | FromDiscord | <ajusa> I like that idea |
05:56:15 | FromDiscord | <Elegantbeef> Lol |
05:56:50 | FromDiscord | <ajusa> "if you complain enough, Elegantbeef or PMunch will create a library for you" - Sun Tzu |
05:57:50 | FromDiscord | <Elegantbeef> Also the hell are you talking about with frosty? |
05:57:51 | FromDiscord | <Elegantbeef> It allows you serialize however you want |
05:58:29 | FromDiscord | <ajusa> it defaults to using ints for strings and objects rather than varints I think? |
05:58:30 | FromDiscord | <Elegantbeef> In my case it's more "will answer a question and get enthused by an idea and implement it" |
05:58:43 | FromDiscord | <Elegantbeef> Cool, but you know you can do it yourself right? |
05:59:15 | FromDiscord | <Rika> Why do it yourself if you can get someone else to do it for you |
05:59:26 | FromDiscord | <Elegantbeef> No i more mean that you can serialize it however you want |
05:59:30 | FromDiscord | <ajusa> don't think you can do it without modifying the library? |
05:59:49 | FromDiscord | <ajusa> (I might be completely wrong about that) |
05:59:50 | FromDiscord | <Elegantbeef> You can write your own hooks |
06:00:07 | FromDiscord | <Elegantbeef> https://github.com/disruptek/frosty#easily-customize-serialization-for-types |
06:00:36 | FromDiscord | <ajusa> oh |
06:01:01 | FromDiscord | <Elegantbeef> It does support all primitives out of the box but you can always make your own serialization |
06:01:34 | FromDiscord | <ajusa> see this is the kind of response I was looking for @Rika, me not reading docs properly and beef kindly explaining how I can solve my problem. thanks! |
06:01:50 | FromDiscord | <Elegantbeef> I think you can technically do the same with flatty |
06:03:18 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PJH |
06:03:37 | FromDiscord | <Elegantbeef> then use `MyString` in place of `string` in your object so you can override the serialize just for these specific cases |
06:03:48 | FromDiscord | <Elegantbeef> Dont know if frosty supports overriding primitives, it might |
06:04:26 | FromDiscord | <ajusa> so that way I retain string operations (like strutils) while being able to do custom serialization. sounds pretty good |
06:04:43 | FromDiscord | <Elegantbeef> Yep |
06:17:34 | FromDiscord | <Rika> Well I have no idea what you were even talking about until you explained it which by then I was busy |
06:17:57 | FromDiscord | <Elegantbeef> In other words, rika dont give no fucks |
06:19:36 | FromDiscord | <Rika> In reply to @ajusa "it defaults to using": I missed seeing this message xd |
06:19:46 | * | rockcavera quit (Remote host closed the connection) |
06:28:30 | * | slowButPresent quit (Quit: leaving) |
06:36:38 | FromDiscord | <ITR> Are there any alternatives to synthesis for statemachines yet? |
06:37:02 | FromDiscord | <ITR> (edit) "statemachines yet?" => "statemachines?" |
06:39:31 | FromDiscord | <Rika> Any issues with synthesis? |
06:47:52 | FromDiscord | <Bloss> has anyone else tried adding GC hooks to fixed-size array types with `ptr UncheckedArray[T]`? for me some memory corruption happens if `T` is a ref type |
06:55:40 | FromDiscord | <Elegantbeef> You will probably need to use the `trace` and `GcRef` |
07:00:30 | FromDiscord | <Bloss> yeah it is probably related to ref counting at some point the value of my pointer was 1 |
07:03:37 | FromDiscord | <ITR> In reply to @Rika "Any issues with synthesis?": it'd be interesting to see different takes on it. IIRC synthesis doesn't support statecharts and has limited async support |
07:04:27 | FromDiscord | <Bloss> found this <https://github.com/nim-lang/Nim/issues/16274> |
07:04:57 | FromDiscord | <Rika> State charts? You mean visualisation? |
07:09:33 | FromDiscord | <ITR> In reply to @Rika "State charts? You mean": Simply explained, statecharts are statemachines with support for subcharts and parallel statemachines |
07:09:50 | FromDiscord | <ITR> I'd recommend looking into talks about xstate, which goes a bit more into it |
07:11:06 | FromDiscord | <Rika> That’s much deeper than a regular FSM would be wow |
07:11:22 | FromDiscord | <ITR> it's pretty interesting, and I think it might have a positive effect on programming going forward |
07:12:47 | FromDiscord | <Rika> It’s more complex though |
07:16:47 | FromDiscord | <ITR> yeah, and pretty foreign given that most people don't even use regular FSMs, so it's not very widespread yet |
07:17:02 | FromDiscord | <ITR> (edit) "so" => "two reasons for why" |
07:19:44 | FromDiscord | <ITR> One thing that's interesting is that statecharts themselves are fairly old |
07:41:31 | * | jjido joined #nim |
08:18:08 | * | rwb joined #nim |
08:19:43 | * | rb quit (Read error: Connection reset by peer) |
08:25:02 | * | PMunch joined #nim |
08:31:39 | FromDiscord | <Rika> I suppose it wouldn’t be too hard to make this GIVEN that the restrictions are loosened from synthesis, since synthesis was aimed for embedded and restrained resource environments |
08:32:10 | FromDiscord | <Rika> Actually this might not need the loosening |
08:32:51 | FromDiscord | <Rika> Yeah okay maybe I’ll look into it |
09:06:17 | FromDiscord | <Valdar> is there some rule that a ref object has to have its type defined in the same module as the variable? |
09:06:31 | FromDiscord | <Elegantbeef> No |
09:06:45 | PMunch | What variable? |
09:06:52 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PKa |
09:07:02 | FromDiscord | <Elegantbeef> export even |
09:07:31 | PMunch | I always exprort my variables |
09:07:47 | FromDiscord | <Valdar> I'm just doing import. Do I have to export too? |
09:08:00 | FromDiscord | <Elegantbeef> Yes |
09:08:08 | FromDiscord | <Elegantbeef> Nim defaults to unexported |
09:08:15 | PMunch | If you want to use a type definition defined in one module from another module which imports it you need to export that definition |
09:08:19 | FromDiscord | <Elegantbeef> Which means that any top level symbol is not accessible from an `import` |
09:08:38 | FromDiscord | <Valdar> I never do with anything else. just when i changed it to ref |
09:09:00 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
09:09:11 | FromDiscord | <Valdar> k, thx. I'll try that |
09:09:21 | FromDiscord | <Elegantbeef> ref doesnt change anything |
09:09:28 | FromDiscord | <Elegantbeef> So are you talking about a different issue? |
09:09:55 | FromDiscord | <Elegantbeef> `let` is immutable |
09:09:57 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PKb |
09:12:13 | FromDiscord | <Valdar> I'm using var |
09:12:28 | FromDiscord | <Elegantbeef> Showing the code will give a more concise answer to the issue 😀 |
09:16:40 | FromDiscord | <Valdar> yeah, I'll have another look. maybe I'm missing something. I'll post it if I don't find the issue. I gotta run out for a bit anyways. I'll go at it again when i get back |
09:19:21 | FromDiscord | <Valdar> by export, you mean "export", right. I'm just using SomeOject = object |
09:19:32 | FromDiscord | <Elegantbeef> `` is the export marker |
09:19:49 | FromDiscord | <Valdar> yeah, i'm doing that |
09:19:51 | FromDiscord | <Elegantbeef> It exports the top level statements or fields |
09:20:01 | FromDiscord | <Elegantbeef> Then there is another issue |
09:21:01 | FromDiscord | <Valdar> and it has always worked fine, but when i changed to SomeOject = ref object, it was no longer accessible |
09:21:35 | FromDiscord | <Elegantbeef> well `ref object` doesnt change anything so either you found a bug or are doing something wrong |
09:22:31 | FromDiscord | <Valdar> Maybe I did something else to bugger it up, but I don't think so. |
09:24:35 | FromDiscord | <Elegantbeef> Not using any macros are you? |
09:26:07 | PMunch | What is the actual error you're getting @Valdar? |
09:27:09 | PMunch | Hmm, is there a way to echo out a compile-time stack trace? I'm debugging where in my code the `os` module is imported (it just errors out the program when not run on a supported OS (even if you only use it for macros (yay...))) |
09:32:55 | FromDiscord | <Valdar> Neer mind. I'm an idiot. I was using tuples before, so now I have to export each field since changing it to ref object Thx to you both for the help |
09:34:42 | FromDiscord | <Elegantbeef> Yep tuples suck |
09:34:54 | FromDiscord | <Elegantbeef> Dont use them like types, only as return values or for unpacking! |
09:35:00 | FromDiscord | <Elegantbeef> like objects\ |
09:35:44 | FromDiscord | <Valdar> Oh, Beef. i meant to ask you yesterday.... you said linked lists sucked. did you mean in general, or Nim's implementation? |
09:35:51 | FromDiscord | <Rika> In general |
09:35:53 | FromDiscord | <Elegantbeef> General |
09:36:01 | FromDiscord | <Valdar> yep, k |
09:36:21 | FromDiscord | <Rika> Their use is essentially limited to “learning “ |
09:36:52 | FromDiscord | <Elegantbeef> They have their applications |
09:37:17 | FromDiscord | <Elegantbeef> Any situation you need a cheap remove/add it's golde |
09:37:38 | FromDiscord | <Elegantbeef> I do speak in hyperbole a lot, but most of the time there is some basis of truth there 😀 |
09:38:06 | FromDiscord | <Valdar> Just because the data gets scattered all over? or is there another reason |
09:38:42 | FromDiscord | <Elegantbeef> length is `O(n)`, not good for the cache |
09:39:02 | FromDiscord | <Rika> I’d say that it’s rare to need a constant time remove and insert while having random access unimportant |
09:39:25 | FromDiscord | <Elegantbeef> But when you do need it you'll be happy to know it's there 😛 |
09:39:34 | FromDiscord | <Elegantbeef> Like most data types they exist for a reason |
09:41:52 | FromDiscord | <Valdar> true. I'll be back in a bit. I think my problem is solved though. Stupid VS Code didn't give me the red squiggles right away, only after if changed it to ref, but the issue was actually not exporting the fields after changing from tuples |
09:42:17 | FromDiscord | <Valdar> thx again |
09:47:18 | FromDiscord | <Rika> In reply to @Rika "Yeah okay maybe I’ll": I thought about it for a moment and it’s gonna be messy as hell |
09:47:22 | FromDiscord | <Rika> Needs more thought |
09:53:29 | PMunch | Of course you could implement a mixed implementation that would alleviate some of the issues with linked lists |
09:53:58 | PMunch | E.g chunked pieces of memory strung together in a linked list |
09:55:02 | PMunch | With some clever logic you could also keep an updated length field somewhere and avoid the O(N) length issue |
09:55:46 | PMunch | For random access you could store a pointer to each chunk in a sequence, bit more overhead, but essentially works as a finger table |
09:56:13 | PMunch | Now of course you might have to implement some chunk rebalancing if you do a lot of inserts and deletes in specific patterns |
09:56:27 | FromDiscord | <Rika> Then it’s not a linked list anymore. |
09:56:32 | FromDiscord | <Rika> It’s a different data type |
09:56:36 | PMunch | Sure |
09:56:47 | PMunch | That's why I called it a mixed implementation |
10:17:29 | * | vicecea quit (Remote host closed the connection) |
10:18:23 | * | vicecea joined #nim |
10:19:31 | PMunch | The way the OS module prevents its own import is really annoying and dumb.. https://github.com/PMunch/ratel/issues/4 |
10:32:39 | FromDiscord | <abdu> what's difference `assert` and `doassert` ? |
10:32:57 | FromDiscord | <haxscramper> `assert` does not run with `-d:release` or `-d:danger` |
10:33:09 | FromDiscord | <Rika> It does in release though? |
10:46:42 | NimEventer | New question by congusbongus: Pop first element of OrderedSet, see https://stackoverflow.com/questions/71140344/pop-first-element-of-orderedset |
11:13:38 | FromDiscord | <mratsim> In reply to @ITR "it'd be interesting to": you can compose statemachines in Synthesis, just call your inner state machines from the hig-level state machine |
11:14:28 | FromDiscord | <mratsim> In reply to @ITR "it'd be interesting to": async/await is just implemented using state machines inside. |
11:14:41 | FromDiscord | <mratsim> what kind of support do you need? |
11:18:20 | * | advesperacit joined #nim |
11:18:38 | PMunch | @Rika, it does now, but it didn't before `release` and `danger` got split into two flags |
11:19:34 | FromDiscord | <Rika> In reply to @mratsim "you can compose statemachines": Well yeah but I assumed he wanted more consistent support since from what I’m reading state charts have more than just composition |
11:19:55 | FromDiscord | <Rika> In reply to @PMunch "<@259277943275126785>, it does now,": Well that doesn’t matter nowadays does it lol |
11:23:05 | PMunch | Haha, not really |
11:23:18 | PMunch | Unless you for some reason are targeting really old versions :P |
11:28:51 | NimEventer | New question by itil memek cantik: Nim cannot do check regex object with captured group, see https://stackoverflow.com/questions/71140968/nim-cannot-do-check-regex-object-with-captured-group |
11:29:36 | FromDiscord | <mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3PKw |
11:30:07 | FromDiscord | <mratsim> That's what substates boil down to if I understood correctly. |
11:30:20 | FromDiscord | <Rika> Let me think, it seems perfect yes |
11:31:22 | FromDiscord | <Rika> Yeah I don’t know it seems good |
11:34:27 | FromDiscord | <Rika> You can have machines in machines for synthesis right? |
11:34:32 | FromDiscord | <mratsim> I think you can use synthesis as a backend for a statechart lib, there shouldn't be anythng missing |
11:34:43 | FromDiscord | <mratsim> state machines are just proc in synthesis |
11:34:52 | FromDiscord | <mratsim> as long as you can have procs in procs yes |
11:34:53 | FromDiscord | <Rika> Okay |
11:35:14 | FromDiscord | <Rika> Why proc? Traditionally (and personally) it would be a type right? |
11:35:32 | FromDiscord | <BhamidipatiNikhil> sent a code paste, see https://paste.rs/Zoe |
11:35:33 | FromDiscord | <BhamidipatiNikhil> https://media.discordapp.net/attachments/371759389889003532/943470654416642138/unknown.png |
11:35:35 | arkanoid | just heard araq fosdem presentation on parallel programming, and now I'm more unsure if I should async or thread channels |
11:35:45 | FromDiscord | <mratsim> you can't execute proc on a CPU |
11:36:00 | FromDiscord | <Rika> In reply to @mratsim "you can't execute proc": You mean type on CPU? |
11:36:28 | FromDiscord | <Rika> Well I was just thinking because traditionally you’d be pushing transitions to the machine instead of the machine doing transitions itself, dunno. Just what I usually know |
11:36:38 | FromDiscord | <Rika> In reply to @arkanoid "just heard araq fosdem": What’s your bound |
11:36:44 | FromDiscord | <Rika> Determine what you are bound by first |
11:36:47 | * | krux02 joined #nim |
11:37:47 | arkanoid | I/O bound, but async is weird when trying to don't abuse your ram |
11:38:03 | FromDiscord | <Rika> What are you programming for? |
11:38:07 | FromDiscord | <Rika> Embedded? Or what |
11:38:28 | FromDiscord | <Rika> What leads to RAM abuse? |
11:39:13 | arkanoid | It is difficult to control allocations when passing around Future[T]|FutureVal[T] |
11:39:35 | FromDiscord | <Rika> Fair I guess |
11:42:14 | FromDiscord | <BhamidipatiNikhil> In reply to @BhamidipatiNikhil "I want to create": I don't know where to begin working on this... I know i have to learn some regex and some image creating library.... I need some guidance if possible.... |
11:42:33 | FromDiscord | <BhamidipatiNikhil> What should i start learning from? |
11:42:38 | arkanoid | Rika, just look how weird it gets to receive UDP data with recvFrom {.async.} when trying to don't allocate a buffer for each returned packet: https://play.nim-lang.org/#ix=3PKy |
11:42:52 | FromDiscord | <enthus1ast> @BhamidipatiNikhil\: regex is not needed imho |
11:43:57 | FromDiscord | <enthus1ast> think about your data types↵build a text parser/lexer↵render your data |
11:44:58 | FromDiscord | <BhamidipatiNikhil> so which libraries should i learn....? |
11:45:31 | FromDiscord | <enthus1ast> for lexing none (maybe strutils, parseutils, strscans) |
11:45:48 | FromDiscord | <enthus1ast> for rendering i would give pixie a try |
11:47:07 | FromDiscord | <Rika> In reply to @arkanoid "<@259277943275126785>, just look how": I’m not sure what’s weird or how it would look less weird if it were sync |
11:47:29 | FromDiscord | <BhamidipatiNikhil> Thx enthus1ast..... I am on it.....! I will start learning those libraries!! |
11:47:54 | FromDiscord | <Rika> In reply to @enthus1ast "for lexing none (maybe": I really like parseutils lol |
11:48:06 | arkanoid | Rika: data.mget() = newString(bufferLen) is just horrible |
11:48:42 | FromDiscord | <enthus1ast> @Rika\: i mean it gets the job done and is fast |
11:49:06 | FromDiscord | <Rika> In reply to @arkanoid "<@259277943275126785>: data.mget() = newString(buff": How so? You could just replace that part by another call to reset futures too no? |
11:49:32 | FromDiscord | <gerwy> just some quick and dumb question↵would it be possible to make nim's arc usable in C?↵like just lets say arc.h and i could use all of the malloc's and stuff there? |
11:50:00 | FromDiscord | <Rika> Probably? |
11:50:11 | FromDiscord | <Rika> But why? |
11:50:43 | FromDiscord | <Rika> The point of ARC is that the compiler does that for you, otherwise you’re just better off doing the malloc free calls yourself like usual |
11:51:57 | FromDiscord | <gerwy> well im writting like a toy language that also emits code and it needs some GC↵i have one mark and sweep example but if it ironically looks like nim a lot i might even just use arc for it |
11:52:08 | FromDiscord | <gerwy> buut maybe its not the best idea, right... |
11:52:50 | FromDiscord | <Rika> Well yeah ARC isn’t a “GC” it’s analysis + reference counting from what I know |
11:53:02 | PMunch | Yeah, it won't be possible to have arc.h |
11:53:11 | FromDiscord | <gerwy> what about orc/ |
11:53:13 | FromDiscord | <gerwy> (edit) "orc/" => "orc?" |
11:53:15 | FromDiscord | <Rika> Same thing |
11:53:19 | FromDiscord | <Rika> But with a cycle collector |
11:53:22 | PMunch | It is built into the Nim compiler and essentially outputs free statements whenever things go out of scope |
11:53:23 | FromDiscord | <BhamidipatiNikhil> Wait, but i don't know which functions i will find useful.... Should i start learning the whole library? https://media.discordapp.net/attachments/371759389889003532/943475140887478302/unknown.png |
11:53:34 | arkanoid | adding wings to a car doesn't make it a plane |
11:53:36 | PMunch | So it is basically doing manual memory management, just automatically :P |
11:53:49 | FromDiscord | <Rika> That’s what I said yes haha |
11:54:07 | FromDiscord | <gerwy> hmmmm↵if well if i were emitting c++ code i would just use smart pointers that would be super easy solution↵but now, i guess i will use the mark and sweep one because i don't care about stop the world thingy that much\ |
11:54:08 | FromDiscord | <gerwy> (edit) "much\" => "much" |
11:54:09 | PMunch | If you need a GC for C code though you can have a look at Boehm |
11:54:10 | FromDiscord | <Rika> In reply to @BhamidipatiNikhil "Wait, but i don't": There are examples in the repository from what I recall |
11:54:51 | FromDiscord | <gerwy> 👀 i will↵i saw it in the recommended articles when reading about Mark and Sweep |
11:54:59 | FromDiscord | <gerwy> thanks! |
11:57:47 | PMunch | @BhamidipatiNikhil, you could use npeg for parsing those sentences, then Pixie for drawing stuff. Try to first draw something like that manually with Pixie, reading the examples and such, then try to parse your grammar with npeg into some kind of logical representation, then glue those two halves together. |
11:59:01 | FromDiscord | <BhamidipatiNikhil> In reply to @PMunch "<@764483963422375946>, you could use": Got it! I will surely practice Pixie first~! |
11:59:14 | FromDiscord | <haxscramper> In reply to @BhamidipatiNikhil "I want to create": https://forum.nim-lang.org/t/8499 |
11:59:53 | FromDiscord | <haxscramper> I think that is exactly what you need |
12:00:06 | FromDiscord | <haxscramper> animation, text etc. |
12:00:07 | FromDiscord | <BhamidipatiNikhil> In reply to @haxscramper "https://forum.nim-lang.org/t/8499": Wait, i know manim.... it converts code to animation.... i want to convert text to animation! |
12:00:26 | FromDiscord | <haxscramper> text is just a code in some language |
12:00:55 | FromDiscord | <haxscramper> do you have a grammar for your sentences? |
12:01:03 | FromDiscord | <haxscramper> otherwise this is a NLP territory |
12:01:24 | FromDiscord | <BhamidipatiNikhil> In reply to @haxscramper "otherwise this is a": Yes, you are right! |
12:01:50 | FromDiscord | <BhamidipatiNikhil> Its a bit NLP territory, but not completely! |
12:02:34 | FromDiscord | <haxscramper> are sentences freeform of you have some fixed set of supported inputs? |
12:03:19 | FromDiscord | <haxscramper> AS in `<sent> ::= <name> ("is" | "is a") <name>`, `<name> ::= \w+`? |
12:03:40 | FromDiscord | <BhamidipatiNikhil> Initially i want to restrict myself to minimal english... consisting of just 200 or so words |
12:04:12 | FromDiscord | <Rika> English… you won’t have a good time trying to deal with that |
12:04:15 | FromDiscord | <haxscramper> amount of words does not mean anything, if you can build complex sentences not bounded by rigid grammar it is a NLP |
12:04:36 | PMunch | @Rika, implement it in Lojban! :P |
12:05:05 | FromDiscord | <haxscramper> If there is a grammar you can use npeg/re/strscans/lexbase/handrolled parser |
12:05:17 | FromDiscord | <haxscramper> If there is no schema/grammar/spec on what you expect it is a NLP stuff |
12:05:24 | FromDiscord | <abdu> Anyone used to cope object returned in find ↵How solve:↵`Error: unhandled exception: Group '1' was not captured [IndexDefect]`↵as the group really not match |
12:05:42 | FromDiscord | <haxscramper> https://github.com/penrose/penrose |
12:05:46 | FromDiscord | <haxscramper> this is a mix |
12:05:52 | FromDiscord | <haxscramper> but they have a grammar |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.4) |
12:06:31 | * | supakeen joined #nim |
12:08:27 | FromDiscord | <dom96> wowzers at these designs https://forum.nim-lang.org/t/8920 |
12:08:41 | FromDiscord | <haxscramper> For `A "is" B` it can be as simple as `let split = sentence.toLowerAscii().strip({'.', '!', ' '})` and `let (A, B) = (split[0], split[^1])` |
12:09:13 | FromDiscord | <Rika> In reply to @dom96 "wowzers at these designs": It’s good but I got clickbaited because I thought it was for nimble not the directory hahaha |
12:10:20 | FromDiscord | <dom96> lol, what were you imagining as a better look for Nimble? A nicer CLI? 🙂 |
12:10:47 | FromDiscord | <haxscramper> Look-wise it is just about what you could expect for any CLI tool |
12:11:22 | FromDiscord | <haxscramper> you can do `clap!`-tier formatting for `--help` maybe |
12:12:39 | PMunch | Haha, I was also expecting more visuals for the CLI :P |
12:13:11 | * | neurocyte0917090 joined #nim |
12:13:27 | FromDiscord | <haxscramper> "Invalid CLI flag, maybe you meant ..." |
12:13:47 | FromDiscord | <haxscramper> or "invalid value - expected A/B/C, but found G, maybe you meant ..."\ |
12:13:51 | FromDiscord | <haxscramper> (edit) "..."\" => "..."" |
12:14:08 | FromDiscord | <Rika> In reply to @dom96 "lol, what were you": I don’t know lmao |
12:14:46 | FromDiscord | <Rika> Now I’m imagining Nim with elm style errors damn it see what you did to me @ Hax |
12:17:20 | FromDiscord | <haxscramper> "PRs are welcome" |
12:18:41 | FromDiscord | <Rika> Soon! When I feel like it, or when I make myself feel like it |
12:18:50 | * | neurocyte0917090 quit (Ping timeout: 272 seconds) |
12:18:53 | FromDiscord | <Rika> Usually the latter |
12:29:30 | arkanoid | Damn, I was benchmarking without --d:useMalloc and my results were just wrong |
12:29:52 | arkanoid | it seems that both recvFrom procs from asyncnet allocates memory |
12:30:16 | arkanoid | so there's no way to receive udp packets asynchronously without allocating buffer for each packet received? |
12:36:26 | Zevv | use posix.recv |
12:36:40 | Zevv | but, that's not async, so no |
12:37:15 | PMunch | I don't really get the hype around Elm style error messages |
12:40:29 | FromDiscord | <enthus1ast> imho for udp async is not that critical |
12:41:09 | FromDiscord | <enthus1ast> nearly the same code for async or not async |
12:42:18 | FromDiscord | <Rika> In reply to @PMunch "I don't really get": They just look nice that’s it hahaha |
12:44:27 | PMunch | But they're so verbose! |
12:45:12 | FromDiscord | <dom96> In reply to @arkanoid "so there's no way": you can use the FutureVar variant |
12:45:23 | FromDiscord | <dom96> https://nim-lang.org/docs/asyncnet.html#recvFrom%2CAsyncSocket%2CFutureVar%5Bstring%5D%2Cint%2CFutureVar%5Bstring%5D%2CFutureVar%5BPort%5D |
12:45:32 | PMunch | The one time I tried it a little bit I found my brain just learning the shape of an error and where to find the information that was actually needed for understanding within it |
12:45:54 | * | neurocyte0917090 joined #nim |
12:48:19 | FromDiscord | <mratsim> In reply to @Rika "Well I was just": sorry was held up by baby. Basically proc composes and I needed composition. |
12:48:29 | FromDiscord | <Rika> I see |
12:48:48 | FromDiscord | <mratsim> The type are just helpers and then I codegen a proc completely type-erased |
12:50:55 | FromDiscord | <mratsim> sent a long message, see http://ix.io/3PKO |
12:51:10 | FromDiscord | <Rika> Yeah I got that now I was wondering why it was designed like that was all |
12:51:55 | FromDiscord | <mratsim> I needed zero-alloc, lowest overhead, composable. So that it could be used as a building-block for other stuff |
12:52:40 | FromDiscord | <mratsim> The type approaches usually use callbacks/inheritance so that it can be manipulated at run-time |
12:53:31 | FromDiscord | <mratsim> For my use-case I don't need dynamic state-machines, they are known at compile-time and don't "self-modify" |
12:53:56 | FromDiscord | <Rika> Type approach could also be compile time only |
12:54:38 | FromDiscord | <mratsim> do you have an example/pseudocode, maybe in another lang? |
12:54:41 | FromDiscord | <ITR> In reply to @mratsim "async/await is just implemented": I think I remembered incorrectly and it is possible. Use case is ui or games, where a transition would have to run an animation in transitions, and also not hold up the main thread while waiting for user input until a state changes. |
12:55:34 | FromDiscord | <mratsim> In reply to @ITR "I think I remembered": async/await uses closure iterators and iterators are equivalent to state machines. |
12:56:27 | FromDiscord | <Rika> In reply to @mratsim "do you have an": I’m just thinking about this wholly in my head, but I don’t see why a macro can’t generate a case statement for “this proc gets called on this event” inside the “emit” proc which is called to dispatch an event to the FSM |
12:56:44 | FromDiscord | <Rika> It can prolly even inline the proc |
12:56:45 | FromDiscord | <mratsim> In reply to @ITR "I think I remembered": Use a pushdown automaton then not a FSM |
12:57:20 | FromDiscord | <Rika> Man I love automata it’s pretty fun thinking about it lmao |
12:57:27 | FromDiscord | <mratsim> you represent all inputs as a stack, and in the `while true` loop you first check if the stack of input is empty, if not, proces user input, otherwise carry on your task. |
12:57:53 | FromDiscord | <mratsim> (edit) "proces" => "process" |
12:57:58 | * | arkurious joined #nim |
13:00:57 | FromDiscord | <ITR> And the other thing I was looking for is parallel state https://media.discordapp.net/attachments/371759389889003532/943492145703190570/parallel.png |
13:01:05 | FromDiscord | <ITR> bleh, lemme put htat on a white bg real quick |
13:01:46 | FromDiscord | <mratsim> while True: wrapping 2 calls to synthesized FSMs |
13:01:59 | FromDiscord | <ITR> https://media.discordapp.net/attachments/371759389889003532/943492402088386560/unknown.png |
13:02:04 | FromDiscord | <mratsim> the while True can itself be a FSM. |
13:02:13 | FromDiscord | <ITR> hmm |
13:02:37 | FromDiscord | <mratsim> or you use async/await, or if you're adventurous you use CPS (COntinuation Passing Style) |
13:02:43 | FromDiscord | <Rika> You can really make a library that does this which utilises synthesis within |
13:02:49 | FromDiscord | <mratsim> yes |
13:03:52 | FromDiscord | <ITR> How would the inner state machines have to be set up? If I first call one FSM, won't it hold the thread until it exits? |
13:04:39 | FromDiscord | <Rika> You call one FSM and it suspends when it doesn’t have any work, right? Or is my brain a bit too melted today |
13:05:05 | FromDiscord | <mratsim> In reply to @ITR "How would the inner": you're inner state machine doesn't need to never exit. |
13:05:16 | FromDiscord | <mratsim> (edit) "you're" => "your" |
13:05:56 | FromDiscord | <mratsim> For example this one declines steal request in a multithreading runtime: https://github.com/mratsim/weave/blob/master/weave/state_machines/decline_thief.png |
13:06:01 | FromDiscord | <mratsim> there is no loop |
13:06:17 | FromDiscord | <mratsim> and it's wrapped in a higher loop. |
13:06:49 | FromDiscord | <mratsim> it's called by https://github.com/mratsim/weave/blob/master/weave/state_machines/handle_thieves.png |
13:07:17 | FromDiscord | <mratsim> and this one is the higher loop: https://github.com/mratsim/weave/blob/master/weave/state_machines/sync.png |
13:07:39 | advesperacit | does nimble support retrieval from a ssh/git@.. location? |
13:07:54 | FromDiscord | <Rika> Okay the issue I see here is that the FSMs get from the same input right? But the outer FSM can change state and the inners should terminate no matter what by then |
13:08:05 | FromDiscord | <Rika> I can see how that would work with iterators but not synthesis |
13:08:40 | FromDiscord | <mratsim> iterators are just an implicit FSM |
13:08:50 | FromDiscord | <Rika> Yes yes |
13:08:52 | FromDiscord | <ITR> In reply to @ITR "": in terms of this, if both start in state B and "flick" happens, then the top one should have state C, and the bottom one should have state D. ↵↵Then if "1 second passes" happens, the first one should go back to B, but the second should remain in D. |
13:09:04 | FromDiscord | <ITR> I'm trying to wrap my head around it |
13:09:07 | FromDiscord | <mratsim> you can have many params to state machines. |
13:09:12 | FromDiscord | <Rika> In reply to @ITR "in terms of this,": They would be represented by two different events |
13:09:24 | FromDiscord | <ITR> I need to take my corona shot, so brb |
13:09:27 | FromDiscord | <Rika> Okay |
13:17:07 | * | keyehzh joined #nim |
13:27:54 | * | jmdaemon quit (Ping timeout: 252 seconds) |
13:28:09 | FromDiscord | <ITR> In reply to @mratsim "you can have many": params = startup params, right? wouldn't that just end up losing a lot of the benefits? |
13:30:35 | FromDiscord | <ITR> In reply to @Rika "They would be represented": Could you clarify what you mean? |
13:30:38 | FromDiscord | <mratsim> they are procs, you can pas as many parameters as you want. |
13:30:48 | FromDiscord | <mratsim> (edit) "pas" => "pass" |
13:31:11 | FromDiscord | <Rika> I might be thinking too much in iterators than in synthesis |
13:31:20 | FromDiscord | <mratsim> For me the benefits are easier to debug the state flow thanks to the diagram, and make sure all cases are handled. |
13:32:19 | FromDiscord | <mratsim> I had issues when writing my multithreading runtime with deadlocks, that I solved thanks to seeing in diagrams some race conditions where requests for tasks were sent when a thread was actually asleep. |
13:35:20 | FromDiscord | <ITR> hmm |
13:42:34 | FromDiscord | <ITR> sent a long message, see http://ix.io/3PKU |
13:43:20 | FromDiscord | <mratsim> that's how you get concurrency on a single processor |
13:43:35 | FromDiscord | <mratsim> you give each FSM some time-slice to run. |
13:43:48 | FromDiscord | <mratsim> and they all make a little bit of advance before you swap to another. |
13:46:40 | FromDiscord | <ITR> right, but in terms of ui/games, it's not necessarily concurrency that's the goal. It's usually more to avoid needing 16 states to describe 2 statemachines with 4 states each, for example. |
13:46:49 | * | slowButPresent joined #nim |
13:51:48 | FromDiscord | <ITR> and though it _can_ be described as several statemachines that use different parameters, it can end up messy/bloated |
13:52:38 | FromDiscord | <ITR> hmm, unless I had an implicit transition from entry to any state, and from any state to exit, maybe? |
13:58:02 | FromDiscord | <ITR> In reply to @Rika "Okay the issue I": Oh, I missed this. From what I understand, the outer one can only transition when the inner ones are in a "final state" https://statecharts.dev/concepts.html↵↵So without parallel states, synthesis as already supports this |
13:59:21 | * | rockcavera joined #nim |
13:59:21 | * | rockcavera quit (Changing host) |
13:59:21 | * | rockcavera joined #nim |
13:59:33 | FromDiscord | <ITR> Here's their page on parallel states: https://statecharts.dev/glossary/parallel-state.html |
13:59:59 | FromDiscord | <Rika> Okay then that's totally doable |
14:01:23 | FromDiscord | <ITR> And here's the xstate page on it: https://xstate.js.org/docs/guides/parallel.html#api |
14:03:12 | FromDiscord | <ITR> In reply to @Rika "Okay then that's totally": do you have a pseudo example/or can you explain your thought process? |
14:05:03 | FromDiscord | <Rika> I mean without parallel |
14:05:36 | FromDiscord | <Rika> With parallel I still have trouble seeing how this would be done since synthesis isn't iterator based |
14:05:53 | FromDiscord | <Rika> I wonder if there's an operation that can combine fsms |
14:05:57 | FromDiscord | <Rika> I believe there is... |
14:06:38 | FromDiscord | <ITR> mhm |
14:06:57 | FromDiscord | <Rika> https://stackoverflow.com/questions/11201643/how-to-merge-two-finite-state-automata#11201991 |
14:07:00 | FromDiscord | <Rika> Lol |
14:07:23 | FromDiscord | <Rika> It's gonna be large unless minimised |
14:07:33 | FromDiscord | <Rika> Unless further minimised |
14:12:13 | * | Gustavo6046 joined #nim |
14:13:59 | * | Gustavo6046 quit (Remote host closed the connection) |
14:14:28 | * | Gustavo6046 joined #nim |
14:15:00 | FromDiscord | <ITR> In reply to @Rika "It's gonna be large": yea, state charts are meant partially to prevent that when implementing |
14:15:09 | arkanoid | Dom96: I'm using it, it allocates buffer anyway on every recvFrom |
14:16:00 | FromDiscord | <Rika> In reply to @ITR "yea, state charts are": Well I don’t know, I can only imagine the iterator/type version of FSMs working well with this |
14:16:11 | FromDiscord | <ITR> maybe I should take a go at implementing xstate |
14:16:44 | FromDiscord | <Rika> I was thinking of doing so too but cannot as I am away from my computers |
14:16:45 | arkanoid | dom96: unless you spot any error in this example https://play.nim-lang.org/#ix=3PLb |
14:16:55 | FromDiscord | <Rika> I mean, I prolly could program on my phone but I would rather not |
14:17:20 | FromDiscord | <ITR> there are a few implementations in other languages, and I could probably check how synthesis was implemented too |
14:17:58 | FromDiscord | <ITR> tho i am also on my phone |
14:18:14 | arkanoid | running valgrind on binary compiled with --gc:orc --d:userMalloc results in constantly increasing mallocs |
14:20:03 | PMunch | -d:userMalloc? |
14:20:07 | PMunch | It should be -d:useMalloc |
14:21:48 | FromDiscord | <ITR> maybe nim should complain if you use invalid params, lol |
14:23:25 | FromDiscord | <Rika> It's not an invalid param |
14:23:33 | FromDiscord | <Rika> Define parameters are arbitrary |
14:23:52 | FromDiscord | <mratsim> Synthesis is really simple, it's about 500k lines |
14:23:53 | PMunch | Yeah but a hint would be nice if you define something which is never checked |
14:23:56 | FromDiscord | <mratsim> 500 lines |
14:24:13 | PMunch | "Really simple", "500k lines" :o |
14:24:14 | FromDiscord | <Rika> > 500k↵😓 hahaha |
14:24:20 | FromDiscord | <mratsim> but yeah if it get complex, I think iterators to build an implicit state machine are easier. |
14:24:55 | FromDiscord | <Rika> I'd question your humanity if you thought 500k lines were simple |
14:24:56 | FromDiscord | <mratsim> endgame would be continuation passing style |
14:25:51 | arkanoid | PMunch: sure, just a typo. valgrind is catching the problem so it works |
14:27:53 | FromDiscord | <mratsim> In reply to @Rika "I'd question your": I recently saw a project to count lines of code with a Japanese-like name, something like Tokkei or whatever, it seemed to have unique features but can't find it again |
14:29:01 | * | Gustavo6046 quit (Remote host closed the connection) |
14:29:20 | * | Gustavo6046 joined #nim |
14:29:53 | FromDiscord | <mratsim> haha, it was this: https://github.com/XAMPPRocky/tokei |
14:29:57 | FromDiscord | <mratsim> with a single k |
14:30:44 | FromDiscord | <Rika> Clock |
14:30:48 | FromDiscord | <Rika> Why did they name it that |
14:31:11 | FromDiscord | <ct.clmsn> hello everyone, i'm new to the language and community - is this an appropriate forum to ask questions? |
14:31:35 | FromDiscord | <mratsim> Arraymancer: https://media.discordapp.net/attachments/371759389889003532/943514952919044186/unknown.png |
14:31:36 | FromDiscord | <enthus1ast> hi @ct.clmsn |
14:31:38 | FromDiscord | <ct.clmsn> i'm trying to find a datatype that is capable of acting as a byte buffer |
14:32:08 | FromDiscord | <mratsim> In reply to @ct.clmsn "i'm trying to find": seq[byte] |
14:32:11 | FromDiscord | <Rika> seq[byte] |
14:32:24 | FromDiscord | <mratsim> why do I have 170k lines of C++ in Weave? wtf, where? https://media.discordapp.net/attachments/371759389889003532/943515158569971712/unknown.png |
14:32:34 | FromDiscord | <ct.clmsn> so one could do something like a ostream in c++ using seq[byte]? |
14:32:45 | FromDiscord | <ct.clmsn> to write serialization routines? |
14:33:04 | FromDiscord | <mratsim> import std/streams for serialization |
14:33:10 | FromDiscord | <ct.clmsn> (edit) "in" => "an" |
14:33:15 | FromDiscord | <ct.clmsn> (edit) "an" => "in" |
14:33:18 | FromDiscord | <mratsim> or faststreams |
14:33:21 | FromDiscord | <ct.clmsn> ah ok |
14:33:43 | FromDiscord | <mratsim> seq[byte] is like std::vector<uint8_t> |
14:34:33 | FromDiscord | <ct.clmsn> yep! i was hoping to get something like an ostream over bytes to avoid flattening to strings but, it looks like faststreams is the solution i was hoping to find |
14:34:34 | FromDiscord | <ct.clmsn> thanks! |
14:36:13 | FromDiscord | <b4mbus> does nim have a build system? |
14:36:18 | FromDiscord | <b4mbus> is `nimble `one? |
14:36:20 | FromDiscord | <b4mbus> (edit) "`nimble `one?" => "`nimble` one?" |
14:36:27 | FromDiscord | <b4mbus> I think its only a package manager |
14:36:29 | FromDiscord | <ct.clmsn> @mratsim supports kernel bypass? very nice |
14:37:01 | FromDiscord | <mratsim> In reply to @b4mbus "does nim have a": you can do nimble build and nimble install and nimble test and create your own tasks |
14:37:10 | FromDiscord | <b4mbus> cool |
14:37:13 | FromDiscord | <mratsim> You can also replace cmake if you want |
14:37:36 | FromDiscord | <b4mbus> and how do I manage external dependencies? on Nimbles page theres nothing about it, theres only how to create a package |
14:37:36 | FromDiscord | <mratsim> Replacing cmake with Nim: https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim#L40-L83 |
14:37:48 | FromDiscord | <Rika> There was this dude a while back shilling some make alternative called xmake |
14:38:01 | FromDiscord | <ITR> nimmake |
14:38:21 | FromDiscord | <b4mbus> In reply to @Rika "There was this dude": there are so many alternatives to cmake :kek |
14:38:22 | FromDiscord | <mratsim> In reply to @b4mbus "and how do I": "requires foo >= 1.0.0" |
14:38:47 | FromDiscord | <b4mbus> yeah but whats the name of the file I put it in?? |
14:38:47 | PMunch | Or do you mean external dependencies like a non-Nim dependency? |
14:38:48 | arkanoid | PMunch: do you remember that flag to dump the async result? |
14:39:03 | FromDiscord | <mratsim> In reply to @PMunch "Or do you mean": mypackage.nimble |
14:39:05 | FromDiscord | <b4mbus> In reply to @PMunch "Or do you mean": nim dependencies, dimscord for example |
14:39:10 | FromDiscord | <b4mbus> https://github.com/nim-lang/nimble |
14:39:14 | arkanoid | nim --fullhelp | grep -i async doesn't return anything |
14:39:23 | FromDiscord | <b4mbus> maybe Im blind but I see no docs on how to manage dependencies for my own project |
14:39:27 | FromDiscord | <b4mbus> only how to create packages |
14:39:43 | FromDiscord | <mratsim> In reply to @b4mbus "maybe Im blind but": your own project is a local package |
14:39:51 | PMunch | https://github.com/nim-lang/nimble#dependencies |
14:40:04 | PMunch | Yeah, when you create a Nimble project it is a package |
14:40:26 | PMunch | arkanoid, uhm maybe --expandMacro:async will work? |
14:41:23 | FromDiscord | <b4mbus> In reply to @PMunch "Yeah, when you create": oh? |
14:41:35 | FromDiscord | <b4mbus> okay well that makes sense |
14:41:37 | arkanoid | no, I remember there was n explicit thing. If I remember correctly, you told me about that :P |
14:41:42 | FromDiscord | <b4mbus> thanks |
14:41:57 | PMunch | @arkanoid, ah it's `-d:nimDumpAsync` |
14:42:17 | PMunch | Found it through peeking at the source: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncmacro.nim#L262-L263 |
14:42:23 | FromDiscord | <mratsim> Would be nice to have a way to dump all the flags that exist. |
14:42:27 | arkanoid | oh |
14:42:33 | FromDiscord | <mratsim> they are all freefloating |
14:42:45 | PMunch | @mratsim, the defines that exists are a bit hard to define |
14:42:49 | FromDiscord | <enthus1ast> @b4mbus\: you can install packages by their name (only if thei're in the long json there\: https://github.com/nim-lang/packages or you can install them by their git url |
14:43:07 | PMunch | Does the world flag exist here `when defined(hello): when defined(world):`? |
14:44:18 | FromDiscord | <ct.clmsn> thanks everyone for your time and assistance |
14:44:23 | PMunch | But I agree, defined should be able to track everything that is checked against, and --define should track everything which is defined. Then it should be a useful little hint when something is in --defined but not in the set of checked options, and you would be able to list out all the things which can be defined. |
14:45:12 | PMunch | That long JSON can also be searched here: https://nimble.directory/ |
14:45:30 | PMunch | @ct.clmsn, thank you for your appreciation :) |
14:46:57 | arkanoid | the `while true:` here is constantly calling malloc, but I don't see where and how: https://play.nim-lang.org/#ix=3PLb |
14:47:29 | PMunch | What is that tool @mratsim, maybe it's looking at your Git tree files? |
14:48:25 | PMunch | arkanoid, probably either the clean or the setLen |
14:48:54 | PMunch | Maybe even the mget I guess |
14:49:22 | arkanoid | this is `clean`: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncfutures.nim#L135 |
14:49:40 | arkanoid | `mget`: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncfutures.nim#L135 |
14:49:54 | PMunch | Yeah I just had a look at those, probable not triggering a malloc |
14:50:18 | PMunch | Oh wait, I guess it's actually the await/async part |
14:50:27 | arkanoid | and setLen is setting a len <= the newString(initialSize) |
14:50:48 | PMunch | socket.recvFrom essentially calls a procedure which returns a closure iterator, and closure iterators are heap allocated |
14:50:55 | PMunch | So that would cause a malloc |
14:51:23 | FromDiscord | <cs> Hey, I am pretty new to Nim and I am wondering: what the recommended gui library? I am looking for something that can be customized (so, non-native) |
14:51:26 | FromDiscord | <dom96> futures are also heap allocated |
14:51:37 | PMunch | @cs, it really depends on what you need |
14:51:42 | arkanoid | what's the point of defining an alternative recvFrom "to save memory" and then make it consuming it? Weird |
14:51:44 | PMunch | Nim has bindings to a lot of things |
14:52:01 | FromDiscord | <dom96> In reply to @arkanoid "what's the point of": 3 allocs vs. 2 is still an improvement 🙂 |
14:52:12 | PMunch | Exactly |
14:52:38 | PMunch | If you where receiving large chunks of a file then rewriting the same buffer over and over is better than allocating and freeing the same buffer every time |
14:53:28 | FromDiscord | <dom96> if you have some use case that does a lot of small reads then you might want to handle the IO readiness yourself |
14:53:42 | FromDiscord | <cs> In reply to @PMunch "@cs, it really depends": At the moment I would like to create a little vector graphics editor (probably using pixie) |
14:53:50 | arkanoid | ok, but I was not expecting a code like this to alloc on every await. My code is optimized to not consume memory, it does just by calling await in a loop |
14:54:14 | PMunch | I guess ImGUI might be a good fit then |
14:55:19 | PMunch | Or Fidget, from the same person who wrote Pixie |
14:55:58 | PMunch | @cs ^ |
14:58:49 | FromDiscord | <mratsim> In reply to @PMunch "What is that tool": https://github.com/XAMPPRocky/tokei |
14:59:33 | FromDiscord | <cs> Okay, thanks for the suggestions. Those are both immediate mode. Is there one retained mode (like Qt, etc)? I have used ImGUI before (in another language) so I am familiar with that, but not sure I want to do that for this. |
14:59:48 | FromDiscord | <mratsim> In reply to @cs "Okay, thanks for the": You can use QML or gintro |
15:03:23 | PMunch | There aren't a lot of retained mode UI libraries which aren't system libraries I think |
15:03:25 | arkanoid | warning: NimQML leaks with arc/orc, stick with refc |
15:04:09 | FromDiscord | <cs> In reply to @arkanoid "warning: NimQML leaks with": Ok, good to know |
15:04:34 | * | PMunch quit (Quit: Leaving) |
15:06:21 | FromDiscord | <cs> Also, if you don't mind. Could someone give a quick rundown on how to compile multiple files? I get the ``nim c -r myfile.nim`` for a single file, but why does ``nimble build`` only work sometimes? |
15:07:30 | FromDiscord | <cs> example: |
15:07:34 | FromDiscord | <cs> https://media.discordapp.net/attachments/371759389889003532/943524011722293258/unknown.png |
15:08:45 | * | advesperacit quit () |
15:09:52 | FromDiscord | <cs> Oh, wait. I see |
15:22:13 | FromDiscord | <BhamidipatiNikhil> Does anyone have any idea how to do web scraping using nim? |
15:38:15 | FromDiscord | <jmgomez> Can be nim compiled and into cpp and then include the cpp files into another cpp project? Or it will be better to create a dll? |
15:38:24 | FromDiscord | <jmgomez> (edit) "and" => "" |
15:45:51 | * | neurocyte0917090 quit (Ping timeout: 250 seconds) |
15:50:41 | FromDiscord | <Rika> You could but I don’t know if it would be any good |
15:51:20 | * | {cms} joined #nim |
15:56:36 | FromDiscord | <mratsim> In reply to @jmgomez "Can be nim compiled": just create a DLL, otherwise you will have to hunt for nimbase.h |
15:56:59 | FromDiscord | <mratsim> or create a static library .lib/.a |
16:01:45 | * | neurocyte0917090 joined #nim |
16:02:07 | FromDiscord | <jmgomez> In reply to @mratsim "just create a DLL,": ok, I wanted to take advantage that the import sources already compiles it based on OS and arch. Thanks! |
16:20:37 | * | jjido joined #nim |
16:39:05 | FromDiscord | <VVX7> important question: what are Nim programmers called? |
16:39:56 | FromDiscord | <Zajt> I am automating some Nim stuff in Python which writes text to a file, but nim compiler says ↵`Error: identifier expected, but found 'passC: "-masm=intel"'` even though that line is on a new-line but with a tab in, like in the picture. Is there any way I can make it come to the left or is this not a Nim question? https://media.discordapp.net/attachments/371759389889003532/943547256055951400/unknown.png |
16:41:23 | FromDiscord | <enthus1ast> ...automating some Nim stuff in Python... crazy |
16:42:03 | FromDiscord | <enthus1ast> why don't you use nim to automate nim? \:) |
16:43:04 | FromDiscord | <huantian> In reply to @VVX7 "important question: what are": Nimers? |
16:44:50 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
16:54:26 | NimEventer | New Nimble package! otplib - Easy to use OTP library for Nim, see https://github.com/dimspith/otplib |
16:59:15 | FromDiscord | <VVX7> In reply to @huantian "Nimers?": Nimby? |
17:04:31 | FromDiscord | <huantian> What about Nimologers |
17:08:09 | FromDiscord | <Valdar> I like Nimions |
17:10:32 | FromDiscord | <VVX7> oh, Nimion. I think I've heard that one, actually. I like it. |
17:13:07 | FromDiscord | <dom96> We should really settle on one and make it official |
17:13:17 | FromDiscord | <dom96> anyone wanna set up a poll? 🙂 |
17:16:08 | FromDiscord | <Rika> In reply to @Zajt "I am automating some": Is it a tab or spaces |
17:16:28 | FromDiscord | <Rika> Tabs should be rejected, if it's spaces then it should work... |
17:18:40 | * | PMunch joined #nim |
18:02:02 | * | vicfred joined #nim |
18:04:45 | * | vicfred_ joined #nim |
18:07:35 | * | vicfred quit (Ping timeout: 256 seconds) |
18:09:05 | * | vicfred_ quit (Client Quit) |
19:03:35 | * | wyrd quit (Ping timeout: 240 seconds) |
19:04:54 | FromDiscord | <TurtleP> this is a dumb question, because I'm sure the answer is going to be "the file is safe, add an exclusion", but my anti-virus keeps having issues when I try updating nim: https://media.discordapp.net/attachments/371759389889003532/943583737126453289/unknown.png |
19:05:31 | * | wyrd joined #nim |
19:05:43 | FromDiscord | <haxscramper> This is a known issues, and yes, the answer is just as you guessed |
19:06:39 | FromDiscord | <haxscramper> It would also help if you report it as a false positive, because it is sadly not uncommon (although I've seen less of it recently) for AV to have a false triggers on |
19:07:06 | FromDiscord | <haxscramper> nimble/nimsuggest/choosenim and even the code people just compiled |
19:07:24 | FromDiscord | <Goel> @TurtleP https://github.com/nim-lang/Nim/issues/17820 |
19:07:58 | * | PMunch quit (Ping timeout: 272 seconds) |
19:08:35 | FromDiscord | <TurtleP> haha |
19:08:39 | FromDiscord | <Goel> > even the code people just compiled↵Yeah, never trust your own code 😄 |
19:08:57 | FromDiscord | <TurtleP> I once built a python exe and it would yell at me, purely because of the app name |
19:09:18 | FromDiscord | <demotomohiro> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#nim-compiler-is-nimslashnimble-virus-or-malwareqmark |
19:12:03 | FromDiscord | <haxscramper> In reply to @demotomohiro "https://internet-of-tomohiro.netlify.app/nim/faq.en": 1. Why my list of languages/vms is in here? The https://gist.github.com/haxscramper/3562fa8fee4726d7a30a013a37977df6 one ↵2. I think you can also write a tl;dr version and mention this stupid year-old article https://thehackernews.com/2021/03/researchers-spotted-malware-written-in.html (or any similar) |
19:25:12 | FromDiscord | <haolian9 (高浩亮)> after `channel.close()`, new `channel.send()` will err, but new `channel.recv()` will not; IMO that's strange↵and those blocking `channel.recv()`s that exist before `channel.close()` stay blocking; i think this behavior leads to blocking forever problem easily |
19:28:19 | FromDiscord | <demotomohiro> In reply to @haxscramper "1. Why my list": 1. I'm sorry, it is mistake. I will fix it soon.↵2. Thx! I will add some text to the answer. |
19:49:38 | FromDiscord | <jmgomez> So I got this working and I was wondering if there is a tool/compiler argument that could output the extern "C" part in the cpp side of things? https://media.discordapp.net/attachments/371759389889003532/943594995036868608/unknown.png |
19:51:52 | FromDiscord | <ynfle> Any good async tutorials for nim? Like not the concept of async per se but how nim does it |
19:51:54 | FromDiscord | <ynfle> (edit) "it" => "it?" |
19:52:57 | FromDiscord | <haxscramper> In reply to @jmgomez "So I got this": `extern "C"` can be used in prefixed form IIRC - `extern "C" int multiply ...` and you can use `{.codgendecl.` pragma to manipulate the codegen for a procedure |
19:53:30 | FromDiscord | <haxscramper> `{.codegenDecl: "extern \"C" $# $#$#".}` |
19:53:34 | FromDiscord | <haxscramper> (edit) "\"C"" => "\"C\"" |
19:54:03 | FromDiscord | <haxscramper> And you can put this in `{.pragma exc, codegenDecl: "extern \"C\" $# $#$#".}` to save on typing, and annotate procs simply with `{.exc.}` |
19:54:10 | FromDiscord | <haxscramper> (edit) "$#$#".}`" => "$#$#", exportc.}`" |
19:54:15 | FromDiscord | <haxscramper> I think that should work |
19:58:07 | FromDiscord | <jmgomez> @haxscramper that sounds great! will give it a shot. Thanks |
20:13:33 | FromDiscord | <ynfle> In reply to @ynfle "Any good async tutorials": Never mind |
20:28:12 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3PN9 |
20:28:41 | FromDiscord | <jmgomez> nim suggest: https://media.discordapp.net/attachments/371759389889003532/943604822769303562/unknown.png |
20:29:42 | FromDiscord | <jmgomez> ohh it needs : |
20:30:19 | FromDiscord | <jmgomez> Sorry for the newbie mistake, Im just exploring nim for a new project. Thanks for your help though! |
20:31:23 | FromDiscord | <haxscramper> In reply to @jmgomez "<@!608382355454951435> it worked, now": technically there is a `--header` file, but because "Nim is not a header file generator anymore;" https://github.com/nim-lang/Nim/commit/279df834bae8b6972af6cbcbdd57c1d53e1df9c7 it is "deprecated" |
20:31:51 | FromDiscord | <demotomohiro> sent a long message, see http://ix.io/3PNa |
20:33:31 | FromDiscord | <haxscramper> In reply to @haxscramper "technically there is a": IMO compiler should just dump json of whatever C code it has generated, generating "proper" haders might be a bit too hard, but just infodumping into json? |
20:36:52 | FromDiscord | <jmgomez> In reply to @haxscramper "IMO compiler should just": it would be useful for sure |
20:38:09 | FromDiscord | <demotomohiro> In reply to @jmgomez "<@!608382355454951435> it worked, now": I have never used it, but it seems https://github.com/treeform/genny creates header file for C. |
20:39:55 | * | jjido joined #nim |
20:47:20 | * | tiorock joined #nim |
20:47:20 | * | tiorock quit (Changing host) |
20:47:20 | * | tiorock joined #nim |
20:47:21 | * | rockcavera is now known as Guest8476 |
20:47:21 | * | Guest8476 quit (Killed (copper.libera.chat (Nickname regained by services))) |
20:47:21 | * | tiorock is now known as rockcavera |
20:49:09 | FromDiscord | <TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3PNh |
20:49:27 | FromDiscord | <TurtleP> I mean I can tell why it's erroring, but not sure how it happened |
20:53:32 | FromDiscord | <demotomohiro> Did you tried to clear nimcache? |
20:55:58 | FromDiscord | <TurtleP> where is that again? |
20:59:19 | FromDiscord | <TurtleP> ah, that fixed it! thanks @demotomohiro |
21:29:40 | FromDiscord | <frankzig> Just discovered the coolest thing ever:↵↵write a library in Nim, use Nimpy to export bindings to Python↵use Julia's PyCall package to use the Nim library directly without interface code |
21:30:20 | * | PMunch joined #nim |
21:45:20 | FromDiscord | <Ruby576> Can i ask? |
21:45:39 | FromDiscord | <SoicBR> you literally just did that |
21:45:45 | FromDiscord | <Ruby576> Lmao |
21:45:46 | FromDiscord | <SoicBR> but yes |
21:45:57 | PMunch | Just ask away :) |
21:46:27 | FromDiscord | <Ruby576> sent a long message, see http://ix.io/3PNs |
21:46:33 | PMunch | By the way, if anyone wants some low hanging fruit to be able to call themselves a compiler dev: https://github.com/nim-lang/Nim/issues/19533 |
21:47:12 | PMunch | @Ruby576, I'm not sure I see what's opposite here? |
21:47:54 | PMunch | `const` needs to have its value known during compile-time. If `h` isn't known on compile-time then `i` can't be known at compile time, so it will raise an error saying that `i` can't be known at compile-time. |
21:48:51 | FromDiscord | <Ruby576> Ohhhh |
21:53:51 | FromDiscord | <Ruby576> Also where do you type from |
21:54:00 | FromDiscord | <SoicBR> sent a code paste, see https://play.nim-lang.org/#ix=3PNw |
21:54:11 | FromDiscord | <SoicBR> In reply to @Ruby576 "Also where do you": IRC |
21:54:41 | FromDiscord | <Ruby576> What is that |
21:54:57 | FromDiscord | <SoicBR> Internet Relay Chat |
21:55:10 | FromDiscord | <SoicBR> it's a chatting system or something, I'm not familiar with it, I just know it exists |
21:55:16 | FromDiscord | <Ruby576> Oo oke |
21:59:51 | FromDiscord | <auxym> In reply to @SoicBR "Can someone explain to": I think you have to use waitFor instead of await |
22:00:42 | FromDiscord | <auxym> funny I was just reading https://github.com/nim-lang/RFCs/issues/295 |
22:01:22 | PMunch | Oh yeah sorry, I'm on IRc |
22:01:30 | PMunch | It's an old text-based chat thingy |
22:02:03 | FromDiscord | <Ruby576> Is it on browser or need to download? |
22:02:21 | FromDiscord | <SoicBR> Both AFAIK |
22:02:29 | FromDiscord | <SoicBR> You can make your own IRC client if you want |
22:02:33 | PMunch | @SoicBR, you're trying to call `await` from something which is not an async procedure. Either mark the procedure with `async` or use `waitFor` |
22:02:39 | FromDiscord | <Ruby576> Ooo nicee |
22:02:50 | PMunch | Yeah there are IRC web-clients, but most people download one |
22:03:02 | PMunch | The protocol is also pretty simple, so very easy to write bots or your own client |
22:03:19 | FromDiscord | <SoicBR> In reply to @auxym "I think you have": It worked |
22:03:48 | FromDiscord | <SoicBR> thank you |
22:03:58 | FromDiscord | <SoicBR> In reply to @PMunch "<@290982446445625365>, you're trying to": thank you too |
22:04:16 | FromDiscord | <SoicBR> now it at least compiles |
22:08:20 | FromDiscord | <Ruby576> In reply to @PMunch "The protocol is also": Why are you using irc instead of just discord? |
22:11:59 | PMunch | Lot simpler protocol, not locked into Discord, I've been using it since Discord became a thing |
22:12:43 | PMunch | And I just like the IRC clients better, no nonsense fluff, just straight to the point chat application |
22:13:14 | PMunch | With loooong scrollback. I can still see your "Can i ask?" message only about halfway up my screen |
22:13:30 | FromDiscord | <Ruby576> Wow |
22:14:45 | FromDiscord | <Ruby576> Can you do dms? |
22:14:52 | FromDiscord | <Ruby576> With this |
22:16:12 | nrds | <Prestige99> You can with irc to irc but idk about discord <-> irc |
22:21:29 | PMunch | Yup, but as Prestige said you can't do Discord <-> IRC |
22:30:29 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
22:33:54 | FromDiscord | <auxym> man these people are making me feel old. I remember dowloading warez from IRC bots in the early 2000s, before BT caught on... |
22:35:47 | * | PMunch quit (Quit: leaving) |
22:42:21 | * | vicfred joined #nim |
23:07:01 | arkanoid | Am I the only one who vscode nim extensions stops working for unknown reasons? |
23:07:31 | FromDiscord | <huantian> Yeah it does that |
23:10:55 | * | jjido joined #nim |
23:11:40 | FromDiscord | <ynfle (ynfle)> Nimions↵(@VVX7) |
23:14:30 | FromDiscord | <VVX7> good bot |
23:18:43 | FromDiscord | <ynfle> Thanks |
23:21:00 | FromDiscord | <morgan> sent a long message, see http://ix.io/3PNQ |
23:21:48 | FromDiscord | <morgan> i've made small formats a few times over the years but i think planning it out more and using a tool to generate parsers would be better for the larger formats i'm planning |
23:22:03 | FromDiscord | <morgan> (edit) "few" => "couple" |
23:23:42 | FromDiscord | <Elegantbeef> Frosty/Flatty exist |
23:24:17 | FromDiscord | <Elegantbeef> Frosty allows you to define your own serialization so you can do whatever you want with the data and just call `serialize(target, value)` |
23:24:37 | FromDiscord | <morgan> ah cool |
23:24:58 | FromDiscord | <Elegantbeef> https://github.com/disruptek/frosty it supports binary serialization out of the box |
23:28:32 | FromDiscord | <morgan> cool |
23:28:33 | FromDiscord | <morgan> thanks |
23:33:28 | arkanoid | how can I do async select on sqlite? I am using sqlite as a persistent queue between an async producer and consumer, and I'd like the consumer await for available rows |
23:35:38 | * | euantorano quit (Read error: Connection reset by peer) |
23:35:46 | * | robertmeta quit (Ping timeout: 245 seconds) |
23:36:47 | * | euantorano joined #nim |
23:36:49 | * | robertmeta joined #nim |
23:36:51 | * | robertmeta quit (Changing host) |
23:36:51 | * | robertmeta joined #nim |
23:41:20 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzz…) |
23:51:30 | FromDiscord | <auxym> not sure if there's library support for async sqlite atm |
23:53:12 | * | jmdaemon joined #nim |
23:54:38 | FromDiscord | <treeform> In reply to @arkanoid "how can I do": The way sql works is its not an external library or thread it all runs using the CPU you call it with. There is nothing async about it. |
23:56:23 | arkanoid | treeform, what? I know you have done a postgres async library, but I don't understand your answer |
23:56:29 | arkanoid | I mean |
23:56:58 | arkanoid | running a query on a sqlite db requires I/O, doesn't it make an async candidate? |
23:57:46 | arkanoid | there's also this: https://www.sqlite.org/asyncvfs.html |