01:05:04 | * | vicfred quit (Quit: Leaving) |
01:09:26 | * | vicfred joined #nim |
01:14:27 | * | noeontheend quit (Ping timeout: 240 seconds) |
01:24:09 | FromDiscord | <!Patitotective> what do you guys think about a _development dependencies_ for a nimble package? to specify dependencies that might be useful for dev but actually not needed in the _release_ package |
01:24:31 | FromDiscord | <!Patitotective> (edit) removed "a" | "dev" => "development" |
01:28:14 | * | resumin quit (Ping timeout: 252 seconds) |
01:29:29 | * | noeontheend joined #nim |
01:36:26 | * | rockcavera joined #nim |
01:36:26 | * | rockcavera quit (Changing host) |
01:36:26 | * | rockcavera joined #nim |
02:44:23 | FromDiscord | <Prestige> I believe it's been brought up many times, but is not supported |
02:44:56 | * | vicecea quit (Remote host closed the connection) |
02:45:20 | FromDiscord | <!Patitotective> In reply to @Avahe "I believe it's been": i mean, a feature to add |
02:45:38 | FromDiscord | <Prestige> Yeah it's been requested, I'd appreciate the feature |
02:45:54 | * | vicecea joined #nim |
02:47:29 | FromDiscord | <!Patitotective> In reply to @Avahe "Yeah it's been requested,": do you have the issue or PR where it has been requested? đ |
02:57:13 | * | arkurious quit (Quit: Leaving) |
03:00:43 | FromDiscord | <Prestige> Can't find it atm |
03:02:23 | FromDiscord | <!Patitotective> as a workaround i could create a nimble task to do that |
03:04:10 | FromDiscord | <Prestige> https://github.com/nim-lang/nimble/issues/506 |
03:53:27 | FromDiscord | <proton> Anyone knows this issue: Nim\lib\pure\httpclient.nim(335, 12) Error: cannot evaluate at compile time: defaultSslContext |
03:53:50 | FromDiscord | <Elegantbeef> You're attempting to use something at compile time that cannot be due to C interop |
04:10:43 | * | rockcavera quit (Remote host closed the connection) |
04:19:58 | * | pch joined #nim |
04:21:17 | * | pch_ quit (Ping timeout: 244 seconds) |
05:51:50 | * | noeontheend quit (Ping timeout: 246 seconds) |
05:52:01 | FromDiscord | <Bung> sent a code paste, see https://play.nim-lang.org/#ix=3YW4 |
05:52:27 | FromDiscord | <Bung> wached: TableRef[string, WatchCallback] |
05:53:04 | FromDiscord | <Elegantbeef> You're calling it with the wrong call |
05:53:21 | FromDiscord | <Elegantbeef> `<tuple[action: WatchEventKind]>` `WatchEvent` |
05:54:17 | * | noeontheend joined #nim |
05:54:37 | FromDiscord | <Bung> oh ,it complain about argument |
05:56:50 | FromDiscord | <,.,.,.,.,.> hey |
05:56:58 | FromDiscord | <huantian> hey |
05:57:08 | FromDiscord | <,.,.,.,.,.> is it possible to write web interfaces in nim using wasm? |
05:57:44 | FromDiscord | <Elegantbeef> It supports emscripten and nlvm exists so yes |
05:57:47 | FromDiscord | <huantian> Iâd think so yeah |
05:57:57 | FromDiscord | <Elegantbeef> If you can do it with C you can do it with Nim |
05:58:10 | FromDiscord | <,.,.,.,.,.> i'll find something to make frontends with it |
06:00:41 | FromDiscord | <Elegantbeef> What do you mean make frontends with it? |
06:04:18 | FromDiscord | <,.,.,.,.,.> In reply to @Elegantbeef "What do you mean": because i'm too stupid to use karax i'm trying for alternatives |
06:05:02 | FromDiscord | <Elegantbeef> Why do you think you're too stupid to use karax |
06:05:06 | FromDiscord | <Elegantbeef> Perhaps you just need to leanr more |
06:05:13 | FromDiscord | <,.,.,.,.,.> i've been trying for like 4 months |
06:05:26 | FromDiscord | <Elegantbeef> Have you asked in here? |
06:06:15 | FromDiscord | <,.,.,.,.,.> i asked in the telegram group |
06:06:45 | FromDiscord | <Elegantbeef> That doesnt have me! đ |
06:06:52 | FromDiscord | <huantian> They have stickers tho!!! |
06:06:55 | FromDiscord | <Elegantbeef> I kid, but no clue how active it is |
06:07:01 | * | PMunch joined #nim |
06:13:53 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/980715652778180688/unknown.png |
06:14:14 | FromDiscord | <Elegantbeef> Why are you threading downloads |
06:14:24 | FromDiscord | <Elegantbeef> Nim has async... |
06:14:24 | FromDiscord | <retkid> I always do this |
06:14:24 | FromDiscord | <Phil> Out of curiosity, are docker containers actually used for anything other containers of servers? |
06:14:26 | FromDiscord | <retkid> because |
06:14:34 | FromDiscord | <retkid> i know threading and dont know much asnyc |
06:14:36 | FromDiscord | <retkid> (edit) "asnyc" => "async" |
06:14:41 | FromDiscord | <retkid> this was faster for a simple thing |
06:14:42 | FromDiscord | <Elegantbeef> Well time to learn |
06:14:56 | FromDiscord | <Elegantbeef> Docker is useful for repeatable protable builds |
06:15:15 | FromDiscord | <retkid> also is the ref threads a good way of instantiating an empty thread? |
06:15:16 | FromDiscord | <Elegantbeef> Not that i've used it for such |
06:16:11 | FromDiscord | <Elegantbeef> What? |
06:16:12 | FromDiscord | <Elegantbeef> Also there is `joinThreads` |
06:16:34 | FromDiscord | <Phil> In reply to @Elegantbeef "Docker is useful for": I have no idea on the performance overhead it adds but I sort of just assume that where people want performance they wouldn't use it |
06:16:56 | PMunch | Performance will be pretty good |
06:17:04 | FromDiscord | <Rika> In reply to @Isofruit "I have no idea": Performance is not impacted bad |
06:17:09 | FromDiscord | <Rika> Storage is though đ |
06:19:19 | FromDiscord | <Phil> In reply to @Rika "Storage is though đ": People use electron apps, i have given up on believing that matters when your app size is measured in megabytes |
06:19:56 | FromDiscord | <retkid> In reply to @Elegantbeef "Also there is `joinThreads`": Wonât worry on an array of references |
06:20:05 | FromDiscord | <Phil> But either way good to know that there are non webdev usecases! Thanks everyone! |
06:20:10 | FromDiscord | <retkid> (edit) "worry" => "work" |
06:54:40 | * | noeontheend quit (Ping timeout: 258 seconds) |
07:00:10 | * | ltriant quit (Ping timeout: 240 seconds) |
07:01:18 | * | noeontheend joined #nim |
07:13:09 | * | gsalazar joined #nim |
07:31:22 | FromDiscord | <vegai> Docker's performance hit on Linux is \~1% though |
07:37:43 | FromDiscord | <Rika> ? Yes we said it isnât a big impact |
07:40:38 | FromDiscord | <Turgut> sent a long message, see https://paste.rs/cs5 |
07:41:12 | FromDiscord | <Turgut> @Rika You helped me out yesterday, so maybe you know a little something about the above đ Thanks if so |
07:41:39 | FromDiscord | <Rika> Types do not exist on runtime |
07:41:57 | FromDiscord | <Elegantbeef> Macros provide you with more than enough flexibility to not need runtime reflection |
07:42:04 | FromDiscord | <Rika> Runtime type information is only made for OOP objects |
07:42:11 | FromDiscord | <Elegantbeef> Since you care about runtime reflection are you from C# by any chance? |
07:42:25 | FromDiscord | <Turgut> No, I'm from languages like Pharo and Lisp |
07:42:35 | FromDiscord | <Turgut> Scala too |
07:42:51 | FromDiscord | <Rika> Why come here from Lisp lmao |
07:42:57 | FromDiscord | <Elegantbeef> There isnt much need for runtime reflection when you can introspect your code statically |
07:43:09 | FromDiscord | <Elegantbeef> Like what have you used runtime reflection for before? |
07:43:23 | FromDiscord | <Turgut> For example, I might want to access the runtime stack of Nim |
07:43:32 | FromDiscord | <Rika> ? |
07:43:46 | FromDiscord | <Turgut> I might want to redefine a function at run-time |
07:43:56 | FromDiscord | <Rika> You cannot? |
07:44:02 | FromDiscord | <Rika> I mean, you canât from what I know |
07:44:26 | FromDiscord | <Rika> Unless you explicitly use functions as values and put them in a variable |
07:45:14 | FromDiscord | <Turgut> Does Nim have anything comperable to a metaclass? |
07:45:46 | FromDiscord | <Rika> We donât know what that is, mind describing |
07:46:01 | FromDiscord | <Turgut> Sure |
07:46:23 | FromDiscord | <Rika> Or link a description whichever is easier |
07:46:29 | FromDiscord | <Turgut> Okay đ |
07:47:49 | FromDiscord | <huantian> You can probably do the same stuff as metaclasses with macros as type pragmas, if you mean like the python definition of metaclass |
07:48:12 | FromDiscord | <Turgut> In short, its a reification of language internals that base level programmers do not care about. It allows one to look at, and modify, methods that you usually do not need. An example could be the method `new` or `didNotUnderstand` in OO languages, that are accessible through metaclasses |
07:48:55 | FromDiscord | <Turgut> In reply to @huantian "You can probably do": I explored macros, but I'm not sure what type pragmas are |
07:49:04 | FromDiscord | <Rika> Theyâre just macros applied to a type |
07:49:26 | FromDiscord | <Rika> Macros can be applied two ways, by normal calls or by pragma |
07:50:46 | FromDiscord | <Rika> Iâm still not very sure what a meta type does exactly. It allows you to modify constructors and other stuff? |
07:51:12 | FromDiscord | <huantian> How Iâve understood metaclasses is they allow you to define how classes are made |
07:51:24 | FromDiscord | <Turgut> In reply to @huantian "How Iâve understood metaclasses": this is closer to it I would say |
07:51:33 | FromDiscord | <huantian> In the same way that a class defines how an object is made |
07:51:40 | FromDiscord | <Turgut> yes |
07:51:44 | FromDiscord | <Turgut> so for example you might defined |
07:51:54 | FromDiscord | <Turgut> `class Banana â” def m() = ...` |
07:52:01 | FromDiscord | <huantian> (edit) "In the same way that a class defines how an object is ... madeand" added "madeâ”So if itâs both" | "madeâ”So if itâs bothmade ... " added "and how it works" |
07:52:03 | FromDiscord | <Turgut> now you invoke m on a Banana |
07:52:12 | FromDiscord | <huantian> (edit) "In the same way that a class defines how an object is madeâ”So if itâs both ... made" added "how itâs" |
07:52:12 | FromDiscord | <Turgut> however, where is new Banana implemented? |
07:52:30 | FromDiscord | <Turgut> thats probably in the metaclass of Banana |
07:52:56 | FromDiscord | <Turgut> assuming that such a metaclass is provided to us, through a reification |
07:53:07 | FromDiscord | <Rika> Nim doesnât have strong OOP so itâs hard to translate the idea |
07:53:33 | FromDiscord | <Rika> You canât override the âdefaultâ procedure (the procedure that provides the default value of all types) |
07:53:34 | FromDiscord | <Turgut> Where is function application defined? Can I instrument it? |
07:53:55 | FromDiscord | <Turgut> Can I access the compiler as a first-class value? |
07:54:11 | FromDiscord | <Rika> No I donât think so? |
07:54:25 | FromDiscord | <Turgut> From my look at the documentation, I don't think so either |
07:54:40 | FromDiscord | <Turgut> It seems metaprogramming & reflection, especially reflection, is not very present in Nim |
07:54:41 | FromDiscord | <Elegantbeef> No the compiler cannot be accessed as an object, you can use macros as a high level compiler API |
07:54:49 | FromDiscord | <Turgut> In reply to @Elegantbeef "No the compiler cannot": thanks! |
07:54:54 | FromDiscord | <Elegantbeef> You cant really reflect a natively compiled program that easily |
07:55:26 | FromDiscord | <Elegantbeef> Nor do i think it's overly beneficial but i'm biased |
07:55:29 | FromDiscord | <Turgut> In Scheme or Racket, I can redefined function application, as it is simply a macro |
07:55:50 | FromDiscord | <Turgut> so the default `(function arg1 arg2 ...)` can be overwritten |
07:55:59 | FromDiscord | <Elegantbeef> Are they natively compiled statically typed languages? |
07:56:10 | FromDiscord | <huantian> In reply to @Turgut "It seems metaprogramming &": Metaprogramming is a program that writes or modifies program language. Which is exactly what macros are in Nim |
07:56:10 | FromDiscord | <Turgut> no, they are dynamically typed languages |
07:56:19 | FromDiscord | <Elegantbeef> Yea there's the difference |
07:57:07 | FromDiscord | <Elegantbeef> Nim is much more like C/C++/Rust than racket/scheme |
07:57:18 | FromDiscord | <Turgut> I think this is great stuff for my essay. Thanks very much. |
07:57:20 | FromDiscord | <Turgut> I'll get back to work đ |
07:57:35 | FromDiscord | <Elegantbeef> You can of course do a lot of magic with macros |
07:57:44 | FromDiscord | <Elegantbeef> But it's reasoned statically |
07:58:04 | FromDiscord | <Elegantbeef> The Nim way of changing how a procedure works would be to take a procedure as an argument |
07:58:26 | FromDiscord | <Elegantbeef> This way you can provide a procedure which can be a closure and invoke it where it needs to be |
07:58:35 | FromDiscord | <Turgut> Yes, higher-order programming |
07:58:46 | FromDiscord | <Elegantbeef> I dont use big words so sure |
07:58:58 | FromDiscord | <Turgut> what you are describing is called higher-order programming |
07:59:04 | FromDiscord | <Turgut> it follows from the fact that closures are first-class values |
07:59:04 | FromDiscord | <Elegantbeef> Ok sure |
07:59:32 | FromDiscord | <Elegantbeef> I'll skip the proper name, if i wanted to know it i'd have attended a CS class đ |
07:59:42 | FromDiscord | <Turgut> haha đ sure |
08:00:53 | FromDiscord | <Elias> How can I read the windows Path variable in Nim? Is it just a environment var or a registry thing? (come from linux) |
08:01:16 | FromDiscord | <Rika> Environment variable |
08:01:26 | FromDiscord | <Rika> I donât know how those are read though |
08:01:38 | FromDiscord | <Elegantbeef> `std/os` `getEnv` and `putEnv` |
08:01:50 | FromDiscord | <Elias> Nice, thanks |
08:02:17 | FromDiscord | <Elegantbeef> Think it might be `Path` |
08:02:19 | FromDiscord | <Rika> Iâve seen a distinction between system and user env vars in windows though |
08:02:32 | FromDiscord | <Rika> Not sure how that is handled |
08:04:10 | FromDiscord | <huantian> In reply to @Elegantbeef "But it's reasoned statically": Honestly this is the main thing, instead of overriding a method that the lang uses internally, you rewrite the code that the programmer writes directly |
08:06:14 | FromDiscord | <Elias> In reply to @Rika "Not sure how that": Ill experiment a bit and see how it works. I am trying to automatically retreive a path to the clang dynamic library (wherever it is installed on windows) and think the only robust way on windows is to require clang to be added to path and then misuse the path variable to find the lib folder. |
08:16:30 | FromDiscord | <Elegantbeef> Yea i've never personally went "Shucks i dont have runtime reflection" |
08:16:32 | FromDiscord | <Elegantbeef> I used it a bit in C# and it's fucking god awful and full of hacks ime |
08:18:48 | FromDiscord | <Rika> Prolly a very different story in Pharo |
08:32:25 | * | PMunch quit (Quit: leaving) |
08:32:34 | FromDiscord | <exelotl> In reply to @Elegantbeef "Yea i've never personally": personally I've had the opposite lol - "goddamnit why is this RTTI being generated, every time I introduce a new subclass it eats up more of my 32KiB of RAM" |
08:40:34 | NimEventer | New thread by Dxb: Are user defined pragmas permitted in a let section with Nim 1.6?, see https://forum.nim-lang.org/t/9185 |
09:04:01 | * | ltriant joined #nim |
09:17:27 | * | dtomato quit (Ping timeout: 260 seconds) |
09:41:33 | * | jjido joined #nim |
10:03:47 | FromDiscord | <luteva> is there a "minimal runtime" for executing nimscripts? Or do i have to install "the whole stuff"? |
10:04:22 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
10:04:53 | FromDiscord | <luteva> so, what is needed to execute nimscripts? i mean the debugger etc. (coming with the default installation) shouldn't be needed, right? |
10:05:34 | FromDiscord | <luteva> or do i just have to have the nim excutable? |
10:42:53 | FromDiscord | <Yepoleb> I'm trying to install nimlsp and i have nim installed through the package manager, so i need to specify `-d:explicitSourcePath=PATH`. I can get the package to build using `nimble build -d:explicitSourcePath=~/.local/lib/nim-1.6.6 --path:~/.local/lib/nim-1.6.6` but those parameters do not get passed correctly when using the install or run command, the paths are undefined again. How do i fix that? |
10:55:00 | NimEventer | New thread by Arnetheduck: Nim-snappy, faster and simpler, see https://forum.nim-lang.org/t/9186 |
10:55:03 | * | PMunch joined #nim |
10:55:36 | * | noeontheend quit (Ping timeout: 276 seconds) |
11:09:27 | FromDiscord | <untoreh> sent a code paste, see https://paste.rs/JMp |
11:11:03 | PMunch | @untoreh, maybe try with Futhark instead? |
11:35:00 | FromDiscord | <Turgut> what is the difference between templates and macros in Nim? |
11:36:02 | PMunch | @Turgut, templates are simple AST-replacement things. Macros are complex AST modifiers |
11:43:42 | * | jmdaemon quit (Ping timeout: 276 seconds) |
11:51:38 | FromDiscord | <planetis> in macros you work with AST you traverse the input tree and generate a new one. |
11:55:30 | FromDiscord | <Turgut> And does Nim have splicing in its macros? |
12:01:09 | FromDiscord | <Rika> technically? you can get the implementation of a procedure and modify the insides, but you cannot set it back into the proc you took it from |
12:01:18 | FromDiscord | <Rika> not that i know |
12:02:01 | FromDiscord | <Rika> there are also term rewriting macros which can, but theyre not well tested and you'll still have the issue of choosing an appropriate term to "hook" into that would only catch the specific proc you want |
12:02:48 | FromDiscord | <Rika> im assuming splicing is similar to what aspect-based programming uses |
12:28:33 | FromDiscord | <ynfle> In reply to @Rika "*technically?* you can get": You can have a macro as a pragma on the proc definition and can modify it contents and output a different proc body definition for the same signature |
12:30:30 | FromDiscord | <ynfle> In reply to @Turgut "what you are describing": No, that's different. Macros don't work off of closures, closures are at runtime. Macros can take a function definition and modify actual code (well not really modify) |
12:31:46 | * | jjido joined #nim |
12:33:21 | FromDiscord | <rishav> If I want to use orc, do I need to make any changes in my code or will just any nim cod work with the command line switch? The blog post on orc doesnt says |
12:35:58 | * | rockcavera joined #nim |
12:35:58 | * | rockcavera quit (Changing host) |
12:35:58 | * | rockcavera joined #nim |
12:36:16 | FromDiscord | <ynfle> Should just work |
12:36:38 | FromDiscord | <Rika> In reply to @ynfle "You can have a": Yes, but I assume splicing means you donât have access to that |
12:37:11 | FromDiscord | <Rika> In reply to @rishav "If I want to": There may be a case where it doesnât work but for 99% of the cases it should just work no code change |
12:38:54 | * | om3ga quit (Ping timeout: 258 seconds) |
12:39:20 | * | ltriant quit (Ping timeout: 255 seconds) |
13:10:24 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
13:14:44 | * | arkurious joined #nim |
13:25:44 | FromDiscord | <Gennadiy> sent a long message, see https://paste.rs/Mkv |
13:26:17 | FromDiscord | <Gennadiy> (edit) "http://ix.io/3YWV" => "http://ix.io/3YWW" |
13:35:07 | FromDiscord | <Turgut> Are macros hygenic in Nim? If so, where is the documentation that points this out? I cannot seem to find it :/ |
13:35:42 | PMunch | @Turgut, yes |
13:36:12 | PMunch | Well, templates are hygienic, macros can do pretty much what they want |
13:36:58 | PMunch | But if you use `quote` and/or `genSym` it's hygienic |
13:37:48 | FromDiscord | <Turgut> could you give an example of a macro not being hygenic by default? |
13:38:36 | PMunch | Well you're able to bind to existing identifiers and such mith macros |
13:41:37 | * | om3ga joined #nim |
13:42:43 | FromDiscord | <Turgut> Does the dirty pragma also work for macros? or just for templates? |
13:44:49 | PMunch | Just for templates |
13:45:02 | PMunch | Here is a macro which isn't hygienic: https://play.nim-lang.org/#ix=3YX3 |
13:45:06 | * | ltriant joined #nim |
13:45:46 | PMunch | Note that if you hadn't created that specific identifier first and just put `hello = "world"` in the quote block it wouldn't have worked, because that would've created a new symbol |
13:49:52 | FromDiscord | <Gennadiy> I do not mean to hijack this discussion but could you guys please help me have a look at my problem above. Thanks. |
13:50:11 | * | ltriant quit (Ping timeout: 258 seconds) |
13:50:36 | PMunch | @Gennadiy, my advice would be to use Futhark |
13:52:54 | FromDiscord | <Gennadiy> Yes, I really like Futhark (and please keep up the excellent work!) and that was going to be my next port of call. â”I am just frustrated with the problem above and wanted to understand why it was failing doing it this way. |
13:55:29 | PMunch | Because you're creating a different type from what it expects |
13:55:54 | PMunch | I believe you could add an `{.importc.}` pragma to your object definition and it would work |
13:55:57 | PMunch | Not 100% sure though |
13:59:54 | FromDiscord | <Gennadiy> Yay, it works. Thanks @PMunch â”I will try to create a Nim-native interface with Futhark. |
14:02:59 | FromDiscord | <Turgut> sent a code paste, see https://play.nim-lang.org/#ix=3YX9 |
14:03:05 | FromDiscord | <Turgut> This still is not hygenic. So, macros are not hygenic in Nim? |
14:04:07 | FromDiscord | <Generic> it depends |
14:04:39 | PMunch | Huh, I was sure that would fail. Did `quote` change recently? |
14:04:42 | FromDiscord | <Generic> if you create a new symbol in a macro it won't leak out |
14:05:14 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=3YXa |
14:05:32 | FromDiscord | <Generic> newVariable will be gensymed and not accessible from the outside |
14:06:05 | FromDiscord | <Turgut> alright great |
14:06:20 | FromDiscord | <Turgut> And how could you create an unhygenic macro in Nim, @Generic ? |
14:07:11 | FromDiscord | <Generic> sent a code paste, see https://play.nim-lang.org/#ix=3YXd |
14:07:19 | FromDiscord | <Generic> this is what I've been doing, idk maybe there's a better way |
14:08:04 | FromDiscord | <Generic> (edit) "https://play.nim-lang.org/#ix=3YXd" => "https://play.nim-lang.org/#ix=3YXe" |
14:09:19 | FromDiscord | <Generic> if you want to be hygenic and share symbols between two quote do, use genSym(https://nim-lang.org/docs/macros.html#genSym%2CNimSymKind%2Cstring) |
14:09:30 | * | PMunch quit (Quit: Leaving) |
14:15:52 | FromDiscord | <Andreas> sent a code paste, see https://play.nim-lang.org/#ix=3YXi |
14:16:11 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3YXi" => "https://play.nim-lang.org/#ix=3YXk" |
14:16:53 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3YXk" => "https://play.nim-lang.org/#ix=3IV8" |
14:17:24 | FromDiscord | <Andreas> (edit) "https://play.nim-lang.org/#ix=3YXm" => "https://play.nim-lang.org/#ix=3YXl" |
15:05:23 | FromDiscord | <!Patitotective> @PMunchï»ż i'm trying to wrap the nuklear glfw opengl3 demo using this code https://github.com/Patitotective/niklearâ”but https://media.discordapp.net/attachments/371759389889003532/980849409959022592/error.txt |
15:36:22 | FromDiscord | <planetis> in macros you usually do genSym("temp", ntVar) to create new symbols |
15:36:33 | FromDiscord | <planetis> (edit) "ntVar)" => "kind)" |
15:39:07 | FromDiscord | <planetis> except quote do, there is getAst(mytemplate()) and newTree |
15:47:46 | * | ltriant joined #nim |
15:52:28 | * | ltriant quit (Ping timeout: 258 seconds) |
15:53:43 | * | xet7 quit (Remote host closed the connection) |
16:06:56 | FromDiscord | <jmgomez> hey guys, Is there any built in method that allows you to traverse the AST recursively? |
16:13:39 | FromDiscord | <gibson> @jmgomez I've seen folks use both a while loop or traditional recursive function call to do that. |
16:15:38 | FromDiscord | <jmgomez> I was asking because it's such a common pattern that I supposed there must be something built in. Closest thing is @PMunch's macro utils I think |
16:16:42 | FromDiscord | <gibson> Oh you mean pattern matching with recursion. Yep, probably those macros are the way to go for now. |
16:19:57 | FromDiscord | <gibson> How can we make procs like `joinPath` obey the host OS? `hostOS` is incorrect, because it is being set by `--os:xxx` and I'm cross compiling from linux to windows. All I have to go on is `when defined(mingw)` and I want `joinPath` to behave NOT like it's on windows, but it's using backslashes everywhere and breaking the dependencies that rely on compile-time path generation. |
16:20:51 | FromDiscord | <gibson> I tried `{.push windows: off.}` but this is wrong/does not work. |
16:21:16 | FromDiscord | <gibson> (edit) "wrong/does not work." => "a compiler error." |
16:28:34 | FromDiscord | <gibson> Seems like `joinPath` and friends should include a check for `defined(mingw)` . But I suspect I'm just going about this incorrectly. |
16:35:17 | FromDiscord | <Yepoleb> In reply to @gibson "How can we make": do you want to use posix separators in the build script and windows separators in the compiled files? |
16:37:54 | FromDiscord | <gibson> @Yepoleb Unfortunately no, some of my dependencies (zstd) use joinPath when incorporating the right c files for the libs they wrap. So at compile time they use `joinPath` and get the wrong path. The only define I have is `-d:mingw` but that is enough to make a difference I guess. |
16:38:13 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
16:40:15 | * | Lord_Nightmare joined #nim |
16:40:51 | FromDiscord | <Yepoleb> that's a shitty situation đ |
16:41:37 | FromDiscord | <Yepoleb> there is no way for the compiler to detect when to use which version |
16:43:07 | FromDiscord | <gibson> I think the fix is to upstream patches for doing the right thing. |
16:43:20 | FromDiscord | <gibson> to the dependencies |
16:43:28 | FromDiscord | <Yepoleb> something like PureWindowsPath from python would be needed |
16:43:41 | * | xet7 joined #nim |
16:44:13 | FromDiscord | <Yepoleb> and code for handling the specifics |
16:44:22 | FromDiscord | <Yepoleb> (edit) "and code for handling the specifics ... " added "in each module" |
16:45:19 | FromDiscord | <Gennadiy> @PMunch :Re: Futhark - Because the header file(s) is imported directly, vscode has problems with syntax highlighting and it puts squiggles on everything. Is there a workaround for this? |
16:46:10 | FromDiscord | <gibson> but couldn't the compiler detect `defined(mingw) and nimvm` and do the right thing? Say, a rewrite of `joinPath` for example. |
16:47:44 | FromDiscord | <Yepoleb> you could still be generating target os paths at compile time |
16:52:24 | FromDiscord | <gibson> @Yepoleb true, we're missing a specific proc as you said. An overload of these that takes a specific DirSep would be nice. |
16:54:02 | FromDiscord | <Yepoleb> you can probably work around it for now by patching dependencies to use / and string concatenation |
16:54:50 | FromDiscord | <gibson> đ that's what I'm doing |
16:57:00 | * | gsalazar quit (Ping timeout: 276 seconds) |
17:06:38 | FromDiscord | <br4n_d0n> Without using something like homebrew or compiling from source, is there a way to get Nim on macOS? |
17:08:36 | FromDiscord | <willyboar> choosenim |
17:09:02 | FromDiscord | <willyboar> https://github.com/dom96/choosenim#choosenim |
17:16:30 | * | om3ga quit (Quit: Bye) |
17:19:09 | FromDiscord | <br4n_d0n> Hmm, seems like it will most likely build from source anyways, unless I missed something when skimming the source |
17:19:24 | FromDiscord | <br4n_d0n> (edit) "source" => "files" |
17:21:58 | * | xet7 quit (Remote host closed the connection) |
17:32:04 | FromDiscord | <dom96> it should download nightlies |
17:39:19 | FromDiscord | <br4n_d0n> Thanks |
17:39:33 | FromDiscord | <br4n_d0n> I just downloaded the nightly directly then |
17:43:17 | FromDiscord | <br4n_d0n> BTW, does the Nim compiler store any files locally like something similar to Zig ~/.cache? |
17:44:50 | FromDiscord | <Yardanico> ~/.cache/nim on Linux (not sure about macOS) |
17:45:16 | FromDiscord | <Yardanico> you can override it with `--nimcache` for your project or globally (if you put it in the nim config or your main config) |
17:45:31 | FromDiscord | <br4n_d0n> Thanks |
17:58:48 | * | jjido joined #nim |
18:12:34 | * | gsalazar joined #nim |
18:15:00 | FromDiscord | <PMunch> In reply to @Gennadiy "<@392962235737047041> :Re: Futhark -": Sure, don't use VSCode đ |
18:15:21 | FromDiscord | <Yardanico> In reply to @Gennadiy "<@392962235737047041> :Re: Futhark -": can you show the behaviour? |
18:15:24 | FromDiscord | <Yardanico> vscode works for me with futhark |
18:16:59 | * | gsalazar quit (Ping timeout: 258 seconds) |
18:17:42 | FromDiscord | <PMunch> On a more serious note, Nim tooling isn't perfect an Futhark certainly strains that tooling. I don't really have a workaround for this ATM |
18:23:39 | * | wallabra quit (Ping timeout: 246 seconds) |
18:24:18 | * | wallabra joined #nim |
18:35:30 | * | vicfred quit (Quit: Leaving) |
18:45:12 | FromDiscord | <gibson> Just curious if @dom96 or anyone else knows why the nim domain does not host prebuilt binaries for osx? I always found it to have this air of exclusivity that osx isn't invited to the party. Choosenim is great, and that's what I tell folks to use, but I always wonder why... |
18:51:44 | * | adium quit (Quit: Stable ZNC by #bnc4you) |
18:52:15 | FromDiscord | <br4n_d0n> In reply to @gibson "Just curious if <@132595483838251008>": Good question; even if all it states is to use a nightly build would help and avoid my earlier questions |
19:01:42 | FromDiscord | <gibson> Another tough question: for a nimble package definition what do we do about package conflicts? For instance, I have `requires https://...#fix-awaiting-merge` for the time being. But the user might already have that package's previous stable release installed. Nimble happily installs both. Now I have no idea which one gets loaded for the user when my code does an import. |
19:01:58 | FromDiscord | <Yardanico> nimble handles all that |
19:02:07 | FromDiscord | <Yardanico> if they compile with nimble, nimble will use the correct version of the package |
19:02:21 | FromDiscord | <gibson> oh wow, fantastic. |
19:02:26 | FromDiscord | <Yardanico> since nimble only adds those packages to the import path that are explicitly listed in requires |
19:02:40 | FromDiscord | <gibson> Well, color me impressed. |
19:04:43 | * | adium joined #nim |
19:40:20 | * | jmdaemon joined #nim |
19:49:01 | * | ltriant joined #nim |
19:53:57 | * | ltriant quit (Ping timeout: 246 seconds) |
20:02:32 | * | arkanoid quit (Ping timeout: 248 seconds) |
20:09:19 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
20:25:40 | * | jjido joined #nim |
20:56:04 | * | jmdaemon quit (Ping timeout: 258 seconds) |
21:27:33 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=3YYP |
21:28:33 | FromDiscord | <gibson> (edit) "https://play.nim-lang.org/#ix=3YYP" => "https://play.nim-lang.org/#ix=3YYQ" |
21:40:13 | FromDiscord | <gibson> `selfExec... quit(0)` fixes the issue |
21:42:29 | FromDiscord | <br4n_d0n> Anyone use https://github.com/zah/nim.vim and if so, how do you get ``in`` used with for loops to properly highlight? |
21:43:18 | FromDiscord | <gibson> @br4n_d0n what highlighting are you expecting? |
21:43:20 | FromDiscord | <br4n_d0n> If there is a better vim syntax file for nim please share |
21:43:38 | FromDiscord | <br4n_d0n> The same as if like it's defined in the vim file |
21:43:46 | FromDiscord | <br4n_d0n> It's not highlighted at all |
21:44:06 | FromDiscord | <gibson> I just installed that and it highlights `for` and `in` keywords. |
21:44:24 | FromDiscord | <br4n_d0n> Give me a second, I'll show you how it comes up for me |
21:46:25 | FromDiscord | <br4n_d0n> https://media.discordapp.net/attachments/371759389889003532/980950334534987797/Screen_Shot_2022-05-30_at_17.45.29.png |
21:48:07 | FromDiscord | <gibson> @br4n_d0n type vim command `:set ft=nim` see if that changes anything |
21:48:49 | FromDiscord | <br4n_d0n> nope |
21:49:23 | FromDiscord | <gibson> And it highlights errors for you? |
21:51:02 | FromDiscord | <br4n_d0n> I only grabbed this file and didn't want the other junk... maybe it's needed, but seems strangeâ”https://github.com/zah/nim.vim/blob/master/syntax/nim.vim |
21:52:57 | FromDiscord | <br4n_d0n> I mean, if you look at line 43 of that file ``in`` is listed as a keyword for highlighting |
21:55:49 | FromDiscord | <gibson> sent a code paste, see https://play.nim-lang.org/#ix=3YYW |
22:08:07 | FromDiscord | <br4n_d0n> sent a code paste, see https://play.nim-lang.org/#ix=3YYZ |
22:14:57 | FromDiscord | <Zectbumo> I was compiling nim from scratch and it looks like it does 3 iterations recompiling itself before it becomes stable. is this a constant or can it vary system to system? |
22:15:49 | FromDiscord | <Elegantbeef> Bootstrap -\> Compile -\> Valdiation |
22:16:43 | FromDiscord | <Zectbumo> I'm not sure, but it looked like Bootstrap -> Compile -> validate -> compile -> validate -> Compile -> validate -> success |
22:17:16 | FromDiscord | <Zectbumo> and it showed a counter, something like : iterations: 3 |
22:17:44 | FromDiscord | <Elegantbeef> Yea like i said it compiles with boot strap it then compiles the compiler then compiles the compiler with that compiler to validate |
22:18:03 | FromDiscord | <Zectbumo> I see, that's the validation step |
22:30:53 | FromDiscord | <gibson> @br4n_d0n I'd say try installing the whole nim.vim repo, then pair back once it's working. You can always delete files. |
22:31:21 | FromDiscord | <gibson> Worst case scenario is you have configs fighting each other and have to resolve that. |
22:36:14 | FromDiscord | <br4n_d0n> I think I'll look into making a custom one as I don't like how this syntax is having the same highlight for numbers etc. |
22:36:35 | FromDiscord | <br4n_d0n> It's like I get 3 colors max |
22:38:00 | * | jjido quit (Quit: My MacBook Air has gone to sleep. ZZZzzzâŠ) |
22:40:57 | FromDiscord | <luteva> Hi! Until now i saw the type for object, ref object, enum and even distinct types.â”But now i saw a type MyType = proc(....) : ...â”what is this?? Never seen it before! what is a "type x = proc" used for? any documentation for that? |
22:41:06 | FromDiscord | <Elegantbeef> It's an alias |
22:41:20 | FromDiscord | <Elegantbeef> Nim's type system allows aliasing which just allows you to give less redundant names |
22:41:41 | FromDiscord | <Elegantbeef> For instance you also can do `type MyInventory = array[20, Item]` |
22:45:16 | * | ltriant joined #nim |
22:45:53 | FromDiscord | <luteva> but array is not a proc, right? it is "allocating memory", right?â”how can i use the proc alias then? any example? |
22:46:04 | FromDiscord | <Elegantbeef> It's just a type |
22:46:44 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=3YZ3 |
22:58:16 | FromDiscord | <luteva> sent a long message, see http://ix.io/3YZ8 |
22:58:39 | FromDiscord | <Elegantbeef> Correct `proc(): int` is just a type |
22:59:00 | FromDiscord | <Elegantbeef> `proc: int = 100` is a anonymous procedure |
22:59:26 | FromDiscord | <luteva> ok! that's it! i got it!â”thx! |
22:59:55 | FromDiscord | <br4n_d0n> How is Elegantbeef a bot? |
23:04:01 | FromDiscord | <Elegantbeef> My mother and my father raised a smart cookie |
23:04:02 | FromDiscord | <Elegantbeef> Alternatively i'm on matrix and using a bridge to talk to you lowly peasants |
23:04:02 | FromDiscord | <huantian> no way beef is a bot and a cookie |
23:04:02 | FromDiscord | <Elegantbeef> Thats racist, dont expect any less from a yank though |
23:04:12 | FromDiscord | <huantian> also seems like bridge is dead again |
23:04:13 | FromDiscord | <Elegantbeef> Comtrya! |
23:04:24 | FromDiscord | <Elegantbeef> Seems we're back in business |
23:07:14 | FromDiscord | <demotomohiro> In reply to @br4n_d0n "How is Elegantbeef a": https://internet-of-tomohiro.netlify.app/nim/faq.en.html#community-are-bots-in-nim-discord-channel-aiqmark |
23:14:04 | FromDiscord | <!Patitotective> In reply to @br4n_d0n "How is Elegantbeef a": because đ€â€ïž đ€ âĄïž đ€ |
23:14:32 | FromDiscord | <br4n_d0n> đ€ |
23:30:49 | * | noeontheend joined #nim |
23:33:56 | * | vicfred joined #nim |
23:51:29 | FromDiscord | <Yepoleb> I am confused about how to use a shared heap memory model. the documentation for the threads module repeatedly mentions deep copies and or refs being forbidden. but the memory management page lists orc as supporting a shared heap. how are we supposed to make use of that? |
23:51:39 | FromDiscord | <Yepoleb> (edit) removed "or" |
23:52:13 | FromDiscord | <Elegantbeef> If you're using orc/arc any heap allocations can be accessed from the other threads safely with locking |
23:53:27 | FromDiscord | <Yepoleb> can i also pass references directly to threads? or do i need to use some ugly hacks |
23:55:43 | FromDiscord | <Yepoleb> like creating a pointer to an object containing a ref which i then copy from the thread |
23:59:08 | FromDiscord | <Elegantbeef> sent a code paste, see https://paste.rs/Jr3 |