00:04:20 | * | progranner joined #nim |
00:08:33 | * | progranner quit (Ping timeout: 250 seconds) |
00:09:53 | FromDiscord | <Nilts> Is the "std/hash" module secure? The hashes are quite short |
00:12:19 | * | progranner joined #nim |
00:15:41 | * | progranner quit (Client Quit) |
00:16:06 | * | progranner joined #nim |
00:19:17 | FromDiscord | <Rika> theyre not for cryptographic purposes |
00:20:30 | * | progranner quit (Ping timeout: 252 seconds) |
00:20:53 | FromDiscord | <Nilts> In reply to @Rika "theyre not for cryptographic": then what hash should i use |
00:21:02 | FromDiscord | <Rika> sha? |
00:21:37 | FromDiscord | <Rika> https://github.com/cheatfate/nimcrypto/blob/master/nimcrypto/sha2.nim |
00:22:37 | FromDiscord | <Nilts> In reply to @Rika "https://github.com/cheatfate/nimcrypto/blob/master/": is sha2 fast? |
00:22:56 | FromDiscord | <Rika> are you sure you want to be concerned about speed before security? |
00:23:16 | FromDiscord | <Rika> well, rather, do you know that you need speed |
00:23:29 | FromDiscord | <Rika> but yes it can be assumed that it is fast |
00:23:35 | FromDiscord | <Rika> but it depends on what you need it for |
00:23:40 | FromDiscord | <Nilts> In reply to @Rika "are you sure you": no, I was just wondering if it was incredibly slow (I am making a website) |
00:23:46 | FromDiscord | <Nilts> In reply to @Rika "but it depends on": passwords? |
00:23:52 | FromDiscord | <Rika> sha2 is wildly used |
00:24:07 | FromDiscord | <Rika> for passwords it is recommended to go with another algorithm |
00:24:17 | FromDiscord | <Rika> like bcrypt or argon2 |
00:25:07 | FromDiscord | <Nilts> In reply to @Rika "like bcrypt or argon2": are any of those in nimcrypto or another lib? |
00:26:02 | FromDiscord | <Rika> https://github.com/Ahrotahn/argon2 binding |
00:26:14 | FromDiscord | <amadan> https://github.com/PhilippMDoerner/nimword this also supports argon2 |
00:26:55 | FromDiscord | <Rika> sure |
00:29:24 | FromDiscord | <Nilts> In reply to @Rika "https://github.com/Ahrotahn/argon2 binding": what should salt be (Sorry I am new) |
00:29:31 | FromDiscord | <Nilts> (edit) "new)" => "new to password hashing)" |
00:29:51 | FromDiscord | <Rika> random value that you store unmodified alongside the password |
00:29:53 | FromDiscord | <Rika> (edit) "random value that you store unmodified alongside the password ... " added "hash" |
00:29:56 | FromDiscord | <Rika> (edit) "random value that you store unmodified alongside the password hash ... " added "in the database" |
00:30:31 | FromDiscord | <Rika> https://www.globalsign.com/en/blog/what-is-password-salting maybe helps |
00:40:21 | FromDiscord | <Nilts> In reply to @Rika "random value that you": but then both are leaked in a database leak (if that happens) |
00:40:34 | FromDiscord | <Rika> In reply to @not logged in "but then both are": yes that is inevitable |
00:40:55 | FromDiscord | <Nilts> In reply to @Rika "yes that is inevitable": then how does it make it more secure? |
00:40:55 | FromDiscord | <Rika> without a salt, an adversary can precalculate a bunch of hashes for weak passwords |
00:41:20 | FromDiscord | <Rika> with a salt, the adversary then also needs to make the calculation with the salt |
00:41:23 | FromDiscord | <Rika> but the salt is random |
00:41:31 | FromDiscord | <Rika> so they cant really precalculate anymore |
00:41:38 | FromDiscord | <Nilts> In reply to @Rika "so they cant really": ah |
00:42:17 | FromDiscord | <Nilts> how large should it be, and is https://nim-lang.org/docs/sysrand.html suitable |
00:43:03 | FromDiscord | <Rika> sysrand is okayβ΅size should be more than 32 bytes iirc |
00:43:29 | FromDiscord | <Rika> wait |
00:43:33 | FromDiscord | <Rika> 32 bits |
00:43:34 | FromDiscord | <Nilts> In reply to @Rika "sysrand is okay size": 64 ok? |
00:43:35 | FromDiscord | <Rika> lo |
00:43:57 | FromDiscord | <Rika> wait |
00:43:58 | FromDiscord | <Nilts> In reply to @Rika "32 bits": wait so 16 bytes should be enough? |
00:44:06 | FromDiscord | <Rika> i'm still searching on how many bytes |
00:44:07 | FromDiscord | <Rika> or bits |
00:44:18 | FromDiscord | <Rika> because the data is conflicting and im not a cryptographic expert |
00:44:37 | FromDiscord | <Rika> `Salt Length: The authors of Argon2 recommend this parameter to be 128 bits, but say it can be reduced to 64 bits in the case of space constraints.` |
00:45:46 | FromDiscord | <Nilts> In reply to @Rika "`Salt Length: The authors": so go with that? |
00:46:58 | FromDiscord | <Rika> sure yes |
00:47:23 | * | rockcavera quit (Remote host closed the connection) |
01:00:08 | FromDiscord | <flora1> "I'll teach 10individuals how to earn $100,000 in 72 hours from the crypto market. But you will pay me 10% commission when you receive your profit. if interested send me a direct message by asking me (HOW) for more details on how to get startedhttps://t.me/FloraGordon |
01:00:23 | * | azimut joined #nim |
01:05:01 | FromDiscord | <ββ> <@&371760044473319454> crypto scam |
01:07:50 | FromDiscord | <Yepoleb> thanks |
01:15:15 | FromDiscord | <Rika> i misread as crypto spam and i was confused lmao |
01:15:32 | FromDiscord | <Rika> like "yes but i think your image of crypto is a bit wrong" |
01:38:13 | FromDiscord | <Dudugz> Can someone give me an example of threading in Nim to run two heavy tasks in parallel? |
01:38:28 | FromDiscord | <Dudugz> I'm not sure how I'm supposed to do this. |
01:38:45 | * | arkurious quit (Quit: Leaving) |
01:39:33 | FromDiscord | <Dudugz> And it would also be nice if you could tell me if I could have all the clients of a server running on one thread, like accept the connection and then create an object that handles that connection on one thread |
01:54:19 | * | ltriant quit (Read error: Connection reset by peer) |
01:59:34 | * | ltriant joined #nim |
02:07:10 | FromDiscord | <michaelb.eth> In reply to @Dudugz "And it would also": for that purpose, checkout mummy: https://github.com/guzba/mummy |
02:07:31 | FromDiscord | <michaelb.eth> > Mummy operates with this basic model: handle all socket IO on one thread and dispatch incoming HTTP requests and WebSocket events to a pool of worker threads. Your HTTP handlers probably won't even need to think about threads at all. |
02:08:27 | FromDiscord | <Dudugz> TCP tho, not http |
02:08:32 | FromDiscord | <Dudugz> But i'll check |
02:08:37 | FromDiscord | <michaelb.eth> ah, I see |
02:09:09 | FromDiscord | <Dudugz> Yea no, i'm using TCP server, not HTTP |
02:09:21 | FromDiscord | <Dudugz> mummy is purely http-oriented |
02:09:46 | FromDiscord | <michaelb.eth> sure, but I'm wondering if you could take some inspiration from some of its internals |
02:10:12 | FromDiscord | <michaelb.eth> I may have misunderstood your use case, though |
02:10:22 | FromDiscord | <michaelb.eth> (edit) removed "some" |
02:11:10 | FromDiscord | <Dudugz> Maybe, I wanted to understand how threading works in Nim but there is no useful article, the one I found spoke of system/threads which says it is not to be imported |
02:11:22 | FromDiscord | <Yardanico> I don't do multithreading stuff, but from some basic info iirc you can listen on the same port in different threads with SO_REUSEPORT? |
02:11:45 | FromDiscord | <Dudugz> It's not what I meant |
02:12:06 | FromDiscord | <Dudugz> I meant to accept the connection with the client and invoke a thread to handle the client |
02:12:12 | FromDiscord | <Yardanico> In reply to @Dudugz "Maybe, I wanted to": the note about the import is just because everything in system is always imported |
02:12:23 | FromDiscord | <Yardanico> Threads module is always imported when you have --threads:on |
02:12:37 | FromDiscord | <Dudugz> Yes but the example there is not very clear either |
02:12:59 | FromDiscord | <Yardanico> If you're getting errors in the IDE it's because you also have to add the switch to the config file for your main Nim file so it picks it up |
02:13:03 | FromDiscord | <Dudugz> Like thereads[i].createThread(i, func, (x, y)) |
02:13:18 | FromDiscord | <Dudugz> (edit) "thereads[i].createThread(i," => "threads[i].createThread(i," |
02:13:29 | FromDiscord | <Yardanico> In reply to @Dudugz "Like threads[i].createThread(i, func, (x,": that just creates a thread and passes some arguments to our |
02:13:31 | FromDiscord | <Yardanico> to it |
02:13:52 | FromDiscord | <michaelb.eth> In reply to @Dudugz "Maybe, I wanted to": one thing to be aware of is that the default memory model in 1.6 and earlier is different than the memory model in upcoming 2.0 (and its release candidates), and that has a bearing on inter-thread communication |
02:14:45 | FromDiscord | <Dudugz> Hmm |
02:14:45 | FromDiscord | <michaelb.eth> (edit) "In reply to @Dudugz "Maybe, I wanted to": one thing to be aware of is that the default memory model in 1.6 and earlier is different than the ... memory" added "default" |
02:15:07 | FromDiscord | <Yardanico> yeah, refc has local heap |
02:15:23 | FromDiscord | <Yardanico> arc/orc have a global one, but you still need to ensure that only one thread accesses same location |
02:15:36 | FromDiscord | <Yardanico> Since Nim refs aren't atomic |
02:17:48 | FromDiscord | <Elegantbeef> Well not really true that they cannot both access it |
02:17:55 | FromDiscord | <Elegantbeef> More just you have to ensure one thread is the owner |
02:25:02 | * | xet7 joined #nim |
02:47:44 | FromDiscord | <leorize> and you're limited to looking at the ref |
02:47:49 | FromDiscord | <leorize> copying it can be fatal |
02:48:14 | FromDiscord | <Elegantbeef> All the `{.cursor.}`sd |
03:41:08 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4tTr |
03:41:29 | FromDiscord | <Rika> no |
03:41:49 | FromDiscord | <Dudugz> Hm, there isn't a decent example on the internet so I don't know how to do it |
03:42:58 | FromDiscord | <Rika> sent a code paste, see https://play.nim-lang.org/#ix=4tTs |
03:43:10 | FromDiscord | <Dudugz> '-' what's the difference |
03:43:25 | FromDiscord | <Dudugz> does the same thing just stores the thread in a variable |
03:43:37 | FromDiscord | <Rika> im not sure what you meant then |
03:43:55 | FromDiscord | <Elegantbeef> create thread takes a `var Thread` |
03:44:04 | FromDiscord | <Rika> noit the type |
03:44:06 | FromDiscord | <Dudugz> Oh, got it |
03:44:51 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/threads.html#examples to b e fair there is an example |
03:45:13 | FromDiscord | <Dudugz> Not a good one tho |
03:45:21 | FromDiscord | <Dudugz> this example is confusing |
03:46:33 | FromDiscord | <Rika> i dont really see how |
03:46:46 | FromDiscord | <Rika> tehn again ofc |
04:09:14 | FromDiscord | <Yardanico> In reply to @Dudugz "this example is confusing": anything specific? |
04:11:24 | FromDiscord | <Yardanico> sent a long message, see http://ix.io/4tTz |
04:11:35 | * | azimut quit (Ping timeout: 255 seconds) |
04:12:20 | * | pharonix71 quit (Remote host closed the connection) |
04:12:34 | * | azimut joined #nim |
04:12:53 | * | pharonix71 joined #nim |
04:13:48 | FromDiscord | <Yardanico> I do agree that there should be more blog posts and examples on this, since it seems that everyone has to figure out how threads in Nim exactly work by themselves |
04:13:50 | FromDiscord | <Yardanico> :) |
04:13:57 | FromDiscord | <Yardanico> and info is scattered through a lot of forum topics and chats, e.g. https://forum.nim-lang.org/t/9309 |
04:14:26 | FromDiscord | <Elegantbeef> Especially with orc being default it's certainly going to be needed |
04:15:49 | FromDiscord | <Yardanico> --threads:on by default is going to be a fun surprise to all the async users ;) |
04:16:03 | FromDiscord | <Yardanico> especially with new changes to gcsafe which made me cast(gcsafe) for telebot |
04:16:30 | FromDiscord | <Yardanico> on its own that didn't work btw, so I also added --threadAnalysis:off |
04:16:52 | arkanoid | I have a piece of code that works on linux but does not on windows. Initial debugging shows me that this seems related on how different is the linux and windows asyncdispatch implementation |
04:17:04 | FromDiscord | <Yardanico> and yes, just --threadAnalysis:off doesn't work, only when it's together with cast(gcsafe) |
04:17:16 | FromDiscord | <Yardanico> @Arkanoid that certainly can be the case since asyncdispatch has different implementations for selectors depending on the OS |
04:18:20 | FromDiscord | <Yardanico> https://nim-lang.org/docs/selectors.html has some info about it |
04:25:20 | * | derpydoo joined #nim |
04:32:11 | * | lucasta quit (Remote host closed the connection) |
04:32:42 | * | lucasta joined #nim |
04:33:12 | * | onetwo quit (Quit: The Lounge - https://thelounge.chat) |
04:35:14 | arkanoid | thanks. I've opened a github issue with minimal example for the relevant package |
04:36:21 | FromDiscord | <Yardanico> can you link it here too? |
04:52:44 | arkanoid | Yardanico: https://github.com/simonkrauter/NiGui/issues/174 |
04:52:50 | FromDiscord | <Yardanico> ohh, nigui |
04:54:08 | arkanoid | yes, I'm playing with it. it is nice, until I forced myself into using async with it. I went smooth with linux, but windows behaves weird |
04:54:27 | arkanoid | I'm now really into windows, so it is quite hard for me to understand what is going on |
05:16:58 | FromDiscord | <Bung> `..\config.nims(1, 2) Error: unknown warning: UnnamedBreak` how to solve this in devel ? I have remove `csources_v2` and run `build_all.bat` |
05:17:22 | FromDiscord | <Elegantbeef> Have you removed your build cache? |
05:17:59 | FromDiscord | <Bung> where it located ? |
05:18:15 | FromDiscord | <Elegantbeef> `~/.cache/nim/...` |
05:18:54 | FromDiscord | <Yardanico> and on windows it's in user folder |
05:20:25 | * | lucasta quit (Read error: Connection reset by peer) |
05:21:04 | FromDiscord | <Bung> `~/nimcache` right? I don't find `~/.cache/nim/` |
05:21:19 | FromDiscord | <Yardanico> In reply to @Bung "`~/nimcache` right? I don't": no, it should be ~/.cache/nim on linux at least |
05:21:27 | FromDiscord | <Yardanico> /home/yourname/.cache/nim/ |
05:22:16 | FromDiscord | <Yardanico> this is if we're talking about generic nim cache, nim compiler saves cache in a separate folder |
05:22:34 | FromDiscord | <Yardanico> check your Nim folder, it should have a `nimcache` folder |
05:23:30 | FromDiscord | <Bung> oh, I see , thank you guys |
05:41:00 | * | advesperacit joined #nim |
05:42:34 | * | derpydoo quit (Quit: derpydoo) |
05:43:30 | * | ltriant quit (Read error: Connection reset by peer) |
05:45:04 | * | derpydoo joined #nim |
05:48:44 | * | ltriant joined #nim |
06:46:45 | FromDiscord | <JeysonFlores> sent a long message, see http://ix.io/4tU7 |
06:48:19 | FromDiscord | <Elegantbeef> Your way is more sensible |
06:48:21 | * | PMunch joined #nim |
06:48:25 | * | Notxor joined #nim |
06:49:38 | FromDiscord | <JeysonFlores> what do you mean with "sensible"? |
06:50:03 | FromDiscord | <Elegantbeef> I mean it's what i do |
06:50:34 | FromDiscord | <JeysonFlores> oh I see |
06:51:29 | FromDiscord | <Elegantbeef> Then again i'd probably not use a callback, but i'm a weirdo that prefers static typing |
06:54:29 | * | adigitoleo_ joined #nim |
07:15:12 | * | cm quit (Ping timeout: 255 seconds) |
07:29:32 | * | Notxor quit (Remote host closed the connection) |
07:33:42 | * | Notxor joined #nim |
07:37:45 | * | Notxor quit (Remote host closed the connection) |
07:39:34 | FromDiscord | <Dudugz> In reply to @JeysonFlores "which is the right": well, not that i can opine much but the first version gives me a lot more trouble to read than the last |
07:40:46 | FromDiscord | <Dudugz> It makes the proc ugly and there is no real need to have the parameters on several lines, if you have several parameters then make an Options object |
07:41:54 | * | adigitoleo_ quit (Quit: adigitoleo_) |
07:44:25 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4tUn |
07:45:48 | FromDiscord | <Dudugz> In reply to @Elegantbeef "Then again i'd probably": You're just not used to using FP :v I rather prefer it since it makes more sense than having a body out of thin air |
07:45:55 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4tUo |
07:46:00 | FromDiscord | <Yardanico> you'll be allocating heap memory for nothing |
07:46:09 | FromDiscord | <Dudugz> Hm, yes, I forgot |
07:46:23 | FromDiscord | <Dudugz> (edit) "https://play.nim-lang.org/#ix=4tUn" => "https://play.nim-lang.org/#ix=4tUp" |
07:48:06 | FromDiscord | <JeysonFlores> sent a code paste, see https://play.nim-lang.org/#ix=4tUs |
07:48:41 | FromDiscord | <Yardanico> In reply to @JeysonFlores "Is this a common": not very common, no |
07:48:51 | FromDiscord | <Dudugz> The thing is, Nim doesn't seem to have an exact pattern, you kind of pick and choose which one you prefer. And this pattern of using options is not exclusive to one language, I've seen it in several. |
07:49:18 | * | Notxor joined #nim |
07:49:28 | FromDiscord | <Yardanico> yes, Nim allows you to write in the style that you want, not in the style that some random tool forces you to :) |
07:49:50 | FromDiscord | <Yardanico> UFCS, partial case insensitivity, macros, functional vs imperative, OOP (methods) vs composition (object variants + procs), etc etc |
07:50:07 | FromDiscord | <Dudugz> Go, JS, TS, Java, Rust... You see this pattern more in libraries that export functions that offer a great deal of customization, i.e. you can customize most of the functionality from the library. |
07:50:18 | FromDiscord | <Dudugz> In reply to @Yardanico "yes, Nim allows you": Yea lol |
07:50:25 | FromDiscord | <JeysonFlores> In reply to @JeysonFlores "Is this a common": I'm not a big fan of making specific classes/types that only are used as intermediate abstractions since I tend to forgot their purpose and after some time I end up believing that piece of code is more important than what really is |
07:51:08 | FromDiscord | <Dudugz> Well, Nim doesn't seem to have interfaces, usually you create interfaces to serve as options. |
07:51:47 | FromDiscord | <Dudugz> In reply to @JeysonFlores "I'm not a big": So the objective was not well defined or the name was not clear enough π€·ββοΈ |
07:51:52 | FromDiscord | <Elegantbeef> What?β΅(@Dudugz) |
07:52:53 | FromDiscord | <Dudugz> Functional programming, you say you don't really like using procs in other procs. I'm used to it because of JS where you can do something like array.map((item) => item 2) |
07:53:16 | FromDiscord | <Yardanico> In reply to @Dudugz "Functional programming, you say": you can do same in Nim, even shorter |
07:53:20 | FromDiscord | <Yardanico> array.mapIt(it 2) |
07:53:32 | FromDiscord | <Elegantbeef> It's not about FP |
07:53:37 | FromDiscord | <Elegantbeef> It's about attaching type related operations to types |
07:53:38 | FromDiscord | <Dudugz> You seem to prefer having a block of nothing:β΅array.map(item 2) // where does item come from? |
07:53:47 | FromDiscord | <Elegantbeef> No |
07:53:55 | FromDiscord | <Yardanico> @Dudugz you can always make your own version that forces you to explicitly name the variable |
07:54:03 | FromDiscord | <Yardanico> like array.mapCustom(it, it 2) |
07:54:09 | FromDiscord | <Dudugz> In reply to @Elegantbeef "It's about attaching type": Got it |
07:54:12 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#ix=4tUv i already wrote a CLI prompter to demonstrate code reuse |
07:54:22 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/codereuse.html bottom of this |
07:54:40 | FromDiscord | <Elegantbeef> In most cases it's just an interface for a given type |
07:54:51 | FromDiscord | <Elegantbeef> Nim provides generic interfaces for this |
07:55:59 | FromDiscord | <Dudugz> In reply to @Yardanico "<@265937132886032407> you can always": Nah, unnecessary, I'm not going to create an abstraction layer just for that, it just doesn't make sense since it takes away readability, it's not a matter of the name being ``It`` it's a matter of it being there implicitly |
07:56:18 | FromDiscord | <Elegantbeef> I mean `array.map[it](it 2)` |
07:56:25 | FromDiscord | <Elegantbeef> There are many ways to declare the variable π |
07:56:50 | FromDiscord | <Elegantbeef> I personally prefer `mapIt` which makes it clear |
07:57:04 | FromDiscord | <Yardanico> In reply to @Dudugz "Nah, unnecessary, I'm not": but `mapIt` says `it` directly |
07:57:21 | FromDiscord | <Elegantbeef> But we're not talking about FP anywho |
07:57:32 | FromDiscord | <Dudugz> sent a code paste, see https://play.nim-lang.org/#ix=4tUw |
07:57:34 | FromDiscord | <Elegantbeef> If you're parsing a type it makes much more sense to make it a generic interface |
07:57:55 | FromDiscord | <Yardanico> In reply to @Dudugz "Welp ``array.map(it * 2)``": there will be no issues, since mapIt is a template |
07:58:10 | FromDiscord | <Yardanico> and it injects it by itself |
07:58:18 | FromDiscord | <Yardanico> and local scope variables shadow outer scope ones |
07:58:26 | FromDiscord | <Elegantbeef> What about the naming conflict of `array.map(proc(x: int): int = (let x = "hello";...))` |
07:58:31 | FromDiscord | <Dudugz> Yes, precisely, what if you wanted to use an external variable? |
07:58:35 | FromDiscord | <Yardanico> In reply to @Dudugz "Yes, precisely, what if": ?? |
07:58:39 | FromDiscord | <Yardanico> you just use it, it'll work |
07:58:45 | FromDiscord | <Dudugz> '-' named it? |
07:58:55 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4tUx |
07:58:57 | FromDiscord | <Yardanico> works just fine |
07:59:05 | FromDiscord | <Elegantbeef> Yardanico they're proposing the silly case of what if you named a variable it and want to use it internally |
07:59:07 | FromDiscord | <Yardanico> it's only `it` that gets injected specifically into the code by the template |
07:59:24 | FromDiscord | <Dudugz> In reply to @Elegantbeef "What about the naming": It wouldn't actually be a conflict it would just be redeclaring x within the scope of the function |
07:59:34 | FromDiscord | <Elegantbeef> That's my point |
07:59:45 | FromDiscord | <Elegantbeef> It's a non issue unless you really write shit code |
08:00:01 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tUA |
08:00:06 | FromDiscord | <Elegantbeef> Who writes that |
08:00:07 | FromDiscord | <Dudugz> yea lol, nobody would name a variable as ``it`` |
08:00:42 | FromDiscord | <Elegantbeef> Even if you do write a variable named `it` you can just do `let otherName {.cursor.} = it` |
08:00:56 | FromDiscord | <Dudugz> Hm |
08:01:43 | FromDiscord | <Dudugz> well, since Nim doesn't seem to have something like a lambda or arrow function I understand why using this implicit syntax is better than creating a proc with the types and parameters |
08:01:54 | FromDiscord | <Elegantbeef> I mean it does have \`std/sugar |
08:02:09 | FromDiscord | <Dudugz> ``myArr.map(lambda it: it 2)`` seems more readable |
08:02:13 | FromDiscord | <Elegantbeef> I think the implicit is just better regardless |
08:02:31 | FromDiscord | <Elegantbeef> `myArr.map((it) => it 2)` is valid with `std/sugar` |
08:02:43 | FromDiscord | <Dudugz> Hm, that's nice then |
08:04:38 | FromDiscord | <Yardanico> In reply to @Dudugz "Hm, that's nice then": yes, but it's ~less efficient~ |
08:04:50 | FromDiscord | <Yardanico> my performance π’ |
08:04:55 | FromDiscord | <Elegantbeef> Well it can be assuming the C compiler doesnt inline |
08:05:08 | FromDiscord | <Yardanico> i mean, it's a closure by default |
08:05:24 | FromDiscord | <Yardanico> so I don't think it will, although I don't know how well C compilers optimize Nim code |
08:05:43 | FromDiscord | <Elegantbeef> Right it's a closure |
08:05:45 | FromDiscord | <Elegantbeef> I take it back |
08:06:25 | FromDiscord | <Elegantbeef> Cannot even fix it cause people use the `=>` macrro |
08:06:41 | FromDiscord | <Elegantbeef> Unless that's also a closure i do not recall |
08:10:01 | FromDiscord | <Elegantbeef> But in closing the point was more just about that many things can just be implemented at a type level and do not need to have these pointer procs around |
08:19:47 | FromDiscord | <Bung> what have changed ? I do `.\koch.exe temp c tests/sets/t13764.nim` got error, but `.\koch.exe temp check tests/sets/t13764.nim` don't |
08:21:35 | FromDiscord | <leorize> `c` compiles to binary, `check` only runs sem |
08:27:09 | FromDiscord | <Bung> thanks! I see they are different level errors |
08:54:56 | NimEventer | New thread by Oecophylla: Hex to bytes - How to convert , see https://forum.nim-lang.org/t/10118 |
09:25:31 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4tVb |
09:26:36 | * | Notxor quit (Remote host closed the connection) |
09:31:08 | FromDiscord | <Ras> sent a code paste, see https://play.nim-lang.org/#ix=4tVe |
09:58:06 | * | jmdaemon quit (Ping timeout: 255 seconds) |
10:21:19 | * | PMunch quit (Ping timeout: 276 seconds) |
10:49:48 | * | derpydoo quit (Quit: derpydoo) |
11:01:07 | * | PMunch joined #nim |
11:04:00 | * | lain quit (Ping timeout: 252 seconds) |
11:04:42 | * | lain joined #nim |
11:05:22 | FromDiscord | <auxym> In reply to @Ras "hello! i'm trying to": IIRC it's just that `char` is not interchangeable with `uint8` in nim. `toSeq(someString)` returns `seq[char]` |
11:05:47 | FromDiscord | <Ras> makes sense |
11:05:52 | FromDiscord | <Ras> thanks |
11:44:39 | NimEventer | New question by shirleyquirk: How can you get the sizeof an untyped type identifier, inside a macro?, see https://stackoverflow.com/questions/76072831/how-can-you-get-the-sizeof-an-untyped-type-identifier-inside-a-macro |
12:27:16 | * | kenran joined #nim |
12:57:14 | FromDiscord | <michaelb.eth> In reply to @Ras "hello! i'm trying to": you might find useful toBytes from stew/byteutils |
12:58:08 | FromDiscord | <michaelb.eth> https://github.com/status-im/nim-stew/blob/master/stew/byteutils.nim#L244 |
13:04:23 | FromDiscord | <firasuke> so execProcesses starts commands in parallel, is there a particular order? also how do you store output and track exit status for the commands? |
13:16:36 | * | kenran quit (Remote host closed the connection) |
13:29:23 | FromDiscord | <voidwalker> @firasuke https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/osproc.nim#L362 obviously in the order they are given in the `cmds` array. |
13:30:09 | FromDiscord | <firasuke> oh ok interesting, and what about handling output and exit codes? |
13:35:35 | FromDiscord | <voidwalker> From reading the proc definition, I do not think this is possible, you only get one exit code for all, and no output ? :\ |
13:36:18 | FromDiscord | <voidwalker> hmm unless afterRunEvent is meant for that |
13:36:27 | FromDiscord | <voidwalker> (edit) "afterRunEvent" => "`afterRunEvent`" |
13:37:55 | FromDiscord | <voidwalker> `afterRunEvent: proc (idx: int; p: Process) = nil` seems you get access to the index and the Process in that proc that you can define and pass to execProcesses |
13:40:58 | FromDiscord | <voidwalker> https://github.com/nim-lang/Nim/blob/version-1-6/lib/pure/osproc.nim#L67 |
13:41:39 | FromDiscord | <voidwalker> If someone can tell us if the fields of `ProcessObj` are exported by `Process = ref ProcessObj` (not sure?). |
13:41:56 | FromDiscord | <voidwalker> If yes, then your answer is in ` inStream, outStream, errStream: owned(Stream)β΅ exitStatus: cint` |
13:42:37 | * | progranner joined #nim |
13:43:28 | FromDiscord | <firasuke> oh ok |
13:44:49 | FromDiscord | <voidwalker> yeah it seems they are all exported by using that syntax |
13:45:45 | FromDiscord | <voidwalker> So you must write a proc that handles the output stream read, exit status, and pass that when calling execProcesses |
13:48:34 | FromDiscord | <firasuke> so that proc should be passed as a parameter to execProcesses using afterRunEvent, and in that proc I can handle outStream and errStream and exitStatus |
13:50:01 | FromDiscord | <voidwalker> yeah, like this : https://github.com/juancarlospaco/nim-presentation-slides/blob/3236a03aef31dbabb43b34b3a486184f54fc077c/ejemplos/avanzado/multiprocess/multiprocess3.nim#L3 |
13:50:31 | FromDiscord | <firasuke> oh interesting, thanks for the examples, much appreciated |
13:51:38 | FromDiscord | <firasuke> wonder if we can also contorl what workingDir is being used |
14:03:35 | FromDiscord | <voidwalker> well, this "convenience" proc, execProcesses, does not seem to take workingDir arguments.. it would have to be another array anyway, for each command |
14:05:13 | FromDiscord | <voidwalker> I believe the only way to do this, with this proc, would be to modify it, and use the modified file instead of the nim stdlib one |
14:05:54 | FromDiscord | <voidwalker> well, I guess that's a shitty solution. You could reimplement the proc and modify it to take workingDirs array. and use that instead |
14:10:54 | * | PMunch quit (Quit: Leaving) |
14:31:14 | FromDiscord | <firasuke> interesting |
14:35:46 | FromDiscord | <voidwalker> yeah, I guess nim's stdlib is not a magical swiss army knife.. I myself needed features not present in the procs two times now, and needed to mod them |
14:37:10 | FromDiscord | <firasuke> well I appreciate the clarity of the language which helps a lot |
14:38:13 | * | jmdaemon joined #nim |
14:41:28 | * | krux02 joined #nim |
14:48:03 | * | arkurious joined #nim |
14:48:36 | * | arkurious quit (Remote host closed the connection) |
14:58:16 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
15:00:23 | * | progranner joined #nim |
15:02:19 | * | Notxor joined #nim |
15:09:38 | * | jmdaemon quit (Quit: ZNC 1.8.2 - https://znc.in) |
15:09:56 | * | jmdaemon joined #nim |
15:11:10 | * | al1ranger joined #nim |
15:23:16 | * | al1ranger quit (Quit: Leaving) |
15:23:35 | * | jmdaemon quit (Ping timeout: 264 seconds) |
15:23:54 | * | om3ga quit (Ping timeout: 255 seconds) |
15:35:06 | FromDiscord | <firasuke> I want to split a sequence into multiple sub sequences of length "X", I am using distribute, but it appears that distribute splits the sequence into "X" subsequences, when in fact I don't care about how many sub sequences are split into, but rather the length of each |
15:44:09 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
15:44:45 | * | progranner joined #nim |
15:46:24 | * | progranner quit (Client Quit) |
15:47:03 | * | progranner joined #nim |
15:51:09 | FromDiscord | <voidwalker> hmm |
15:51:34 | FromDiscord | <voidwalker> @firasuke maybe just do mySeq.distribute(mySeq.len div X) ? |
15:52:04 | FromDiscord | <firasuke> I was considering this as well, what about type casting and remainders? |
15:52:14 | FromDiscord | <firasuke> (edit) "was" => "am" |
15:54:58 | FromDiscord | <firasuke> Like it expects `int` not a float |
15:59:00 | FromDiscord | <voidwalker> Oh my bad, you want seqs not to exceed length X |
16:01:56 | FromDiscord | <voidwalker> let me think |
16:04:23 | FromDiscord | <voidwalker> So if you have a seq of len 16, and want to split into length 11, you would have one of len 11, and one of 5 for remainder? |
16:04:33 | FromDiscord | <Nerve> In reply to @firasuke "I want to split": You can do that math on how many subsequences of length X you can get from a seq, then call `distribute` with that length |
16:04:39 | FromDiscord | <Nerve> (edit) "that" => "the" |
16:05:12 | FromDiscord | <Nerve> (edit) "length" => "number" |
16:05:15 | FromDiscord | <voidwalker> If so, distribute won't work, as it distributes, as its name says, the elements evenly |
16:05:29 | FromDiscord | <Nerve> Oh, it's only evenly? |
16:05:41 | FromDiscord | <Nerve> Is there an equivalent to `take` in Nim? |
16:05:56 | FromDiscord | <voidwalker> sent a code paste, see https://paste.rs/QRF |
16:07:25 | FromDiscord | <firasuke> In reply to @voidwalker "So if you have": Not really, I want it to be split into sequences of X size, so 16 with 5 size would be split into 4 sequences, first three containing 5, and the last one containing 1 |
16:08:20 | FromDiscord | <firasuke> sent a long message, see http://ix.io/4tWt |
16:09:20 | FromDiscord | <voidwalker> yeah, that's what I said |
16:11:47 | FromDiscord | <firasuke> Oh ok |
16:12:56 | * | azimut quit (Ping timeout: 255 seconds) |
16:23:52 | FromDiscord | <voidwalker> @firasuke it seems that there is no way to keep control of the max elements in the subsequences with `distribute` |
16:24:16 | FromDiscord | <firasuke> Hmm, so guess I'll be using an additional for loop |
16:24:37 | FromDiscord | <voidwalker> An array with 16 elements of max 5 subsequence, would need to have 5,5,5,1 elements |
16:24:55 | FromDiscord | <voidwalker> If you distribute 16 len sequence with distribute, you get 4,4,4,4 |
16:25:21 | FromDiscord | <firasuke> Yup |
16:25:23 | FromDiscord | <voidwalker> (edit) "If you distribute 16 len sequence ... with" added "into 4 subsequences" |
16:26:04 | FromDiscord | <voidwalker> so diy proc for this, or write it in place : ) |
16:26:35 | FromDiscord | <firasuke> 16 is just an example, for example a 100, I need 20 sub sequences length 5, not 5 sub sequences length 20 which is what distribute is doing |
16:29:22 | FromDiscord | <voidwalker> well if sequence length is divisible by the subsequence max Length, then this is achievable. .distribute(20) will do (20= 100 div 5) |
16:29:33 | FromDiscord | <voidwalker> (edit) "do" => "work." |
16:33:00 | FromDiscord | <guttural666> In reply to @Yardanico "you can make anything": that is what I am trying to do now π |
16:37:31 | FromDiscord | <guttural666> do I need a channel to give one thread an interrupt signal from another thread? I would just naively set a global variable to interrupt = true in one thread and then check that field periodically in the other thread? |
16:38:45 | * | cm joined #nim |
16:41:24 | FromDiscord | <Chronos [She/Her]> I'm thinking of maybe making my MC server impl from scratch again tbh |
16:41:42 | FromDiscord | <Chronos [She/Her]> And using WASM for a plugin system, but that means speed is more important |
16:42:37 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4tWy |
16:43:29 | FromDiscord | <firasuke> Thanks, I'll try that |
16:52:42 | FromDiscord | <guttural666> @ElegantBeef I think you mentioned the other day that echo was thread safe, the manpage for threads has this example though? https://media.discordapp.net/attachments/371759389889003532/1099014861368852551/image.png |
17:09:42 | FromDiscord | <guttural666> hmm, VSCode / nimsuggest doesn't seem to be aware of the thread module, but that should be included in the system module, but it does compile, is this a bug in nimsuggest? https://media.discordapp.net/attachments/371759389889003532/1099019140016123944/image.png |
17:12:06 | FromDiscord | <jmgomez> try adding a nim.cfg file with `--threads:on` |
17:12:53 | FromDiscord | <guttural666> In reply to @jmgomez "try adding a nim.cfg": I do obviously compile with --threads:on, never heard about nim.cfg, gonna read up on that, thanks! |
17:14:15 | FromDiscord | <jmgomez> you can also use config.nims, it will try to read it to debbug your issue furhter you can check out: https://nim-lang.org/docs/nimsuggest.htmlβ΅There is `nimsuggest --stdin yourfile` you can inspect better there what's going on |
17:14:28 | FromDiscord | <jmgomez> (edit) "it to" => "it. To" |
17:14:43 | FromDiscord | <jmgomez> (edit) "furhter" => "further" |
17:18:01 | FromDiscord | <guttural666> perfect, VSCode/nimsuggest seems to be happy now, thanks for the tip! |
17:18:32 | FromDiscord | <guttural666> I previously just had an alias in my fishconfig to pass the compiler flags, but this is much better, also for git clones etc. |
17:19:52 | FromDiscord | <guttural666> threads to set interrupt signals also works like a charm, this is awesome |
17:20:32 | FromDiscord | <guttural666> would have preferred just an async readLine(stdin), but this works |
17:25:36 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
17:27:26 | * | progranner joined #nim |
17:29:03 | * | progranner quit (Client Quit) |
17:30:04 | * | progranner joined #nim |
17:31:07 | FromDiscord | <guttural666> I think enums should initialize to the first value, right? |
17:32:47 | FromDiscord | <guttural666> nah okay, need to init with enum.default |
17:37:05 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
17:54:23 | * | progranner joined #nim |
18:05:23 | * | lucasta joined #nim |
18:07:00 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
18:14:06 | * | progranner joined #nim |
18:43:52 | * | jmdaemon joined #nim |
18:55:14 | * | jmdaemon quit (Ping timeout: 250 seconds) |
19:04:51 | FromDiscord | <guttural666> seen this in Zig talk, is this somehow addressable in Nim? https://media.discordapp.net/attachments/371759389889003532/1099048116017188914/image.png |
19:07:03 | FromDiscord | <Yardanico> "hopeless" is some strong wording lol |
19:07:07 | FromDiscord | <Nerve> Reference counters are not hidden, garbage collectors can be bounded and manually triggered, arena allocation can obviate new allocations for a program's entire runtime. Nim supports these all AFAIK. |
19:07:19 | FromDiscord | <Nerve> (edit) "triggered," => "triggered which "unhides" them," |
19:07:29 | FromDiscord | <Yardanico> In reply to @guttural666 "seen this in Zig": it probably is, but Nim was never meant to be used with explicit memory allocations everywhere |
19:07:49 | FromDiscord | <Yardanico> this point is only concerning languages like C, and Zig tries to be a competitor to C |
19:07:59 | FromDiscord | <Yardanico> it doesn't try to be a general-purpose high-level language, not with manual memory allocation ;) |
19:09:00 | FromDiscord | <Nerve> It is also fair to note that RC and GC are the only extant memory management approaches which near-as-makes-no-difference eliminate memory semantics in programs, such that business logic is all that remains. |
19:09:48 | FromDiscord | <guttural666> In reply to @Yardanico "this point is only": well, I think Nim should be a competitor to C as well, just as any other language, gotta go fast |
19:11:09 | FromDiscord | <Yardanico> In reply to @guttural666 "well, I think Nim": nim is already fast enough |
19:11:10 | FromDiscord | <guttural666> In reply to @Nerve "It is also fair": I am aware of this, but I also know that Discord people ditched Go because of GC and switched to Rust |
19:11:22 | FromDiscord | <Yardanico> i think nim would be a really different language if it had manual memory management |
19:11:35 | FromDiscord | <Yardanico> In reply to @guttural666 "I am aware of": yes, but Nim v2's "GC" isn't much different from Rust with ARC |
19:11:45 | FromDiscord | <guttural666> In reply to @Yardanico "yes, but Nim v2's": also aware |
19:11:46 | FromDiscord | <Nerve> There are good and bad GC strategies and implementations, Go's is famously poor and difficult to tune. |
19:11:47 | FromDiscord | <Yardanico> you have destructors/move semantics/etc and reference counting, which exists in Rust as well |
19:11:54 | FromDiscord | <Yardanico> ORC does add a cycle collector, but you can write your programs to avoid cycles |
19:12:41 | FromDiscord | <guttural666> I think my original question was: can you make Nim "pure" in the sense of ZIG and address these problems if you wanted to |
19:12:57 | FromDiscord | <Nerve> Just use RC |
19:13:56 | FromDiscord | <Yardanico> In reply to @guttural666 "I think my original": by not using any `ref` types or managed containers, yes |
19:14:01 | FromDiscord | <Yardanico> just use `alloc`/`dealloc`/`create` |
19:14:16 | FromDiscord | <Nerve> I should probably note here that RC is the default memory management strategy in C++ (`std::unique_ptr` and such) |
19:14:17 | FromDiscord | <Yardanico> you can still use destructors to ease manual memory management |
19:14:28 | FromDiscord | <Nerve> (edit) "I should probably note here that RC is the default ... memory" added "best-practice" |
19:14:36 | FromDiscord | <Yardanico> but "hidden memory allocations" goes directly against Nim the language as a whole |
19:14:41 | FromDiscord | <jmgomez> The issue left is strings and seqs though |
19:14:42 | FromDiscord | <Yardanico> (edit) ""hidden" => ""no hidden" |
19:14:48 | FromDiscord | <Yardanico> i said managed containers, yes |
19:15:01 | FromDiscord | <guttural666> In reply to @Nerve "Just use RC": I think that will not prevent hidden mem allocs in the stl and I think that is the point of Andrew Kelly et al |
19:15:06 | FromDiscord | <Yardanico> I know Zig enforces operators to just be default operators, while in Nim you can hide away a lot of complexity by overloading/templates/macros/etc |
19:15:13 | FromDiscord | <Yardanico> so really Nim wouldn't be the best language to try to enforce this |
19:16:18 | FromDiscord | <Nerve> In reply to @guttural666 "I think that will": If it's in the standard library then it's not hidden |
19:16:58 | FromDiscord | <jmgomez> It's hard to think a scenario where you will need to remove ref. That said, in NUE besides containers, we dont use ref but ptr everywhere. But thats just because UE has a mark and sweep GC |
19:17:53 | FromDiscord | <Nerve> Which is funny since UE is a realtime-constrained system. Is the foreign language interface for UE only for gameplay logic? |
19:18:13 | FromDiscord | <guttural666> In reply to @Nerve "If it's in the": it is if you your compiler doesn't tell you about that possibility, I think that is ZIGs approach |
19:19:00 | FromDiscord | <Nerve> In reply to @guttural666 "it is if you": I find it baffling that anybody would make use of a large standard library and not check if it makes heap allocations |
19:19:04 | FromDiscord | <guttural666> In reply to @jmgomez "It's hard to think": UE = Unreal Engine? |
19:19:18 | FromDiscord | <jmgomez> In reply to @Nerve "Which is funny since": Yeah, but you dont have that many objects alive all the time. In that sense, it's more performant that Unity's approach (Boehm?). Not sure what you mean with the later |
19:19:21 | FromDiscord | <Nerve> Anyone concerned about "perfect" software should avoid a standard library with any allocations |
19:19:31 | FromDiscord | <jmgomez> In reply to @guttural666 "UE = Unreal Engine?": yup |
19:20:22 | FromDiscord | <Nerve> In reply to @jmgomez "Yeah, but you dont": As in, are you only creating actors/governing interactions/swapping assets/executing rules? Or can you write shaders, rendering code, asset manipulation logic, physics, etc. |
19:20:59 | FromDiscord | <guttural666> In reply to @Nerve "Anyone concerned about "perfect"": sure sure, I don't think that is the issue here, I think ZIG people say that the compiler should tell you about this to enforce "perfect software" |
19:21:08 | FromDiscord | <huantian> In reply to @Nerve "Anyone concerned about "perfect"": Exactly, I think the main point is that Nim isnβt designed to be perfect but easy to use |
19:21:23 | FromDiscord | <huantian> However, you can still write perfect software, it just takes more effort |
19:21:28 | FromDiscord | <jmgomez> In reply to @Nerve "As in, are you": ah, well UE FFI is just C++ FFI which is C. The way we are hook is at different levels, but long story short you can do pretty much anything you can do in C++ at this point |
19:22:46 | FromDiscord | <jmgomez> Things that are not exposed, you can just manually bind and extend it in Nim (there are vfuncs implemented). More down the road I want to automatically bind the cpp side too |
19:25:08 | FromDiscord | <Nerve> Well, Zig and Rust are hype-driven projects in pursuit of some kind of "perfection" or purity ideal, and their hype momentum is going to do a lot of harm in the software world as people build projects with them which would be better served by automatic memory management, better modeling power, faster development velocity, etc. The evidence of this will be uncountable dead/abandoned projects. |
19:25:28 | FromDiscord | <guttural666> In reply to @Nerve "As in, are you": Nim is happy to this (C++ equivalent to vector.reserve) without handling bad alloc: https://media.discordapp.net/attachments/371759389889003532/1099053308464861184/image.png |
19:25:33 | FromDiscord | <Nerve> Maybe the projects have some pragmatism but I've yet to see much evidence |
19:25:50 | FromDiscord | <guttural666> (edit) "In reply to @Nerve "As in, are you": Nim is happy to ... this" added "do" |
19:26:11 | FromDiscord | <Nerve> (edit) "Maybe the ... projectsevidence." added "language" | "evidence" => "evidence." |
19:26:16 | * | om3ga joined #nim |
19:27:15 | FromDiscord | <Nerve> In reply to @guttural666 "Nim is happy to": Where is this function defined |
19:27:33 | FromDiscord | <guttural666> just does what vector.reserve does in C++ |
19:27:57 | FromDiscord | <Yardanico> In reply to @guttural666 "Nim is happy to": That's not a stdlib function though, but it has similar ones |
19:28:17 | FromDiscord | <Yardanico> `setLen` for settings the length (filling with default values), and when creating containers you have `newSeqOfCap` or `newStringOfCap` |
19:28:27 | FromDiscord | <Yardanico> capacity will make it allocate memory for n items, but won't change the length |
19:28:36 | FromDiscord | <guttural666> In reply to @Yardanico "That's not a stdlib": yeah, it just does setLen on a seq to reserve the mem, then sets it back to the actual len |
19:28:49 | FromDiscord | <Yardanico> ah right, forgot about that :) |
19:28:57 | FromDiscord | <guttural666> thanks ElegantBeef haha |
19:32:53 | FromDiscord | <guttural666> my question was just, can you make Nim compatible to the standards of ZIG, because I hear a lot of this stuff in talks, I know you can turn GC off etc. etc. but the stl does not support custom allocators out of the box I think, you would have to rewrite stuff yourself |
19:33:14 | FromDiscord | <ricky> zg... |
19:34:32 | FromDiscord | <Yardanico> In reply to @guttural666 "my question was just,": you can do everything, it'd just be a completely different language |
19:34:39 | FromDiscord | <Yardanico> because it would require changing too much stuff |
19:34:55 | FromDiscord | <Yardanico> Zig is really an anti-thesis of NIm |
19:35:12 | FromDiscord | <Yardanico> as I said before, this is just a complete opposite of what Nim does https://media.discordapp.net/attachments/371759389889003532/1099055753958019133/image.png |
19:36:26 | FromDiscord | <Nerve> Same for Rust, total difference in philosophy. Rust makes it hard to write unsafe programs. Nim makes it easy to write safe programs. There is a distinct difference. |
19:42:20 | FromDiscord | <guttural666> I know the different philosophies guys, my question was a purely technical one π |
19:42:39 | FromDiscord | <Yardanico> but you know well yourself that from a technical perspective you can do anything given enough time |
19:45:05 | FromDiscord | <guttural666> In reply to @Yardanico "but you know well": suuure, I know you can do anything with Nim, I was just interested to hear about what people thought about that, when people say Nim is not able to do XYZ |
19:46:09 | FromDiscord | <guttural666> I know Nim is basically this https://media.discordapp.net/attachments/371759389889003532/1099058510915981342/image.png |
19:46:18 | FromDiscord | <Nerve> There is a direct correlation between the philosophy of a language and how difficult it is to do a given task that has a given alignment with that philosophy |
19:46:46 | FromDiscord | <Nerve> Philosophy informs design decisions, which determines the shape and interface of libraries, APIs, and language features |
19:47:27 | FromDiscord | <Nerve> So if Zig and Nim are philosophically misaligned, it's safe to say Nim can probably do the task but it won't be very Nim-ish |
19:47:49 | FromDiscord | <guttural666> In reply to @Nerve "So if Zig and": yes |
19:48:49 | FromDiscord | <guttural666> also ZIG has curlies and curlies are a pain in the ass to write on German keyboards |
19:49:15 | FromDiscord | <guttural666> indentation and text only is de way |
19:57:47 | FromDiscord | <Elegantbeef> What's "ZIG"? |
19:59:11 | FromDiscord | <Yardanico> NIM but the opposite |
19:59:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tXf |
19:59:26 | FromDiscord | <Elegantbeef> You'll notice that it's indeed threadsafe |
19:59:34 | FromDiscord | <Elegantbeef> Ah that's what i though Yard |
19:59:52 | FromDiscord | <guttural666> In reply to @Elegantbeef "You'll notice that it's": okay, then the docs are wrong I think? |
20:00:16 | FromDiscord | <Elegantbeef> No? |
20:00:23 | FromDiscord | <guttural666> shouldn't have to lock stdout |
20:00:39 | FromDiscord | <Elegantbeef> You're right, but nothing says you have to |
20:00:52 | FromDiscord | <guttural666> In reply to @Elegantbeef "You're right, but nothing": misleading then ^^ |
20:01:00 | FromDiscord | <guttural666> maybe old |
20:01:24 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
20:02:36 | FromDiscord | <Elegantbeef> Custom allocators are something i've considered making an RFC for that do it better than Zig, but do not think my solution is ideal |
20:03:11 | FromDiscord | <Elegantbeef> Custom allocators should be type bound, so something like `ref[int, Allocator = MyAllocator]` would be ideal in Nim |
20:03:26 | FromDiscord | <guttural666> In reply to @Elegantbeef "Custom allocators are something": that would work with overloading the stl procs I guess? |
20:03:41 | FromDiscord | <Elegantbeef> `string[Allocator = MyAllocator]` and so forth would have to be valid syntax and used |
20:04:18 | FromDiscord | <Elegantbeef> Well the idea is that a proc that takes `string` accepts all `string`s with any allocator |
20:04:33 | * | progranner joined #nim |
20:04:33 | FromDiscord | <Elegantbeef> but you could do allocator overloading since it'd be a generic parameter |
20:04:59 | FromDiscord | <guttural666> In reply to @Elegantbeef "but you could do": okay, nice |
20:05:17 | FromDiscord | <Elegantbeef> So like `proc(s: string[Allocator = NimAllocator])` and `proc(s: string[Allocator = MyAllocator])` are two separate procedures and could be overloaded |
20:05:58 | FromDiscord | <guttural666> yeah that would cover the pleeb use case and the advanced use case |
20:06:46 | FromDiscord | <Elegantbeef> It's the only premise that really fits with Nim |
20:07:47 | FromDiscord | <Phil> Awwwwβ΅https://github.com/nim-lang/Nim/pull/21660#event-9066213244β΅Phil sad now |
20:11:03 | FromDiscord | <Elegantbeef> It really should be a CT error anywho |
20:11:45 | FromDiscord | <Elegantbeef> Any upcast assignment should be a CT error |
20:13:29 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tXj |
20:13:37 | FromDiscord | <Elegantbeef> This should not be valid |
20:14:19 | FromDiscord | <Elegantbeef> `assert sizeof(A()[]) != sizeof(B()[])` |
20:14:24 | FromDiscord | <jmgomez> beef FYI my pr for the modules that we discussed about a few weeks? ago got finally merged |
20:14:32 | FromDiscord | <Elegantbeef> Congrats |
20:15:03 | FromDiscord | <jmgomez> thanks! |
20:16:26 | FromDiscord | <jmgomez> btw what are your thoughts on allowing NimMain to be executed multiple times? No one seems to really care about it |
20:16:51 | FromDiscord | <Elegantbeef> It's supposed to be called once and most people have a `once: NimMain()` |
20:18:31 | FromDiscord | <jmgomez> thing is, I posted it on internals but with live++ which seems to work by doing a patch to the binary I need to call it again and it seems to fail only with 1.9 (1.6.x works) on exitProcs |
20:20:17 | FromDiscord | <Elegantbeef> Calling it multiple time is just wrong |
20:21:07 | FromDiscord | <jmgomez> so what solution do you propone to init globals? |
20:21:21 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tXl |
20:21:36 | FromDiscord | <jmgomez> (edit) "propone" => "propose" |
20:21:38 | FromDiscord | <Elegantbeef> I mean calling it once is correct π |
20:22:55 | FromDiscord | <jmgomez> I mean, when I hook a dll it works fine calling it once, when the dll gets loaded. But since this tool only compiles the cpp that actually changed modules arent init if I dont call it or some are and some doesnt |
20:23:24 | FromDiscord | <jmgomez> When it's a dll the problem doesnt exist because all is fresh |
20:24:08 | FromDiscord | <Elegantbeef> Ah the issue is that you're using HCR and it does not properly reload the global data |
20:24:21 | FromDiscord | <jmgomez> right |
20:24:25 | FromDiscord | <Elegantbeef> I do not know what to say here |
20:24:46 | FromDiscord | <Elegantbeef> I'd argue the proper thing is to make Nim's HCR actually work |
20:24:50 | FromDiscord | <Elegantbeef> But that's a shit load of work |
20:25:00 | FromDiscord | <jmgomez> but that spins another dlls, right? |
20:25:12 | FromDiscord | <jmgomez> I mean, it's slower by definition |
20:25:13 | FromDiscord | <Elegantbeef> right |
20:29:50 | FromDiscord | <Elegantbeef> Well having the compiler handle it is just more sensible as it knows the shapes of thing |
20:31:41 | FromDiscord | <jmgomez> Yeah, I get that but as you said it's a lot of work and also it wouldnt be just to get working what already exists but also to do what Live++ is doing which I suppose is not a trivial thing to do. |
20:32:19 | FromDiscord | <jmgomez> I would be happy if the std doesnt crash and work as it used to work |
20:32:37 | FromDiscord | <guttural666> can I somehow save a slice of a seq to disk without copying? say I have a big seq that is async filled be another thread and I want to periodcally fetch all the new entries and save them to disk, I would prefer to just "view" a section of the seq and save that to disk without creating a new seq with a slice [last_looked_at..newest_entry] |
20:33:05 | FromDiscord | <Elegantbeef> `file.write(mySeq.toOpenArray(3, 5))` |
20:33:22 | FromDiscord | <Elegantbeef> `toOpenArray` is a view, but it cannot be stored to a variable |
20:33:35 | FromDiscord | <guttural666> just want to save that data to disk |
20:33:38 | FromDiscord | <Elegantbeef> Use it directly and problem solved |
20:33:43 | FromDiscord | <Elegantbeef> Just told you how |
20:33:50 | FromDiscord | <guttural666> okay, nice, gonna look at openArray |
20:34:06 | FromDiscord | <huantian> be careful you might turn into beef if you look at openArrays too much |
20:34:10 | FromDiscord | <guttural666> think you wrote on that topic on your notes that you posted? |
20:34:19 | FromDiscord | <Elegantbeef> Yea |
20:34:36 | FromDiscord | <Elegantbeef> https://www.jasonbeetham.com/codereuse.html to spam it yet again |
20:34:56 | FromDiscord | <guttural666> that would be safe if the seq does not move while I read right? |
20:35:03 | FromDiscord | <guttural666> thread safe I mean |
20:35:11 | FromDiscord | <Elegantbeef> Indeed |
20:35:40 | FromDiscord | <guttural666> which I could potentially guarantee with the reserve proc you proposed some days ago |
20:36:01 | FromDiscord | <guttural666> to do all this without locking |
20:37:23 | * | Notxor quit (Remote host closed the connection) |
20:46:36 | * | progranner quit (Quit: My Mac has gone to sleep. ZZZzzzβ¦) |
21:00:48 | * | jmdaemon joined #nim |
21:18:08 | FromDiscord | <ββ> In reply to @guttural666 "I am aware of": . |
21:18:30 | FromDiscord | <ββ> when they switched they also changed their whole data structures i think |
21:18:39 | FromDiscord | <ββ> so its not to useful comparison |
21:19:12 | FromDiscord | <morgan> @treeform is the fidget export plugin on figma outdated or something? i'm getting some errors on code it generated |
21:20:04 | FromDiscord | <guttural666> In reply to @ββ "when they switched they": dunno I think I just read about this because of the Primeagen |
21:21:39 | FromDiscord | <ββ> you know what they sayβ΅a nickel is half a dime |
21:22:05 | * | lucasta quit (Remote host closed the connection) |
21:30:30 | FromDiscord | <Elegantbeef> I thought a dime was two nickels |
21:31:02 | FromDiscord | <treeform> In reply to @MorganAlyssa "<@107140179025735680> is the fidget": Yes, sorry |
21:31:18 | FromDiscord | <DestyNova> In reply to @guttural666 "seen this in Zig": Seeing phrases like "hopeless" and "perfect software" makes it hard to take that seriously. And if "hidden memory allocations" makes a language hopeless, well why not continue that line of reasoning and say that the only "perfect" language is assembly? |
21:32:32 | FromDiscord | <morgan> In reply to @treeform "Yes, sorry": ok, i'm installing typescript rn to get the current one |
21:36:33 | FromDiscord | <Elegantbeef> @DestyNova\: the context matters so I hope it was in regard to something like Kernel or OS development π |
21:38:28 | FromDiscord | <voidwalker> What would be the shortest way to get Table[string, string] import/export to files ? |
21:38:40 | FromDiscord | <voidwalker> as in the fewest needed lines of code |
21:38:47 | FromDiscord | <voidwalker> (edit) "as in the fewest needed lines of code ... " added "and using only stdlib prefferably" |
21:39:01 | FromDiscord | <voidwalker> (edit) "prefferably" => "preferably" |
21:39:02 | FromDiscord | <Elegantbeef> Use Frosty or Flatty |
21:39:13 | FromDiscord | <Elegantbeef> Otherwise write your own serialiser |
21:40:19 | FromDiscord | <Elegantbeef> QED |
21:40:24 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tXI |
21:40:38 | FromDiscord | <Elegantbeef> Could also just use std/json |
21:56:22 | FromDiscord | <ricky> sent a code paste, see https://play.nim-lang.org/#ix=4tXM |
21:58:08 | * | advesperacit quit () |
22:03:08 | FromDiscord | <voidwalker> @ElegantBeef flatty looks very nice and simple, but it doesn't have proc variants that return the serialized string instead of putting it in a var |
22:03:14 | FromDiscord | <voidwalker> so I have to ` var s: string; toFlatty(s,cards); writeFile(readLine(stdin), s)` |
22:03:57 | FromDiscord | <voidwalker> instead of `writeFile(readLine(stdin), toFlatty(cards)` |
22:04:01 | FromDiscord | <Elegantbeef> `toFlatty` returns a string |
22:04:05 | FromDiscord | <voidwalker> (edit) "toFlatty(cards)`" => "toFlatty(cards))`" |
22:04:14 | FromDiscord | <Elegantbeef> image.png https://media.discordapp.net/attachments/371759389889003532/1099093259411804200/image.png |
22:04:53 | FromDiscord | <voidwalker> i was reading here: https://nimdocs.com/treeform/flatty/flatty.html |
22:05:05 | FromDiscord | <Elegantbeef> https://nimdocs.com/treeform/flatty/flatty.html#toFlatty%2CT |
22:07:33 | FromDiscord | <voidwalker> magic |
22:09:07 | FromDiscord | <Elegantbeef> No it's called overloading π |
22:12:33 | FromDiscord | <morgan> In reply to @treeform "Yes, sorry": i'm still getting the same error, it creates a "laInherit" for layoutAlign which doesn't seem to exist |
22:13:01 | FromDiscord | <morgan> (edit) ""laInherit"" => "`laInherit`"" |
22:40:09 | FromDiscord | <morgan> just removed that for now. also ellipse doesn't exist yet |
22:40:26 | FromDiscord | <morgan> i think i just need circles so i'll replace them with rounded rectangles |
22:44:04 | FromDiscord | <voidwalker> no standard proc to find a key in a table if you know the value ? assuming values are unique |
22:44:52 | FromDiscord | <morgan> seems like fidget still needs a lot of work on instances |
22:47:55 | FromDiscord | <morgan> or at least the plugin does |
23:01:13 | FromDiscord | <Yardanico> In reply to @voidwalker "no standard proc to": i think you just iterate over values, since tables are hash tables |
23:01:19 | FromDiscord | <Yardanico> so there's no more efficient way |
23:01:26 | FromDiscord | <Yardanico> unless you sort the table of course |
23:02:35 | FromDiscord | <louis77> hey there, which data type would I use to model a JSON object? I've tried `OrderedTable[string, JsonNode]` but that gives me a very cryptic error message |
23:02:52 | FromDiscord | <Elegantbeef> `JsonNode` is what you'd use |
23:03:08 | FromDiscord | <louis77> `JsonNode` works obviously but that doesn't constrain to a proper JSON object which is a map of string->any |
23:03:13 | FromDiscord | <Yardanico> it does |
23:03:19 | FromDiscord | <Elegantbeef> `myJsonNode["hello"].getint` |
23:03:31 | FromDiscord | <Yardanico> i mean "any" can't happen in Nim because nim is statically typed, but JsonNode is an object variant that provides all possible JSON types |
23:03:52 | FromDiscord | <Elegantbeef> Nim is statically typed so it needs `getInt` and friends to extract data, but jsonnode is a variant type that in theory can any type |
23:03:58 | FromDiscord | <Elegantbeef> can represent any\ |
23:04:24 | FromDiscord | <louis77> so coming from Go, I would use `map[string]interface{}` ... in Nim it is the JsonNode ? |
23:04:39 | FromDiscord | <Yardanico> you don't have a direct equivalent of that in Nim, what's your usecase? |
23:04:57 | FromDiscord | <Elegantbeef> Avoiding dynamically typed data is always best π |
23:05:01 | FromDiscord | <Yardanico> you can't just create a table that maps from a string to any type if you don't know the types beforehand |
23:05:07 | FromDiscord | <Yardanico> if you just want to do JSON, then use JsonNode, yeah |
23:05:28 | FromDiscord | <Yardanico> otherwise you generally use object variants, or maybe inheritance if that fits your use-case better |
23:05:29 | FromDiscord | <louis77> sent a code paste, see https://play.nim-lang.org/#ix=4tXT |
23:05:39 | FromDiscord | <Elegantbeef> What is the actually query though? |
23:06:00 | FromDiscord | <Elegantbeef> you can just use `std/json` and `std/jsonutils` to convert the data to your type |
23:06:06 | FromDiscord | <Yardanico> In reply to @louis77 "I get a JSON": yes that just works |
23:06:13 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=4tXU |
23:06:37 | FromDiscord | <louis77> @Yardanico damn you are fast π |
23:06:44 | FromDiscord | <Yardanico> copilot wrote the json for me :) |
23:07:04 | FromDiscord | <Elegantbeef> Yea clearly was not yard he'd have used %\ π |
23:07:10 | FromDiscord | <louis77> just curious, why doesn't OrderedTable[string, JsonNode] not work? |
23:07:17 | FromDiscord | <Elegantbeef> What's the error? |
23:07:46 | FromDiscord | <louis77> sent a code paste, see https://play.nim-lang.org/#ix=4tXV |
23:08:00 | * | azimut joined #nim |
23:08:00 | FromDiscord | <Elegantbeef> You did `myTable = newJObject()`? |
23:08:19 | FromDiscord | <Elegantbeef> `myTable["key"] = newJObject()` |
23:08:20 | FromDiscord | <Yardanico> sent a code paste, see https://paste.rs/oRP |
23:08:34 | FromDiscord | <Yardanico> oh actually you don't need to import jsonutils here |
23:09:02 | FromDiscord | <Elegantbeef> That doesnt actually work though does it yard? |
23:09:06 | FromDiscord | <Elegantbeef> job\_id is an int |
23:09:07 | FromDiscord | <Yardanico> it works |
23:09:11 | FromDiscord | <morgan> In reply to @MorganAlyssa "i think i just": oof there's no vector or boolean stuff yet. guess i'll have to work on fidget a bit before i can really use it fully, tho i think i can work around it using images of the stuff and making procs for stuff |
23:09:20 | FromDiscord | <Yardanico> @beef but we have keys as strings |
23:09:21 | FromDiscord | <Yardanico> but values are JsonNode |
23:09:26 | FromDiscord | <Yardanico> job_id will just become a JsonNode |
23:09:40 | FromDiscord | <Elegantbeef> Ok i see |
23:09:53 | FromDiscord | <Yardanico> i half didn't expect it to work though :) |
23:09:57 | FromDiscord | <Elegantbeef> Awful dynamic typed code |
23:13:33 | FromDiscord | <louis77> ChatGPT is unfortunately very bad with Nim Code |
23:13:44 | FromDiscord | <Elegantbeef> Good |
23:13:58 | FromDiscord | <louis77> Copilot works well? |
23:14:00 | FromDiscord | <Yardanico> In reply to @louis77 "ChatGPT is unfortunately very": yes, because it's bad with everything that doesn't have millions of examples |
23:14:13 | FromDiscord | <Yardanico> In reply to @louis77 "Copilot works well?": it's better if you're writing in the context of Nim code already |
23:14:18 | FromDiscord | <louis77> Or anyone tried Tabnine with Nim? |
23:14:28 | FromDiscord | <Yardanico> i did a looong time ago, i think it'd be worse than copilot |
23:18:59 | FromDiscord | <louis77> JsonNode works pretty well - thank you guys |
23:19:11 | FromDiscord | <louis77> I've just started with Nim a few hours ago π |
23:20:21 | FromDiscord | <Rika> thats cool, p quick |
23:24:30 | FromDiscord | <Recruit_main707> i use chatgpt to explain me mathematical notations and expressions i dont know |
23:24:38 | FromDiscord | <Recruit_main707> it works surprisingly well |
23:24:47 | FromDiscord | <Elegantbeef> Living life dangerously i see |
23:25:03 | FromDiscord | <Recruit_main707> if you knew |
23:26:55 | FromDiscord | <Elegantbeef> I just think cunningham's law is fantastic and 1\:1 private chats with an LLM do not allow it |
23:29:39 | FromDiscord | <Recruit_main707> true, chatgpt is extremely prone to reassuring whatever you say |
23:29:55 | FromDiscord | <Elegantbeef> Wait are you a chatgpt?! |
23:29:57 | FromDiscord | <Elegantbeef> Fuuuuuk |
23:30:17 | FromDiscord | <Recruit_main707> as a language model, i am not designed to imitate human behaviour |
23:30:25 | FromDiscord | <Rika> beef wtf are you saying youre the bot here |
23:30:29 | FromDiscord | <Yardanico> exactly |
23:30:37 | madprops | im the bot |
23:30:49 | FromDiscord | <Rika> man these gpt models are so prone to hallucination |
23:30:56 | FromDiscord | <Elegantbeef> "The truman show will continue after a break for our sponsors" |
23:31:00 | FromDiscord | <Recruit_main707> maybe the bot is the friends we made along the way |
23:31:09 | FromDiscord | <Yepoleb> Who are the bots here |
23:31:16 | FromDiscord | <Rika> what is a bot, really |
23:31:18 | FromDiscord | <Elegantbeef> Beep boop beep |
23:31:29 | madprops | i don't know one day i woke up here |
23:31:29 | FromDiscord | <Yepoleb> Please raise your hand if you are human |
23:31:34 | FromDiscord | <Elegantbeef> A bot is just an undertrained LLM |
23:31:51 | FromDiscord | <Rika> no one has raised their hand |
23:31:53 | FromDiscord | <Rika> therefore |
23:32:06 | FromDiscord | <Yepoleb> All banned |
23:32:21 | FromDiscord | <Yardanico> π¨ |
23:32:35 | madprops | ban halen |
23:33:20 | FromDiscord | <Yepoleb> You need a license for being a bot here |
23:34:59 | FromDiscord | <Recruit_main707> like, tell me this isnt cool https://media.discordapp.net/attachments/371759389889003532/1099116100467306536/image.png |
23:35:17 | FromDiscord | <Yardanico> In reply to @Recruit_main707 "like, tell me this": > not using latex rendering |
23:35:31 | FromDiscord | <Recruit_main707> and if someone knows confirm this is true because my teacher just slapped it in the board, no explanation and kept going |
23:36:39 | FromDiscord | <Elegantbeef> It might be cool, but is it correct |
23:37:24 | FromDiscord | <Recruit_main707> i mean, he is a theoretical mathematician, must be |
23:38:04 | FromDiscord | <Elegantbeef> I can barely do basic algebra so I cannot confirm nor deny it |
23:38:06 | FromDiscord | <Yepoleb> We just redefine reality to be like the bots claim |
23:38:20 | FromDiscord | <voidwalker> Any hackish shortcut to get all the console read/write activity in a string ? Without writing 10.000 .toLog commands |
23:38:44 | FromDiscord | <Elegantbeef> Maybe our understanding of math is wrong and gpt has gained function to understand iit |
23:38:52 | FromDiscord | <Elegantbeef> What do you mean void |
23:38:54 | FromDiscord | <voidwalker> (edit) "commands" => "commands. For self program, not for an external process" |
23:39:11 | FromDiscord | <voidwalker> (edit) "Any hackish shortcut to get all the console read/write ... activity" added "(echo/readLine(stdin)" |
23:39:17 | FromDiscord | <Yardanico> i think void just wants to redirect all stdout/stderr to a nim string |
23:39:28 | FromDiscord | <Yardanico> stdout/stderr output that's being printed by the same nim program |
23:39:55 | FromDiscord | <Yepoleb> Didn't pmunch write something for that |
23:40:03 | FromDiscord | <Yardanico> can't you do something like https://stackoverflow.com/questions/29154056/redirect-stdout-to-a-file |
23:40:22 | FromDiscord | <Yardanico> ah, well, but this is to a file |
23:40:28 | FromDiscord | <Elegantbeef> Yea you can redirect stdout and stderr to a file |
23:40:29 | FromDiscord | <Yardanico> void wants it to go inside a nim string |
23:41:38 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/1099117770089709648/image.png |
23:42:03 | FromDiscord | <Elegantbeef> Yea a memfile and a cstring is like the best i can think |
23:42:08 | FromDiscord | <Yepoleb> https://github.com/PMunch/echooverride |
23:42:21 | FromDiscord | <Yepoleb> I found it |
23:42:34 | FromDiscord | <Yardanico> ah, the man-made horrors beyond comprehension (term-rewriting macros) |
23:42:38 | FromDiscord | <Yardanico> very powerful but also quite broken :P |
23:42:51 | FromDiscord | <Elegantbeef> In devel they're mostly fixed thanks to the noRewriite Fix |
23:43:01 | FromDiscord | <Yardanico> nah, strenc stuff is still broken |
23:43:03 | FromDiscord | <Elegantbeef> Coincidentally the best linter |
23:43:11 | FromDiscord | <Yardanico> but yes I'm lazy and can't report all issue properly or even find them |
23:43:20 | FromDiscord | <Elegantbeef> strenc? |
23:43:40 | FromDiscord | <Yardanico> <https://github.com/Yardanico/nim-strenc> a small silly trm that got created from a forum thread |
23:43:54 | FromDiscord | <Elegantbeef> Ah i see |
23:44:07 | FromDiscord | <Yardanico> you can check open issue for some fun |
23:44:40 | FromDiscord | <Elegantbeef> Still it's usable as a AST linter now, so I think it's in a better state now π |
23:44:50 | FromDiscord | <Yardanico> what do you mean by that |
23:45:01 | FromDiscord | <Elegantbeef> You can write a TRM to lint on an AST level |
23:45:14 | FromDiscord | <Elegantbeef> https://forum.nim-lang.org/t/9739#64098 |
23:45:50 | FromDiscord | <Elegantbeef> Any AST operation one wants to enforce or hint about you can do |
23:46:15 | FromDiscord | <Elegantbeef> Want to warn `seq[a..b]` can allocate you can |
23:46:26 | FromDiscord | <Yardanico> cursed |
23:46:42 | FromDiscord | <Elegantbeef> I think it's much better than having text based linting |
23:49:18 | FromDiscord | <Elegantbeef> Plus it's pluggable so you can easily write rules in user space |
23:55:28 | FromDiscord | <voidwalker> that PMunch project looks too hackish, needing a custom nim.cfg |
23:55:51 | FromDiscord | <voidwalker> sent a code paste, see https://play.nim-lang.org/#ix=4tY8 |
23:55:51 | FromDiscord | <Elegantbeef> It only needs it to enable it globally |
23:56:32 | FromDiscord | <voidwalker> and I also need one for readLine I guess :\ |
23:56:43 | FromDiscord | <Elegantbeef> You'll thank me later |
23:56:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tY9 |
23:57:03 | FromDiscord | <Elegantbeef> Well obviously the global variable needs to be changed |
23:57:25 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4tYa |
23:58:14 | FromDiscord | <voidwalker> Why is that necessary ? |