00:01:53 | * | TechAspirer is now known as kayabaNerve |
00:08:21 | * | src quit (Quit: Leaving) |
00:30:06 | * | Vladar quit (Quit: Leaving) |
00:33:16 | FromDiscord | <pyautogui> Is the {.extern.} pragma supposed to work with functions that take typeclass arguments? |
00:34:55 | FromDiscord | <Elegantbeef> Probably not since you cannot know the code required |
01:44:55 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3FP8 |
01:45:56 | FromDiscord | <Elegantbeef> I mean it starts showing it but gives up |
01:45:58 | FromDiscord | <Elegantbeef> Which is odd |
01:46:07 | FromDiscord | <impbox [ftsf]> yeah. mid line |
01:46:09 | * | vicfred quit (Quit: Leaving) |
01:46:53 | FromDiscord | <Elegantbeef> There might be an existent issue, you're not using MT are you? |
01:47:18 | FromDiscord | <lenis> sent a code paste, see https://play.nim-lang.org/#ix=3FP9 |
01:47:37 | FromDiscord | <Elegantbeef> Indeed hell on earth π |
01:49:32 | FromDiscord | <impbox [ftsf]> In reply to @Elegantbeef "There might be an": threads are enabled though i don't think i have them doing anything |
01:49:45 | FromDiscord | <tsoj> sent a code paste, see https://play.nim-lang.org/#ix=3FPb |
01:51:30 | FromDiscord | <codic> do you have a very old version perhaps? |
01:52:02 | FromDiscord | <tsoj> Doesn't seem so: `nimble v0.13.1 compiled at 2021-10-19 01:07:39` |
01:59:04 | FromDiscord | <lenis> maybe an issue with your nible cache or something |
02:00:05 | FromDiscord | <gdquest> Is there a function to do regex replace by calling a function on each match like in Python? Or anything that would make it convenient to process each match? β΅I have code in which I need to process every match to insert extra HTML before it.β΅I'm using `re.findBounds()` right now as an alternative to just find each portion of the string and process it. Works well but it's not as convenient |
02:00:54 | FromDiscord | <gdquest> I couldn't find that in the standard lib, so if I'm not missing anything, I was wondering if someone had that kind of code out there. |
02:01:59 | FromDiscord | <impbox [ftsf]> sent a code paste, see https://play.nim-lang.org/#ix=3FPe |
02:02:02 | FromDiscord | <impbox [ftsf]> I seem to recall you showing something similar beef? |
02:03:44 | FromDiscord | <lenis> In reply to @gdquest "Is there a function": you can process each match using findAll, but you cant modify the string in the iterator |
02:04:18 | FromDiscord | <lenis> https://nim-lang.org/docs/re.html#findAll.i%2Cstring%2CRegex%2Cint |
02:05:56 | FromDiscord | <lenis> hmm, that isnt really useful for your usecase I think |
02:07:26 | FromDiscord | <lenis> im guessing you could take inspirtation from https://github.com/nim-lang/Nim/blob/version-1-6/lib/impure/re.nim#L447 |
02:08:15 | FromDiscord | <gdquest> In reply to @lenis "you can process each": Thanks, yup saw that. That'd work if it returned the bounds but there it doesn't. |
02:08:34 | FromDiscord | <gdquest> And yeah the code I have is very similar |
02:08:37 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FPf |
02:09:15 | FromDiscord | <gdquest> I keep forgetting to look at the std's source code, that's a great resource to learn, thanks! |
02:09:55 | FromDiscord | <lenis> You're welcome π
|
02:10:03 | FromDiscord | <lenis> yeah the std source is pretty useful |
02:10:09 | FromDiscord | <lenis> and the nim docs link to the source for each function |
02:10:18 | FromDiscord | <impbox [ftsf]> @ElegantBeef thanks! |
02:10:44 | FromDiscord | <lenis> https://i.gyazo.com/f056d7f255819d771362b7f6984bb08a.png |
02:10:52 | FromDiscord | <Elegantbeef> you can even drop the `@` if you want |
02:11:03 | FromDiscord | <lenis> https://i.gyazo.com/f056d7f255819d771362b7f6984bb08a.png |
02:12:10 | FromDiscord | <IsaacPaul> @gdquest β΅Use split, then recombine them with the replacement string inbetween? I'm not sure what you mean by bounds tho.. |
02:12:15 | FromDiscord | <lenis> In reply to @lenis "and the nim docs": Its a useful life hack. @gdquest |
02:16:14 | FromDiscord | <gdquest> In reply to @IsaacPaul "<@!202865241971884032> Use split,": Split doesn't work in this case because it doesn't return the separating regex. The things I'm looking to replace are strings like ``SomeClassName`` |
02:16:19 | FromDiscord | <gdquest> (edit) "``SomeClassName``" => "`\`SomeClassName\``" |
02:16:28 | FromDiscord | <gdquest> (edit) "`\`SomeClassName\``" => "\`SomeClassName\`" |
02:16:57 | FromDiscord | <gdquest> findBounds returns the start and end index of a found pattern based on a regexp |
02:17:16 | FromDiscord | <gdquest> That's what I'm calling bounds - it allows me to capture the string and feed it to a function |
02:23:37 | * | krux02 quit (Remote host closed the connection) |
02:24:05 | FromDiscord | <IsaacPaul> ah ya that makes sense |
02:35:41 | FromDiscord | <evoalg> @gdquest sorry I'm wondering why you don't use `replace` from the re or regex modules? |
02:41:10 | * | neurocyte0132889 quit (Ping timeout: 260 seconds) |
02:44:31 | * | tiorock joined #nim |
02:44:31 | * | tiorock quit (Changing host) |
02:44:31 | * | tiorock joined #nim |
02:44:31 | * | rockcavera quit (Killed (platinum.libera.chat (Nickname regained by services))) |
02:44:31 | * | tiorock is now known as rockcavera |
03:01:15 | * | rockcavera quit (Remote host closed the connection) |
03:20:06 | * | arkurious quit (Quit: Leaving) |
03:32:00 | FromDiscord | <Lincent> Hello |
03:32:17 | FromDiscord | <evoalg> Hi |
03:32:28 | FromDiscord | <Lincent> nim is a cool lang |
03:32:39 | FromDiscord | <Lincent> I found it on wikipedia lol |
03:33:20 | FromDiscord | <Elegantbeef> It's indeed |
03:33:37 | FromDiscord | <Elegantbeef> Any questions?! |
03:33:47 | FromDiscord | <Elegantbeef> I'm sure evo will be more than happy to answer them |
03:33:50 | FromDiscord | <Elegantbeef> π |
03:33:52 | FromDiscord | <Lincent> would nim be a hight tier language or a mid tier? |
03:34:05 | FromDiscord | <Lincent> or maybe both concurrently? |
03:35:05 | FromDiscord | <Elegantbeef> Well it can be used like a fancy C, but can also be used as a automatically memory managed language |
03:35:37 | FromDiscord | <Elegantbeef> Like evo here is relatively new to Nim from python and probably doesnt find it that confusing |
03:37:03 | FromDiscord | <Lincent> likewise |
03:37:11 | FromDiscord | <Lincent> I noticed it is very similar to python |
03:37:16 | FromDiscord | <Lincent> but also C |
03:37:32 | FromDiscord | <evoalg> hehe yes it can be used as a high level language like python, so you can get into the nitty gritty behind the scenes stuff if you want to or need to |
03:37:58 | FromDiscord | <evoalg> I mean but you can... |
03:39:00 | FromDiscord | <evoalg> I tend to use it it high level and nothing fancy (as I don't know much) but it still runs at C-like-speed |
03:39:47 | FromDiscord | <evoalg> I had to (and still am having to) get around the typed vars as I'm not used to that |
03:40:08 | FromDiscord | <Lincent> yea that's a very C thing lol |
03:40:26 | FromDiscord | <Lincent> I wonder does it have something like an auto type from C++? |
03:40:36 | FromDiscord | <Elegantbeef> Nim defaults to inferred types |
03:40:42 | FromDiscord | <Elegantbeef> `var a = 300` |
03:40:50 | FromDiscord | <Lincent> ok cool |
03:40:52 | FromDiscord | <Elegantbeef> We only use type annotations for proc defs typically |
03:41:29 | FromDiscord | <Lincent> seems straightforward |
03:41:55 | FromDiscord | <Lincent> I think my goal will be to do something with nimbers in nim |
03:42:02 | FromDiscord | <Lincent> just because :D |
03:50:48 | FromDiscord | <evoalg> sent a long message, see http://ix.io/3FPx |
03:52:43 | FromDiscord | <Elegantbeef> evolag leaves out that there's also me which is neither knowledgeable or shaping anything π |
03:52:56 | FromDiscord | <evoalg> not true! |
03:53:14 | FromDiscord | <Lincent> you've been very helpful so far, thanks |
03:53:31 | FromDiscord | <Lincent> there's 2k people on this server |
03:53:47 | FromDiscord | <Lincent> I'm sure one if I ask might answer if I have a question |
03:54:02 | FromDiscord | <Lincent> and there's always github and google |
03:55:13 | FromDiscord | <evoalg> I can tell you already know more than me about programming in general ... I think you'll be fine |
04:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
04:06:32 | * | supakeen joined #nim |
05:36:49 | FromDiscord | <lenis> In reply to @evoalg "Personally, nim's been a": some of the docs are lacking. memory management, dll generation and threading could use more info |
05:37:08 | FromDiscord | <lenis> you have to resort to the blog or forum posts for some things |
05:39:50 | FromDiscord | <evoalg> In reply to @lenis "you have to resort": Thank you. Oh and I wanted to ask, when you were testing different gc's for mem usage, did you do that with some sort of debugger / profiler? |
05:41:49 | FromDiscord | <lenis> No i used Araq's test from his ORC post https://nim-lang.org/blog/2020/12/08/introducing-orc.htmlβ΅β΅Later i switched to using benchy to avoid the overhead of the async http server which has cycles. |
05:42:03 | FromDiscord | <evoalg> nice |
05:42:37 | FromDiscord | <lenis> I still dont fully understand why ORC was so much slower in my final test case, I need to do some further research.β΅I think it has to do with the number of ref object allocations but im not certain |
05:43:12 | FromDiscord | <lenis> just goes to show that you should write your nim code, and then benchmark it with several GCs to figure out which one is best for your code |
05:43:49 | FromDiscord | <lenis> the biggest advantage of ORC is that it has the cycles collector optimization which makes it the only viable option if sub 100ms latency is important |
05:44:35 | FromDiscord | <lenis> and for most use-cases ORC performs similarly to refc |
05:45:50 | FromDiscord | <evoalg> Is refc the default gc in nim 1.6? I've noticed when doing different programs, sometimes orc is good and sometimes arc is good and sometimes default |
05:47:02 | FromDiscord | <lenis> I think refc is still the default. |
05:47:10 | FromDiscord | <evoalg> Also for some things `nim -d:danger --passC:-flto c foo.nim` is the fastest |
05:47:23 | FromDiscord | <lenis> refc has surprisingly good latency and trhougput as long as the cycle collector doesnt run |
05:49:14 | FromDiscord | <lenis> lto only makes sense when your application will always (or almost always) be used in the same way |
05:49:31 | FromDiscord | <evoalg> ... but you may know that I don't know what I'm talking about ... I don't know what latency and throughput is? ... should I be looking at more than the speed of the executable to run? |
05:50:22 | FromDiscord | <Elegantbeef> Latency and throughput are two marks you can use to bench long running programs |
05:50:44 | FromDiscord | <lenis> throughput is simply how much work your application can perform in a given amount of time.β΅For a webserver that's requests per second. for a game that's frames per second, etc. |
05:50:56 | FromDiscord | <Elegantbeef> Latency is "how long inbetween messages" and throughput is the overall "how many messages per second" |
05:51:15 | FromDiscord | <lenis> ^^^ |
05:51:38 | FromDiscord | <Elegantbeef> So with ORC you get lower latency but you dont get as much throughput cause the cycle collector takes some time |
05:51:47 | FromDiscord | <lenis> latency in the context of GC means how long your request (for web) or frame (for games) will take in a worse-case scenario during a GC cycle |
05:52:00 | FromDiscord | <lenis> (edit) "latency in the context of GC ... means" added "latency" |
05:52:25 | FromDiscord | <lenis> (edit) "games)" => "games/UI)" |
05:52:37 | FromDiscord | <evoalg> bad latency should decrease throughput though? |
05:52:54 | FromDiscord | <lenis> that depends |
05:53:19 | FromDiscord | <lenis> traditional GCs like markAndSweep defer all deallocation work so it can do it all at once more efficiently |
05:54:00 | FromDiscord | <lenis> this means that the latency is greater, because your application is frozen while doing garbage collection, but the overall time spent deallocating memory is less than when doing reference counting |
05:54:10 | FromDiscord | <lenis> at least in theory, in practice it's more complicated |
05:54:20 | FromDiscord | <evoalg> ahhh ok! |
05:54:33 | FromDiscord | <lenis> ORC/ARC are well optimized so sometimes they can actually have better througput than markAndSweep |
05:55:40 | FromDiscord | <lenis> thats mainly because ARC/ORC only manage memory that is being mutated. where as markAndSweep has to check the entire heap |
05:55:41 | FromDiscord | <evoalg> ok ... as usual, things are more complex that I first thought π |
05:55:54 | FromDiscord | <evoalg> (edit) "that" => "than" |
05:56:07 | FromDiscord | <Elegantbeef> Well in your case fast is fast π |
05:56:35 | FromDiscord | <evoalg> lol ... no I actually understand the diff between latency and throughput now! |
05:56:56 | FromDiscord | <evoalg> (but really I just care about fast, you're right) |
05:57:13 | FromDiscord | <lenis> yeah |
05:57:31 | FromDiscord | <lenis> in summary, latency is how responsive your application is, throughput is how fast your application is |
05:57:44 | FromDiscord | <lenis> latency isnt always important though |
05:58:10 | FromDiscord | <lenis> i mean, professionally I only use Java. So I ought to know. |
05:58:22 | FromDiscord | <Elegantbeef> Lol |
05:58:43 | FromDiscord | <lenis> Java actually has surprisingly good throughput, but worst-in-class latency |
05:58:55 | FromDiscord | <Elegantbeef> Sorry i didnt get that the world stopped |
05:59:15 | FromDiscord | <evoalg> makes sense ... I think people were battling with this stuff with voip when it first came out, as bad lags are unacceptable even if they only happen every now & then |
05:59:51 | FromDiscord | <lenis> exactly |
06:00:19 | FromDiscord | <lenis> VOIP, video players, UIs, etc. all require low latency because any "lag spike" is unacceptable |
06:00:51 | FromDiscord | <lenis> pursists will tell you that if latency matters at all you should allocate memory manually |
06:01:04 | FromDiscord | <lenis> but these guys just like to spent all their time in memory profilers |
06:01:18 | FromDiscord | <lenis> they're like people who make their own pasta |
06:01:26 | FromDiscord | <Elegantbeef> Whereas Email servers and webhooks can handle a few seconds of latency and throughput is actually better π |
06:01:50 | FromDiscord | <lenis> yes |
06:02:08 | FromDiscord | <lenis> seconds is rare though |
06:03:17 | FromDiscord | <Elegantbeef> Hey exaggeration never killed anyone, i swear i thought the car was kilometres away |
06:03:18 | FromDiscord | <lenis> usually GC cycles take somewhere in the neighborhood of 30-500ms |
06:03:31 | FromDiscord | <lenis> nim gives you plenty of options |
06:03:38 | FromDiscord | <lenis> just not generational garbage collectors |
06:04:20 | FromDiscord | <evoalg> nice |
06:04:41 | FromDiscord | <Elegantbeef> Worst comes to worst you have `alloc` and `dealloc` π |
06:04:55 | FromDiscord | <lenis> blasphemy |
06:05:47 | FromDiscord | <Elegantbeef> Hey it's a system language afterall, what else are you supposed to do with those procs?! |
06:06:11 | FromDiscord | <lenis> set them to discard |
06:06:17 | FromDiscord | <lenis> π |
06:06:45 | FromDiscord | <lenis> no im kidding. alloc/dealloc has its use-cases |
06:07:19 | FromDiscord | <lenis> my favorite thing coming from Java in Nim though, is that you can allocate objects on the stack |
06:07:26 | FromDiscord | <lenis> in Java all objects are ref objects |
06:07:46 | FromDiscord | <lenis> only primitives are allocated on the stack |
06:07:54 | FromDiscord | <Rika> is refc not a generational? |
06:08:26 | FromDiscord | <Elegantbeef> Yea that's one thing i laugh at java about |
06:09:03 | FromDiscord | <Rika> In reply to @lenis "in Java all objects": its not even a jvm limitation |
06:09:16 | FromDiscord | <lenis> No. refc is deferred reference counting + markAndSweep cycle collector |
06:09:17 | FromDiscord | <Rika> java just decided that "ok lets fuck with all our future users" /s |
06:09:30 | FromDiscord | <Elegantbeef> Want to make a game with your own vector type, die to lack of stack allocated types! |
06:12:49 | FromDiscord | <lenis> sent a long message, see http://ix.io/3FPP |
06:14:00 | FromDiscord | <lenis> refc is faster in theory but when a cheap reference counting cycle doesnt clear enough memory refc runs a full markAndSweep cycle which means that sometimes it does double work |
06:14:25 | FromDiscord | <Rika> yeah |
06:14:46 | FromDiscord | <Rika> orc and arc should be advertised less as "better" and more as it really is, deterministic, i guess |
06:15:01 | FromDiscord | <Elegantbeef> Well orc isnt deterministic |
06:15:11 | FromDiscord | <Rika> it's "kinda" deterministic |
06:15:23 | FromDiscord | <Rika> as araq says |
06:15:38 | FromDiscord | <lenis> a generational gc however (like, Java's G1 GC) works by keeping a counter with each object in memory that is incremented whenever it "survives" a GC cycle.β΅After a certain number of survived cycles, the memory is concidered old and moved to a seperate area in the heap that is checked much less frequently |
06:16:56 | FromDiscord | <lenis> the idea of a generational GC is that most memory is short-lived. and the memory that isn't short lived is unlikely to be deallocacted. so the GC can skip tracing the old memory most of the time |
06:17:18 | FromDiscord | <lenis> where as something like markAndSweep scans the entire heap every cycle |
06:17:31 | FromDiscord | <lenis> (edit) "scans" => "traces" |
06:18:09 | FromDiscord | <Rika> boehm is generational |
06:18:36 | FromDiscord | <lenis> ah. i hadnt looked into boehm because it requires a dll |
06:19:10 | FromDiscord | <Rika> time to check if it works well for you(r use case) π |
06:19:59 | FromDiscord | <lenis> maybe another day |
06:20:07 | FromDiscord | <lenis> I have a meeting in 2 hours and I have yet to go to sleep |
06:20:40 | FromDiscord | <Rika> see you then, get ready for that meeting |
06:32:04 | FromDiscord | <haxscramper> arkanoid\:Nimtral that beef linked is just a dependency of haxdoc, and yes, haxdoc is able to do this, but I need to fix up the CI and installation in order for it to be at least somewhat useful, and before that I want to get some other things finished, so in short - no, there are no tools that can do things like that |
06:32:17 | FromDiscord | <haxscramper> And most likely haxdoc will target nimskull anyway |
06:33:37 | FromDiscord | <haxscramper> Even though for now it is just a cloud of vaporware with nothing that can be considered folly finished |
06:35:10 | * | Guest9 joined #nim |
06:35:51 | * | Raflemakt quit (Ping timeout: 264 seconds) |
06:37:11 | * | Guest9 quit (Client Quit) |
06:47:27 | FromDiscord | <evoalg> @ElegantBeef I just realized you put a const in a proc (in your enum example) ... for some reason I never thought about ever doing that |
06:48:11 | FromDiscord | <Elegantbeef> Well there's a reason why you'd want to π |
06:48:44 | FromDiscord | <evoalg> if some can be determined at compile time then it should be a const? |
06:49:26 | FromDiscord | <Elegantbeef> Yep |
06:49:47 | FromDiscord | <Elegantbeef> You should go `const` -\> `let` -\> `var` |
06:50:01 | FromDiscord | <evoalg> it wasn't clear to me, as that proc is some sort of generic, that's called by another proc (am I right about that?) |
06:50:03 | FromDiscord | <Elegantbeef> The thing is making the mutability is little as possible to remove any error |
06:50:28 | FromDiscord | <Elegantbeef> Nah a generic is instantiated replacing the parameters with those passed |
06:50:38 | FromDiscord | <Elegantbeef> So in this case it replaces `T` with `Weekdays` |
06:50:53 | FromDiscord | <Elegantbeef> You can even manually do that and you'd see the same results |
06:51:18 | FromDiscord | <evoalg> and this is done at CT? |
06:51:48 | FromDiscord | <Rika> yes |
06:51:49 | FromDiscord | <Elegantbeef> Yes |
06:52:07 | FromDiscord | <Elegantbeef> When you call a generic procedure at the callsite if it hasnt been called before will instantiate a new procedure |
06:52:18 | FromDiscord | <Elegantbeef> Otherwise it refers to the old one |
06:52:31 | FromDiscord | <evoalg> ahhh ok |
06:55:23 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=t%20wr you can run this to follow the CT logic |
06:57:30 | FromDiscord | <Elegantbeef> ... ix gave me a bad link |
06:58:34 | FromDiscord | <Elegantbeef> Hopefully this one is better https://play.nim-lang.org/#ix=3FPX |
06:59:24 | FromDiscord | <evoalg> I was wondering why you gave me that hehe |
07:05:53 | FromDiscord | <evoalg> that's a really nice example ... it shows me that the proc that calls it makes it instantiated, even if the proc that calls it hasn't been called yet ... and I learned about "static: echo" and the error pragma ... 3 birds, one stone |
07:08:16 | FromDiscord | <Elegantbeef> lol |
07:08:38 | FromDiscord | <Elegantbeef> `static: echo` isnt special you can use static for most nim code, whenever you want to run code that doesnt rely on C interop at compile time π |
07:09:33 | FromDiscord | <evoalg> what sort of things besides echo doesn't require C interop? |
07:09:46 | FromDiscord | <Elegantbeef> Pure Nim code π |
07:10:24 | FromDiscord | <Elegantbeef> For instance `Zippy` and `supersnappy` both run at compile time, one is file archiver, and the other a compression algorithim |
07:10:25 | FromDiscord | <evoalg> All of that example you gave me was pure nim? ... well I mean it was written in nim |
07:11:01 | FromDiscord | <Elegantbeef> Yes |
07:11:18 | FromDiscord | <Elegantbeef> https://github.com/guzba/zippy for reference |
07:12:42 | FromDiscord | <evoalg> So if I had a program to recursively work out the factorial of 30, and I make it all run in compile time? |
07:13:07 | FromDiscord | <evoalg> (sorry it's a new concept for me) |
07:14:03 | FromDiscord | <Elegantbeef> You can do it, it might be slow or hit the stack but you can |
07:14:16 | FromDiscord | <Elegantbeef> The funny thing is you can use Nim code both at CT and run time without any magic |
07:16:14 | FromDiscord | <evoalg> my factorial example is a silly one, but for interest, how would I tell it to do it all at CT? when I do `static: proc fact(...` and `static: echo fact(30)` or I bet I can pass a compile fag ... and I bet there's a proc pragma too |
07:16:23 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FQ6 |
07:16:31 | FromDiscord | <evoalg> ooooooo |
07:16:45 | FromDiscord | <Elegantbeef> `static` is how you'd tell it to do it at `CT` you can do `static: for x in 0..10: echo x` if you wanted |
07:17:29 | FromDiscord | <Rika> ~~also `const a = ...` works differently from `let a = static: ...`~~ |
07:18:45 | FromDiscord | <evoalg> In reply to @Rika "~~also `const a =": what does that strike-through font mean? |
07:19:45 | * | Raflemakt joined #nim |
07:19:54 | FromDiscord | <Elegantbeef> It means the there is a difference between const and let |
07:20:05 | FromDiscord | <Rika> a difference between const and let static |
07:20:19 | FromDiscord | <Rika> some people might think theyre basically the same |
07:21:02 | FromDiscord | <evoalg> ok I think I get why ... makes sense ... but your sentence had a strike-through font style and I'm wonder why you used that? |
07:21:13 | FromDiscord | <Rika> i just often do that |
07:21:36 | FromDiscord | <evoalg> hehe young people! |
07:21:51 | FromDiscord | <evoalg> I can never understand them |
07:22:04 | FromDiscord | <Elegantbeef> He says praising me whenever I explain stuff |
07:22:21 | FromDiscord | <Rika> beef isnt much older than me apparently |
07:22:47 | FromDiscord | <evoalg> beef is old in spirit, everyone knows that |
07:22:59 | FromDiscord | <Rika> i would have thought he was older than you |
07:23:15 | FromDiscord | <evoalg> mentally I think so |
07:24:56 | FromDiscord | <Elegantbeef> Aw fuck am i already senile, i knew something was up |
07:25:12 | FromDiscord | <Rika> dude you say that with those spelling skills? |
07:26:10 | FromDiscord | <Elegantbeef> Sorry rika i never had to learn to spell since i had spell check |
07:26:27 | FromDiscord | <Rika> even then people usually learned the spelling once they use spell check |
07:27:14 | FromDiscord | <Elegantbeef> Why would i have to i just get close enough and it takes care of it, i write fast and proofread faster |
07:27:38 | FromDiscord | <Rika> you waste time every next occurrence of a misspell |
07:27:50 | FromDiscord | <Rika> just realised i used two commonly misspelled words lmao |
07:27:57 | FromDiscord | <Elegantbeef> That implies i always correct it |
07:28:12 | FromDiscord | <Rika> true, i doubt you ever |
07:28:15 | FromDiscord | <Rika> π |
07:28:15 | FromDiscord | <Elegantbeef> I'm the epitome of a dumb dumb |
07:36:23 | FromDiscord | <evoalg> so not only does the generic get instantiated at CT on first call, but the calling site is replaced inline, right? |
07:36:57 | FromDiscord | <Elegantbeef> Nope it just gets instantiated |
07:37:20 | FromDiscord | <evoalg> ahhh is it only templates that are inlined? |
07:38:24 | FromDiscord | <Elegantbeef> Templates/macros are inlined but also procs can be if the C compiler says "yep i should inline this" |
07:38:33 | FromDiscord | <Elegantbeef> templates/macros are inlined 100% of the time |
07:39:21 | FromDiscord | <evoalg> nice, thank you for being so easy to understand |
07:40:13 | FromDiscord | <Elegantbeef> It's the senility much closer to your mental age π |
07:40:17 | FromDiscord | <Rika> how do you have so much time |
07:40:48 | FromDiscord | <Elegantbeef> Havent we been over this? |
07:41:09 | FromDiscord | <evoalg> who? ... me? I don't have much time left as you (thanks for reminding me) |
07:41:22 | FromDiscord | <Rika> oh are you sure about that |
07:41:29 | FromDiscord | <Rika> for all ya know i could be deathly sick |
07:41:32 | FromDiscord | <Elegantbeef> Jeez so rude rika |
07:41:38 | FromDiscord | <Elegantbeef> We could only hope |
07:41:45 | FromDiscord | <evoalg> then I'd feel pretty bad right now |
07:41:46 | FromDiscord | <Rika> that i die first? |
07:42:06 | FromDiscord | <evoalg> not the first time I put my foot in it |
07:42:14 | FromDiscord | <Rika> ( i dont actually know what you mean by hope ) |
07:42:25 | FromDiscord | <Elegantbeef> I was jokingly saying it'd be good rika |
07:42:44 | FromDiscord | <Rika> thats exactly what im asking, wtf do you refer to when you say "it" |
07:43:30 | FromDiscord | <Rika> i should probably get to converting my processing script into nim/pixie or something ig |
07:43:49 | FromDiscord | <Elegantbeef> What's the processing code do? |
07:43:56 | FromDiscord | <Rika> uh display shit |
07:44:01 | FromDiscord | <Rika> what else does processing code do |
07:44:09 | FromDiscord | <Elegantbeef> Well ii more mean https://github.com/GabrielLasso/drawim does this work for you |
07:44:18 | FromDiscord | <Rika> i know |
07:44:31 | FromDiscord | <Rika> i need stroke weight hto |
07:44:33 | FromDiscord | <Rika> (edit) "hto" => "tho" |
07:46:54 | FromDiscord | <evoalg> With those generics you did for enums, will a different proc be created for each enum type that calls it? |
07:47:02 | FromDiscord | <Elegantbeef> Yep |
07:47:08 | FromDiscord | <Elegantbeef> That's how generics work |
07:47:16 | FromDiscord | <evoalg> gotcha ok |
07:47:25 | FromDiscord | <Elegantbeef> They take the types replace them then instantiate a new proc |
07:47:56 | FromDiscord | <Elegantbeef> There is a bit more logic in the back than that but it's the gis |
07:47:57 | FromDiscord | <evoalg> ahhh cheers |
07:48:33 | FromDiscord | <evoalg> no there isn't - I know everything now! |
07:55:13 | * | xet7 quit (Remote host closed the connection) |
07:56:14 | * | xet7 joined #nim |
08:08:16 | * | xet7 quit (Ping timeout: 245 seconds) |
08:10:03 | * | LyndsySimon quit (Ping timeout: 264 seconds) |
08:14:29 | * | LyndsySimon joined #nim |
08:17:06 | FromDiscord | <lenis> In reply to @Elegantbeef "https://github.com/guzba/zippy for reference": someone made a pure nim implementation of zip? nice |
08:21:02 | * | xet7 joined #nim |
08:30:22 | FromDiscord | <claude> was it always allowed for `foo()` in `type T = foo()` to return an nkObjectTy? i'm guessing it was since it the implementation looks like it allows it, but when i tried a long time ago it didn't work |
08:32:13 | FromDiscord | <claude> apparently it's not allowed, but nkEnumTy is |
08:46:59 | * | lumo_e joined #nim |
08:50:51 | * | PMunch joined #nim |
08:59:21 | * | Guest9 joined #nim |
08:59:45 | * | Guest9 quit (Client Quit) |
09:23:45 | * | Raflemakt quit (Ping timeout: 256 seconds) |
09:26:11 | * | LyndsySimon quit (Ping timeout: 245 seconds) |
09:26:13 | * | xet7 quit (Quit: Leaving) |
09:26:37 | * | xet7 joined #nim |
09:27:50 | * | LyndsySimon joined #nim |
09:29:09 | * | xet7 quit (Remote host closed the connection) |
09:29:33 | * | xet7 joined #nim |
09:30:26 | * | dtomato joined #nim |
09:42:34 | * | Raflemakt joined #nim |
10:03:43 | PMunch | Hmm, the "Which of these features do you use" section has an odd choice of options |
10:04:15 | PMunch | I mean I know that Nim has an effect system, I don't really use it for anything in particular, but I wouldn't say I don't have any need for it |
10:04:34 | PMunch | I'm just not sure what I'd use it for |
10:12:27 | * | lumo_e quit (Ping timeout: 264 seconds) |
10:20:20 | * | dv^_^ quit (Quit: dv^_^) |
10:22:48 | * | dv^_^ joined #nim |
10:25:23 | * | dv^_^ quit (Client Quit) |
10:26:22 | * | dv^_^ joined #nim |
10:41:53 | FromDiscord | <tandy> if i want to get the nim code for a certain 2d seq |
10:42:05 | FromDiscord | <tandy> can i just do `dumpAst:`? |
10:43:02 | FromDiscord | <tandy> dumpAstGen\ |
10:45:00 | FromDiscord | <Rika> Hm? What do you mean? |
10:45:08 | FromDiscord | <Rika> That will return AST and not code |
10:55:35 | FromDiscord | <tandy> tru |
10:55:41 | FromDiscord | <tandy> nvm i jst handwrote the 2d array |
10:56:14 | FromDiscord | <tandy> so i have a seq[seq[GridSquare]], but when i compare two of them to check for equality, it doesnt work |
10:56:36 | FromDiscord | <tandy> sent a code paste, see https://play.nim-lang.org/#ix=3FQX |
10:57:18 | FromDiscord | <Rika> Doesnβt work like? |
10:57:41 | FromDiscord | <tandy> do i need another function to compare `seq[seq[GridSquare]]`? |
10:58:06 | FromDiscord | <Rika> I donβt think so |
10:58:26 | FromDiscord | <Rika> Are you getting an error or is it just not behaving as expected |
10:58:42 | FromDiscord | <Rika> Think you might need an == for seq in seq but I donβt remember |
10:58:51 | FromDiscord | <tandy> o wait i think i know what i need to doβ΅(@Rika) |
10:58:59 | FromDiscord | <tandy> il try that and come back |
10:59:51 | FromDiscord | <tandy> ok i fixed it \:))) |
11:00:52 | FromDiscord | <Marisol> I saw func keyword is just a macro for proc no side effects... but when to use func and when to use proc? |
11:01:07 | FromDiscord | <Rika> Not a macro |
11:01:23 | FromDiscord | <Rika> Use func if you want a guarantee of no side effects |
11:01:26 | FromDiscord | <Rika> Otherwise use proc |
11:08:20 | FromDiscord | <Marisol> Ah ok |
11:10:03 | * | Raflemakt quit (Ping timeout: 264 seconds) |
11:19:52 | * | Raflemakt joined #nim |
11:25:54 | FromDiscord | <evoalg> func is just an alias for proc with no side effects (if I've got that right), and the idea is that if you are intending to produce no side effects, use func as good programming practice, so that if you did create side effects then it's a bug and the compiler will tell you about it when you compile (so errors can be caught early). Side effects are things like IO (but I'm not sure what else) |
11:28:05 | FromDiscord | <Rika> Anything relating to βmodifying anything else other than inputs and outputs of the functionβ |
11:28:13 | FromDiscord | <Rika> IO, global state, etc |
11:28:43 | FromDiscord | <Rika> Actually not just modifying |
11:28:59 | FromDiscord | <Rika> βBeing dependent on anything elseβ¦β is more accurate |
11:29:26 | FromDiscord | <Rika> So yeah thereβs a lot of limitation unless you declare a lot of things as parameters |
11:29:42 | FromDiscord | <evoalg> thank you! |
11:30:28 | FromDiscord | <Rika> If you know math in a higher than elementary context (I guess?) then it is the same idea |
11:35:45 | qwr | IO can be considered modifing global state (ie external world being part of global state), so the func is proc that do not change global state |
11:36:11 | qwr | but modification of var arguments is allowed |
11:38:46 | qwr | as nim views var arguments as part of "return value", a bit like returning multiple values in some other languages |
11:43:16 | PMunch | You can't read global state either |
11:43:39 | PMunch | Because that would mean that this is possible myFunc(100) != myFunc(100) |
11:44:15 | PMunch | Or maybe I'm wrong |
11:46:07 | FromDiscord | <Yardanico> you're right |
11:46:33 | FromDiscord | <Yardanico> you can only use `const` globals in `func`s |
11:53:53 | FromDiscord | <evoalg> interesting! |
11:55:47 | arkanoid | haxscramper, thanks for the feedback |
12:06:01 | * | supakeen quit (Quit: WeeChat 3.3) |
12:06:32 | * | supakeen joined #nim |
12:08:38 | FromDiscord | <hmmm> what was the format of pre declaring procs before defining? proc thingy() =? |
12:08:59 | FromDiscord | <hmmm> compiler complains about nests π€ |
12:09:19 | FromDiscord | <enthus1ast> prof foo(baa\: int)\: int |
12:09:21 | FromDiscord | <enthus1ast> proc |
12:09:22 | FromDiscord | <enthus1ast> ... |
12:09:25 | FromDiscord | <hmmm> why do we even have to pre declare stuff ffs |
12:09:28 | FromDiscord | <hmmm> so no equal |
12:09:55 | FromDiscord | <enthus1ast> to forward declare stuff |
12:11:11 | FromDiscord | <enthus1ast> i think for most stuff you can use the experimental code reordering |
12:11:13 | FromDiscord | <Rika> In reply to @hmmm "why do we even": Limitation as of now, no idea if any plans to remove |
12:11:40 | FromDiscord | <enthus1ast> think Araq mentioned it in the forum post |
12:13:04 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3FRp |
12:15:13 | FromDiscord | <enthus1ast> but a Version\: 2.x goal, so currently, just forward declare and call it a day π |
12:15:51 | FromDiscord | <enthus1ast> or restructure and not forward declare |
12:15:52 | FromDiscord | <enthus1ast> ;) |
12:18:34 | FromDiscord | <hmmm> I slapped a nice introductory section with #pre declare hacks, see you in 2.x. And predeclared all my stuff away, so now I am free like a birdbeer |
12:24:40 | FromDiscord | <enthus1ast> what i often do is while hacking i just forward declare, then in the end i restructure and i end with just a few forward declarations if any |
12:26:24 | Amun-Ra | I've never used object inheritance in Nim before, I got a little problem: https://play.nim-lang.org/#ix=3FRu |
12:27:40 | FromDiscord | <Yardanico> why are you using owned here though? |
12:28:51 | FromDiscord | <Yardanico> but about your question - can't you just do something like this? |
12:28:58 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3FRw |
12:29:09 | FromDiscord | <Yardanico> (forgot to put the s into the newStringStream call though) |
12:39:28 | Amun-Ra | hmm |
12:41:03 | Amun-Ra | that's invalid object conversion |
12:43:21 | FromDiscord | <Yardanico> hm, yeah, I don't think you can do that |
12:43:27 | FromDiscord | <Yardanico> or maybe you can |
12:43:31 | FromDiscord | <Yardanico> I'm not good at OOP in Nim :) |
12:43:37 | Amun-Ra | same here ;> |
12:44:36 | Amun-Ra | in worst case scenarion I'll just put string in proxy object as a member |
12:44:41 | Amun-Ra | scenario* |
12:49:13 | FromDiscord | <gdquest> In reply to @evoalg "<@!202865241971884032> sorry I'm wondering": Because it doesn't fit my requirements. I need to replace with different things depending on the match - things that require processing each match individually |
13:02:06 | FromDiscord | <hmmm> hey how do I reset x = 5 to a clean var x : int state? |
13:02:31 | FromDiscord | <Rika> x = default(typeof(x)) |
13:02:33 | FromDiscord | <Rika> Perhaps? |
13:02:36 | FromDiscord | <hmmm> jesus |
13:02:38 | FromDiscord | <hmmm> looks ugly |
13:03:01 | FromDiscord | <Rika> For all integers 0 is the default anyway |
13:03:06 | FromDiscord | <Rika> If you want to use that instead |
13:03:13 | FromDiscord | <hmmm> hmm okok |
13:03:39 | Zevv | or make a nice little template for the ugly solution, right |
13:04:02 | Zevv | reset(var) will do |
13:04:30 | FromDiscord | <Rika> Sure |
13:04:59 | FromDiscord | <Rika> Iβd prefer using a proc for that though |
13:05:45 | Zevv | no, I mean, reset() is what you need. it's already there. |
13:07:29 | FromDiscord | <hmmm> when I get spaceX money I will employ a google sized force to fork nim to have synthax identical to python |
13:08:04 | FromDiscord | <Rika> It exists? Okay |
13:08:08 | FromDiscord | <Rika> I think I forgot about it |
13:08:15 | FromDiscord | <Rika> In reply to @hmmm "when I get spaceX": Why? |
13:08:32 | FromDiscord | <Rika> There are reasons for some of them being missing |
13:08:47 | FromDiscord | <Rika> What are you missing from Python |
13:09:03 | FromDiscord | <hmmm> yea but the google sized force will make it work 1:1 |
13:09:17 | FromDiscord | <Rika> Well why |
13:09:39 | FromDiscord | <Rika> At that point just use Python with another implementation |
13:09:50 | FromDiscord | <Rika> There are plenty |
13:10:25 | FromDiscord | <hmmm> because that's what I like lol |
13:10:33 | FromDiscord | <hmmm> I like nim and I like python synthax |
13:10:35 | FromDiscord | <Rika> Then use Python |
13:10:38 | FromDiscord | <hmmm> NU |
13:11:01 | FromDiscord | <Rika> A Python syntaxed Nim is not Nim like at all |
13:11:07 | FromDiscord | <Rika> Itβs just Python |
13:11:09 | FromDiscord | <Rika> Think about it |
13:11:31 | FromDiscord | <hmmm> don't worry my google sized force will think about everything it will be glorious |
13:11:50 | FromDiscord | <hmmm> I'll worry about the funding by investing in exoteric bitcoins |
13:11:55 | FromDiscord | <Rika> No, itβs literally contradicting to be βNim likeβ and have βPython syntaxβ |
13:12:32 | FromDiscord | <enthus1ast> nim syntax often is superior |
13:12:38 | FromDiscord | <enthus1ast> not always but often |
13:13:27 | FromDiscord | <enthus1ast> `os.path.join("foo" , "baa")` vs `"foo" / "baa"` |
13:13:46 | FromDiscord | <enthus1ast> always hate it when i must write python |
13:13:48 | FromDiscord | <Rika> Path lib in Python has / |
13:13:54 | FromDiscord | <enthus1ast> ok ;) |
13:14:04 | FromDiscord | <Rika> Path(βfooβ) / βbarβ |
13:14:12 | FromDiscord | <Rika> I think is how that works |
13:14:19 | FromDiscord | <Rika> But thatβs not a limitation of syntax |
13:15:56 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3FRP |
13:17:48 | FromDiscord | <hmmm> hmm I don't know, when I search for "how to do thingy on x on python" you mostly get stackoverflow solutions like : just call x.thingy. Nim has the same thing but you must search pretty hard, it has a different name that is less simple and you probably need to import a module. Also you need to check if the module you are importing is the right one or the abandoned one from 7years ago |
13:18:27 | FromDiscord | <hmmm> I guess the difference is half stack overflow presence, half simple names and half batteries included for a cool 150% sum in total |
13:18:49 | FromDiscord | <enthus1ast> sure you must be familiar with the docu and tools you use. |
13:18:52 | FromDiscord | <Rika> That is not syntax then |
13:18:57 | FromDiscord | <Rika> That is just library difference |
13:19:40 | FromDiscord | <Rika> You can always create your own standard library, I was planning to until I got hit by other plans |
13:19:52 | FromDiscord | <enthus1ast> python tk for me is like\: "is it TK or Tk or tkinter or Tkinter..." |
13:20:19 | FromDiscord | <hmmm> my google sized force will take care of the std/lib no prob rika |
13:20:25 | FromDiscord | <enthus1ast> then you copy paste stuff, then ohh no its not correct.... |
13:21:01 | * | arkurious joined #nim |
13:21:20 | FromDiscord | <Rika> In reply to @hmmm "my google sized force": I personally would not like a Python like standard library though |
13:21:23 | FromDiscord | <enthus1ast> i often find it easier to just read nim code than to resort to pythons documentation |
13:21:42 | FromDiscord | <Rika> I honestly donβt like Pythonβs documentation |
13:21:47 | FromDiscord | <enthus1ast> me neither |
13:22:03 | FromDiscord | <Rika> Nor the cruft of its bloated βbatteries includedβ library |
13:22:23 | FromDiscord | <Rika> Haha url lib |
13:22:28 | FromDiscord | <Rika> Very fun to deal with |
13:23:56 | FromDiscord | <evoalg> In reply to @hmmm "I guess the difference": why do you use Nim instead of Python? For speed? |
13:24:23 | FromDiscord | <enthus1ast> @evoalg\: because deep inside he knows that its the better lang ;) |
13:25:05 | FromDiscord | <hmmm> at the start I needed small exe, nim took care of it fast and easy |
13:25:15 | FromDiscord | <hmmm> then I stayed for the landscape I guess lol |
13:25:16 | FromDiscord | <Rika> I really wish somehow the βsplit the stdlib into a nimble packageβ plan pulled through |
13:25:29 | FromDiscord | <enthus1ast> small exe == malware? |
13:25:31 | FromDiscord | <hmmm> I don't need much tbh, I'm still learning lol |
13:25:33 | FromDiscord | <Rika> But I can see the massive headache that would be |
13:25:51 | FromDiscord | <hmmm> nunu exe like small utility for myself |
13:25:59 | FromDiscord | <Rika> No really Python canβt really be made into an executable |
13:26:18 | FromDiscord | <hmmm> I needed to shop it around and didn't want to shop a 50mb slo py bloat for a very simple utility |
13:26:28 | FromDiscord | <Rika> Yes |
13:26:48 | FromDiscord | <enthus1ast> i mean pyinstaller can create a dir, then just put the various exes in the dir -\> win |
13:27:14 | FromDiscord | <Rika> Yes but have you seen the sizes |
13:27:15 | FromDiscord | <hmmm> it was still cumbersome, Nim was easy to transition to |
13:27:15 | FromDiscord | <Rika> Theyβre massive |
13:36:36 | FromDiscord | <enthus1ast> i've written an vacation planner, exporter etc, with excel reader and tk gui in python, it has around 6mb |
13:36:43 | FromDiscord | <enthus1ast> not too bad |
13:37:11 | FromDiscord | <enthus1ast> the reason it is in python because back then we did not had a macos gui library |
13:38:04 | FromDiscord | <enthus1ast> and today i would still write it in python because we (still) have no cross platform gui (ok gtk, but gtk is terrible) |
13:38:34 | FromDiscord | <enthus1ast> and gtk would bloat it to much more then 6mb i guess |
13:39:35 | FromDiscord | <enthus1ast> BF2142Unlocker\_v0.9.6\_win.zip 15.1 mb |
13:40:21 | FromDiscord | <enthus1ast> most of this size ^ is gtk for windows |
13:43:43 | FromDiscord | <enthus1ast> so please if anyone (with time and leisure) PLEASE write a crossplatform gui! |
14:08:05 | * | luis_ joined #nim |
14:11:17 | FromDiscord | <hmmm> lol we should just jump the shark and make nim godot usable. People are starting to write 2d gui on godot because it's often easier than using the gui behemots. I plan to try and convert some of my small gui apps in godot because why the hell not lol |
14:19:53 | FromDiscord | <IsaacPaul> In reply to @enthus1ast "so please if anyone": Something I've been wanting to do for a while. I actually spent a lot of time reworking flutter (removing dart and unnecessary cruft) and trying to turn it into a crossplatform gui library. |
14:21:25 | FromDiscord | <IsaacPaul> it's on the back burner tho |
14:21:49 | * | Raflemakt quit (Ping timeout: 256 seconds) |
14:23:20 | FromDiscord | <IsaacPaul> In reply to @hmmm "lol we should just": Godot is actually pretty slow, which is why I'm avoiding it. β΅β΅Unity as much as I hate to say it has a pretty good UI api. |
14:24:27 | * | luis_ quit (Ping timeout: 264 seconds) |
14:26:50 | FromDiscord | <hmmm> still it's telling people are abusing 3D stuff just to avoid having to deal with QT / Gtk and the likes. No one likes to use that stuff |
14:30:56 | FromDiscord | <IsaacPaul> There's also dear imgui but.. sigh. it's immediate mode. |
14:31:29 | FromDiscord | <Yardanico> I think it's more suitable for standalone UIs than Godot though :D |
14:31:36 | FromDiscord | <Yardanico> and some people actually do use it as such |
14:31:39 | FromDiscord | <Yardanico> with transparent background |
14:32:40 | FromDiscord | <Yardanico> and for imgui inspiration you can always see the examples of imgui GUIs |
14:32:43 | FromDiscord | <Yardanico> the newest thread is https://github.com/ocornut/imgui/issues/4451 |
14:32:45 | FromDiscord | <enthus1ast> imho the most sane gui currently is lazarus .... |
14:32:56 | FromDiscord | <Yardanico> did you get far with the nim lcl binding? |
14:33:23 | FromDiscord | <enthus1ast> yeah did the stuff i needed by hand |
14:33:27 | FromDiscord | <Yardanico> nice |
14:33:31 | FromDiscord | <Yardanico> lcl might be a very good choice for Nim |
14:33:38 | FromDiscord | <Yardanico> for small native UIs |
14:33:45 | FromDiscord | <enthus1ast> yes |
14:37:44 | FromDiscord | <Yardanico> In reply to @Yardanico "the newest thread is": also it's really funny that game cheat developers show off their ImGUI layouts in these threads :) |
14:38:26 | FromDiscord | <enthus1ast> yeah imgui is nice and has alot of good widgets |
14:38:37 | FromDiscord | <enthus1ast> only stuff like copy paste etc must be done manually |
14:38:56 | FromDiscord | <enthus1ast> so there is still some hacky work todo |
14:39:54 | FromDiscord | <Yardanico> found some interesting projects from these threads, but that's for #offtopic |
14:49:51 | * | Raflemakt joined #nim |
14:56:33 | FromDiscord | <Yardanico> On that note, initial Nim support (as in default templates and stuff) was merged to https://github.com/aduros/wasm4 ! |
14:56:38 | FromDiscord | <Yardanico> I'll probably add it to TMWN |
14:56:45 | FromDiscord | <Yardanico> https://github.com/aduros/wasm4/pull/167 |
14:58:19 | PMunch | Hmm, I was waiting for whoever was wrapping Sciter with Futhark to put it in TMWN |
14:58:34 | FromDiscord | <Yardanico> aaaaaaaa |
14:58:35 | PMunch | Wait, wasn't that you Yardanico? |
14:58:48 | FromDiscord | <Yardanico> πΏ |
14:58:54 | FromDiscord | <Yardanico> yes yes i will try today |
15:02:51 | FromDiscord | <dom96> In reply to @Yardanico "On that note, initial": π |
15:03:16 | FromDiscord | <dom96> We need a Nim MVP of the Month award π |
15:06:59 | FromDiscord | <Yardanico> In reply to @PMunch "Hmm, I was waiting": do you have the gist with the options you used for sciter? i only have this saved - https://gist.github.com/Yardanico/45c4c588449b49b3bcf514c64460ee4c |
15:07:06 | FromDiscord | <Yardanico> but it fails because of uint16_t |
15:07:20 | FromDiscord | <Yardanico> ah right cushort |
15:07:25 | FromDiscord | <Yardanico> or not |
15:11:49 | PMunch | Hmm, I don't think I used any compiler args for it |
15:12:58 | PMunch | But I need to go now. I'll check on this chat in a little while though |
15:13:01 | * | PMunch quit (Quit: Leaving) |
15:26:36 | FromDiscord | <gdquest> In reply to @IsaacPaul "Godot is actually pretty": Did you have performance issues with Godot's UI? |
15:26:58 | FromDiscord | <gdquest> The Godot editor uses it, I've never had performance problems with that |
15:31:09 | * | Vladar joined #nim |
15:31:49 | FromDiscord | <IsaacPaul> sent a long message, see http://ix.io/3FSS |
15:32:20 | FromDiscord | <gdquest> Okay so it's just things you've heard |
15:32:25 | FromDiscord | <IsaacPaul> yup |
15:32:46 | FromDiscord | <gdquest> Well the UI isn't slow at all. As I mentioned, Godot's editor is written in Godot, and it runs on cheap notebooks no problem |
15:33:11 | FromDiscord | <gdquest> The 3D engine's rendering performance has no relation with the performance of other areas - they kinda work in silos |
15:34:14 | FromDiscord | <gdquest> Now as to using Godot to make apps... we're doing it right now, it's good if you use Godot itself, but definitely not adapted to Nim or other external languages |
15:34:26 | FromDiscord | <gdquest> I mean it works with the native bindings tech, and you get near C++ performance |
15:34:52 | FromDiscord | <gdquest> But it's not designed as a UI toolkit |
15:34:57 | FromDiscord | <gdquest> Note Tesla uses Godot UI in their cars |
15:35:09 | FromDiscord | <gdquest> Their android app and dashboard is made in Godot |
15:35:14 | FromDiscord | <gdquest> (edit) "in" => "with" |
15:35:24 | FromDiscord | <IsaacPaul> In reply to @gdquest "Now as to using": Very interesting.. so is the UI built on top of the 2d engine? or is that separate |
15:36:02 | FromDiscord | <gdquest> It's on the 2D engine, which is quite optimized by now - there's ongoing work happening on performance in all areas of the engine actually |
15:36:33 | FromDiscord | <IsaacPaul> well that's good. |
15:37:21 | FromDiscord | <gdquest> But if you look at the source code basically the UI has its own logic code but calls into the RenderingServer for all drawing. |
15:37:34 | FromDiscord | <gdquest> Which does it all through the 2D renderer. |
15:37:51 | FromDiscord | <gdquest> This means you can strip Godot's physics engine, 3d, audio, and everything else to use just the GUI part |
15:38:41 | FromDiscord | <gdquest> This guy is making a Digital Audio Workstation this way - using Godot just for the GUI <https://twitter.com/colugomusic> |
15:38:42 | FromDiscord | <IsaacPaul> I'll have to check out godot again.. though the last time I did.. I saw that an http request was a 'node' on the scene and that.. was just weird. |
15:39:10 | FromDiscord | <IsaacPaul> I guess the scene is the context/controller |
15:39:11 | FromDiscord | <gdquest> In reply to @IsaacPaul "I'll have to check": I don't think it's ever been that way. It's just people use nodes a lot to attach code to their scene. |
15:39:42 | FromDiscord | <IsaacPaul> It's really designed at beginners and that scares me away xD |
15:39:45 | FromDiscord | <gdquest> You'll always have one viewport node created by the engine, but that aside nodes are optional |
15:41:31 | FromDiscord | <hmmm> gdquest have you tried the godot nim bindings yet? |
15:41:54 | FromDiscord | <hmmm> I'm curious if it works or it's too much of a hassle |
15:42:06 | FromDiscord | <gdquest> No, but I know someone who did and they worked fine for them |
15:42:33 | FromDiscord | <gdquest> Right now using GDNative - the base tech for all those external language bindings - is a little tedious to set up |
15:42:55 | FromDiscord | <gdquest> Well it's just you have to download and compile the right GDNative headers (C++) to get started |
15:43:07 | FromDiscord | <Yardanico> In reply to @hmmm "gdquest have you tried": there has been at 3 commercial games made in godot with nim |
15:43:11 | FromDiscord | <Yardanico> two mobile, one steam |
15:43:20 | FromDiscord | <Yardanico> there are probably more that we don't know about :) |
15:43:35 | FromDiscord | <gdquest> The bindings seem reliable at least yeah that's what this colleague told me |
15:43:40 | FromDiscord | <Yardanico> https://frayhem.com/en/β΅https://summonage.com/en/β΅https://store.steampowered.com/app/1444480/Turing_Complete/ |
15:44:37 | FromDiscord | <hmmm> nice, I need to try them |
15:47:11 | FromDiscord | <IsaacPaul> I would love to look through an example nim/godot project if anyone finds one lol |
15:47:37 | FromDiscord | <hmmm> yea! we need to see the good stuff |
15:57:51 | * | LyndsySimon quit (Ping timeout: 245 seconds) |
15:58:55 | * | LyndsySimon joined #nim |
16:03:38 | FromDiscord | <lenis> In reply to @gdquest "Note Tesla uses Godot": Really? thats cool |
16:03:55 | FromDiscord | <lenis> I thought that using Godot for UI development was more of a gimmick |
16:04:26 | nrds | <Prestige99> hm I would assume the same, really |
16:04:51 | FromDiscord | <Yardanico> In reply to @lenis "Really? thats cool": they had a job offering for a godot developer for UI |
16:04:58 | FromDiscord | <Yardanico> it's no longer up though |
16:05:19 | FromDiscord | <Yardanico> http://web.archive.org/web/20210828105259/https://www.tesla.com/careers/search/job/software-engineerenergymobilewebui-72387 |
16:05:27 | FromDiscord | <gdquest> We know that Tesla and Google use Godot |
16:05:30 | nrds | <Prestige99> Maybe they'll ship games inside their cars :P |
16:05:36 | FromDiscord | <Yardanico> they already do :) |
16:05:50 | FromDiscord | <gdquest> Tesla for sure in their car apps for UI and UI animation, people found Godot data files in there |
16:05:51 | * | robertmeta quit (Ping timeout: 264 seconds) |
16:06:01 | FromDiscord | <gdquest> Google uses it for unreleased internal projects |
16:06:03 | FromDiscord | <Yardanico> @Prestige https://www.motortrend.com/features/tesla-arcade-video-gaming-review-model-s-plaid/ |
16:06:38 | nrds | <Prestige99> Well, it only makes sense I guess haha |
16:06:52 | FromDiscord | <gdquest> In reply to @lenis "I thought that using": It's really cool, you have programs made with Godot like MaterialMaker (procedural material and texture creation like Substance designer), Pixelorama (pixel art program) and some others |
16:07:03 | FromDiscord | <lenis> are there good docs on how to use godot for UI? |
16:07:08 | FromDiscord | <gdquest> Godot's editor is made with the Godot UI framework |
16:07:18 | FromDiscord | <gdquest> Actually Godot is a Godot game technically |
16:08:04 | FromDiscord | <gdquest> In reply to @lenis "are there good docs": The class reference is good but the docs and usability not as good as some more popular alternatives. It's getting better, and we hired a UX designer/dev to improve the usability already |
16:08:27 | * | robertmeta joined #nim |
16:08:34 | FromDiscord | <lenis> thats good to hear |
16:08:45 | FromDiscord | <gdquest> You can get by - we certainly do - but I think with Godot 4 the experience will be much smoother |
16:09:21 | FromDiscord | <gdquest> We're waiting on the redesign to make some free resources and likely a paid companion course dedicated to UI |
16:09:27 | nrds | <Prestige99> I'll probably do some nim/godot things after 4 comes out |
16:09:31 | FromDiscord | <gdquest> (edit) "redesign" => "usability improvements" |
16:09:52 | FromDiscord | <gdquest> Yeah Godot 4 even for us long term users brings so many improvements we're all waiting for it |
16:10:01 | FromDiscord | <lenis> Godot 4 sure it taking its time |
16:10:26 | FromDiscord | <gdquest> It's the scope is insane. Also devs backport many features to Godot 3 so we're still getting major updates |
16:10:36 | nrds | <Prestige99> I'd rather have the devs take their time |
16:10:38 | FromDiscord | <gdquest> It's a complete rewrite of a 10 year-old engine |
16:11:01 | FromDiscord | <gdquest> Making almost everything modern, bringing multithreading and perf improvements to many areas |
16:11:38 | FromDiscord | <no name fits> So I'm working with Vulkan which means I have a cstringArray. How do I push to a cstringArray exactly? |
16:11:42 | FromDiscord | <lenis> I tried using godot at one point. but i found that in many areas its just lacking. such as terrain editing, big scenes, working with shadersβ΅β΅And it had a cool window for generating patch files for game data, but the code for it was never implemented |
16:12:11 | FromDiscord | <enthus1ast> then maybe my reported my 2d physic engine bug will be fixed \:) |
16:12:13 | FromDiscord | <gdquest> Yeah terrain editing is still not coming either. At least not yet. |
16:12:15 | FromDiscord | <enthus1ast> after 5+ years \:D |
16:12:40 | FromDiscord | <gdquest> You'd have to check if it's still relevant, as so much changed already |
16:13:03 | * | kayabaNerve quit (Ping timeout: 264 seconds) |
16:13:43 | * | rockcavera joined #nim |
16:13:43 | * | rockcavera quit (Changing host) |
16:13:43 | * | rockcavera joined #nim |
16:13:45 | FromDiscord | <no name fits> I can only find how to convert cstringArray to seq in the docs, but I just need to push one more cstring to the array |
16:13:57 | FromDiscord | <lenis> well if Godot becomes easily compatible with Nim ill give it another shot haha |
16:14:05 | FromDiscord | <lenis> I think i actually still have one of your courses for Godot π |
16:14:49 | FromDiscord | <gdquest> Ah! Thanks π |
17:14:39 | FromDiscord | <b1tt> Nim is amazing |
17:15:35 | Amun-Ra | yes it is |
17:16:53 | FromDiscord | <hmmm> I just found the hard way I cannot name a proc mod |
17:16:58 | FromDiscord | <hmmm> π§ |
17:17:45 | FromDiscord | <hmmm> why compiler sama can't just say "hey dude that is already reserved, stop using stupid names" |
17:18:07 | FromDiscord | <hmmm> instead of Error: identifier expected, but got 'keyword mod' |
17:18:18 | Amun-Ra | hmm: you can, proc `mod`(): discard |
17:18:35 | Amun-Ra | not that would be a good idea |
17:18:35 | FromDiscord | <hmmm> whot |
17:19:02 | FromDiscord | <hmmm> try proc mod(a : int) = |
17:19:11 | Amun-Ra | you can extend what "mod" operates on by escaping the name with `` |
17:19:51 | FromDiscord | <hmmm> lol I just want to avoid all the hassle regarding mod, I didn't know there was already a mod in existance |
17:20:22 | FromDiscord | <Yardanico> In reply to @hmmm "whot": he used backticks for stropping |
17:20:24 | FromDiscord | <hmmm> from now it will be modx, mody and the likes |
17:20:27 | FromDiscord | <Yardanico> in discord those are used for monospace font |
17:20:31 | FromDiscord | <Yardanico> so you didn't see the backticks |
17:20:43 | FromDiscord | <hmmm> ah ok |
17:20:43 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=3FTu |
17:20:45 | Amun-Ra | hmm: https://play.nim-lang.org/#ix=3FTt (but that's bad as overloading in C++) |
17:20:56 | FromDiscord | <hmmm> nono backticks for me thanks I'm already confused enough |
17:22:26 | Amun-Ra | what if I escape backticks: \`mod\` |
17:24:08 | FromDiscord | <IsaacPaul> yea then you can see it |
17:24:18 | Amun-Ra | hmm |
17:25:24 | FromDiscord | <@droptweetrxd_twitter-5a0487c2d7> sent a code paste, see https://paste.rs/VJF |
17:26:25 | FromDiscord | <@droptweetrxd_twitter-5a0487c2d7> I'm using Ubuntu with WSL on Windows. Nim 1.6.0 with nimble v0.13.1 compiled at 2021-10-19 01\:07\:39 |
17:27:53 | FromDiscord | <hmmm> hey dude are you really named @droptweetrxd_twitter-5a0487c2d7? |
17:28:39 | * | Raflemakt quit (Ping timeout: 264 seconds) |
17:29:32 | FromDiscord | <@droptweetrxd_twitter-5a0487c2d7> versus a nicer name? I authenticated using my twitter login and that's the name I was given??? |
17:30:00 | FromDiscord | <hmmm> I see π§ |
17:30:14 | FromDiscord | <@droptweetrxd_twitter-5a0487c2d7> apologies. new to gitter |
17:30:24 | FromDiscord | <hmmm> np π |
17:30:40 | FromDiscord | <Rika> ah gitter |
17:32:04 | FromDiscord | <@droptweetrxd_twitter-5a0487c2d7> Do you have any guesses as to what I did incorrectly to result in the error message? |
17:32:11 | FromDiscord | <Rika> nothing |
17:33:41 | FromDiscord | <@droptweetrxd_twitter-5a0487c2d7> weird. switching to devel lets me install properly, but stable doesn't |
17:37:22 | FromDiscord | <Rika> i installed it on stable successfully |
17:45:51 | FromDiscord | <IsaacPaul> sent a code paste, see https://play.nim-lang.org/#ix=3FTL |
17:46:43 | Amun-Ra | Yardanico: btw, I ended up implementing my own stream object |
18:02:53 | * | PMunch joined #nim |
18:14:05 | FromDiscord | <pmunch> Well that pretty much is what it's saying, just in a bit nicer way \:Pβ΅(@hmmm) |
18:17:03 | FromDiscord | <dom96> In reply to @IsaacPaul "if you remove all": https://github.com/nim-lang/nimble/issues/945 |
18:17:15 | FromDiscord | <dom96> Best guess: the new Nimble is causing you problems. |
18:17:24 | FromDiscord | <dom96> but I dunno how you'd get it with 1.6.0 |
18:17:46 | FromDiscord | <dom96> you can try `nimble refresh` as well |
18:17:49 | * | Raflemakt joined #nim |
18:17:53 | FromDiscord | <IsaacPaul> @droptweetrxd_twitter-5a0487c2d7β΅^ |
18:19:11 | FromDiscord | <Rika> he said it was on 0.13.1 though |
18:19:58 | FromDiscord | <dom96> there was a period of time when the new Nimble had that version number :/ |
18:21:47 | FromDiscord | <pmunch> 0.13.1? That's ancient! |
18:24:02 | * | PMunch quit (Quit: leaving) |
18:24:26 | FromDiscord | <dom96> that's the latest release lol |
18:26:52 | FromDiscord | <Rika> nimble, not nim |
18:27:04 | FromDiscord | <Rika> In reply to @dom96 "there was a period": aw fuk |
18:39:11 | FromDiscord | <pmunch> Ah right π |
18:50:10 | FromDiscord | <codic> sent a code paste, see https://play.nim-lang.org/#ix=3FU6 |
18:50:21 | FromDiscord | <codic> https://www.toptal.com/developers/hastebin/ekoyicukup.rb wtf are these c errors? |
18:50:52 | FromDiscord | <codic> it looks like it is having trouble compiling `x = none y` |
18:51:06 | FromDiscord | <codic> where x: Option[y] |
18:54:23 | FromDiscord | <Rika> needs more context |
18:54:27 | FromDiscord | <Rika> code sample perhaps? |
19:02:36 | * | Raflemakt left #nim (#nim) |
19:03:00 | FromDiscord | <codic> sure |
19:03:14 | FromDiscord | <codic> 1s |
19:03:54 | FromDiscord | <codic> sent a code paste, see https://paste.rs/0Zo |
19:04:21 | FromDiscord | <codic> https://github.com/nim-lang/Nim/issues/11228 according to this you get this C error when the types are different, but in this case it's uint on both sides |
19:07:34 | FromDiscord | <codic> also:β΅before I was using Nim 1.4.8 @ Void, was working fineβ΅then I distrohopped to Debian Sid and got Nim 1.6.0, working fineβ΅then again to Artix, and got Nim 1.4.8, not working fine |
19:07:38 | FromDiscord | <codic> I don't see why |
19:09:37 | FromDiscord | <Rika> Maybe force a recompile |
19:09:48 | FromDiscord | <Rika> -f in the compile command I assume |
19:10:28 | FromDiscord | <hmmm> In reply to @pmunch "Well that pretty much": I want a compiler flag just for me -d:stupid. It will be very explicit for the easy errors (You forgot the = at the end of proc declaration you idiot, it is now the <counter>th time) and very cryptic for general type errors "Dude some thingy error happened at line 298. Fix that line. I spare you the 2000 lines of details you wouldn't get anyway" |
19:13:41 | FromDiscord | <codic> I'm using Nimble, but no, that doesn't seem to do anything |
19:13:48 | FromDiscord | <codic> Nor does creating a new project & copying over the code |
19:13:57 | FromDiscord | <codic> or removing ~/.cache/nim |
19:21:09 | FromDiscord | <codic> oh it works with 1.6.0 with choosenim |
19:21:11 | FromDiscord | <codic> weird..... |
19:21:15 | FromDiscord | <codic> what broke?? |
19:21:53 | * | fputs5 joined #nim |
19:24:22 | * | fputs quit (Ping timeout: 268 seconds) |
19:24:23 | * | fputs5 is now known as fputs |
19:28:45 | * | src joined #nim |
19:41:45 | * | anddam quit (Quit: WeeChat 3.3) |
19:42:11 | * | anddam joined #nim |
19:45:24 | * | anddam quit (Client Quit) |
19:45:42 | * | anddam joined #nim |
19:48:17 | * | anddam quit (Client Quit) |
19:50:35 | * | anddam joined #nim |
19:50:58 | nixfreaknim[m] | trying to load a sample rss feed like so: let feed = loadRSS("http://data.xssed.org/news.rss") |
19:51:06 | nixfreaknim[m] | and read pubDate |
19:51:21 | nixfreaknim[m] | echo feed.pubDate |
19:51:49 | nixfreaknim[m] | https://github.com/achesak/nim-rss/blob/master/src/rss.nim |
19:54:16 | nixfreaknim[m] | Keep getting error Users/.choosenim/toolchains/nim-#version-1-6/lib/system/io.nim(853) readFile |
19:54:16 | nixfreaknim[m] | Error: unhandled exception: cannot open: http://data.xssed.org/news.rss [IOError] |
19:54:16 | nixfreaknim[m] | Error: execution of an external program failed: '/Users/tmp/read_rss ' |
19:55:27 | FromDiscord | <Elegantbeef> `getRSS` |
19:55:38 | FromDiscord | <Elegantbeef> `load` is from local `getRss` is remote |
20:02:41 | nixfreaknim[m] | so getRSS("http://data.xssed.org/news.rss") |
20:03:24 | nixfreaknim[m] | let x = getRSS("http://data.xssed.org/news.rss") |
20:03:24 | FromDiscord | <Elegantbeef> yep |
20:03:51 | nixfreaknim[m] | echo x.pubDate ? |
20:04:46 | FromDiscord | <Elegantbeef> Should be |
20:06:25 | nixfreaknim[m] | yeah not getting anything back from it |
20:06:28 | nixfreaknim[m] | just blank |
20:07:09 | FromDiscord | <Elegantbeef> well there is no pub date for the parent node |
20:07:47 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FUz |
20:08:25 | nixfreaknim[m] | oh because its under item node |
20:10:11 | nixfreaknim[m] | <channel>... (full message at https://libera.ems.host/_matrix/media/r0/download/libera.chat/f36fca0fd409eeff9aeeb2a4509963184893c218) |
20:10:41 | FromDiscord | <hmmm> is there a sane way of assigning the string of a proc name to a var? |
20:11:20 | FromDiscord | <Elegantbeef> What? |
20:11:41 | FromDiscord | <Elegantbeef> You want to take a string input and get the proc of that name? |
20:11:44 | FromDiscord | <hmmm> I have a proc named thingy I want var x = "thingy" |
20:12:16 | FromDiscord | <Elegantbeef> well you can with a bit more mechanisms |
20:12:25 | FromDiscord | <Elegantbeef> Are these procs all the same types? |
20:12:34 | FromDiscord | <hmmm> hmm |
20:13:09 | FromDiscord | <Elegantbeef> If not there isnt really a way to do this neatly |
20:13:18 | FromDiscord | <hmmm> they take and return different types if that's what you are asking |
20:13:40 | FromDiscord | <Elegantbeef> So they have different signatures, are they all unique or do the fall under a specific set of procedures? |
20:14:03 | FromDiscord | <hmmm> π |
20:14:09 | FromDiscord | <hmmm> can I have a reserve question |
20:14:41 | FromDiscord | <Elegantbeef> Elaboration is all i need to be able to provide a solution |
20:14:51 | FromDiscord | <hmmm> hmm |
20:15:28 | * | dtomato quit (Quit: The Lounge - https://thelounge.chat) |
20:15:48 | * | dtomato joined #nim |
20:16:48 | FromDiscord | <hmmm> even google seem puzzled by my request |
20:16:56 | FromDiscord | <hmmm> thought it was something normal |
20:17:34 | FromDiscord | <hmmm> isn't there a function somewhere that gets out all of the symbols? |
20:17:55 | FromDiscord | <hmmm> woa |
20:17:56 | FromDiscord | <enthus1ast> sent a code paste, see https://play.nim-lang.org/#ix=3FUB |
20:18:07 | FromDiscord | <enthus1ast> but might not work in any case |
20:18:18 | FromDiscord | <hmmm> lemme try a quick copy paste then I will try to understand what is doin |
20:18:34 | FromDiscord | <Elegantbeef> Tis is just taking in a symbol and returning the ast of it |
20:18:45 | FromDiscord | <enthus1ast> what do you try to do this? |
20:18:47 | FromDiscord | <enthus1ast> why |
20:19:15 | FromDiscord | <IsaacPaul> ... uh but _why_ do you need the name of procs? what are you trying to do. I have a feeling there maybe a better solution to your problem because you're essentially asking for some sort reflection for procs. |
20:19:21 | FromDiscord | <hmmm> yea it is what I want |
20:19:29 | FromDiscord | <hmmm> but there is too magic I don't get in there |
20:19:36 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/SMB |
20:19:38 | FromDiscord | <hmmm> jeesus |
20:19:58 | FromDiscord | <enthus1ast> > β΅> The less silly version of the aboveβ΅> \:(β΅> |
20:20:06 | FromDiscord | <IsaacPaul> lol |
20:20:20 | FromDiscord | <Elegantbeef> Well what you're wanting isnt overly needed, getting procs by name like this is only available at CT |
20:20:32 | FromDiscord | <Elegantbeef> Sorry enthus it's just the truth π |
20:21:29 | FromDiscord | <Elegantbeef> Either way we probably should've done `obj: typed{proc}` and `p: proc{proc}` respectively |
20:22:03 | nixfreaknim[m] | So can I access the item node.pubDate ? |
20:22:14 | FromDiscord | <Elegantbeef> But yea hmmm elaborate what you're doing instead of making us guess, my assumption is you want to have strings change a proc call |
20:22:25 | FromDiscord | <Elegantbeef> https://github.com/achesak/nim-rss/blob/master/src/rss.nim#L18-L39 |
20:24:19 | FromDiscord | <hmmm> hmm I was just trying to spare me some typing, I have to refactor my weekend project with proper names and I have procs and later strings that refer to them and I was thinking it would be neat to tie the strings to the proc so if later I change the proc names again I don't need to change the strings |
20:25:03 | FromDiscord | <Elegantbeef> Why do the proc names matter in relation to strings |
20:25:49 | FromDiscord | <hmmm> well the strings are just terminal output that say: hey we now "push" things and there is indeed a push proc |
20:26:07 | FromDiscord | <hmmm> or something like that lol the more I write about it the more I get confuus'd |
20:26:11 | FromDiscord | <Elegantbeef> Ok here we go |
20:26:20 | FromDiscord | <Elegantbeef> Here we go you want keys -\> procs |
20:26:27 | FromDiscord | <hmmm> yea? |
20:26:31 | FromDiscord | <hmmm> YEA I WANT THAT |
20:26:52 | FromDiscord | <hmmm> how do I activate this magic protocol |
20:26:53 | FromDiscord | <Elegantbeef> So what do the procs signatures look like `proc doStuff(args: openarray[string])`? |
20:27:19 | FromDiscord | <Elegantbeef> Well we first need to see what your requirement is |
20:28:07 | FromDiscord | <Elegantbeef> You need to think about "what procs are needed" |
20:29:46 | FromDiscord | <hmmm> they are mostly normal simple procs like proc push(x :int) = |
20:30:28 | FromDiscord | <Elegantbeef> You really need to learn how to elaborate |
20:30:35 | FromDiscord | <hmmm> yea! |
20:30:41 | FromDiscord | <Elegantbeef> Is this code posted anywhere? |
20:30:53 | FromDiscord | <hmmm> well my vocabulary is limited by my rudimentary cs skills lol |
20:31:12 | FromDiscord | <Elegantbeef> I'm legitmately just asking "What are your current procedure signatures, give me all of them!" |
20:31:55 | FromDiscord | <hmmm> oh |
20:31:59 | FromDiscord | <hmmm> that is simple |
20:33:13 | FromDiscord | <hmmm> sent a code paste, see https://play.nim-lang.org/#ix=3FUI |
20:33:19 | FromDiscord | <hmmm> π
|
20:33:43 | nixfreaknim[m] | ok so pubDate is an RSSItems object and that is a seq |
20:34:16 | nixfreaknim[m] | so echo feed.items["pubDate"] |
20:34:25 | nixfreaknim[m] | but doesn't work |
20:37:21 | FromDiscord | <Elegantbeef> Ok so they have the same signatures |
20:39:47 | nixfreaknim[m] | cho feed.items[2] |
20:39:47 | nixfreaknim[m] | (title: "Happy New Year 2012!", link: "http://www.xssed.com/news/129/Happy_New_Year_2012/", description: "Wishing you a very healthy, happy and prosperous new year!", author: "", category: @[], comments: "", enclosure: (url: "", length: "", enclosureType: ""), guid: "", pubDate: "Sun, 01 Jan 2012 19:19:09 +0100", sourceUrl: "", sourceText: "") |
20:40:34 | nixfreaknim[m] | How can I just parse out just a specific child ? |
20:40:37 | FromDiscord | <hmmm> well my initial thought was: there should exist something like var x = $name[push()], but looking at the examples maybe it's not that easy nor needed so probably people do it in a much simpler way |
20:40:55 | FromDiscord | <Elegantbeef> Items is a seq |
20:41:04 | FromDiscord | <Elegantbeef> so you need to get the element you want and access the `.pubdate` |
20:42:46 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FUK |
20:43:13 | FromDiscord | <Elegantbeef> It's a `seq` nix so you can just do `yourRssData.items[yourInterestedIndex]` |
20:43:31 | FromDiscord | <Elegantbeef> I think i provided something that should work for you hmmm |
20:44:34 | nixfreaknim[m] | yep I did a typeof on it |
20:44:50 | FromDiscord | <hmmm> oh π
I think I recognize std/tables in there. The rest I will need to take time study it |
20:45:33 | FromDiscord | <hmmm> ty beefy sorry for the long winded request :nim1: I'll get to you when / if I get what it does lol |
20:46:44 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=3FUM |
20:46:55 | FromDiscord | <gibson> (edit) |
20:51:03 | FromDiscord | <Elegantbeef> Seems it's a bug with how parameters are evaluated before tuple accessors are expanded |
20:52:31 | FromDiscord | <firasuke> Hey there |
20:53:18 | FromDiscord | <firasuke> I'm very impressed with Nim, especially with how easy it is to bootstrap, and it not having a dependency on LLVM is a big plus imho |
20:55:26 | FromDiscord | <Elegantbeef> Actually this is just an array issue, it sems without reference to generics on declaration |
20:56:31 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FUR |
20:56:49 | FromDiscord | <Elegantbeef> It's silly but the `template` is delayed untill the instantiation of the generic |
20:56:54 | FromDiscord | <Elegantbeef> Hello fira |
20:57:08 | FromDiscord | <firasuke> Yo |
20:57:46 | FromDiscord | <gibson> @ElegantBeef Ah, right, template resolution is later. Thanks - that's the "not a bug" insight I was looking for! This is the kind of advanced nim that trips me up. |
20:57:59 | FromDiscord | <Elegantbeef> Well i'd say it's a bug |
20:58:16 | FromDiscord | <Elegantbeef> But it's just due to the array semming at declaration instead of instantiation |
20:58:27 | nixfreaknim[m] | How would I break this down even further cho feed.items[0..<1] |
20:58:27 | nixfreaknim[m] | @[(title: "Another Ebay permanent XSS", link: "http://www.xssed.com/news/131/Another_Ebay_permanent_XSS/", description: "The Indian security researcher Shubham Upadhyay aka Cyb3R_Shubh4M, sent us a new permanent XSS affecting the products listings on Ebay.com", author: "", category: @[], comments: "", enclosure: (url: "", length: "", enclosureType: ""), guid: "", pubDate: "Tue, 13 Nov 2012 19:25:59 +0100", sourceUrl: "", sourceText: |
20:58:27 | nixfreaknim[m] | "")] |
20:58:51 | FromDiscord | <Elegantbeef> I mean what are you after? |
20:58:59 | nixfreaknim[m] | pubDate |
20:59:07 | FromDiscord | <Elegantbeef> `.pubDate` |
20:59:27 | FromDiscord | <Elegantbeef> `echo feed.items[0].pubDate` |
20:59:40 | FromDiscord | <Elegantbeef> It's just a sequence of `RSSItems` |
21:00:07 | nixfreaknim[m] | damn I thought I tried that already |
21:00:16 | nixfreaknim[m] | thank you |
21:00:57 | FromDiscord | <Elegantbeef> I will say gibson it's a sucky bug but alteast the work around isnt too ergonomically ugly |
21:01:39 | FromDiscord | <Elegantbeef> I do wonder if it's as simple as not semming arrays π |
21:01:54 | FromDiscord | <gibson> Yeah, true! What is "semming"? Is that the semantic pass or something? I've never heard that before. |
21:02:16 | FromDiscord | <Elegantbeef> yep |
21:02:29 | FromDiscord | <Elegantbeef> Semantic analysis |
21:02:33 | FromDiscord | <Elegantbeef> I toy with the compiler a bit, so i play pretend compiler dev |
21:03:06 | FromDiscord | <gibson> :p |
21:03:45 | FromDiscord | <firasuke> Is koch still used to bootstrap Nim? |
21:03:52 | FromDiscord | <Elegantbeef> Yes |
21:04:19 | FromDiscord | <firasuke> Nice, I've read the bootstrap script and it's very straightforward |
21:04:34 | FromDiscord | <Elegantbeef> I like that even i havent done that π |
21:04:39 | FromDiscord | <firasuke> I wonder how compatible Nim is with a gcc/musl toolchain |
21:05:00 | FromDiscord | <firasuke> In reply to @Elegantbeef "I like that even": Yeah well, I'd rather do that than bootstrap LLVM π |
21:05:13 | FromDiscord | <Elegantbeef> Gcc is the default compiler, and some people have compiled with musl |
21:05:21 | FromDiscord | <firasuke> In reply to @Elegantbeef "Gcc is the default": Epic news |
21:05:55 | FromDiscord | <firasuke> I'm actually working on a linux distribution built from scratch that's based on musl libc and toybox |
21:06:20 | FromDiscord | <firasuke> I actually wrote the package manager in shell, then I switched to Rust. |
21:06:44 | FromDiscord | <firasuke> Well bootstrapping Rust isn't the prettiest thing lol |
21:06:55 | FromDiscord | <firasuke> so I'm thinking of at least trying Nim and see how it goes |
21:06:56 | FromDiscord | <Elegantbeef> It's fine if you have 10 hours π |
21:07:13 | FromDiscord | <firasuke> In reply to @Elegantbeef "It's fine if you": for bootstrapping Nim or Rust lol |
21:07:19 | FromDiscord | <Elegantbeef> Rust |
21:07:23 | FromDiscord | <firasuke> makes sense xD |
21:07:39 | FromDiscord | <firasuke> This is the toolchain I'm using |
21:07:42 | FromDiscord | <firasuke> https://github.com/firasuke/mussel |
21:07:49 | FromDiscord | <Elegantbeef> Though i guess if you were to build the compiler from scratch it'd take some time to bootstrap aswell |
21:07:55 | FromDiscord | <Elegantbeef> The C compiler that is |
21:09:18 | FromDiscord | <firasuke> hmm can you link the latest/newest documentation for bootstrapping Rust |
21:09:29 | FromDiscord | <firasuke> the one I have says that the repo is archived or something |
21:10:22 | FromDiscord | <firasuke> (edit) "Rust" => "Nim" |
21:10:31 | FromDiscord | <firasuke> In reply to @firasuke "hmm can you link": Nim lol |
21:11:13 | FromDiscord | <firasuke> In reply to @Elegantbeef "Though i guess if": You mean Nim's compiler? can we estimate build times in comparison to gcc? equal or less? |
21:12:13 | FromDiscord | <Yardanico> In reply to @firasuke "You mean Nim's compiler?": Nim takes much less to compile than GCC or other C compilers of course, the main reason being that Nim complies to C itself (by default) |
21:12:24 | FromDiscord | <Yardanico> So it reuses existing stuff |
21:12:47 | FromDiscord | <firasuke> Awesome |
21:12:50 | FromDiscord | <Elegantbeef> Nim's compiler takes like 2 minutes on my xeon1231v3 to compile |
21:13:01 | FromDiscord | <firasuke> Superb |
21:13:02 | FromDiscord | <Yardanico> In reply to @firasuke "hmm can you link": Check https://github.com/nim-lang/Nim/blob/devel/build_all.sh and https://github.com/nim-lang/Nim/blob/devel/ci/funs.sh |
21:13:13 | FromDiscord | <firasuke> Awesome, thanks |
21:13:14 | FromDiscord | <Elegantbeef> But i was saying if you were going to compile the entire C and Nim compiler it'd take longer |
21:13:50 | FromDiscord | <firasuke> In reply to @Elegantbeef "But i was saying": Yes for sure, my custom toolchain requires 18 to 20 minute to build a musl/gcc cross-compilation toolchain using a single-pass build for GCC |
21:13:58 | FromDiscord | <firasuke> so it's very much acceptable |
21:14:20 | FromDiscord | <firasuke> So Nim taking a couple of minutes is most certainly nothing |
21:14:48 | FromDiscord | <Yardanico> It's basically compiling Nim compiler out of precompiled C sources (the csources_v1), and then the actual bootstrapping happens with koch - it builds the compiler a few times and compares the binaries to ensure that the bootstrapping is working |
21:15:37 | FromDiscord | <firasuke> In reply to @Yardanico "It's basically compiling Nim": kinda like GCC bootstrap options, and how it can build itself 3 times or so each time with the resulting compiler and apply some optimizations on the resulting build of itself like LTO and the like, understandable |
21:15:50 | FromDiscord | <firasuke> all in all it's still so much less than cloning LLVM's tree and bootstrapping it lol |
21:17:16 | FromDiscord | <jfmonty2> Is there a way to pass a code block to a macro in a single line? Obviously you can with expressions, like a proc call or a boolean compare or whatever, but I can't get it to work for e.g. `mymacro(let x = 3)` or `mymacro: let x = 3` |
21:19:41 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FUX |
21:19:54 | FromDiscord | <Elegantbeef> or `myMacro((let x = 3))` |
21:20:14 | FromDiscord | <firasuke> @Yardanico what about this?β΅https://github.com/nim-lang/csources/blob/master/build.sh |
21:20:44 | FromDiscord | <Yardanico> In reply to @firasuke "<@!177365113899057152> what about this?": This is the old csources repo |
21:20:50 | FromDiscord | <Yardanico> Check csources_v1 one |
21:21:09 | FromDiscord | <firasuke> oh, is that a branch or another repo? |
21:21:16 | FromDiscord | <Yardanico> Another repo |
21:21:29 | FromDiscord | <jfmonty2> @ElegantBeef thanks! didn't know that wrapping in parens would have that effect |
21:21:52 | FromDiscord | <Yardanico> And also, this is just for the initial bootstrapping, even with csources_v1 it bootstraps Nim 1.0 which is then used to compile the newest compiler (Nim 1.6 at the moment if you checkout a stable branch) |
21:22:10 | FromDiscord | <firasuke> Epic |
21:22:14 | FromDiscord | <firasuke> I love how Nim is LLVM-free lol |
21:22:17 | FromDiscord | <Elegantbeef> Yea you can abuse `()` for manything it lets you right many programs single lined |
21:22:37 | FromDiscord | <Elegantbeef> Dont say that too loudly some dislike that it's not using llvm π |
21:22:45 | FromDiscord | <firasuke> Will their be a gcc frontend for nim? |
21:22:57 | FromDiscord | <Yardanico> In reply to @jfmonty2 "<@!145405730571288577> thanks! didn't know": This feature is called "statement list expression" btw |
21:23:01 | FromDiscord | <Yardanico> You can find it in the manual |
21:23:02 | FromDiscord | <firasuke> (edit) "gcc" => "Nim" | "nim?" => "GCC?" |
21:23:31 | FromDiscord | <Elegantbeef> write many programs\ jeez where is rika to bitch and moan at my spelling |
21:23:34 | FromDiscord | <jfmonty2> thanks, I was looking in the docs but I couldn't find a full list of AST node types with explanations anywhere |
21:24:19 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/macros.html#the-ast-in-nim explains them a bit, but i generally just write what i want in a `dumpTree` block and use that |
21:24:26 | FromDiscord | <Yardanico> In reply to @firasuke "Will their be a": Don't think so, currently C backend is pretty stable and allows for painless C interop |
21:24:34 | FromDiscord | <Sevos> hello y'all |
21:24:41 | FromDiscord | <Yardanico> Nim also has C++, Objective C and JS backends |
21:24:41 | FromDiscord | <Elegantbeef> Hello |
21:24:48 | FromDiscord | <Elegantbeef> So many new people |
21:24:51 | FromDiscord | <firasuke> In reply to @Yardanico "Don't think so, currently": which is perfect, just inquiring, thanks |
21:25:15 | FromDiscord | <Elegantbeef> There is also the `nlvm` compiler which as the name implies uses `llvm` |
21:25:16 | FromDiscord | <jfmonty2> dumpTree works if you have syntax and you want the node names, but my issue was I didn't know what syntax would produce the effect I was looking for |
21:25:29 | FromDiscord | <Sevos> so Nim combines the ease of Python with the efficiency of C/Rust? |
21:25:36 | FromDiscord | <Sevos> i discovered this language just now |
21:25:42 | FromDiscord | <Elegantbeef> Yea that's just the case of "learn the AST" π |
21:25:53 | FromDiscord | <Elegantbeef> It's fast with an expressive syntax |
21:26:04 | FromDiscord | <Elegantbeef> So if that's how you describe that, then yess |
21:26:20 | FromDiscord | <Sevos> by expressive you mean you don't have to code a lot of extra stuff in order to achieve something? |
21:26:27 | FromDiscord | <jfmonty2> I wouldn't say Nim is _quite_ as easy as python, coming from python myself, although it's certainly much easier than other compiled/static typed languages I've tried |
21:26:31 | FromDiscord | <Elegantbeef> Easy to read and write |
21:26:52 | FromDiscord | <Sevos> > Support for various backends: it compiles to C, C++ or JavaScript so that Nim can be used for all backend and frontend needs.β΅interesting - how does that work? |
21:27:15 | FromDiscord | <Elegantbeef> The compiler takes the code and outputs files that work with the given backends |
21:27:16 | FromDiscord | <Sevos> it "rewrites" the entire code to something C/C++/JS-like? |
21:27:28 | FromDiscord | <Sevos> nice lol |
21:27:34 | FromDiscord | <Yardanico> In reply to @Sevos "it "rewrites" the entire": Yeah, although since it's a compiler the term is "compiles" :) |
21:27:34 | FromDiscord | <Sevos> didn't even know that's possible |
21:27:43 | FromDiscord | <firasuke> In reply to @jfmonty2 "I wouldn't say Nim": It certainly is easier than Rust, C and C++ for example. |
21:27:43 | FromDiscord | <Yardanico> It doesn't use advanced features of C++ or JS |
21:27:46 | FromDiscord | <Elegantbeef> there are multiple stages to the compiler, Lexer/Parser -\> Semantic Analysis -\> code generation |
21:27:50 | FromDiscord | <Yardanico> It just treats them as simple backends |
21:28:10 | FromDiscord | <Elegantbeef> code generation is a sort of pluggable system where you get the AST and emit the files required for the language |
21:28:11 | FromDiscord | <jfmonty2> In reply to @firasuke "It certainly is easier": Rust is exactly what I was thinking of. I love the idea of the language but boy is it a pain to get started in |
21:28:39 | FromDiscord | <firasuke> In reply to @jfmonty2 "Rust is exactly what": Same, I won't stop using Rust, but having Nim as an asset is super powerful as well. |
21:28:55 | FromDiscord | <Elegantbeef> AST being the abstract syntax tree, which is just the code as reasoned/parsed data |
21:29:17 | FromDiscord | <Recruit_main707> In reply to @jfmonty2 "I wouldn't say Nim": i started coding in python and had a hard time switching to other langs because everything was a magic box for me that just worked, im glad i went to a lower level, it made things easier to understand |
21:29:30 | FromDiscord | <Elegantbeef> When notnil and views become stable there will be no reason to use Rust! π |
21:29:42 | FromDiscord | <jfmonty2> Agreed, just figuring out the stack/heap distinction was a huge jump in my understanding as well (which is not a distinction that you can really make in pythong) |
21:29:44 | FromDiscord | <jfmonty2> (edit) "pythong)" => "python)" |
21:30:25 | FromDiscord | <Sevos> @ElegantBeef you're the creator of this language? asking because you're "a bot" |
21:30:33 | FromDiscord | <Elegantbeef> I came from C# and picking up Nim helped a lot with fundamentals and increased my code quality |
21:30:37 | FromDiscord | <Sevos> i assume you did this in order to effectively avoid DM's / friend invites etc? |
21:30:46 | FromDiscord | <Sevos> In reply to @Elegantbeef "I came from C#": OK, that answered my question ahaha |
21:30:48 | FromDiscord | <IsaacPaul> He is an advanced AI programmed in nim |
21:30:49 | FromDiscord | <Elegantbeef> Nah i've contributed a bit, but i'm just on matrix |
21:30:54 | FromDiscord | <IsaacPaul> exactly |
21:30:56 | FromDiscord | <jfmonty2> ah matrix, I was wondering which bridge it is |
21:31:07 | FromDiscord | <jfmonty2> Do you run your own bridge? Is that how you have a distinct user? |
21:31:19 | FromDiscord | <Yardanico> In reply to @jfmonty2 "Do you run your": No, these are discord webhooks |
21:31:21 | FromDiscord | <Elegantbeef> Nah the matrix bridge is just smart |
21:31:26 | FromDiscord | <jfmonty2> huh nice |
21:31:29 | FromDiscord | <jfmonty2> Didn't realize it had come that far |
21:31:42 | FromDiscord | <Elegantbeef> The Discord -\> matrix side even shows discord users typing |
21:31:47 | FromDiscord | <Yardanico> For matrix we use t2bot.io |
21:31:51 | FromDiscord | <jfmonty2> I have a matrix homeserver but rarely use it because I'm too lazy to set up all the bridges to make it useful π |
21:31:55 | FromDiscord | <Elegantbeef> Some nice QoL features with it |
21:32:00 | FromDiscord | <Yardanico> For IRC it's my own bridge :P |
21:32:12 | FromDiscord | <Yardanico> In reply to @Elegantbeef "Some nice QoL features": Sadly no proper discord pings or edit support :( |
21:32:17 | FromDiscord | <Sevos> funny that i'm in here |
21:32:18 | FromDiscord | <Elegantbeef> cmon monty use matrix, it's cooler! π |
21:32:20 | FromDiscord | <Sevos> i have never programmed in my life |
21:32:23 | FromDiscord | <Sevos> cuz me too dumb for that π |
21:32:31 | FromDiscord | <jfmonty2> always time to learn! |
21:32:35 | FromDiscord | <Sevos> nah, i'm dumb |
21:32:39 | FromDiscord | <Sevos> i even suck at maths |
21:32:44 | FromDiscord | <Elegantbeef> So what |
21:32:50 | FromDiscord | <Sevos> but hey! |
21:32:52 | FromDiscord | <jfmonty2> don't need maths, all the hard problems have been solved already by other people |
21:32:53 | FromDiscord | <Sevos> i can print hello world |
21:33:01 | FromDiscord | <jfmonty2> You can have a lot of fun (and do a lot of useful stuff) just wiring together other people's code |
21:33:03 | FromDiscord | <Sevos> π |
21:33:03 | FromDiscord | <Sevos> sent a code paste, see https://play.nim-lang.org/#ix=E4Z |
21:33:09 | FromDiscord | <jfmonty2> tbh that's ~90% of programming nowadays |
21:33:14 | FromDiscord | <Elegantbeef> Not how we do it here, going to get a f- |
21:33:31 | FromDiscord | <Sevos> sent a code paste, see https://play.nim-lang.org/#ix=1X8p |
21:33:33 | FromDiscord | <Sevos> happier now? :uwu: |
21:33:49 | FromDiscord | <Sevos> In reply to @jfmonty2 "tbh that's ~90% of": lmao |
21:34:07 | FromDiscord | <Elegantbeef> How dare you imply that all i've done is glue code together... Quickly deletes my game framework that glues opengl/sdl/assimp together |
21:34:25 | FromDiscord | <jfmonty2> π |
21:34:33 | FromDiscord | <jfmonty2> hey I'm not throwing shade, I work in devops primarily |
21:34:38 | FromDiscord | <jfmonty2> basically the definition of gluing stuff together |
21:35:30 | FromDiscord | <Sevos> actually guys |
21:35:43 | FromDiscord | <Sevos> due to tomorrow i have to memorize 10 formulas |
21:35:48 | FromDiscord | <Sevos> any tips how to learn it quickly? |
21:35:57 | FromDiscord | <Elegantbeef> Tomorrow is a bad day |
21:36:03 | FromDiscord | <Sevos> i agree |
21:36:44 | FromDiscord | <IsaacPaul> -b (+ or -) radical b squared - 4ac all divided by 2a |
21:36:50 | FromDiscord | <IsaacPaul> just remember that in sing-song format |
21:37:12 | FromDiscord | <Sevos> xd |
21:37:16 | FromDiscord | <IsaacPaul> then you have the quadratic formula |
21:37:17 | FromDiscord | <Sevos> it's not maths but thanks Isaac β€οΈ |
21:37:26 | FromDiscord | <Sevos> from now on you're my bestie |
21:37:27 | FromDiscord | <Sevos> i'm gonna stalk you |
21:37:42 | FromDiscord | <Sevos> friend invite sent. i'll harrass you as much as possible π |
21:38:51 | FromDiscord | <Yardanico> I hate to be that guy but we have #offtopic :) |
21:38:51 | FromDiscord | <Elegantbeef> Eh monty has moved to the matrix! |
21:39:11 | FromDiscord | <jfmonty2> still syncing history but we'll see |
21:39:43 | FromDiscord | <jfmonty2> Once threading support finishes landing in Matrix I might take another stab at moving to it more fully |
21:39:59 | FromDiscord | <Sevos> he rejecteed me π¦ |
21:40:16 | FromDiscord | <Sevos> In reply to @Yardanico "I hate to be": sure |
21:41:22 | FromDiscord | <Sevos> In reply to @Elegantbeef "there are multiple stages": does that work the other way around? |
21:41:30 | FromDiscord | <Sevos> e. g. importing Python modules |
21:41:42 | FromDiscord | <Yardanico> In reply to @Sevos "e. g. importing Python": not sure what you mean |
21:41:52 | FromDiscord | <Sevos> Python has a lot of libraries that can be used |
21:42:01 | FromDiscord | <Sevos> alone this fact makes programming much easier i guess |
21:42:02 | FromDiscord | <Yardanico> For importing python modules we have nimpy which uses CPython's C FFI |
21:42:42 | FromDiscord | <Sevos> nice lol |
21:43:03 | FromDiscord | <Sevos> ah |
21:43:07 | FromDiscord | <Elegantbeef> Yea monty, i only want 2 things really a functioning Nim sdk(it's started) and a channelled voip π |
21:43:27 | FromDiscord | <jfmonty2> Interesting, who's working on the nim sdk? I might have to take a look |
21:44:00 | FromDiscord | <Elegantbeef> https://github.com/dylhack/matrix-nim-sdk is where it's at and it of course has a matrix room |
21:44:22 | FromDiscord | <Elegantbeef> I have thought about properly contributing, but I need to read/look into how the API should be done |
21:44:50 | FromDiscord | <jfmonty2> Yeah, think I'd have to try writing a bot in it or something before I'd feel ready to contribute |
21:44:53 | FromDiscord | <Elegantbeef> Presently my contribution is just adding a macro that removes redundant procs due to using a generic for async |
21:45:19 | FromDiscord | <jfmonty2> That's another thing, I haven't really messed with async in nim at all |
21:45:20 | FromDiscord | <Sevos> @ElegantBeef how did you learn programming? |
21:45:42 | FromDiscord | <Elegantbeef> Primarily through trying to make games using the Unity engine |
21:45:47 | FromDiscord | <Sevos> oof |
21:48:16 | FromDiscord | <Elegantbeef> I dont get what's oof worthy there, and i never will |
22:33:28 | FromDiscord | <lenis> ^ |
22:34:02 | FromDiscord | <lenis> I learned it through Minecraft. and now I work for the largest commercial bank in my country |
23:07:42 | FromDiscord | <treeform> In reply to @@droptweetrxd_twitter-5a0487c2d7 "hi. does someone": Also globby is not that great. We ended up not using it that much. |
23:09:04 | FromDiscord | <evoalg> @treeform I use your `print` all the time and I want it in std libs or even in system! π |
23:10:49 | FromDiscord | <Elegantbeef> This is why stdlib distributions are a good idea |
23:11:52 | FromDiscord | <Elegantbeef> But alas, guess you can always just always import the file in your nimcfg |
23:14:38 | FromDiscord | <Elegantbeef> For instance you can add `--import:"print"` to `.config/nim/nim.cfg` then you dont need to import `print` any more |
23:15:07 | FromDiscord | <Elegantbeef> The downside is it's global so if you release a library and use print i'll complain on the user side if you forget to add it as a dep |
23:15:09 | FromDiscord | <evoalg> I have to print out vars so much while I'm debugging etc and so when I do `print a, b, myseq` I get this printed out `a=4 b="foo bar" myseq=@[1, 2, 3]` (and in pretty colors) and it's so helpful and saves typing, speeds up debugging (for me) |
23:15:46 | FromDiscord | <Elegantbeef> otherwise you can put a `config.nims` with `--import:"print"` in your local file |
23:15:56 | FromDiscord | <Elegantbeef> Depends what you're doing/wanting, just something to consider |
23:16:11 | FromDiscord | <evoalg> interesting - thanks! |
23:16:59 | FromDiscord | <evoalg> does the .nims have the same format as nim.cfg? |
23:17:31 | FromDiscord | <Elegantbeef> `.nims` is a nimscript file, it has to be parseable nim, but there is a template/macro for `--import:"print"` syntax |
23:17:50 | FromDiscord | <Elegantbeef> comiically that's just `--(import, "print")` π |
23:18:42 | FromDiscord | <Elegantbeef> You dont have to do the latter it's just how it expands, the `--a:b` works fine |
23:19:12 | FromDiscord | <evoalg> so I could put `--import:"print"` in either config.nims or nim.cfg? I don't really now what nimscript is for? |
23:19:21 | FromDiscord | <Elegantbeef> Yes |
23:19:44 | FromDiscord | <Elegantbeef> Nimscript is just a scriptable subset of Nim, so it can be used for manythings, configuration, program scripting... whatever you use a scripting language fo |
23:20:02 | FromDiscord | <Elegantbeef> For instance this is nimscript in use with my interop https://streamable.com/9zr8w4 |
23:20:44 | FromDiscord | <Elegantbeef> In this case of course nimscript is being used to call functions and set values for the compiler before it's fully invoked |
23:21:02 | FromDiscord | <evoalg> is that updating live like being interpreted? |
23:21:11 | FromDiscord | <Elegantbeef> It is being interpreted |
23:21:16 | FromDiscord | <Elegantbeef> Since it's nimscript |
23:21:27 | FromDiscord | <Elegantbeef> Nimscript is also what is used for macros/compile time evaluation |
23:21:34 | FromDiscord | <Elegantbeef> So this links back to `static` π |
23:21:53 | FromDiscord | <evoalg> hehe true. I didn't know Nim had an interpreter |
23:22:17 | FromDiscord | <Elegantbeef> It does and it's pretty nifty |
23:22:36 | FromDiscord | <evoalg> it's not a repl though right? |
23:22:50 | FromDiscord | <Elegantbeef> Nope, it's a VM |
23:23:02 | FromDiscord | <Elegantbeef> it takes Nim code converts it to op codes and then runs it |
23:23:15 | FromDiscord | <Elegantbeef> So it can be used like a REPL but not explicitly one |
23:23:23 | FromDiscord | <Elegantbeef> `nim secret` is the repl usage of it |
23:23:37 | FromDiscord | <Elegantbeef> Though if you want a repl i'd still say inim is the best, it's not instant but pretty fast |
23:24:32 | FromDiscord | <evoalg> yea inim is just a bit annoying that it's slow, so I end up not using it much |
23:25:07 | FromDiscord | <Elegantbeef> Yea i prefer a proper editor anyway so i just do that whole `nvim /tmp/someFile.nim` |
23:25:17 | FromDiscord | <Elegantbeef> it's functionally the same to me |
23:26:02 | FromDiscord | <Elegantbeef> Though i also use nim-playground so i guess i'm dishonest |
23:26:03 | FromDiscord | <evoalg> is nimscript a strict subset of Nim? |
23:26:08 | FromDiscord | <Elegantbeef> Yep |
23:26:18 | FromDiscord | <Elegantbeef> Some things are unimplemented or invalid |
23:26:29 | FromDiscord | <Elegantbeef> C interop for one, some type casting is aswell |
23:26:53 | FromDiscord | <evoalg> does nimscript work in playground? |
23:27:03 | FromDiscord | <Elegantbeef> Nah |
23:27:17 | FromDiscord | <Elegantbeef> Well yes the compile time/macros work, but you cant write nimscript |
23:27:25 | FromDiscord | <Elegantbeef> It always compiles |
23:28:05 | FromDiscord | <evoalg> can you give me a really simple example of a nimscript file and how I would run it? |
23:28:42 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FVp |
23:29:22 | FromDiscord | <evoalg> oooo thank you! |
23:29:32 | FromDiscord | <enthus1ast> but when you want to embed nimscript into your application you could use nimscripter |
23:29:42 | FromDiscord | <enthus1ast> or use the compilerapi directly |
23:29:52 | FromDiscord | <Elegantbeef> Lol i dont even have to whore my own libraries anymore |
23:30:07 | FromDiscord | <enthus1ast> ;) |
23:31:02 | * | pch quit (Quit: Leaving) |
23:31:06 | FromDiscord | <evoalg> it's pretty darn fast |
23:31:30 | FromDiscord | <Elegantbeef> Just think the startup time can be made faster with a minor change to the compiler π |
23:33:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3FVr |
23:33:16 | FromDiscord | <Elegantbeef> All documented here https://nim-lang.org/docs/nims.html and https://nim-lang.org/docs/nimscript.html |
23:33:53 | FromDiscord | <evoalg> do you use it much yourself? |
23:34:12 | FromDiscord | <Elegantbeef> not as an external scripting language, i do have plans for it as an embedded one |
23:34:25 | FromDiscord | <Elegantbeef> I dont need scripting languages much |
23:34:48 | * | src_ joined #nim |
23:34:55 | * | kayabaNerve joined #nim |
23:35:12 | FromDiscord | <Elegantbeef> Like i plan on removing the Toml config and replacing it with nimscript for my WM, but that involves me working on it again, couldnt ever get the gnome password guard to properly unlock for me |
23:35:53 | FromDiscord | <evoalg> wow |
23:36:56 | FromDiscord | <evoalg> why do you do test files in `/tmp/someFile.nim` (and playground) and not nimscript (eg `/tmp/someFile.nims`) if it's faster? |
23:37:15 | FromDiscord | <Elegantbeef> Cause it's not noticeably faster |
23:37:50 | FromDiscord | <Elegantbeef> Compiling a small program takes all but a second on my machine, booting up the vm takes probably 100ms |
23:37:51 | * | src quit (Ping timeout: 245 seconds) |
23:38:15 | FromDiscord | <Elegantbeef> One thing i did want to do is make a REPL for macros |
23:39:19 | FromDiscord | <Elegantbeef> A small program that takes a nimscript file you write macros in and output the AST in a nice graphic, something like a projective editor just no dragging/dropping |
23:39:44 | FromDiscord | <evoalg> ahhhh nice |
23:40:25 | FromDiscord | <evoalg> You're so smart, it makes me appreciate how you come down to my level to explain things in a way I can understand |
23:40:41 | FromDiscord | <Elegantbeef> It's funny you say that cause i dont feel that smart π |
23:41:53 | nixfreaknim[m] | Elegantbeef how can I loop through all the pubDates , do I have to know the ending range? |
23:42:19 | FromDiscord | <Elegantbeef> `for x in rssData.items: echo x.pubDate` |
23:42:44 | FromDiscord | <Elegantbeef> Damn it evo now i really want to make that silly tool, shame on you |
23:43:30 | nixfreaknim[m] | Thanks |
23:44:39 | FromDiscord | <evoalg> lol |
23:45:04 | * | src_ quit (Quit: Leaving) |
23:45:14 | * | src joined #nim |
23:45:15 | * | Vladar quit (Quit: Leaving) |
23:46:18 | FromDiscord | <Elegantbeef> [enthus1ast](https://matrix.to/#/@sn0re:matrix.code0.xyz)\: also have you used nimscripter any? |
23:49:00 | * | pch joined #nim |
23:51:08 | FromDiscord | <evoalg> when I try and run the nimscript example `nim e eg2.nims` it fails with a ValueError ... I tried `nim e eg2.nims 5` too but still no good |
23:51:37 | FromDiscord | <Elegantbeef> I set it up for the shebang so the`paramStr` should be like 4 or 5 |
23:52:57 | FromDiscord | <evoalg> `nim e eg2.nims 5 5 5 5 5 5` didn't work either ... I don't know how to run it π |
23:54:41 | FromDiscord | <evoalg> Oh I reread what you said ... it's working now! |
23:55:06 | FromDiscord | <evoalg> I had to use `paramStr(3)` |