00:15:51 | FromDiscord | <!Patitotective> sent a long message, see http://ix.io/46in |
00:32:24 | FromDiscord | <#!/rip/luke> sent a code paste, see https://play.nim-lang.org/#ix=46io |
00:32:54 | FromDiscord | <Prestige> Yeah it'll return the url |
00:33:07 | FromDiscord | <#!/rip/luke> ok |
00:35:08 | FromDiscord | <Prestige> I have a more useful script if you'd like, that I use for screenshots |
00:35:28 | FromDiscord | <Prestige> maybe I'll put it in #offtopic |
00:41:02 | FromDiscord | <neon_> i still haven't gotten it to compile nativesockets T.T |
00:45:23 | * | wallabra_ joined #nim |
00:46:45 | * | wallabra quit (Ping timeout: 276 seconds) |
00:47:18 | * | wallabra_ is now known as wallabra |
00:53:10 | FromDiscord | <neon_> I dont know where or how but nim generates a c file for nativesockets and it has a conflicting definition that i have no clue how to fix |
00:53:14 | FromDiscord | <Tuatarian> If I have a variable length array that I need only to find the minimum element of |
00:53:33 | FromDiscord | <Tuatarian> It is more efficient to go through a seq than to use a min heap right? |
00:54:23 | FromDiscord | <Tuatarian> I take the min element quite a bit less often than I push to the array |
00:54:36 | FromDiscord | <Tuatarian> So the heapification would be way more expensive, right? |
00:54:41 | FromDiscord | <Elegantbeef> Probably since the elements are stored contiguously |
00:54:46 | FromDiscord | <Tuatarian> (djikstra Algo) |
00:55:09 | FromDiscord | <Tuatarian> In reply to @Elegantbeef "Probably since the elements": Meaning? |
00:55:17 | FromDiscord | <Elegantbeef> It's more cache friendly |
00:55:25 | FromDiscord | <Tuatarian> Wdym contiguously |
00:55:46 | FromDiscord | <Elegantbeef> A binary tree generally uses references so the data is stored all over the heap, a seq can store value types next to eachother tightly |
00:56:02 | FromDiscord | <Tuatarian> Oh I see |
00:56:02 | FromDiscord | <Elegantbeef> How are you compiling?↵(@neon_) |
00:56:18 | FromDiscord | <Tuatarian> Would that make accesses more efficient then? |
00:56:23 | FromDiscord | <Elegantbeef> Yes |
00:56:31 | FromDiscord | <Tuatarian> Since you only need to ask for one spot in memory |
00:56:33 | FromDiscord | <Tuatarian> Makes sense |
00:56:34 | FromDiscord | <Tuatarian> Thanks |
00:56:52 | FromDiscord | <Elegantbeef> Well you also have a cache line which is generally 64-128 bytes |
00:57:04 | FromDiscord | <Elegantbeef> So when you get 1 element in a seq you get more than just that element generally |
00:57:24 | FromDiscord | <neon_> sent a code paste, see https://play.nim-lang.org/#ix=46iq |
00:58:55 | FromDiscord | <neon_> basically im doing dynlibOverride since from as far as i understood it it'll integrate the dll's required into the executable without me having to include them externaly on the filesystem |
00:59:06 | FromDiscord | <Elegantbeef> that's not what that does |
00:59:15 | FromDiscord | <neon_> what does it do then |
00:59:44 | FromDiscord | <Elegantbeef> It stops the dynamic linking for all modules, you need to then provide them with a static version of the library |
01:00:56 | FromDiscord | <Elegantbeef> https://nim-lang.org/docs/nimc.html#dynliboverride |
01:01:08 | FromDiscord | <neon_> sent a code paste, see https://play.nim-lang.org/#ix= |
01:01:31 | FromDiscord | <Elegantbeef> You will not when you use dynliboverride and provide it with the static library for all your dlls |
01:01:45 | FromDiscord | <Elegantbeef> But you have to statically link all of them manually |
01:01:50 | FromDiscord | <neon_> its not failing because of the library |
01:02:03 | FromDiscord | <Elegantbeef> I know i'm just saying that's wrong |
01:02:25 | FromDiscord | <Elegantbeef> Is there anyway i can get the code? |
01:02:37 | FromDiscord | <neon_> well i added --dynlibOverride:opus and it didnt link |
01:02:56 | FromDiscord | <neon_> like it still required the dll to be present |
01:03:07 | FromDiscord | <neon_> but it compiled without the windows socket error |
01:04:05 | FromDiscord | <neon_> In reply to @Elegantbeef "But you have to": ok so just so i understand it; it does what i want but i have to provide the libraries myself correct? as in it packages them into the exe itself |
01:04:32 | FromDiscord | <Elegantbeef> You have to have the `.lib` or `.a` files(dont recall which windows uses) and pass them to the linker |
01:06:01 | FromDiscord | <neon_> sent a code paste, see https://play.nim-lang.org/#ix= |
01:18:49 | FromDiscord | <ajusa> Has anyone here worked with npeg? I'm trying to match the string values of an enum, but even after converting the enum values to a set it doesn't let me use it as a constant... |
01:19:28 | FromDiscord | <Elegantbeef> Might it need to be an array of strings instead? |
01:20:59 | FromDiscord | <Elegantbeef> Hasnt @!Patitotective used npeg? |
01:21:07 | FromDiscord | <ajusa> I don't think it does? Not sure |
01:24:18 | FromDiscord | <!Patitotective> In reply to @Elegantbeef "Hasnt <@762008715162419261> used npeg?": yea |
01:25:22 | FromDiscord | <ajusa> sent a code paste, see https://play.nim-lang.org/#ix=46iv |
01:29:30 | FromDiscord | <!Patitotective> i dont think you can, you have to repeat them in the npeg rule |
01:29:43 | FromDiscord | <!Patitotective> since npeg has its own syntax it doesnt allow external variables |
01:29:51 | FromDiscord | <!Patitotective> (edit) "since npeg has its own syntax ... it" added "(macro)" |
01:31:35 | FromDiscord | <ajusa> Oh. I think I'll just have it match any character, and then count on the parseEnum to throw an error |
01:32:31 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46iz |
01:32:38 | FromDiscord | <!Patitotective> (edit) "https://play.nim-lang.org/#ix=46iz" => "https://play.nim-lang.org/#ix=46iA" |
01:33:38 | FromDiscord | <ajusa> Thanks for the example! |
01:33:59 | FromDiscord | <!Patitotective> sent a code paste, see https://play.nim-lang.org/#ix=46iB |
01:34:17 | FromDiscord | <!Patitotective> 🌃 |
02:10:36 | FromDiscord | <Tuatarian> anyone have any idea why djikstra's algorithm might be running super slowly? |
02:11:27 | FromDiscord | <Tuatarian> this is my code |
02:11:29 | FromDiscord | <Tuatarian> sent a code paste, see https://play.nim-lang.org/#ix=46iI |
02:11:31 | FromDiscord | <Tuatarian> it seems fairly standard |
02:11:37 | FromDiscord | <Tuatarian> not sure what I'm doing super wrong here |
02:13:38 | FromDiscord | <Prestige> How slow is it? |
02:21:51 | FromDiscord | <voidwalker> any http client that allows getting a byte range or stop after getting N bytes ? |
02:23:13 | FromDiscord | <huantian> I'm not sure, we do really need a nice streaming api for httpclient tho |
02:23:47 | FromDiscord | <huantian> is bodyStream for the synchronous version of httpclient streaming? |
02:28:13 | FromDiscord | <voidwalker> yeah looks like it's for both. I searched the wrong words in the page |
02:40:29 | FromDiscord | <flywind> Should this compile? |
02:40:42 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46iT |
02:41:02 | FromDiscord | <Rika> Probably not |
02:41:17 | FromDiscord | <flywind> I think so, this is broken. |
02:42:20 | FromDiscord | <voidwalker> but wait, if the http client body is read synchronously, then it must block until it has finished/errored |
02:42:40 | FromDiscord | <voidwalker> so the bodyStream must be available only after it has already finished downloading |
02:42:57 | FromDiscord | <Prestige> `implicit initialization can also be prevented by the requiresInit type pragma. The compiler requires an explicit initialization for the object and all of its fields.` @flywind |
02:43:38 | FromDiscord | <Prestige> Under this section: https://nim-lang.org/docs/manual.html#statements-and-expressions-var-statement |
02:43:56 | FromDiscord | <flywind> I see |
02:44:41 | FromDiscord | <flywind> sent a code paste, see https://play.nim-lang.org/#ix=46iU |
02:44:45 | FromDiscord | <flywind> (edit) |
02:44:58 | FromDiscord | <flywind> `Cannot prove that 'result' is initialized. This will become a compile time error in the future. [ProveInit]` |
02:45:27 | FromDiscord | <Prestige> Ah, yeah |
02:45:36 | FromDiscord | <Prestige> I thought it would already by an error |
02:45:54 | FromDiscord | <theangryepicbanana> curious, is there a reason why nim outputs `(foo).bar` in C output instead of `foo->bar`? |
02:48:17 | * | arkurious quit (Quit: Leaving) |
04:50:37 | FromDiscord | <Tuatarian> is there a faster way than hashtables to implement djikstra's algorithm? |
04:50:43 | FromDiscord | <Tuatarian> hashtables in general seem to be slow |
04:50:57 | FromDiscord | <Tuatarian> but i can't think of any non terrible way to do it without them |
04:51:10 | FromDiscord | <huantian> Isn't the traditional way with a heap queue? |
04:51:37 | FromDiscord | <Tuatarian> yes for the nodes currently being considered |
04:52:02 | FromDiscord | <Tuatarian> but for example the way you store where you came from is a hashtable, and the way you associate costs to tiles is a hashtable |
04:57:08 | * | rockcavera quit (Remote host closed the connection) |
05:07:02 | * | termer quit (Quit: ZNC 1.7.5+deb4 - https://znc.in) |
05:37:06 | FromDiscord | <babusri> Trying out nim for the first time. I install inim on mac and ran↵sha256.digest("hello nim")↵↵It takes 5 seconds every time. What is the reason for this? |
05:37:36 | FromDiscord | <Elegantbeef> Inim recompiles the program each change |
05:41:12 | FromDiscord | <babusri> Is there a solution for this? Like I said, I am new to nim.↵python -i gives the result immediately the first time and every time. |
05:42:11 | FromDiscord | <Rika> Write the file and compile with Nim |
05:42:29 | FromDiscord | <Elegantbeef> Yea writing the code in a file is the best way if inim isnt making you happy |
05:42:40 | FromDiscord | <Elegantbeef> Nim being statically typed and compiled means it takes time to get runnable code |
05:43:58 | FromDiscord | <Prestige> `nim c foo.nim` then `./foo` to run |
05:44:10 | FromDiscord | <Elegantbeef> Or just `nim c -r ./foo.nim` if you're cool |
05:44:17 | FromDiscord | <Prestige> neat |
05:44:21 | FromDiscord | <Elegantbeef> Or `nim r ./foo.nim` if you dont want to look at the binary |
05:46:56 | FromDiscord | <Phil> In reply to @babusri "Is there a solution": I have a "playground" project for exactly this purpose |
05:47:06 | FromDiscord | <Rika> I have a scratches folder |
05:47:15 | FromDiscord | <Elegantbeef> Everyone has a playground project it's `/tmp/` on \nix 😄 |
05:47:41 | FromDiscord | <babusri> It is not a question of making me happy. A repl is convenient to run some quick commands (like a calculator). Say you downloaded a executable and you want to check its hash.↵5 seconds on mac seems a long time. ↵Anyway, thanks for your answers. |
05:47:43 | FromDiscord | <Phil> I want my playground stuff to stick around though since I often take another look at it later again |
05:48:11 | FromDiscord | <Phil> (that was directed at beef) |
05:48:44 | FromDiscord | <Phil> In reply to @babusri "It is not a": For simple stuff you may also look into Nim secret |
05:49:12 | FromDiscord | <Prestige> In reply to @babusri "It is not a": Well Macs _do_ suck at being fast |
05:49:21 | FromDiscord | <Rika> In reply to @Avahe "Well Macs _do_ suck": Depends on the Max |
05:49:22 | FromDiscord | <babusri> In reply to @Isofruit "I have a "playground"": Ok |
05:49:22 | FromDiscord | <Elegantbeef> Hey M1 and M2s are pretty fast |
05:49:23 | FromDiscord | <Rika> Mac |
05:49:38 | FromDiscord | <Prestige> The hardware is fast |
05:49:45 | FromDiscord | <Phil> It doesn't allow you to use the entire std lib but it basically runs on the compiler VM that it uses to compile your code. Or something like that, I'm not insanely deep into the technicalities |
05:50:03 | FromDiscord | <Elegantbeef> It uses the VM that's used for compile time evaluation and macro expansion |
05:50:10 | FromDiscord | <Rika> In reply to @Avahe "The hardware is fast": What does that even mean? Were you not talking about the hardware |
05:50:32 | FromDiscord | <Prestige> Beef was |
05:50:49 | FromDiscord | <babusri> btw, regarding nim being a statically typed language, I remember running a repl with haskell (another statically typed language) and running commands and it was very fast.↵So, I am not sure statically typed is the culprit here. |
05:51:01 | FromDiscord | <Rika> Yes but how would the hardware being fast allow for the thing not being fast, I sure doubt macOS is slow |
05:51:16 | FromDiscord | <Prestige> It is slow |
05:51:32 | FromDiscord | <Elegantbeef> Prestige you're making me lose IQ points here |
05:51:39 | FromDiscord | <Tuatarian> guys are hashtables slow? |
05:51:46 | FromDiscord | <Rika> In reply to @iWonderAboutTuatara "guys are hashtables slow?": Slower than? |
05:51:49 | FromDiscord | <Elegantbeef> Compared to what |
05:51:54 | FromDiscord | <Tuatarian> not sure what the alternative is |
05:52:10 | FromDiscord | <Tuatarian> I need to run djikstra each position of my game |
05:52:11 | FromDiscord | <Prestige> Linux desktops |
05:52:12 | FromDiscord | <Rika> Well it’s hard to say because you usually say something is slow because something else is fast |
05:52:31 | FromDiscord | <Tuatarian> is there a faster way to do many of the djikstra things than hashtable |
05:53:03 | FromDiscord | <Tuatarian> since for example storing where each cell came from typically uses hashtable, storing cost till a cell typically uses hashtable, etc |
05:53:17 | FromDiscord | <Tuatarian> but i seem to be losing time to the `isFilled` (or something like that) function |
05:53:22 | FromDiscord | <Tuatarian> which appears in a lot of the table ops |
05:53:23 | FromDiscord | <Rika> Someone mentioned that Dijkstra is usually implemented with a heap queue |
05:53:28 | FromDiscord | <Tuatarian> even access and setting |
05:53:29 | FromDiscord | <babusri> Lots of statically typed languages (go, rust) don't have repls and that is perfectly fine, but when some do, there is an expectation of good response. |
05:53:46 | FromDiscord | <Tuatarian> right, but the heapqueue is used as a priority queue |
05:53:52 | FromDiscord | <Phil> In reply to @babusri "It is not a": I'm somewhat surprised as the hardware I'm using works in under 1 sec, though that's x86 |
05:53:52 | FromDiscord | <Tuatarian> not the same purpose as the hashtables |
05:53:55 | FromDiscord | <Rika> In reply to @babusri "Lots of statically typed": Then feel free to treat the REPL here as nonexistent 😛 |
05:54:13 | FromDiscord | <Tuatarian> and rather than using a heap, I think it makes more sense to just use a seq and find the smallest element each time |
05:54:15 | FromDiscord | <Phil> Is the same speed true for Nim secret? |
05:54:23 | FromDiscord | <Tuatarian> since it should be cheaper than recomputing the heap each time you push onto it |
05:54:34 | FromDiscord | <Tuatarian> though i am not sure about that |
05:54:43 | FromDiscord | <Elegantbeef> Nim secret is faster as it just has the Nim compiler + interpreter |
05:54:46 | FromDiscord | <Tuatarian> plus, I think access should be faster |
05:54:51 | FromDiscord | <Elegantbeef> It doesnt output C code to then get compiled by the C compiler |
05:55:10 | FromDiscord | <Phil> Was directed at babusri to test it out and report performance |
05:55:10 | FromDiscord | <Rika> In reply to @iWonderAboutTuatara "but i seem to": How’d you benchmark? |
05:55:15 | FromDiscord | <Tuatarian> nimprof |
05:55:22 | FromDiscord | <Elegantbeef> In a release build? |
05:55:25 | FromDiscord | <Tuatarian> debug |
05:55:32 | FromDiscord | <Elegantbeef> you dont benchmark debug builds |
05:56:01 | FromDiscord | <Rika> Personally I don’t use that because it shows call counts and not CPU time |
05:56:01 | FromDiscord | <Tuatarian> yeah I realized that I should have thought a little bit more once you asked if it was a release build lmao |
05:56:10 | FromDiscord | <Rika> Something called often doesn’t necessarily mean it’s the blocker |
05:56:12 | FromDiscord | <Tuatarian> agree, but not sure what else to use instead |
05:56:14 | FromDiscord | <Elegantbeef> you want that optimiser on before you attempt to reason performance of anything |
05:56:24 | FromDiscord | <Elegantbeef> valgrind, perf, vtune, literally any profiler |
05:56:37 | FromDiscord | <Prestige> I love valgrind |
05:56:37 | FromDiscord | <Rika> Doesn’t treeform also have profiler libraries |
05:56:47 | FromDiscord | <Prestige> Yes |
05:56:59 | FromDiscord | <Rika> The motherfucker has everything lmao |
05:57:14 | FromDiscord | <Rika> Definition of 10x programmer: treeform |
05:57:25 | FromDiscord | <Prestige> For real |
05:57:27 | FromDiscord | <babusri> In reply to @Isofruit "Was directed at babusri": I did not understand. What do you want me to try? |
05:57:31 | FromDiscord | <huantian> honestly tho |
05:57:31 | FromDiscord | <Tuatarian> treeform is absolutely insane |
05:57:37 | FromDiscord | <Tuatarian> the guy has a library for everything |
05:57:40 | FromDiscord | <Tuatarian> no idea how they manage it |
05:58:09 | FromDiscord | <Prestige> I wonder if he doesn't work or if he just does all of that in his free time |
05:58:21 | FromDiscord | <Tuatarian> ok release build is a million times faster |
05:58:24 | FromDiscord | <Elegantbeef> This is for his job afaict |
05:58:26 | FromDiscord | <huantian> we still need yamly and tomly 😛 |
05:58:35 | FromDiscord | <Elegantbeef> No just use frosty huan |
05:58:40 | FromDiscord | <Prestige> In reply to @Elegantbeef "This is for his": Oh, that explains a lot |
05:59:01 | FromDiscord | <Elegantbeef> Frosty literally solves the serialiser problem for every format |
05:59:10 | FromDiscord | <Elegantbeef> But no one uses! |
05:59:26 | FromDiscord | <huantian> yeah frosty is pretty awesome |
05:59:48 | FromDiscord | <Prestige> https://github.com/treeform/benchy |
05:59:55 | FromDiscord | <huantian> also the current dominant nim yaml uses nix flakes which is quite based |
06:00:10 | FromDiscord | <Tuatarian> In reply to @Elegantbeef "This is for his": that would make sense |
06:00:13 | FromDiscord | <Elegantbeef> Frosty is the serde of Nim, so it's a shame no one really uses it |
06:00:25 | FromDiscord | <Tuatarian> I personally hate his naming format lmao |
06:00:34 | FromDiscord | <Tuatarian> everything ending in y, for some reason I don't like it |
06:00:42 | FromDiscord | <Elegantbeef> Y?↵(@Tuatarian) |
06:00:47 | FromDiscord | <Prestige> At least his name isn't treeformy |
06:00:50 | FromDiscord | <huantian> is disruptek still active? |
06:00:51 | FromDiscord | <Tuatarian> puppy, flippy, frosty, etc etc |
06:01:00 | FromDiscord | <Tuatarian> In reply to @Avahe "At least his name": lmao |
06:01:02 | FromDiscord | <Elegantbeef> I was making aj oke |
06:01:10 | FromDiscord | <Tuatarian> oh lol, went over my head |
06:01:10 | FromDiscord | <Phil> In reply to @babusri "I did not understand.": To start up Nim secret, which supports a subset of nim syntax and can act as a repl and see whether it performs better |
06:01:11 | FromDiscord | <huantian> i'd say he's treeform level, balls and nimph are quite awesome |
06:01:12 | FromDiscord | <Prestige> In reply to @huantian "is disruptek still active?": Yes but not in this chat, he's been banned |
06:01:14 | FromDiscord | <Elegantbeef> He doesnt write Nim but he's still alive in his banland↵(@huantian) |
06:01:21 | FromDiscord | <Tuatarian> what does he do now? |
06:01:27 | FromDiscord | <Tuatarian> he's not banned from forums right, just irc? |
06:01:31 | FromDiscord | <Elegantbeef> Makes a shitload of money |
06:01:39 | FromDiscord | <Tuatarian> where does he work? |
06:01:48 | FromDiscord | <Tuatarian> / what does he do |
06:01:49 | FromDiscord | <Elegantbeef> I'm not going to say anymore |
06:01:50 | FromDiscord | <Prestige> Also this: https://github.com/treeform/hottie |
06:01:56 | FromDiscord | <Tuatarian> fair |
06:01:57 | FromDiscord | <Prestige> For profiling code |
06:02:08 | FromDiscord | <Elegantbeef> Hey that has my name on it |
06:05:43 | FromDiscord | <huantian> man nim drama is so juicy |
06:06:25 | FromDiscord | <babusri> In reply to @Isofruit "To start up Nim": With nim secret I get the hash value instantaneously. |
06:38:28 | * | Guest2776 quit (*.net *.split) |
06:38:28 | * | robertmeta quit (*.net *.split) |
06:38:28 | * | oz quit (*.net *.split) |
06:38:29 | * | euantorano quit (*.net *.split) |
06:38:29 | * | DixieFlatline quit (*.net *.split) |
06:38:29 | * | madprops quit (*.net *.split) |
06:38:29 | * | meowray quit (*.net *.split) |
06:38:36 | * | Guest2776 joined #nim |
06:38:37 | * | meowray joined #nim |
06:38:39 | * | madprops joined #nim |
06:38:43 | * | robertmeta joined #nim |
06:38:44 | * | DixieFlatline joined #nim |
06:38:46 | * | euantorano joined #nim |
06:39:11 | * | madprops quit (Changing host) |
06:39:11 | * | madprops joined #nim |
06:39:31 | * | ox joined #nim |
06:42:27 | FromDiscord | <Aster> How is nim when used for reverse engineering? Not hacking but reversing file archives, decompression, etc. |
06:45:55 | * | gsalazar joined #nim |
06:51:09 | * | NimBot joined #nim |
06:51:31 | * | nisstyre joined #nim |
06:51:42 | * | xaltsc joined #nim |
06:51:56 | * | xaltsc quit (Changing host) |
06:51:56 | * | xaltsc joined #nim |
06:51:59 | * | ormiret joined #nim |
06:57:39 | * | gsalazar quit (Read error: Connection reset by peer) |
06:57:41 | * | gsalazar_ joined #nim |
07:16:45 | * | gsalazar_ quit (Quit: Leaving) |
07:17:03 | * | gsalazar joined #nim |
07:46:12 | FromDiscord | <Phil> In reply to @Aster "How is nim when": I can't really be of help there... do we have folks that do reverse engineering? |
07:46:49 | FromDiscord | <Aster> Decompression and byte extraction pretty much. Anything in assembly I can do outside Nim. |
07:47:21 | FromDiscord | <Yardanico> In reply to @Aster "How is nim when": not different from other languages :) |
07:47:29 | FromDiscord | <Yardanico> there are some libraries that help with (de)serialization as well |
07:47:43 | FromDiscord | <Phil> In reply to @babusri "With nim secret I": Nice! Does the slightly limited capability of that repl fulfill the role you'd want it to? |
07:50:25 | FromDiscord | <Aster> In reply to @Yardanico "not different from other": Thank you my friend. This is excellent news. I have been using C# but I wanted to learn Nim. It is such a beautiful language to read. |
07:50:42 | FromDiscord | <Aster> Way better than R for sure. |
08:07:57 | * | gsalazar quit (Ping timeout: 245 seconds) |
08:08:44 | * | gsalazar joined #nim |
08:39:31 | * | mfx joined #nim |
08:39:56 | FromDiscord | <babusri> In reply to @Isofruit "Nice! Does the slightly": Yes. |
08:40:39 | * | mfx quit (Client Quit) |
08:48:10 | FromDiscord | <Phil> That leads me to a different question that I'm kinda curious what could cause such slowness in inim on mac |
08:49:21 | FromDiscord | <flywind> In reply to @Isofruit "That leads me to": inim is basically using the Nim compiler to compile everything. |
08:49:37 | FromDiscord | <flywind> It is not a real repl. |
08:51:18 | FromDiscord | <j-james> is `nim secret` nimscript? |
08:51:23 | FromDiscord | <Elegantbeef> Yes |
08:56:41 | FromDiscord | <j-james> damn inim's pretty good for compiling everything then |
08:57:13 | FromDiscord | <Yardanico> In reply to @j-james "damn inim's pretty good": i mean, that's thanks to Nim itself not being too slow for compiling small things :) |
08:57:57 | FromDiscord | <Yardanico> when you start inim, it makes a temporary file, and then appends each line you add and recompiles + re-runs the whole file, and strips output that's been output'd in previous lines already |
08:59:16 | FromDiscord | <Yardanico> you can generally make inim even faster with tcc |
09:07:43 | FromDiscord | <Phil> In reply to @flywind "inim is basically using": That I understand, however I do not get how a simple command appears to take so long on Mac to execute, is the compiler on Mac just especially slow? |
09:10:09 | FromDiscord | <flywind> Don't a have a mac, how slow? |
09:11:17 | FromDiscord | <flywind> Somethimes I need to use a debug compiler to compile the Nim compiler, which spends 3 minutes 🙁 |
09:11:32 | FromDiscord | <Yardanico> huh? |
09:11:41 | FromDiscord | <Yardanico> ah, got it |
09:11:45 | FromDiscord | <Phil> Me neither, babusri mentioned it taking upwards of seconds to check the hash of an executable around 7:47 today, that's my point of reference |
09:27:02 | * | gsalazar quit (Read error: Connection reset by peer) |
09:27:20 | * | gsalazar joined #nim |
09:35:32 | * | bitgestalt joined #nim |
09:35:38 | * | pch joined #nim |
09:46:39 | * | bitgestalt quit (Quit: Leaving) |
10:00:14 | * | wallabra_ joined #nim |
10:00:52 | * | wallabra quit (Ping timeout: 245 seconds) |
10:01:43 | * | wallabra_ is now known as wallabra |
10:23:17 | * | xet7 quit (Quit: Leaving) |
10:34:17 | FromDiscord | <4zv4l> can I create an array without giving the length but the array is written in the code so the size won't change ? |
10:34:27 | FromDiscord | <4zv4l> just it's long and I don't wanna count oh much element there is inside |
10:35:15 | FromDiscord | <Yardanico> In reply to @4zv4l "can I create an": of course, you can do that for every type, not just arrays |
10:35:18 | FromDiscord | <4zv4l> (edit) "oh" => "how" |
10:35:18 | * | gsalazar quit (Quit: Leaving) |
10:35:20 | FromDiscord | <Yardanico> `let a = [1, 2, 3, 4, 5]` |
10:35:25 | FromDiscord | <4zv4l> oh perfect ! |
10:35:34 | * | gsalazar joined #nim |
10:35:42 | FromDiscord | <Yardanico> specifying types for variables when you initialize them right away is optional |
10:35:51 | * | Wabby joined #nim |
10:35:53 | FromDiscord | <Yardanico> it's only needed if you initialize them later, so the compiler doesn't know the type |
10:36:49 | FromDiscord | <4zv4l> alright, thank you very much |
10:36:56 | FromDiscord | <4zv4l> I also got another question |
10:37:15 | FromDiscord | <4zv4l> if I import a library does the compiler will optimize and only import the functions I use or not ? |
10:39:16 | FromDiscord | <Yardanico> In reply to @4zv4l "if I import a": yes, Nim always does dead code elimination |
10:39:22 | * | Wabby quit (Client Quit) |
10:39:39 | FromDiscord | <Yardanico> the stuff that's left in binary is only code/functions/etc that are actually used by your code (unless you specifically use things like `exportc` to keep them) |
10:40:41 | FromDiscord | <4zv4l> and if I import libraries that use the same name for functions↵I can precise them with for example terminal.doThis and anotherlib.doThis ? |
10:40:49 | FromDiscord | <Yardanico> yes |
10:40:58 | FromDiscord | <4zv4l> (edit) "terminal.doThis" => "`terminal.doThis`" | "anotherlib.doThis" => "`anotherlib.doThis`" |
10:41:00 | FromDiscord | <4zv4l> amazing |
10:41:03 | FromDiscord | <Yardanico> but that is only required if those functions have exactly the same signature (number of arguments) |
10:41:16 | FromDiscord | <Yardanico> and even then you can overload by argument names if you specify them in the call |
10:41:23 | FromDiscord | <Yardanico> In reply to @Yardanico "but that is only": and type of arguments as well of course |
10:42:15 | FromDiscord | <Yardanico> so if you have `proc doThis(x: int, y: string)` in `terminal` and `proc doThis(x: string, y: int)` in `anotherlib`, then you can call them from both libs as `doThis` without specifying the module, since their signatures are different |
10:42:47 | FromDiscord | <Yardanico> nim stdlib only has a couple cases where different modules' procs have the same signature |
10:50:54 | FromDiscord | <4zv4l> yeaaah, actually I learnt overloading with Nim |
10:51:11 | FromDiscord | <4zv4l> just I use `sample` to get a random word from an array of string and it always return the same one |
10:51:20 | FromDiscord | <4zv4l> is that normal ? Do I need to give a seed to the randomizer ? |
10:52:24 | FromDiscord | <4zv4l> of yeah with `randomize()` |
10:52:26 | FromDiscord | <Rika> You need to call "randomize()" at thebstart |
10:53:40 | FromDiscord | <4zv4l> thanks ^^ |
11:00:52 | FromDiscord | <LaughingBubba> Hi does anyone know how long it takes to get a confirmation email for a new forums account? |
11:01:16 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=46kZ |
11:07:45 | FromDiscord | <domosokrat> @4zv4l\: default is to only document exported symbols. |
11:08:12 | FromDiscord | <4zv4l> how do I change that ? |
11:08:33 | FromDiscord | <4zv4l> I don't find how to change that in the doc |
11:08:47 | FromDiscord | <domosokrat> Add `--docInternal` to your `nim doc` call |
11:09:52 | FromDiscord | <4zv4l> where is that written to do that ? |
11:10:49 | FromDiscord | <LaughingBubba> In the config.nims I think |
11:11:44 | FromDiscord | <4zv4l> also how do I do a newline ? `\` ` ` didn't work |
11:11:52 | FromDiscord | <4zv4l> In reply to @LaughingBubba "In the config.nims I": I mean that should be written in the doc |
11:12:04 | FromDiscord | <domosokrat> nim --fullhelp shows that option |
11:15:03 | * | termer joined #nim |
11:20:16 | FromDiscord | <domosokrat> Try a Lineblock\: https://docutils.sourceforge.io/docs/user/rst/quickref.html#line-blocks↵(@4zv4l) |
11:22:43 | FromDiscord | <4zv4l> In reply to @domosokrat "nim --fullhelp shows that": alright thanks ! |
11:22:54 | FromDiscord | <4zv4l> In reply to @domosokrat "Try a Lineblock\: https://docutils.sourceforge.io/d": I did a blank like with ## and it worked |
11:27:41 | FromDiscord | <4zv4l> is it possible to export the doc to a README.md ? |
11:34:08 | * | om3ga quit (Ping timeout: 255 seconds) |
11:35:33 | * | wallabra_ joined #nim |
11:37:11 | * | wallabra quit (Ping timeout: 244 seconds) |
11:39:02 | * | wallabra joined #nim |
11:41:51 | * | wallabra_ quit (Ping timeout: 268 seconds) |
11:50:04 | * | wallabra_ joined #nim |
11:51:21 | FromDiscord | <hotdog> In reply to @4zv4l "is it possible to": Have a look at https://nimble.directory/pkg/mddoc |
11:52:32 | * | wallabra quit (Ping timeout: 255 seconds) |
11:54:25 | * | jmdaemon quit (Ping timeout: 272 seconds) |
11:54:29 | * | wallabra joined #nim |
11:56:14 | * | wallabra_ quit (Ping timeout: 240 seconds) |
12:01:56 | FromDiscord | <Phil> In reply to @LaughingBubba "Hi does anyone know": <@&371760044473319454> potential email problems |
12:02:41 | FromDiscord | <Yardanico> yes but where's the username :/ |
12:02:49 | FromDiscord | <Yardanico> In reply to @LaughingBubba "Hi does anyone know": What's your username on the forum? |
12:02:58 | FromDiscord | <Yardanico> If you didn't get the email right away, it probably won't come at all |
12:03:04 | FromDiscord | <LaughingBubba> Same as discord |
12:03:41 | FromDiscord | <Yardanico> approved |
12:29:29 | FromDiscord | <LaughingBubba> Ok thanks!! @Yardanico |
12:35:27 | NimEventer | New thread by LaughingBubba: Text portion of an XmlNode type, see https://forum.nim-lang.org/t/9335 |
12:35:46 | * | wallabra_ joined #nim |
12:37:50 | * | wallabra quit (Ping timeout: 240 seconds) |
12:37:51 | * | wallabra_ is now known as wallabra |
12:48:58 | FromDiscord | <Phil> sent a code paste, see https://paste.rs/SLq |
12:49:27 | FromDiscord | <Phil> (edit) "https://play.nim-lang.org/#ix=46lv" => "https://play.nim-lang.org/#ix=46lu" |
12:50:54 | FromDiscord | <Phil> the field names are not all that straight forward, because object of an object variants have fields that exist or do not exist depending on the value of a "kind" field!↵That's how you manage to be somewhat dynamic in nim, allowing e.g. parsing from Json into an intermediate state where you represent something as JsonNode, even though it could contain a string, an int, an array, a bool, an object or something else |
12:51:13 | FromDiscord | <Phil> (edit) "JsonNode," => "a statically typed JsonNode object," |
12:52:00 | * | pch_ joined #nim |
12:52:11 | * | pch_ quit (Client Quit) |
12:52:22 | FromDiscord | <Phil> I'm actually not familiar with if that concept exists in other languages |
12:54:36 | * | gsalazar quit (Remote host closed the connection) |
12:54:46 | * | gsalazar joined #nim |
12:56:41 | FromDiscord | <Rika> Discriminated unions is what they’re more commonly called |
12:57:08 | FromDiscord | <Rika> Tagged union I guess |
12:57:13 | FromDiscord | <Phil> Alternatively "tagged union"? |
12:57:15 | FromDiscord | <Phil> Ah, check |
12:57:31 | FromDiscord | <Phil> In that case nevermind, java does have tagged union |
12:57:38 | FromDiscord | <Phil> Though I have never ever ever ever seen them being used |
12:59:02 | FromDiscord | <Rika> Probably because enterprise lag |
12:59:57 | FromDiscord | <Phil> I'd wager it's more likely that the usecase is abstracted away behind 50 abstraction layers so some sort of package (e.g. jackson) takes care of it for you |
13:00:16 | FromDiscord | <Phil> java things |
13:00:24 | FromDiscord | <Phil> (edit) |
13:07:18 | FromDiscord | <4zv4l> In reply to @hotdog "Have a look at": I don't succeed to use it |
13:07:25 | FromDiscord | <4zv4l> there is no real help on the github page |
13:07:43 | FromDiscord | <4zv4l> like it asks for a README but I want to generate it↵and it asks for a doc.json but there isn't in my project |
13:08:00 | FromDiscord | <4zv4l> and when I run `mddoc -h` it shows the `nim` help not the mddoc help |
13:12:19 | * | wallabra_ joined #nim |
13:14:14 | * | wallabra quit (Ping timeout: 240 seconds) |
13:14:15 | * | wallabra_ is now known as wallabra |
13:36:40 | FromDiscord | <LaughingBubba> @Phil thanks will look into it but seems overly tricky to just access the text node. I’m not a fan of parsing into a dom but it should quick and easy … I think I’ll go for the SAX type of parsing next |
13:39:46 | * | arkurious joined #nim |
13:48:04 | FromDiscord | <Phil> In reply to @LaughingBubba "<@180601887916163073> thanks will": For ease of use you have convenience procs such as text() and the like, which tries to shield you from that complexity. Combined with the answers you got in the forum I mostly wanted to give you a basis for understanding what language feature you're dealing with there |
13:52:06 | * | ggsx joined #nim |
13:53:19 | FromDiscord | <hotdog> In reply to @4zv4l "like it asks for": Just make an empty README file and it should append to it |
13:53:29 | FromDiscord | <hotdog> You don't need any doc.json |
13:53:29 | FromDiscord | <LaughingBubba> @Phil thing is text() doesn’t work hence the forum post. |
13:53:39 | NimEventer | New thread by Juancarlospaco: Nim Wiki disabled contributions, see https://forum.nim-lang.org/t/9336 |
13:53:53 | FromDiscord | <4zv4l> In reply to @hotdog "Just make an empty": I did but then the readme contains almost nothing |
13:54:06 | FromDiscord | <Rika> In reply to @LaughingBubba "<@180601887916163073> thing is text()": Someone replied that the alternative works "innerText" |
13:54:07 | FromDiscord | <LaughingBubba> (edit) "@Phil thing is text() doesn’t work hence the forum post. ... " added "Will replies in the antipodean AM" |
13:54:48 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#ix=46lR |
13:54:51 | FromDiscord | <4zv4l> it contains only this |
13:55:03 | FromDiscord | <4zv4l> (edit) "https://play.nim-lang.org/#ix=46lR" => "https://play.nim-lang.org/#ix=46lS" |
13:56:51 | FromDiscord | <hotdog> In reply to @4zv4l "it contains only this": Hmm |
13:57:11 | FromDiscord | <hotdog> Seems like maybe it is not updated for the latest compiler version |
13:57:18 | FromDiscord | <hotdog> ping @treeform 🙂 |
13:59:23 | ggsx | in a template, to avoid to importing mymodule at each use of the template, I am using bind mymodule.`[]=`. I can then use it in the template like this mymodule.`[]=`(x, y, z) but not like this x[y] = z. is there a better way? |
14:08:20 | * | CyberTailor joined #nim |
14:22:53 | * | Guest2776 quit (Ping timeout: 252 seconds) |
14:27:32 | FromDiscord | <Phil> In reply to @ggsx "in a template, to": Why not export the module whose value you are binding?↵It's not ideal but I found it workable |
14:33:00 | * | Guest56 joined #nim |
14:34:09 | Guest56 | Hi, I am trying to create a barebone UDP server, but I always get back 0 bytes. Am I missing something in the source? |
14:34:09 | Guest56 | import std/net |
14:34:10 | Guest56 | proc main() = |
14:34:10 | Guest56 | let socket = newSocket(AF_INET, SOCK_DGRAM, IPPROTO_UDP) |
14:34:11 | Guest56 | socket.bindAddr(Port(8000)) |
14:34:11 | Guest56 | while true: |
14:34:12 | Guest56 | var data, address: string |
14:34:12 | Guest56 | var length: int |
14:34:13 | Guest56 | var port: Port |
14:34:13 | Guest56 | let n = socket.recvFrom(data, length, address, port) |
14:34:14 | Guest56 | echo n," ", data," ", length," ", address, " ", port |
14:34:14 | Guest56 | when isMainModule: |
14:34:15 | Guest56 | main() |
14:34:54 | Guest56 | The result is: |
14:34:55 | Guest56 | 0 0 127.0.0.1 34562 |
14:34:55 | Guest56 | 0 0 127.0.0.1 34562 |
14:34:56 | Guest56 | 0 0 127.0.0.1 34562 |
14:38:50 | ggsx | @phil : I tried it, it didn't work for me, I am not familiar with export but I guess it could be because the import chain is long and I have generics too. I need to reduce the problem. |
14:41:17 | ggsx | structuring a big project in nim appears to be the most difficult thing for me now |
14:46:04 | FromDiscord | <Phil> In reply to @ggsx "<@180601887916163073> : I tried": What was your error or what stopped you?↵Ambiguous symbols? |
14:46:13 | Guest56 | ok, I found myself my error |
14:46:29 | FromDiscord | <Phil> Maybe you stumbled into a circular dependency? |
14:46:44 | ggsx | @Phil: Error: type mismatch: got ... |
14:47:32 | ggsx | @Phil: it doesn't see my []= but the system ones only |
14:48:51 | * | rockcavera joined #nim |
14:48:52 | * | rockcavera quit (Changing host) |
14:48:52 | * | rockcavera joined #nim |
14:49:38 | * | ggsx quit (Quit: Client closed) |
14:51:27 | * | ggsx joined #nim |
14:54:51 | * | Guest56 quit (Quit: Client closed) |
14:58:01 | * | ggsx quit (Quit: Client closed) |
15:15:06 | * | oz joined #nim |
15:15:31 | * | Guest2776 joined #nim |
15:15:34 | * | oz is now known as Guest2417 |
15:41:55 | NimEventer | New thread by Chaemon: String of compressed source code, see https://forum.nim-lang.org/t/9337 |
16:13:25 | FromDiscord | <PyryTheBurger> what is the difference between result and return in procs |
16:18:58 | FromDiscord | <exelotl> return affects control flow, making the function exit immediately. You should prefer `result` or simply having the last expression in the procedure be the result (e.g. `proc add(a, b: int) = a + b`), unless you specifically want that early-exit behaviour |
16:20:32 | * | nisstyre quit (Changing host) |
16:20:32 | * | nisstyre joined #nim |
16:24:13 | FromDiscord | <Kermithos> can I check the type of a variable like this: `headers.type == string`? Or do I have to convert it to a string first? |
16:35:49 | FromDiscord | <exelotl> sent a code paste, see https://play.nim-lang.org/#ix=46mD |
16:36:18 | FromDiscord | <exelotl> note that `when` is a compile-time `if`. |
16:37:32 | FromDiscord | <Kermithos> In reply to @exelotl "nim is a statically": worked, thanks |
16:38:11 | FromDiscord | <hotdog> In reply to @exelotl "nim is a statically": You don't need that first typeof, it could also just be `when a is string` |
16:38:21 | FromDiscord | <exelotl> mmh yeah |
16:38:38 | FromDiscord | <exelotl> I originally did `typeof(a) == string` but that didn't work for some reason |
16:44:29 | FromDiscord | <PyryTheBurger> what is the difference between is and == then |
16:51:15 | FromDiscord | <treeform> In reply to @4zv4l "and when I run": Sorry we stopped using mddoc, we use nimdocs.com instead now. Maybe nim changed the way to generates docs so it does not work anymore? |
16:56:31 | FromDiscord | <!!sharpcdf!!> does `writeFile` append or write over the file |
16:57:05 | FromDiscord | <gibson> @PyryTheBurger `is` inspects the type. `==` inspects the value. |
16:57:41 | FromDiscord | <gibson> `of` inspects the object-oriented inheritance relationship. |
17:00:58 | * | fallback quit (Ping timeout: 240 seconds) |
17:02:23 | * | rwb quit (Ping timeout: 252 seconds) |
17:04:12 | FromDiscord | <treeform> In reply to @sharpcdf "does `writeFile` append or": writes over |
17:08:28 | * | rwb joined #nim |
17:17:07 | * | rwb quit (Ping timeout: 245 seconds) |
17:17:31 | * | rwb joined #nim |
17:18:48 | FromDiscord | <!!sharpcdf!!> alright |
17:23:53 | FromDiscord | <4zv4l> In reply to @treeform "Sorry we stopped using": alright ! thanks ^^ |
17:25:00 | FromDiscord | <!!sharpcdf!!> In reply to @treeform "writes over": what about `writeLine`? |
17:25:15 | FromDiscord | <!!sharpcdf!!> i remember there being a shorthand proc for appending a line to a file |
17:25:40 | FromDiscord | <4zv4l> In reply to @treeform "Sorry we stopped using": I get this↵`404: https://github.com/4zv4l/ not allowed` |
17:26:05 | FromDiscord | <4zv4l> but my github repo is public↵https://github.com/4zv4l/wordle_nim |
17:27:21 | FromDiscord | <!!sharpcdf!!> In reply to @sharpcdf "what about `writeLine`?": whats the name of the proc that opens a filename, appends to it then closes it |
17:30:27 | * | rwb quit (Ping timeout: 245 seconds) |
17:34:05 | FromDiscord | <jmgomez> where does nimble looks for libcrypto-1_1-x64.dll? I have it in the nimsources/bin folder but it doesnt pick it up |
17:38:45 | * | rwb joined #nim |
17:38:48 | FromDiscord | <EyeCon> In reply to @jmgomez "where does nimble looks": This question has an incredibly complicated answer: https://docs.microsoft.com/en-us/windows/win32/dlls/dynamic-link-library-search-order |
17:39:15 | FromDiscord | <EyeCon> Short answer, you're good if the DLL is in the same folder as the executable, hopefully |
17:42:21 | FromDiscord | <jmgomez> yeah, I have it there but as I said it doesnt pick it up. Thanks for the link though! |
17:43:00 | FromDiscord | <EyeCon> It's in the same directory as nimble itself, and cannot be found? |
17:43:10 | FromDiscord | <jmgomez> yes |
17:44:10 | FromDiscord | <jmgomez> sent a code paste, see https://play.nim-lang.org/#ix=46mV |
17:44:43 | * | fallback joined #nim |
17:45:34 | FromDiscord | <jmgomez> (edit) "https://play.nim-lang.org/#ix=46mV" => "https://play.nim-lang.org/#ix=46mX" |
17:45:56 | FromDiscord | <treeform> In reply to @4zv4l "I get this `404:": Sorry during alpha, we only allow people we trust on nimdocs.com ... you can write your own server though. |
17:46:29 | FromDiscord | <treeform> https://github.com/treeform/nimdocs/blob/master/src/nimdocs.nim#L26 |
17:46:35 | FromDiscord | <EyeCon> sent a code paste, see https://play.nim-lang.org/#ix=46mY |
17:46:44 | FromDiscord | <treeform> (edit) "write" => "run" |
17:46:53 | FromDiscord | <EyeCon> Note that it doesn't say it cannot be found, only that it cannot be loaded |
17:48:59 | FromDiscord | <jmgomez> In reply to @eyecon "You are on x64": yup |
17:49:28 | FromDiscord | <jmgomez> I got it from some random place on the net, will try to find another |
17:50:03 | FromDiscord | <jmgomez> BTW did anyone here the nimlangserver to work on win? It works pretty much of the box on macOs |
17:50:22 | FromDiscord | <EyeCon> In reply to @jmgomez "I got it from": Mine has SHA-1 `E7B955F64DB1C239EAD411E392CD1CCB6EDA3318`, in case it helps |
17:50:40 | FromDiscord | <jmgomez> (edit) "BTW did anyone ... heregot" added "in" | "inhere ... the" added "got" |
17:51:16 | FromDiscord | <EyeCon> In reply to @jmgomez "I got it from": It should be one of the files in https://nim-lang.org/download/dlls.zip - try that |
17:51:34 | FromDiscord | <EyeCon> Although I'm not sure, but can't hurt |
17:52:17 | FromDiscord | <4zv4l> In reply to @treeform "Sorry during alpha, we": alright xD |
17:53:51 | FromDiscord | <jmgomez> In reply to @eyecon "It should be one": aggh that worked out! Do you mind to share were that link is located in the docs? |
17:53:55 | FromDiscord | <jmgomez> Thanks a bunch! |
17:54:08 | FromDiscord | <EyeCon> In reply to @jmgomez "aggh that worked out!": It isn't 😔 |
17:54:24 | FromDiscord | <geekrelief> In reply to @jmgomez "aggh that worked out!": I think I found it in a forum post |
17:54:32 | FromDiscord | <EyeCon> We need a "deployment" manual |
17:54:49 | FromDiscord | <EyeCon> In reply to @geekrelief "I think I found": Yes, along with another incredibly important link, let me find that |
17:54:57 | FromDiscord | <geekrelief> https://forum.nim-lang.org/t/9254#60610 |
17:55:00 | FromDiscord | <EyeCon> https://forum.nim-lang.org/t/9254 |
17:55:18 | FromDiscord | <jmgomez> haha cool, thanks! |
17:55:28 | FromDiscord | <geekrelief> there's an older thread where I found it though 🙂 |
17:55:40 | FromDiscord | <jmgomez> IMO they should be more discoverable |
17:56:42 | FromDiscord | <geekrelief> In reply to @jmgomez "IMO they should be": when in doubt check google, discord, forum, github 🙂 |
17:59:53 | FromDiscord | <jmgomez> In reply to @geekrelief "when in doubt check": yes, but it would be useful to have a document called working with sources or something like that that covers this small issues. Seems to me there are more hidden stuff like this |
18:01:17 | FromDiscord | <geekrelief> I think the issue is most people find the fix and then move on. |
18:02:07 | FromDiscord | <geekrelief> I don't even recall why I have these dlls anymore. I just know I needed them and they're in my path. |
18:02:44 | FromDiscord | <jmgomez> yes.. problem is that adds up |
18:02:55 | FromDiscord | <jmgomez> I think it's due to an issue with open ssl but not sure |
18:03:29 | FromDiscord | <geekrelief> maybe you can create an issue it's still fresh for you? |
18:04:42 | FromDiscord | <jmgomez> Im trying to figure out why the lang server doesnt work on Win but will definitely do it afterwards |
18:05:33 | FromDiscord | <geekrelief> Are you looking into the saem extension as well? |
18:05:47 | FromDiscord | <jmgomez> yes |
18:39:02 | * | wallabra quit (Ping timeout: 240 seconds) |
18:41:23 | * | wallabra joined #nim |
19:16:47 | FromDiscord | <Vivek> For anybody that's well versed with Nimpy/Nimporter, do you guys know how to convert from a python object (lists and numpy arrays) to nim sequences? I've been struggling with trying to read in data from python and passing that data into nim for computations. |
19:19:40 | FromDiscord | <Yardanico> See https://github.com/yglukhov/nimpy/blob/master/tests/numpytest.nim for an example for numpy |
19:19:50 | FromDiscord | <Yardanico> and for lists it should just work I think |
19:22:30 | FromDiscord | <Vivek> In reply to @Yardanico "and for lists it": It was going to be a bit inconvenient to pass in numpy arrays as parameters, so this is perfect |
19:22:31 | FromDiscord | <Vivek> thanks |
19:40:09 | * | Guest2417 is now known as om3ga |
19:44:07 | NimEventer | New post on r/nim by AmazonEchoDotSupreme: GitHub - sharpcdf/jitter: A Github binary manager, see https://reddit.com/r/nim/comments/wdqhml/github_sharpcdfjitter_a_github_binary_manager/ |
19:50:33 | FromDiscord | <SteveMCWin> Hey guys, I wanna get into Nim, and since I love coding shaders in GLSL I was wondering whether it's possible to do something like that with Nim. |
19:55:20 | FromDiscord | <Prestige> It is, seehttps://github.com/treeform/shady |
19:55:25 | FromDiscord | <Prestige> (edit) "seehttps://github.com/treeform/shady" => "see https://github.com/treeform/shady" |
20:17:44 | FromDiscord | <gibson> In reply to @NimEventer "New post on r/nim": This is a very popular kind of project lately. There are a lot of implementations and apparently no one is getting it right, because every few weeks someone releases their own version because nothing else was quite right. |
20:18:19 | FromDiscord | <huantian> the solution is to not use git for binaries 😛 |
20:18:34 | FromDiscord | <gibson> What would you use? |
20:19:13 | FromDiscord | <huantian> actually I have no idea what exactly this project is |
20:20:21 | FromDiscord | <gibson> No problem. |
20:21:17 | FromDiscord | <huantian> uh I would just use a traditional package manager |
20:21:38 | FromDiscord | <huantian> because there's no good way to manage dependencies with github releases |
20:21:39 | FromDiscord | <gibson> And then you can't script for arbitrary platforms without root. |
20:22:11 | FromDiscord | <huantian> unless you only allow packaging formats that bundle dependencies, in which case just use flatpak |
20:22:16 | FromDiscord | <huantian> In reply to @gibson "And then you can't": wdym |
20:22:45 | NimEventer | New thread by Cnerd: Ormin postgres backend with threads, see https://forum.nim-lang.org/t/9338 |
20:23:28 | FromDiscord | <gibson> These projects often try to solve creating a uniform CLI for grabbing and installing software. For instance, "install NeoVim on whatever OS I'm on" = grab appropriate binary from github, extract, put somewhere expected. |
20:23:52 | FromDiscord | <gibson> (edit) "These projects often try to solve creating a uniform CLI for grabbing and installing software. For instance, "install NeoVim on whatever OS I'm on" = grab appropriate binary from github, extract, put somewhere expected. ... " added "(without root)" |
20:24:40 | FromDiscord | <huantian> other package managers can do the same |
20:24:54 | FromDiscord | <huantian> to try and make it work on all OSes is a fools errand |
20:25:19 | FromDiscord | <huantian> (edit) "same" => "same, ie nix can install systemwide and per-user" |
20:25:48 | FromDiscord | <gibson> "fools errand" == "it's very hard" |
20:26:15 | FromDiscord | <gibson> nix is not cross platform |
20:27:02 | FromDiscord | <huantian> I wasn't saying it was |
20:27:33 | FromDiscord | <huantian> In reply to @gibson ""fools errand" == "it's": very very very very very very very hard |
20:28:26 | FromDiscord | <gibson> Yeah I see. It's an interesting problem domain. I'm personally invested because I started one last year I hope to release this year. 🙂 Can't solve everything 100%, but it is possible to create a great ecosystem that solves most problems. |
20:29:10 | FromDiscord | <huantian> I just personally don't find any use for this when I can just use my package manager |
20:29:21 | FromDiscord | <!Patitotective> In reply to @huantian "I just personally don't": ~~apt 💀 ~~ |
20:29:45 | FromDiscord | <gibson> Right, it's for people who would normally use docker/ansible, but can't for whatever reason (resources, admin, technical difficulty, etc.) |
20:30:28 | FromDiscord | <gibson> Especially in the High Performance Computing domain. |
20:30:37 | FromDiscord | <huantian> isn't the point of docker containerization + reproducibility? |
20:30:46 | FromDiscord | <gibson> Yes, so are these projects. |
20:30:57 | FromDiscord | <gibson> Except removing the container. |
20:32:05 | FromDiscord | <huantian> ig I'm just too privileged to understand 😛 |
20:32:19 | FromDiscord | <huantian> In reply to @Patitotective "~~apt 💀 ~~": debain issue 😎 |
20:32:22 | FromDiscord | <huantian> (edit) "debain" => "debian" |
20:33:16 | FromDiscord | <gibson> like how a nimble file describes a cross platform automation for setting up a new environment and dependent software. but instead think all software, not just nim modules. |
20:33:34 | FromDiscord | <!!sharpcdf!!> In reply to @gibson "This is a very": i just made it because i was bored 😂 |
20:33:55 | FromDiscord | <gibson> I'm not complaining! I think it's interesting there's so much interest in this domain. |
20:34:09 | FromDiscord | <gibson> Very cool; I encourage you to work on it. |
20:34:16 | FromDiscord | <!!sharpcdf!!> thanks lol |
20:34:25 | FromDiscord | <!!sharpcdf!!> i made it really just for personal use but apparently other people were interested |
20:34:43 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=46nk |
20:35:37 | FromDiscord | <huantian> In reply to @gibson "like how a nimble": isn't that a solved problem? like that's what nix does |
20:35:48 | FromDiscord | <gibson> nix is not cross platform. |
20:35:57 | FromDiscord | <huantian> well if you don't count windows as a platform |
20:36:18 | FromDiscord | <Prestige> Things get a lot easier when you don't count Windows as a platform, lol |
20:36:48 | FromDiscord | <gibson> Or you have admin access, that's also easier. |
20:37:14 | FromDiscord | <huantian> I mean sometimes you need admin access |
20:37:23 | FromDiscord | <gibson> Sometimes you will never get it. |
20:37:32 | FromDiscord | <!Patitotective> In reply to @Avahe "Things get a lot": Things get nice |
20:39:38 | FromDiscord | <huantian> In reply to @gibson "Sometimes you will never": never get that all programs can run without admin? |
20:40:28 | FromDiscord | <gibson> Yeah, even python, nim, c++, julia, rust, do not need admin to download and use. It's great. |
20:41:26 | FromDiscord | <gibson> Basically makes a security nightmare haha, but that's not my problem when admins refuse to install the software I need to get work done. |
20:41:57 | FromDiscord | <huantian> what about programs like steam, or drivers? |
20:42:44 | FromDiscord | <gibson> That's the "can't solve 100% everything" GPU drivers are the biggest thorn I can't solve, but it turns out that in all contexts desktop, HPC, web, where that's needed, it's already solved. |
20:43:22 | FromDiscord | <gibson> Stuff like that is critical enough, that services or admins have solved it. |
20:44:22 | FromDiscord | <gibson> Contexts = your desktop computer, all the way up to govt compute centers. |
20:44:56 | FromDiscord | <huantian> I think I personally haven't ran into the problem you're describing and I'm not the target demographic |
20:45:21 | FromDiscord | <gibson> I'll shut up then :p |
20:45:51 | * | krux02 joined #nim |
20:45:52 | FromDiscord | <huantian> nah no need lol, I was just curious on exactly the goals of your project |
20:46:02 | FromDiscord | <huantian> and I think I undestand more now |
20:46:08 | FromDiscord | <Prestige> I don't miss having to work on a govt. controlled windows pc |
20:46:16 | FromDiscord | <gibson> It's really for "when does Docker fail?" it's those use cases. |
20:46:33 | FromDiscord | <gibson> In reply to @Avahe "I don't miss having": Oh gross! I'm sorry. |
20:47:10 | FromDiscord | <huantian> In reply to @gibson "It's really for "when": yeah makes sense, I just never used docker so it never failed for me 😛 |
20:47:20 | FromDiscord | <gibson> In reply to @huantian "yeah makes sense, I": I am sooo jealous. |
20:48:17 | FromDiscord | <gibson> In reply to @gibson "Why does this fail?": I don't even know the words to search this issue in the Nim github issues... 🤔 |
20:49:04 | FromDiscord | <huantian> Actually I’ve used it once or twice for simple stuff, but I think I’m happy with how Nix does things, but there is a huge cost in switching ot jt |
20:49:08 | FromDiscord | <huantian> (edit) "jt" => "it" |
20:49:37 | FromDiscord | <gibson> I understand. I researched the nix way before beginning my project. It was.. intense. |
20:49:52 | FromDiscord | <huantian> In reply to @gibson "I don't even know": myabe it's cus of plain `tuple` as a param? |
20:50:19 | FromDiscord | <gibson> But the order determines error vs no error? I don't understand that part. |
20:50:38 | FromDiscord | <Prestige> I would think it shouldn't compile either way |
20:50:51 | FromDiscord | <Yardanico> In reply to @Avahe "I would think it": nah using `tuple` like that is fine, it's a generic typeclass by itself |
20:51:06 | FromDiscord | <Yardanico> same as you can do `object` |
20:51:06 | FromDiscord | <Prestige> Ah, I see |
20:51:18 | FromDiscord | <Yardanico> useful for generic programming, especially combined with `fields` or `fieldPairs` |
20:51:29 | FromDiscord | <Yardanico> but yeah, maybe it's bugging when using as template argument types |
20:54:11 | FromDiscord | <gibson> Also, strangely (to me), `openArray` must be used alone. It is not a typeclass -- I guess that makes some sense. I'm so used to thinking of it like a composite typeclass. |
21:02:49 | NimEventer | New thread by Ggibson: Composite type bug? Order makes difference., see https://forum.nim-lang.org/t/9339 |
21:28:05 | * | xet7 joined #nim |
21:28:14 | * | CyberTailor quit (Ping timeout: 268 seconds) |
21:28:48 | * | CyberTailor joined #nim |
21:35:35 | FromDiscord | <topmark> Hi, does anyone know how to disable targeting JS when using a nimscript?↵↵I'm trying to use nim as a shell scripting language, and whenever I use certain file commands like copyDir, it says "Error: this proc is not available on the NimScript/js target". I understand why that would be so, but I don't care to target JS, I just want to run the script in a terminal like `nim script.nims`. I've tried googling and stackoverflow, it's not cl |
21:37:22 | * | wallabra_ joined #nim |
21:38:58 | qwr | i think its just a message used for both nimscript and js targets |
21:39:26 | * | wallabra quit (Ping timeout: 240 seconds) |
21:39:27 | * | wallabra_ is now known as wallabra |
21:40:14 | * | dv^_^9 joined #nim |
21:41:02 | qwr | nimscript is run by interpreter, and i guess that it doesn't support C FFI |
21:41:17 | * | jkl1337 joined #nim |
21:42:32 | * | void09_ joined #nim |
21:42:53 | FromDiscord | <topmark> Thanks for your reply. It does not complete the task. It doesn't even seem to start executing the script, so I think the error happens while it's analyzing before it runs the script |
21:43:19 | * | dextop_ joined #nim |
21:43:25 | * | tk quit (Ping timeout: 272 seconds) |
21:43:42 | * | qwr uses nim for samething resembling shell scripting, but i'm just compiling the code to native binary |
21:48:16 | * | void09 quit (*.net *.split) |
21:48:17 | * | jkl quit (*.net *.split) |
21:48:17 | * | oddish quit (*.net *.split) |
21:48:17 | * | dv^_^ quit (*.net *.split) |
21:48:17 | * | dextop quit (*.net *.split) |
21:48:17 | * | dv^_^9 is now known as dv^_^ |
21:49:34 | * | vicecea quit (Remote host closed the connection) |
21:50:07 | * | vicecea joined #nim |
21:54:11 | FromDiscord | <amadan> In reply to @topmark "Hi, does anyone know": `cpDir` is the version that runs on nimscript (https://nim-lang.org/docs/nimscript.html#cpDir%2Cstring%2Cstring) |
21:54:15 | * | TakinOver quit (Ping timeout: 252 seconds) |
22:00:07 | FromDiscord | <topmark> @amadan Oh thank you! That works! Somehow I wandered off that nimscript page to the std/os doc page... |
22:02:55 | FromDiscord | <Prestige> Is there a way to clear a `set`? |
22:03:04 | qwr | reset |
22:03:20 | FromDiscord | <Prestige> ah, thank you |
22:47:46 | FromDiscord | <Require Support> `value out of range: -36 notin 0 .. 9223372036854775807` no idea what this error means.. im trying to pull everything from the string except the first 36 chars using `myvar[36 .. ^1]` |
22:48:10 | FromDiscord | <Require Support> (edit) "means.." => "means." |
22:49:04 | FromDiscord | <!Patitotective> how long is your string? |
22:49:54 | FromDiscord | <Require Support> pretty long... 🙂 |
22:50:16 | FromDiscord | <!Patitotective> whats its length? |
22:52:46 | FromDiscord | <Require Support> no idea, im getting it as a response from a server. it's nearly 512KB in bytes |
22:53:25 | FromDiscord | <!Patitotective> try to provide a reproducible snippet 🤷♂️ |
22:54:16 | FromDiscord | <Require Support> is there a certain limit to my string? or what are you suspecting the problem is |
22:54:34 | FromDiscord | <huantian> You probably don’t want to store that in a string, you might have better luck with a steam 😛 |
22:54:52 | FromDiscord | <!Patitotective> https://nim-lang.org/docs/streams.html |
22:55:19 | FromDiscord | <Require Support> thanks ill try it out |
23:03:01 | * | tk joined #nim |
23:12:07 | * | tk quit (Quit: Well, this is unexpected.) |
23:12:53 | * | tk joined #nim |
23:21:18 | FromDiscord | <#!/rip/luke> Can I run nimscript from the command line? |
23:21:26 | FromDiscord | <#!/rip/luke> Something like python -c |
23:24:57 | CyberTailor | nim --eval:'echo "Hello world!"' |
23:28:38 | FromDiscord | <#!/rip/luke> Oh |
23:40:42 | qwr | the startup overhead of nimscript is considerable - i wrote hello.nims and hello.pl for comparison, and on odroid-n2 those ran 0m0.425s for nimscript and 0m0.006s for perl (on faster system it might not matter) |
23:42:51 | qwr | tbh, i don't know _any_ language which is nice to use and has both fast startup and reasonably fast runtime without ahead-of-time compilation |
23:44:19 | FromDiscord | <#!/rip/luke> Made a command that runs Nim code https://media.discordapp.net/attachments/371759389889003532/1003810439374831697/IMG_1820.png |
23:48:18 | FromDiscord | <!Patitotective> what? |
23:48:33 | FromDiscord | <#!/rip/luke> Wdym what |
23:48:50 | FromDiscord | <!Patitotective> you made !eval? |
23:48:54 | FromDiscord | <#!/rip/luke> Yup |
23:49:19 | FromDiscord | <!Patitotective> !eval import os:for files in walkDir("."): echo files.path |
23:49:23 | NimBot | Compile failed: /usercode/in.nim(1, 10) Error: invalid indentation |
23:49:28 | FromDiscord | <!Patitotective> damn |
23:49:38 | FromDiscord | <!Patitotective> !eval import os;for files in walkDir("."): echo files.path |
23:49:44 | NimBot | Compile failed: ./nimble↵./nim |
23:49:54 | FromDiscord | <#!/rip/luke> The semicolon isn't valid nim |
23:50:04 | FromDiscord | <!Patitotective> it is |
23:50:09 | FromDiscord | <#!/rip/luke> In my code it's replaced with a newline char |
23:50:16 | FromDiscord | <#!/rip/luke> In reply to @Patitotective "it is": You sure? |
23:50:22 | FromDiscord | <!Patitotective> yes |
23:50:36 | FromDiscord | <#!/rip/luke> Oh well I replace it with a newline charecter |
23:50:41 | FromDiscord | <!Patitotective> thats better |
23:50:50 | FromDiscord | <huantian> What if you have a semicolon in a string tho |
23:50:54 | FromDiscord | <!Patitotective> because you can't do two inline blocks (?) |
23:50:58 | FromDiscord | <!Patitotective> In reply to @huantian "What if you have": die |
23:51:10 | FromDiscord | <#!/rip/luke> In reply to @huantian "What if you have": Itll get replaced XD |
23:51:25 | FromDiscord | <#!/rip/luke> But I mean I don't really use semicolons in strings |
23:51:35 | FromDiscord | <huantian> You should just have it accept code blocks |
23:51:36 | FromDiscord | <!Patitotective> In reply to @ripluke "Yup": but, not this server's eval, right |
23:51:54 | FromDiscord | <#!/rip/luke> What |
23:51:58 | FromDiscord | <#!/rip/luke> No |
23:52:09 | FromDiscord | <#!/rip/luke> I can send the code if u want lol |
23:52:24 | FromDiscord | <!Patitotective> so a discord bot? |
23:52:48 | FromDiscord | <#!/rip/luke> Yup |
23:53:00 | FromDiscord | <!Patitotective> nice |
23:53:20 | FromDiscord | <!Patitotective> you should just accept multiple lines instead of replacing ; with new lines lol |
23:54:06 | FromDiscord | <#!/rip/luke> In reply to @Patitotective "you should just accept": It can do that too |
23:54:18 | FromDiscord | <!Patitotective> then you shouldnt replace ; at all |
23:54:29 | FromDiscord | <#!/rip/luke> I prefer using semicolons tho |
23:54:51 | FromDiscord | <#!/rip/luke> sent a code paste, see https://play.nim-lang.org/#ix=46nN |
23:54:59 | FromDiscord | <!Patitotective> In reply to @ripluke "I prefer using semicolons": you can |
23:55:25 | FromDiscord | <!Patitotective> but dont replace the semicolons↵nim will parse the semicolons later |
23:55:26 | FromDiscord | <#!/rip/luke> (edit) "https://play.nim-lang.org/#ix=46nN" => "https://play.nim-lang.org/#ix=46nO" |
23:55:36 | FromDiscord | <#!/rip/luke> ohk |