<< 16-02-2022 >>

00:02:41FromDiscord<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:21FromDiscord<JSONBash> sent a code paste, see https://play.nim-lang.org/#ix=3PIP
00:03:22FromDiscord<JSONBash> is my nim.cfg file
00:39:13arkanoidhere 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:28arkanoid`value` of Future[T] is not exported either
01:19:46arkanoidsolved with some convoluted code
01:29:47FromDiscord<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:55FromDiscord<treeform> then we use lipo to glue them together to form a super dylib that works everywhere
01:40:08arkanoidhow to stop/conclude nimble develop?
01:44:42NimEventerNew 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:59FromDiscord<JSONBash> In reply to @treeform "we are able to": That worked like a charm! thanks so much!
01:47:08FromDiscord<JSONBash> I can finally sleep lol
01:50:07FromDiscord<auxym> In reply to @arkanoid "how to stop/conclude nimble": My undersanding is `nimble uninstall`
01:50:33arkanoidauxym, it deletes the one in .nimble folder, not the local one
01:51:41FromDiscord<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:22FromDiscord<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:23FromDiscord<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:31rockcaveraajusa https://github.com/treeform/flatty
05:01:35FromDiscord<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:16FromDiscord<Elegantbeef> It's only really good for Nim serialization of objects
05:41:25FromDiscord<ajusa> yeah, I'm trying to use varints (want to do some minecraft protocol stuff)
05:41:53FromDiscord<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:25FromDiscord<ajusa> any other ideas or libraries I could consider?
05:46:45FromDiscord<Rika> What’s wrong with what you just said
05:48:55FromDiscord<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:25FromDiscord<Rika> If there was no issue then what would constitute as “better”?
05:51:01FromDiscord<ajusa> hm, I guess an existing library that supports the varint format? or some sort of macro magic I'm unaware of?
05:55:20FromDiscord<Elegantbeef> Making your own is another alternative 😜
05:56:02FromDiscord<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:07FromDiscord<Rika> Making beef make one for you is another
05:56:13FromDiscord<ajusa> I like that idea
05:56:15FromDiscord<Elegantbeef> Lol
05:56:50FromDiscord<ajusa> "if you complain enough, Elegantbeef or PMunch will create a library for you" - Sun Tzu
05:57:50FromDiscord<Elegantbeef> Also the hell are you talking about with frosty?
05:57:51FromDiscord<Elegantbeef> It allows you serialize however you want
05:58:29FromDiscord<ajusa> it defaults to using ints for strings and objects rather than varints I think?
05:58:30FromDiscord<Elegantbeef> In my case it's more "will answer a question and get enthused by an idea and implement it"
05:58:43FromDiscord<Elegantbeef> Cool, but you know you can do it yourself right?
05:59:15FromDiscord<Rika> Why do it yourself if you can get someone else to do it for you
05:59:26FromDiscord<Elegantbeef> No i more mean that you can serialize it however you want
05:59:30FromDiscord<ajusa> don't think you can do it without modifying the library?
05:59:49FromDiscord<ajusa> (I might be completely wrong about that)
05:59:50FromDiscord<Elegantbeef> You can write your own hooks
06:00:07FromDiscord<Elegantbeef> https://github.com/disruptek/frosty#easily-customize-serialization-for-types
06:00:36FromDiscord<ajusa> oh
06:01:01FromDiscord<Elegantbeef> It does support all primitives out of the box but you can always make your own serialization
06:01:34FromDiscord<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:50FromDiscord<Elegantbeef> I think you can technically do the same with flatty
06:03:18FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PJH
06:03:37FromDiscord<Elegantbeef> then use `MyString` in place of `string` in your object so you can override the serialize just for these specific cases
06:03:48FromDiscord<Elegantbeef> Dont know if frosty supports overriding primitives, it might
06:04:26FromDiscord<ajusa> so that way I retain string operations (like strutils) while being able to do custom serialization. sounds pretty good
06:04:43FromDiscord<Elegantbeef> Yep
06:17:34FromDiscord<Rika> Well I have no idea what you were even talking about until you explained it which by then I was busy
06:17:57FromDiscord<Elegantbeef> In other words, rika dont give no fucks
06:19:36FromDiscord<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:38FromDiscord<ITR> Are there any alternatives to synthesis for statemachines yet?
06:37:02FromDiscord<ITR> (edit) "statemachines yet?" => "statemachines?"
06:39:31FromDiscord<Rika> Any issues with synthesis?
06:47:52FromDiscord<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:40FromDiscord<Elegantbeef> You will probably need to use the `trace` and `GcRef`
07:00:30FromDiscord<Bloss> yeah it is probably related to ref counting at some point the value of my pointer was 1
07:03:37FromDiscord<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:27FromDiscord<Bloss> found this <https://github.com/nim-lang/Nim/issues/16274>
07:04:57FromDiscord<Rika> State charts? You mean visualisation?
07:09:33FromDiscord<ITR> In reply to @Rika "State charts? You mean": Simply explained, statecharts are statemachines with support for subcharts and parallel statemachines
07:09:50FromDiscord<ITR> I'd recommend looking into talks about xstate, which goes a bit more into it
07:11:06FromDiscord<Rika> That’s much deeper than a regular FSM would be wow
07:11:22FromDiscord<ITR> it's pretty interesting, and I think it might have a positive effect on programming going forward
07:12:47FromDiscord<Rika> It’s more complex though
07:16:47FromDiscord<ITR> yeah, and pretty foreign given that most people don't even use regular FSMs, so it's not very widespread yet
07:17:02FromDiscord<ITR> (edit) "so" => "two reasons for why"
07:19:44FromDiscord<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:39FromDiscord<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:10FromDiscord<Rika> Actually this might not need the loosening
08:32:51FromDiscord<Rika> Yeah okay maybe I’ll look into it
09:06:17FromDiscord<Valdar> is there some rule that a ref object has to have its type defined in the same module as the variable?
09:06:31FromDiscord<Elegantbeef> No
09:06:45PMunchWhat variable?
09:06:52FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PKa
09:07:02FromDiscord<Elegantbeef> export even
09:07:31PMunchI always exprort my variables
09:07:47FromDiscord<Valdar> I'm just doing import. Do I have to export too?
09:08:00FromDiscord<Elegantbeef> Yes
09:08:08FromDiscord<Elegantbeef> Nim defaults to unexported
09:08:15PMunchIf 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:19FromDiscord<Elegantbeef> Which means that any top level symbol is not accessible from an `import`
09:08:38FromDiscord<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:11FromDiscord<Valdar> k, thx. I'll try that
09:09:21FromDiscord<Elegantbeef> ref doesnt change anything
09:09:28FromDiscord<Elegantbeef> So are you talking about a different issue?
09:09:55FromDiscord<Elegantbeef> `let` is immutable
09:09:57FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3PKb
09:12:13FromDiscord<Valdar> I'm using var
09:12:28FromDiscord<Elegantbeef> Showing the code will give a more concise answer to the issue 😀
09:16:40FromDiscord<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:21FromDiscord<Valdar> by export, you mean "export", right. I'm just using SomeOject = object
09:19:32FromDiscord<Elegantbeef> `` is the export marker
09:19:49FromDiscord<Valdar> yeah, i'm doing that
09:19:51FromDiscord<Elegantbeef> It exports the top level statements or fields
09:20:01FromDiscord<Elegantbeef> Then there is another issue
09:21:01FromDiscord<Valdar> and it has always worked fine, but when i changed to SomeOject = ref object, it was no longer accessible
09:21:35FromDiscord<Elegantbeef> well `ref object` doesnt change anything so either you found a bug or are doing something wrong
09:22:31FromDiscord<Valdar> Maybe I did something else to bugger it up, but I don't think so.
09:24:35FromDiscord<Elegantbeef> Not using any macros are you?
09:26:07PMunchWhat is the actual error you're getting @Valdar?
09:27:09PMunchHmm, 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:55FromDiscord<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:42FromDiscord<Elegantbeef> Yep tuples suck
09:34:54FromDiscord<Elegantbeef> Dont use them like types, only as return values or for unpacking!
09:35:00FromDiscord<Elegantbeef> like objects\
09:35:44FromDiscord<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:51FromDiscord<Rika> In general
09:35:53FromDiscord<Elegantbeef> General
09:36:01FromDiscord<Valdar> yep, k
09:36:21FromDiscord<Rika> Their use is essentially limited to “learning “
09:36:52FromDiscord<Elegantbeef> They have their applications
09:37:17FromDiscord<Elegantbeef> Any situation you need a cheap remove/add it's golde
09:37:38FromDiscord<Elegantbeef> I do speak in hyperbole a lot, but most of the time there is some basis of truth there 😀
09:38:06FromDiscord<Valdar> Just because the data gets scattered all over? or is there another reason
09:38:42FromDiscord<Elegantbeef> length is `O(n)`, not good for the cache
09:39:02FromDiscord<Rika> I’d say that it’s rare to need a constant time remove and insert while having random access unimportant
09:39:25FromDiscord<Elegantbeef> But when you do need it you'll be happy to know it's there 😛
09:39:34FromDiscord<Elegantbeef> Like most data types they exist for a reason
09:41:52FromDiscord<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:17FromDiscord<Valdar> thx again
09:47:18FromDiscord<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:22FromDiscord<Rika> Needs more thought
09:53:29PMunchOf course you could implement a mixed implementation that would alleviate some of the issues with linked lists
09:53:58PMunchE.g chunked pieces of memory strung together in a linked list
09:55:02PMunchWith some clever logic you could also keep an updated length field somewhere and avoid the O(N) length issue
09:55:46PMunchFor 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:13PMunchNow of course you might have to implement some chunk rebalancing if you do a lot of inserts and deletes in specific patterns
09:56:27FromDiscord<Rika> Then it’s not a linked list anymore.
09:56:32FromDiscord<Rika> It’s a different data type
09:56:36PMunchSure
09:56:47PMunchThat'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:31PMunchThe way the OS module prevents its own import is really annoying and dumb.. https://github.com/PMunch/ratel/issues/4
10:32:39FromDiscord<abdu> what's difference `assert` and `doassert` ?
10:32:57FromDiscord<haxscramper> `assert` does not run with `-d:release` or `-d:danger`
10:33:09FromDiscord<Rika> It does in release though?
10:46:42NimEventerNew question by congusbongus: Pop first element of OrderedSet, see https://stackoverflow.com/questions/71140344/pop-first-element-of-orderedset
11:13:38FromDiscord<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:28FromDiscord<mratsim> In reply to @ITR "it'd be interesting to": async/await is just implemented using state machines inside.
11:14:41FromDiscord<mratsim> what kind of support do you need?
11:18:20*advesperacit joined #nim
11:18:38PMunch@Rika, it does now, but it didn't before `release` and `danger` got split into two flags
11:19:34FromDiscord<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:55FromDiscord<Rika> In reply to @PMunch "<@259277943275126785>, it does now,": Well that doesn’t matter nowadays does it lol
11:23:05PMunchHaha, not really
11:23:18PMunchUnless you for some reason are targeting really old versions :P
11:28:51NimEventerNew 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:36FromDiscord<mratsim> sent a code paste, see https://play.nim-lang.org/#ix=3PKw
11:30:07FromDiscord<mratsim> That's what substates boil down to if I understood correctly.
11:30:20FromDiscord<Rika> Let me think, it seems perfect yes
11:31:22FromDiscord<Rika> Yeah I don’t know it seems good
11:34:27FromDiscord<Rika> You can have machines in machines for synthesis right?
11:34:32FromDiscord<mratsim> I think you can use synthesis as a backend for a statechart lib, there shouldn't be anythng missing
11:34:43FromDiscord<mratsim> state machines are just proc in synthesis
11:34:52FromDiscord<mratsim> as long as you can have procs in procs yes
11:34:53FromDiscord<Rika> Okay
11:35:14FromDiscord<Rika> Why proc? Traditionally (and personally) it would be a type right?
11:35:32FromDiscord<BhamidipatiNikhil> sent a code paste, see https://paste.rs/Zoe
11:35:33FromDiscord<BhamidipatiNikhil> https://media.discordapp.net/attachments/371759389889003532/943470654416642138/unknown.png
11:35:35arkanoidjust heard araq fosdem presentation on parallel programming, and now I'm more unsure if I should async or thread channels
11:35:45FromDiscord<mratsim> you can't execute proc on a CPU
11:36:00FromDiscord<Rika> In reply to @mratsim "you can't execute proc": You mean type on CPU?
11:36:28FromDiscord<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:38FromDiscord<Rika> In reply to @arkanoid "just heard araq fosdem": What’s your bound
11:36:44FromDiscord<Rika> Determine what you are bound by first
11:36:47*krux02 joined #nim
11:37:47arkanoidI/O bound, but async is weird when trying to don't abuse your ram
11:38:03FromDiscord<Rika> What are you programming for?
11:38:07FromDiscord<Rika> Embedded? Or what
11:38:28FromDiscord<Rika> What leads to RAM abuse?
11:39:13arkanoidIt is difficult to control allocations when passing around Future[T]|FutureVal[T]
11:39:35FromDiscord<Rika> Fair I guess
11:42:14FromDiscord<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:33FromDiscord<BhamidipatiNikhil> What should i start learning from?
11:42:38arkanoidRika, 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:52FromDiscord<enthus1ast> @BhamidipatiNikhil\: regex is not needed imho
11:43:57FromDiscord<enthus1ast> think about your data types↵build a text parser/lexer↵render your data
11:44:58FromDiscord<BhamidipatiNikhil> so which libraries should i learn....?
11:45:31FromDiscord<enthus1ast> for lexing none (maybe strutils, parseutils, strscans)
11:45:48FromDiscord<enthus1ast> for rendering i would give pixie a try
11:47:07FromDiscord<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:29FromDiscord<BhamidipatiNikhil> Thx enthus1ast..... I am on it.....! I will start learning those libraries!!
11:47:54FromDiscord<Rika> In reply to @enthus1ast "for lexing none (maybe": I really like parseutils lol
11:48:06arkanoidRika: data.mget() = newString(bufferLen) is just horrible
11:48:42FromDiscord<enthus1ast> @Rika\: i mean it gets the job done and is fast
11:49:06FromDiscord<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:32FromDiscord<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:00FromDiscord<Rika> Probably?
11:50:11FromDiscord<Rika> But why?
11:50:43FromDiscord<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:57FromDiscord<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:08FromDiscord<gerwy> buut maybe its not the best idea, right...
11:52:50FromDiscord<Rika> Well yeah ARC isn’t a “GC” it’s analysis + reference counting from what I know
11:53:02PMunchYeah, it won't be possible to have arc.h
11:53:11FromDiscord<gerwy> what about orc/
11:53:13FromDiscord<gerwy> (edit) "orc/" => "orc?"
11:53:15FromDiscord<Rika> Same thing
11:53:19FromDiscord<Rika> But with a cycle collector
11:53:22PMunchIt is built into the Nim compiler and essentially outputs free statements whenever things go out of scope
11:53:23FromDiscord<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:34arkanoidadding wings to a car doesn't make it a plane
11:53:36PMunchSo it is basically doing manual memory management, just automatically :P
11:53:49FromDiscord<Rika> That’s what I said yes haha
11:54:07FromDiscord<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:08FromDiscord<gerwy> (edit) "much\" => "much"
11:54:09PMunchIf you need a GC for C code though you can have a look at Boehm
11:54:10FromDiscord<Rika> In reply to @BhamidipatiNikhil "Wait, but i don't": There are examples in the repository from what I recall
11:54:51FromDiscord<gerwy> 👀 i will↵i saw it in the recommended articles when reading about Mark and Sweep
11:54:59FromDiscord<gerwy> thanks!
11:57:47PMunch@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:01FromDiscord<BhamidipatiNikhil> In reply to @PMunch "<@764483963422375946>, you could use": Got it! I will surely practice Pixie first~!
11:59:14FromDiscord<haxscramper> In reply to @BhamidipatiNikhil "I want to create": https://forum.nim-lang.org/t/8499
11:59:53FromDiscord<haxscramper> I think that is exactly what you need
12:00:06FromDiscord<haxscramper> animation, text etc.
12:00:07FromDiscord<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:26FromDiscord<haxscramper> text is just a code in some language
12:00:55FromDiscord<haxscramper> do you have a grammar for your sentences?
12:01:03FromDiscord<haxscramper> otherwise this is a NLP territory
12:01:24FromDiscord<BhamidipatiNikhil> In reply to @haxscramper "otherwise this is a": Yes, you are right!
12:01:50FromDiscord<BhamidipatiNikhil> Its a bit NLP territory, but not completely!
12:02:34FromDiscord<haxscramper> are sentences freeform of you have some fixed set of supported inputs?
12:03:19FromDiscord<haxscramper> AS in `<sent> ::= <name> ("is" | "is a") <name>`, `<name> ::= \w+`?
12:03:40FromDiscord<BhamidipatiNikhil> Initially i want to restrict myself to minimal english... consisting of just 200 or so words
12:04:12FromDiscord<Rika> English… you won’t have a good time trying to deal with that
12:04:15FromDiscord<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:36PMunch@Rika, implement it in Lojban! :P
12:05:05FromDiscord<haxscramper> If there is a grammar you can use npeg/re/strscans/lexbase/handrolled parser
12:05:17FromDiscord<haxscramper> If there is no schema/grammar/spec on what you expect it is a NLP stuff
12:05:24FromDiscord<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:42FromDiscord<haxscramper> https://github.com/penrose/penrose
12:05:46FromDiscord<haxscramper> this is a mix
12:05:52FromDiscord<haxscramper> but they have a grammar
12:06:01*supakeen quit (Quit: WeeChat 3.4)
12:06:31*supakeen joined #nim
12:08:27FromDiscord<dom96> wowzers at these designs https://forum.nim-lang.org/t/8920
12:08:41FromDiscord<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:13FromDiscord<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:20FromDiscord<dom96> lol, what were you imagining as a better look for Nimble? A nicer CLI? 🙂
12:10:47FromDiscord<haxscramper> Look-wise it is just about what you could expect for any CLI tool
12:11:22FromDiscord<haxscramper> you can do `clap!`-tier formatting for `--help` maybe
12:12:39PMunchHaha, I was also expecting more visuals for the CLI :P
12:13:11*neurocyte0917090 joined #nim
12:13:27FromDiscord<haxscramper> "Invalid CLI flag, maybe you meant ..."
12:13:47FromDiscord<haxscramper> or "invalid value - expected A/B/C, but found G, maybe you meant ..."\
12:13:51FromDiscord<haxscramper> (edit) "..."\" => "...""
12:14:08FromDiscord<Rika> In reply to @dom96 "lol, what were you": I don’t know lmao
12:14:46FromDiscord<Rika> Now I’m imagining Nim with elm style errors damn it see what you did to me @ Hax
12:17:20FromDiscord<haxscramper> "PRs are welcome"
12:18:41FromDiscord<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:53FromDiscord<Rika> Usually the latter
12:29:30arkanoidDamn, I was benchmarking without --d:useMalloc and my results were just wrong
12:29:52arkanoidit seems that both recvFrom procs from asyncnet allocates memory
12:30:16arkanoidso there's no way to receive udp packets asynchronously without allocating buffer for each packet received?
12:36:26Zevvuse posix.recv
12:36:40Zevvbut, that's not async, so no
12:37:15PMunchI don't really get the hype around Elm style error messages
12:40:29FromDiscord<enthus1ast> imho for udp async is not that critical
12:41:09FromDiscord<enthus1ast> nearly the same code for async or not async
12:42:18FromDiscord<Rika> In reply to @PMunch "I don't really get": They just look nice that’s it hahaha
12:44:27PMunchBut they're so verbose!
12:45:12FromDiscord<dom96> In reply to @arkanoid "so there's no way": you can use the FutureVar variant
12:45:23FromDiscord<dom96> https://nim-lang.org/docs/asyncnet.html#recvFrom%2CAsyncSocket%2CFutureVar%5Bstring%5D%2Cint%2CFutureVar%5Bstring%5D%2CFutureVar%5BPort%5D
12:45:32PMunchThe 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:19FromDiscord<mratsim> In reply to @Rika "Well I was just": sorry was held up by baby. Basically proc composes and I needed composition.
12:48:29FromDiscord<Rika> I see
12:48:48FromDiscord<mratsim> The type are just helpers and then I codegen a proc completely type-erased
12:50:55FromDiscord<mratsim> sent a long message, see http://ix.io/3PKO
12:51:10FromDiscord<Rika> Yeah I got that now I was wondering why it was designed like that was all
12:51:55FromDiscord<mratsim> I needed zero-alloc, lowest overhead, composable. So that it could be used as a building-block for other stuff
12:52:40FromDiscord<mratsim> The type approaches usually use callbacks/inheritance so that it can be manipulated at run-time
12:53:31FromDiscord<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:56FromDiscord<Rika> Type approach could also be compile time only
12:54:38FromDiscord<mratsim> do you have an example/pseudocode, maybe in another lang?
12:54:41FromDiscord<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:34FromDiscord<mratsim> In reply to @ITR "I think I remembered": async/await uses closure iterators and iterators are equivalent to state machines.
12:56:27FromDiscord<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:44FromDiscord<Rika> It can prolly even inline the proc
12:56:45FromDiscord<mratsim> In reply to @ITR "I think I remembered": Use a pushdown automaton then not a FSM
12:57:20FromDiscord<Rika> Man I love automata it’s pretty fun thinking about it lmao
12:57:27FromDiscord<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:53FromDiscord<mratsim> (edit) "proces" => "process"
12:57:58*arkurious joined #nim
13:00:57FromDiscord<ITR> And the other thing I was looking for is parallel state https://media.discordapp.net/attachments/371759389889003532/943492145703190570/parallel.png
13:01:05FromDiscord<ITR> bleh, lemme put htat on a white bg real quick
13:01:46FromDiscord<mratsim> while True: wrapping 2 calls to synthesized FSMs
13:01:59FromDiscord<ITR> https://media.discordapp.net/attachments/371759389889003532/943492402088386560/unknown.png
13:02:04FromDiscord<mratsim> the while True can itself be a FSM.
13:02:13FromDiscord<ITR> hmm
13:02:37FromDiscord<mratsim> or you use async/await, or if you're adventurous you use CPS (COntinuation Passing Style)
13:02:43FromDiscord<Rika> You can really make a library that does this which utilises synthesis within
13:02:49FromDiscord<mratsim> yes
13:03:52FromDiscord<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:39FromDiscord<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:05FromDiscord<mratsim> In reply to @ITR "How would the inner": you're inner state machine doesn't need to never exit.
13:05:16FromDiscord<mratsim> (edit) "you're" => "your"
13:05:56FromDiscord<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:01FromDiscord<mratsim> there is no loop
13:06:17FromDiscord<mratsim> and it's wrapped in a higher loop.
13:06:49FromDiscord<mratsim> it's called by https://github.com/mratsim/weave/blob/master/weave/state_machines/handle_thieves.png
13:07:17FromDiscord<mratsim> and this one is the higher loop: https://github.com/mratsim/weave/blob/master/weave/state_machines/sync.png
13:07:39advesperacitdoes nimble support retrieval from a ssh/git@.. location?
13:07:54FromDiscord<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:05FromDiscord<Rika> I can see how that would work with iterators but not synthesis
13:08:40FromDiscord<mratsim> iterators are just an implicit FSM
13:08:50FromDiscord<Rika> Yes yes
13:08:52FromDiscord<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:04FromDiscord<ITR> I'm trying to wrap my head around it
13:09:07FromDiscord<mratsim> you can have many params to state machines.
13:09:12FromDiscord<Rika> In reply to @ITR "in terms of this,": They would be represented by two different events
13:09:24FromDiscord<ITR> I need to take my corona shot, so brb
13:09:27FromDiscord<Rika> Okay
13:17:07*keyehzh joined #nim
13:27:54*jmdaemon quit (Ping timeout: 252 seconds)
13:28:09FromDiscord<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:35FromDiscord<ITR> In reply to @Rika "They would be represented": Could you clarify what you mean?
13:30:38FromDiscord<mratsim> they are procs, you can pas as many parameters as you want.
13:30:48FromDiscord<mratsim> (edit) "pas" => "pass"
13:31:11FromDiscord<Rika> I might be thinking too much in iterators than in synthesis
13:31:20FromDiscord<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:19FromDiscord<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:20FromDiscord<ITR> hmm
13:42:34FromDiscord<ITR> sent a long message, see http://ix.io/3PKU
13:43:20FromDiscord<mratsim> that's how you get concurrency on a single processor
13:43:35FromDiscord<mratsim> you give each FSM some time-slice to run.
13:43:48FromDiscord<mratsim> and they all make a little bit of advance before you swap to another.
13:46:40FromDiscord<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:48FromDiscord<ITR> and though it _can_ be described as several statemachines that use different parameters, it can end up messy/bloated
13:52:38FromDiscord<ITR> hmm, unless I had an implicit transition from entry to any state, and from any state to exit, maybe?
13:58:02FromDiscord<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:33FromDiscord<ITR> Here's their page on parallel states: https://statecharts.dev/glossary/parallel-state.html
13:59:59FromDiscord<Rika> Okay then that's totally doable
14:01:23FromDiscord<ITR> And here's the xstate page on it: https://xstate.js.org/docs/guides/parallel.html#api
14:03:12FromDiscord<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:03FromDiscord<Rika> I mean without parallel
14:05:36FromDiscord<Rika> With parallel I still have trouble seeing how this would be done since synthesis isn't iterator based
14:05:53FromDiscord<Rika> I wonder if there's an operation that can combine fsms
14:05:57FromDiscord<Rika> I believe there is...
14:06:38FromDiscord<ITR> mhm
14:06:57FromDiscord<Rika> https://stackoverflow.com/questions/11201643/how-to-merge-two-finite-state-automata#11201991
14:07:00FromDiscord<Rika> Lol
14:07:23FromDiscord<Rika> It's gonna be large unless minimised
14:07:33FromDiscord<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:00FromDiscord<ITR> In reply to @Rika "It's gonna be large": yea, state charts are meant partially to prevent that when implementing
14:15:09arkanoidDom96: I'm using it, it allocates buffer anyway on every recvFrom
14:16:00FromDiscord<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:11FromDiscord<ITR> maybe I should take a go at implementing xstate
14:16:44FromDiscord<Rika> I was thinking of doing so too but cannot as I am away from my computers
14:16:45arkanoiddom96: unless you spot any error in this example https://play.nim-lang.org/#ix=3PLb
14:16:55FromDiscord<Rika> I mean, I prolly could program on my phone but I would rather not
14:17:20FromDiscord<ITR> there are a few implementations in other languages, and I could probably check how synthesis was implemented too
14:17:58FromDiscord<ITR> tho i am also on my phone
14:18:14arkanoidrunning valgrind on binary compiled with --gc:orc --d:userMalloc results in constantly increasing mallocs
14:20:03PMunch-d:userMalloc?
14:20:07PMunchIt should be -d:useMalloc
14:21:48FromDiscord<ITR> maybe nim should complain if you use invalid params, lol
14:23:25FromDiscord<Rika> It's not an invalid param
14:23:33FromDiscord<Rika> Define parameters are arbitrary
14:23:52FromDiscord<mratsim> Synthesis is really simple, it's about 500k lines
14:23:53PMunchYeah but a hint would be nice if you define something which is never checked
14:23:56FromDiscord<mratsim> 500 lines
14:24:13PMunch"Really simple", "500k lines" :o
14:24:14FromDiscord<Rika> > 500k↵😓 hahaha
14:24:20FromDiscord<mratsim> but yeah if it get complex, I think iterators to build an implicit state machine are easier.
14:24:55FromDiscord<Rika> I'd question your humanity if you thought 500k lines were simple
14:24:56FromDiscord<mratsim> endgame would be continuation passing style
14:25:51arkanoidPMunch: sure, just a typo. valgrind is catching the problem so it works
14:27:53FromDiscord<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:53FromDiscord<mratsim> haha, it was this: https://github.com/XAMPPRocky/tokei
14:29:57FromDiscord<mratsim> with a single k
14:30:44FromDiscord<Rika> Clock
14:30:48FromDiscord<Rika> Why did they name it that
14:31:11FromDiscord<ct.clmsn> hello everyone, i'm new to the language and community - is this an appropriate forum to ask questions?
14:31:35FromDiscord<mratsim> Arraymancer: https://media.discordapp.net/attachments/371759389889003532/943514952919044186/unknown.png
14:31:36FromDiscord<enthus1ast> hi @ct.clmsn
14:31:38FromDiscord<ct.clmsn> i'm trying to find a datatype that is capable of acting as a byte buffer
14:32:08FromDiscord<mratsim> In reply to @ct.clmsn "i'm trying to find": seq[byte]
14:32:11FromDiscord<Rika> seq[byte]
14:32:24FromDiscord<mratsim> why do I have 170k lines of C++ in Weave? wtf, where? https://media.discordapp.net/attachments/371759389889003532/943515158569971712/unknown.png
14:32:34FromDiscord<ct.clmsn> so one could do something like a ostream in c++ using seq[byte]?
14:32:45FromDiscord<ct.clmsn> to write serialization routines?
14:33:04FromDiscord<mratsim> import std/streams for serialization
14:33:10FromDiscord<ct.clmsn> (edit) "in" => "an"
14:33:15FromDiscord<ct.clmsn> (edit) "an" => "in"
14:33:18FromDiscord<mratsim> or faststreams
14:33:21FromDiscord<ct.clmsn> ah ok
14:33:43FromDiscord<mratsim> seq[byte] is like std::vector<uint8_t>
14:34:33FromDiscord<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:34FromDiscord<ct.clmsn> thanks!
14:36:13FromDiscord<b4mbus> does nim have a build system?
14:36:18FromDiscord<b4mbus> is `nimble `one?
14:36:20FromDiscord<b4mbus> (edit) "`nimble `one?" => "`nimble` one?"
14:36:27FromDiscord<b4mbus> I think its only a package manager
14:36:29FromDiscord<ct.clmsn> @mratsim supports kernel bypass? very nice
14:37:01FromDiscord<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:10FromDiscord<b4mbus> cool
14:37:13FromDiscord<mratsim> You can also replace cmake if you want
14:37:36FromDiscord<b4mbus> and how do I manage external dependencies? on Nimbles page theres nothing about it, theres only how to create a package
14:37:36FromDiscord<mratsim> Replacing cmake with Nim: https://github.com/numforge/agent-smith/blob/master/third_party/ale_build.nim#L40-L83
14:37:48FromDiscord<Rika> There was this dude a while back shilling some make alternative called xmake
14:38:01FromDiscord<ITR> nimmake
14:38:21FromDiscord<b4mbus> In reply to @Rika "There was this dude": there are so many alternatives to cmake :kek
14:38:22FromDiscord<mratsim> In reply to @b4mbus "and how do I": "requires foo >= 1.0.0"
14:38:47FromDiscord<b4mbus> yeah but whats the name of the file I put it in??
14:38:47PMunchOr do you mean external dependencies like a non-Nim dependency?
14:38:48arkanoidPMunch: do you remember that flag to dump the async result?
14:39:03FromDiscord<mratsim> In reply to @PMunch "Or do you mean": mypackage.nimble
14:39:05FromDiscord<b4mbus> In reply to @PMunch "Or do you mean": nim dependencies, dimscord for example
14:39:10FromDiscord<b4mbus> https://github.com/nim-lang/nimble
14:39:14arkanoidnim --fullhelp | grep -i async doesn't return anything
14:39:23FromDiscord<b4mbus> maybe Im blind but I see no docs on how to manage dependencies for my own project
14:39:27FromDiscord<b4mbus> only how to create packages
14:39:43FromDiscord<mratsim> In reply to @b4mbus "maybe Im blind but": your own project is a local package
14:39:51PMunchhttps://github.com/nim-lang/nimble#dependencies
14:40:04PMunchYeah, when you create a Nimble project it is a package
14:40:26PMuncharkanoid, uhm maybe --expandMacro:async will work?
14:41:23FromDiscord<b4mbus> In reply to @PMunch "Yeah, when you create": oh?
14:41:35FromDiscord<b4mbus> okay well that makes sense
14:41:37arkanoidno, I remember there was n explicit thing. If I remember correctly, you told me about that :P
14:41:42FromDiscord<b4mbus> thanks
14:41:57PMunch@arkanoid, ah it's `-d:nimDumpAsync`
14:42:17PMunchFound it through peeking at the source: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncmacro.nim#L262-L263
14:42:23FromDiscord<mratsim> Would be nice to have a way to dump all the flags that exist.
14:42:27arkanoidoh
14:42:33FromDiscord<mratsim> they are all freefloating
14:42:45PMunch@mratsim, the defines that exists are a bit hard to define
14:42:49FromDiscord<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:07PMunchDoes the world flag exist here `when defined(hello): when defined(world):`?
14:44:18FromDiscord<ct.clmsn> thanks everyone for your time and assistance
14:44:23PMunchBut 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:12PMunchThat long JSON can also be searched here: https://nimble.directory/
14:45:30PMunch@ct.clmsn, thank you for your appreciation :)
14:46:57arkanoidthe `while true:` here is constantly calling malloc, but I don't see where and how: https://play.nim-lang.org/#ix=3PLb
14:47:29PMunchWhat is that tool @mratsim, maybe it's looking at your Git tree files?
14:48:25PMuncharkanoid, probably either the clean or the setLen
14:48:54PMunchMaybe even the mget I guess
14:49:22arkanoidthis is `clean`: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncfutures.nim#L135
14:49:40arkanoid`mget`: https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/asyncfutures.nim#L135
14:49:54PMunchYeah I just had a look at those, probable not triggering a malloc
14:50:18PMunchOh wait, I guess it's actually the await/async part
14:50:27arkanoidand setLen is setting a len <= the newString(initialSize)
14:50:48PMunchsocket.recvFrom essentially calls a procedure which returns a closure iterator, and closure iterators are heap allocated
14:50:55PMunchSo that would cause a malloc
14:51:23FromDiscord<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:26FromDiscord<dom96> futures are also heap allocated
14:51:37PMunch@cs, it really depends on what you need
14:51:42arkanoidwhat's the point of defining an alternative recvFrom "to save memory" and then make it consuming it? Weird
14:51:44PMunchNim has bindings to a lot of things
14:52:01FromDiscord<dom96> In reply to @arkanoid "what's the point of": 3 allocs vs. 2 is still an improvement 🙂
14:52:12PMunchExactly
14:52:38PMunchIf 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:28FromDiscord<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:42FromDiscord<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:50arkanoidok, 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:14PMunchI guess ImGUI might be a good fit then
14:55:19PMunchOr Fidget, from the same person who wrote Pixie
14:55:58PMunch@cs ^
14:58:49FromDiscord<mratsim> In reply to @PMunch "What is that tool": https://github.com/XAMPPRocky/tokei
14:59:33FromDiscord<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:48FromDiscord<mratsim> In reply to @cs "Okay, thanks for the": You can use QML or gintro
15:03:23PMunchThere aren't a lot of retained mode UI libraries which aren't system libraries I think
15:03:25arkanoidwarning: NimQML leaks with arc/orc, stick with refc
15:04:09FromDiscord<cs> In reply to @arkanoid "warning: NimQML leaks with": Ok, good to know
15:04:34*PMunch quit (Quit: Leaving)
15:06:21FromDiscord<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:30FromDiscord<cs> example:
15:07:34FromDiscord<cs> https://media.discordapp.net/attachments/371759389889003532/943524011722293258/unknown.png
15:08:45*advesperacit quit ()
15:09:52FromDiscord<cs> Oh, wait. I see
15:22:13FromDiscord<BhamidipatiNikhil> Does anyone have any idea how to do web scraping using nim?
15:38:15FromDiscord<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:24FromDiscord<jmgomez> (edit) "and" => ""
15:45:51*neurocyte0917090 quit (Ping timeout: 250 seconds)
15:50:41FromDiscord<Rika> You could but I don’t know if it would be any good
15:51:20*{cms} joined #nim
15:56:36FromDiscord<mratsim> In reply to @jmgomez "Can be nim compiled": just create a DLL, otherwise you will have to hunt for nimbase.h
15:56:59FromDiscord<mratsim> or create a static library .lib/.a
16:01:45*neurocyte0917090 joined #nim
16:02:07FromDiscord<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:05FromDiscord<VVX7> important question: what are Nim programmers called?
16:39:56FromDiscord<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:23FromDiscord<enthus1ast> ...automating some Nim stuff in Python... crazy
16:42:03FromDiscord<enthus1ast> why don't you use nim to automate nim? \:)
16:43:04FromDiscord<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:26NimEventerNew Nimble package! otplib - Easy to use OTP library for Nim, see https://github.com/dimspith/otplib
16:59:15FromDiscord<VVX7> In reply to @huantian "Nimers?": Nimby?
17:04:31FromDiscord<huantian> What about Nimologers
17:08:09FromDiscord<Valdar> I like Nimions
17:10:32FromDiscord<VVX7> oh, Nimion. I think I've heard that one, actually. I like it.
17:13:07FromDiscord<dom96> We should really settle on one and make it official
17:13:17FromDiscord<dom96> anyone wanna set up a poll? 🙂
17:16:08FromDiscord<Rika> In reply to @Zajt "I am automating some": Is it a tab or spaces
17:16:28FromDiscord<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:54FromDiscord<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:43FromDiscord<haxscramper> This is a known issues, and yes, the answer is just as you guessed
19:06:39FromDiscord<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:06FromDiscord<haxscramper> nimble/nimsuggest/choosenim and even the code people just compiled
19:07:24FromDiscord<Goel> @TurtleP https://github.com/nim-lang/Nim/issues/17820
19:07:58*PMunch quit (Ping timeout: 272 seconds)
19:08:35FromDiscord<TurtleP> haha
19:08:39FromDiscord<Goel> > even the code people just compiled↵Yeah, never trust your own code 😄
19:08:57FromDiscord<TurtleP> I once built a python exe and it would yell at me, purely because of the app name
19:09:18FromDiscord<demotomohiro> https://internet-of-tomohiro.netlify.app/nim/faq.en.html#nim-compiler-is-nimslashnimble-virus-or-malwareqmark
19:12:03FromDiscord<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:12FromDiscord<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:19FromDiscord<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:38FromDiscord<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:52FromDiscord<ynfle> Any good async tutorials for nim? Like not the concept of async per se but how nim does it
19:51:54FromDiscord<ynfle> (edit) "it" => "it?"
19:52:57FromDiscord<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:30FromDiscord<haxscramper> `{.codegenDecl: "extern \"C" $# $#$#".}`
19:53:34FromDiscord<haxscramper> (edit) "\"C"" => "\"C\""
19:54:03FromDiscord<haxscramper> And you can put this in `{.pragma exc, codegenDecl: "extern \"C\" $# $#$#".}` to save on typing, and annotate procs simply with `{.exc.}`
19:54:10FromDiscord<haxscramper> (edit) "$#$#".}`" => "$#$#", exportc.}`"
19:54:15FromDiscord<haxscramper> I think that should work
19:58:07FromDiscord<jmgomez> @haxscramper that sounds great! will give it a shot. Thanks
20:13:33FromDiscord<ynfle> In reply to @ynfle "Any good async tutorials": Never mind
20:28:12FromDiscord<jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=3PN9
20:28:41FromDiscord<jmgomez> nim suggest: https://media.discordapp.net/attachments/371759389889003532/943604822769303562/unknown.png
20:29:42FromDiscord<jmgomez> ohh it needs :
20:30:19FromDiscord<jmgomez> Sorry for the newbie mistake, Im just exploring nim for a new project. Thanks for your help though!
20:31:23FromDiscord<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:51FromDiscord<demotomohiro> sent a long message, see http://ix.io/3PNa
20:33:31FromDiscord<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:52FromDiscord<jmgomez> In reply to @haxscramper "IMO compiler should just": it would be useful for sure
20:38:09FromDiscord<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:09FromDiscord<TurtleP> sent a code paste, see https://play.nim-lang.org/#ix=3PNh
20:49:27FromDiscord<TurtleP> I mean I can tell why it's erroring, but not sure how it happened
20:53:32FromDiscord<demotomohiro> Did you tried to clear nimcache?
20:55:58FromDiscord<TurtleP> where is that again?
20:59:19FromDiscord<TurtleP> ah, that fixed it! thanks @demotomohiro
21:29:40FromDiscord<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:20FromDiscord<Ruby576> Can i ask?
21:45:39FromDiscord<SoicBR> you literally just did that
21:45:45FromDiscord<Ruby576> Lmao
21:45:46FromDiscord<SoicBR> but yes
21:45:57PMunchJust ask away :)
21:46:27FromDiscord<Ruby576> sent a long message, see http://ix.io/3PNs
21:46:33PMunchBy 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:12PMunch@Ruby576, I'm not sure I see what's opposite here?
21:47:54PMunch`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:51FromDiscord<Ruby576> Ohhhh
21:53:51FromDiscord<Ruby576> Also where do you type from
21:54:00FromDiscord<SoicBR> sent a code paste, see https://play.nim-lang.org/#ix=3PNw
21:54:11FromDiscord<SoicBR> In reply to @Ruby576 "Also where do you": IRC
21:54:41FromDiscord<Ruby576> What is that
21:54:57FromDiscord<SoicBR> Internet Relay Chat
21:55:10FromDiscord<SoicBR> it's a chatting system or something, I'm not familiar with it, I just know it exists
21:55:16FromDiscord<Ruby576> Oo oke
21:59:51FromDiscord<auxym> In reply to @SoicBR "Can someone explain to": I think you have to use waitFor instead of await
22:00:42FromDiscord<auxym> funny I was just reading https://github.com/nim-lang/RFCs/issues/295
22:01:22PMunchOh yeah sorry, I'm on IRc
22:01:30PMunchIt's an old text-based chat thingy
22:02:03FromDiscord<Ruby576> Is it on browser or need to download?
22:02:21FromDiscord<SoicBR> Both AFAIK
22:02:29FromDiscord<SoicBR> You can make your own IRC client if you want
22:02:33PMunch@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:39FromDiscord<Ruby576> Ooo nicee
22:02:50PMunchYeah there are IRC web-clients, but most people download one
22:03:02PMunchThe protocol is also pretty simple, so very easy to write bots or your own client
22:03:19FromDiscord<SoicBR> In reply to @auxym "I think you have": It worked
22:03:48FromDiscord<SoicBR> thank you
22:03:58FromDiscord<SoicBR> In reply to @PMunch "<@290982446445625365>, you're trying to": thank you too
22:04:16FromDiscord<SoicBR> now it at least compiles
22:08:20FromDiscord<Ruby576> In reply to @PMunch "The protocol is also": Why are you using irc instead of just discord?
22:11:59PMunchLot simpler protocol, not locked into Discord, I've been using it since Discord became a thing
22:12:43PMunchAnd I just like the IRC clients better, no nonsense fluff, just straight to the point chat application
22:13:14PMunchWith loooong scrollback. I can still see your "Can i ask?" message only about halfway up my screen
22:13:30FromDiscord<Ruby576> Wow
22:14:45FromDiscord<Ruby576> Can you do dms?
22:14:52FromDiscord<Ruby576> With this
22:16:12nrds<Prestige99> You can with irc to irc but idk about discord <-> irc
22:21:29PMunchYup, 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:54FromDiscord<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:01arkanoidAm I the only one who vscode nim extensions stops working for unknown reasons?
23:07:31FromDiscord<huantian> Yeah it does that
23:10:55*jjido joined #nim
23:11:40FromDiscord<ynfle (ynfle)> Nimions↵(@VVX7)
23:14:30FromDiscord<VVX7> good bot
23:18:43FromDiscord<ynfle> Thanks
23:21:00FromDiscord<morgan> sent a long message, see http://ix.io/3PNQ
23:21:48FromDiscord<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:03FromDiscord<morgan> (edit) "few" => "couple"
23:23:42FromDiscord<Elegantbeef> Frosty/Flatty exist
23:24:17FromDiscord<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:37FromDiscord<morgan> ah cool
23:24:58FromDiscord<Elegantbeef> https://github.com/disruptek/frosty it supports binary serialization out of the box
23:28:32FromDiscord<morgan> cool
23:28:33FromDiscord<morgan> thanks
23:33:28arkanoidhow 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:30FromDiscord<auxym> not sure if there's library support for async sqlite atm
23:53:12*jmdaemon joined #nim
23:54:38FromDiscord<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:23arkanoidtreeform, what? I know you have done a postgres async library, but I don't understand your answer
23:56:29arkanoidI mean
23:56:58arkanoidrunning a query on a sqlite db requires I/O, doesn't it make an async candidate?
23:57:46arkanoidthere's also this: https://www.sqlite.org/asyncvfs.html