00:49:45 | * | Jjp137_ quit (Ping timeout: 252 seconds) |
00:50:04 | * | Jjp137_ joined #nim |
01:50:45 | * | krux02 quit (Remote host closed the connection) |
01:51:42 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
02:02:15 | * | alexdaguy joined #nim |
02:15:25 | * | beholders_eye joined #nim |
02:21:03 | * | beholders_eye quit (Ping timeout: 276 seconds) |
02:43:54 | * | rockcavera quit (Remote host closed the connection) |
03:10:57 | * | pbsds3 quit (*.net *.split) |
03:10:57 | * | Artea quit (*.net *.split) |
03:10:57 | * | Lord_Nightmare quit (*.net *.split) |
03:10:59 | * | maytha8 quit (*.net *.split) |
03:13:06 | * | Lord_Nightmare joined #nim |
03:19:56 | * | maytham joined #nim |
03:20:12 | * | pbsds3 joined #nim |
03:25:54 | * | Artea joined #nim |
04:03:03 | * | SchweinDeBurg joined #nim |
04:07:43 | FromDiscord | <maxtachine> im really not sure what is this error https://media.discordapp.net/attachments/371759389889003532/1314443125590065235/image.png?ex=6753ca0e&is=6752788e&hm=5836c501e735f4544d902d2413139bbb8d425b649aa3be26b0ec90cab36e36b4& https://media.discordapp.net/attachments/371759389889003532/1314443126152106015/image.png?ex=6753ca0e&is=6752788e&hm=1bbc5849054b390966af42d447ff8a4df239f3bb5e34c044f15f3a195a25b33c& |
04:31:42 | * | alexdaguy quit (Quit: WeeChat 4.4.4) |
04:59:37 | FromDiscord | <thearthurm> How hard is it to write bindings for a c library? |
04:59:55 | FromDiscord | <Elegantbeef> It's not, especially if you use Futhark |
05:00:24 | FromDiscord | <thearthurm> W, thanks. I'm gonna write bindings for FLECS |
05:43:05 | * | kotrcka quit (Ping timeout: 252 seconds) |
05:56:20 | FromDiscord | <4zv4l> Hello, is there a similar feature of `python venv` for `nim` ?↵when it installed the dependency for a package I am writing, it installed it locally (home dir) instead of inside the project directory |
05:57:57 | FromDiscord | <k0ts> You want nimble to install dependencies inside the project directory? Use `-l` option |
06:02:32 | FromDiscord | <4zv4l> okay that easy xD, thanks ! |
06:42:30 | FromDiscord | <enthus1ast.> In reply to @pmunch "I need to check": The test portals of all browsers |
06:42:52 | FromDiscord | <angelsdust> Test portal? |
06:43:08 | FromDiscord | <enthus1ast.> Yes to check for captive portals |
06:43:26 | FromDiscord | <enthus1ast.> Every browser does it |
06:44:28 | FromDiscord | <angelsdust> I have never heard of this |
06:45:00 | FromDiscord | <enthus1ast.> Http://detectportal.firefox.de |
06:45:46 | FromDiscord | <enthus1ast.> They need to check if you can reach the Internet / if your DNS is highjacked |
06:45:57 | FromDiscord | <enthus1ast.> For hotels or trains etc |
06:47:01 | FromDiscord | <angelsdust> I wonder if this is country specific |
06:47:38 | FromDiscord | <enthus1ast.> Idk |
06:48:20 | FromDiscord | <enthus1ast.> Ever had this Firefox message "you need to sign in the network"?↵That's the implementation |
06:51:55 | FromDiscord | <pmunch> In reply to @enthus1ast. "The test portals of": Ooh, good idea! |
07:11:35 | * | ntat joined #nim |
08:04:23 | FromDiscord | <.tokyovigilante> @pmunch did you know your blog is down? |
08:05:59 | FromDiscord | <pmunch> Yes I know 😦 |
08:06:13 | FromDiscord | <pmunch> Temporary server outage, but I don't know when it'll be back |
08:06:17 | FromDiscord | <.tokyovigilante> Not like J Brown either sadly |
08:06:25 | FromDiscord | <pmunch> Huh? |
08:07:29 | FromDiscord | <.tokyovigilante> https://media.discordapp.net/attachments/371759389889003532/1314503464394559540/B1pppR4gVKL.png?ex=67540240&is=6752b0c0&hm=2504d720864be8b931b5c0cc86851921bb2e30f86892ea175bcf850a4ce1ab19& |
08:16:01 | * | ntat quit (Quit: Leaving) |
08:25:09 | * | alexdaguy joined #nim |
08:26:10 | * | coldfeet joined #nim |
09:06:01 | * | ntat joined #nim |
09:30:07 | FromDiscord | <Clonkk> What's the best way of transforming a NimNode into a sttic[string] ? |
09:30:31 | FromDiscord | <Clonkk> The goal is to transform a potentially camelCase identifier into a snake case identifier i na macros |
09:47:06 | FromDiscord | <Elegantbeef> `repr` though if it's an identifier you can just do `.strVal` or `$`↵(@Clonkk) |
09:47:39 | FromDiscord | <Clonkk> hmm the compiler complained about it being a string and not a static[string] I must have gotten it wrong |
09:47:47 | FromDiscord | <Clonkk> (that was my idea too) |
09:48:03 | FromDiscord | <Elegantbeef> You only need a `string` cause it's in a macro in the VM |
09:48:30 | FromDiscord | <Clonkk> Even for a macro that's used as a pragma with argument ? |
09:48:47 | FromDiscord | <Elegantbeef> Got an example of what you're doing? |
09:48:51 | FromDiscord | <Elegantbeef> My money is on `string` is fine |
09:49:13 | FromDiscord | <Clonkk> sent a code paste, see https://play.nim-lang.org/#pasty=bHgpeeOy |
09:49:54 | FromDiscord | <Elegantbeef> Right so `importMe(name: static string, def: untyped)` |
09:49:59 | FromDiscord | <Clonkk> sent a code paste, see https://play.nim-lang.org/#pasty=KZzDyvgQ |
09:50:06 | FromDiscord | <Clonkk> Yep |
09:50:59 | FromDiscord | <Elegantbeef> And you want to transform `$n[0]` to `label_modifiers`? |
09:51:53 | FromDiscord | <Clonkk> Exactly, I want to be able to do `importMe` in a proc (without argument) and then it converts the proc name to snake case and calls the one with argument |
09:52:00 | FromDiscord | <Clonkk> I could also copy / pste the macro and change one line but it's ugly |
09:53:27 | FromDiscord | <Clonkk> sent a code paste, see https://play.nim-lang.org/#pasty=AxldVnSA |
09:53:42 | FromDiscord | <Clonkk> Note that the macro itself works |
09:54:00 | FromDiscord | <Clonkk> So it's really about transforming `call[0]` into a static string |
09:54:54 | FromDiscord | <Elegantbeef> Well no |
09:55:09 | FromDiscord | <Elegantbeef> You can make a proc that does the internals of the macro |
09:55:12 | FromDiscord | <Elegantbeef> Or you can do some indirection magic |
09:57:30 | FromDiscord | <Elegantbeef> Though overloading macros with typed and untyped is never really great |
10:00:07 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=bWRpwqgr but this will do |
10:00:25 | FromDiscord | <Elegantbeef> Not ideal, but it does work |
10:00:50 | FromDiscord | <Clonkk> Ah using, template, smart |
10:01:00 | FromDiscord | <Elegantbeef> You can always put a `when name isnot static[string]: {.error: "Bleh wanted a name".}` |
10:02:11 | FromDiscord | <Elegantbeef> https://play.nim-lang.org/#pasty=NXBWRDPi works better than the alternative error (comment the error out to see) |
10:05:01 | FromDiscord | <Clonkk> Eh this is for showing off Nim in a company hackathon so code doesn't have to be error proofed |
10:05:12 | FromDiscord | <Clonkk> But that's a good idea, I'll keep it in mind, thanks ! |
10:08:10 | FromDiscord | <Elegantbeef> Showing off Nim and having to work around the typed vs. untyped oddities is fun |
10:09:05 | * | ntat quit (Quit: Leaving) |
10:10:04 | FromDiscord | <Clonkk> Yeah, the goal is to show just enough macros that it's useful to reduce boiler plate code but not enough that it scares people away |
10:12:11 | FromDiscord | <Elegantbeef> Reminds me of https://play.nim-lang.org/#pasty=OdQfFPUs though this sadly does not work in nested constructors so it's a useless invention |
10:12:57 | FromDiscord | <Clonkk> Was that for your constructor library ? |
10:13:06 | FromDiscord | <Elegantbeef> sent a code paste, see https://play.nim-lang.org/#pasty=lnKzKvdw |
10:13:11 | FromDiscord | <Elegantbeef> Nah this was for my GUI stuff |
10:13:17 | FromDiscord | <Elegantbeef> I wanted to make anonymous procedures nicer |
10:13:32 | FromDiscord | <Elegantbeef> But sadly you can only do a single statement inside this |
10:13:52 | FromDiscord | <Clonkk> Ah yeah makes sense. I never really had a need for anonymous procedure besides the `+.` and `->` macros |
10:14:03 | FromDiscord | <Clonkk> (edit) "`+.`" => "`=>`" |
10:14:07 | FromDiscord | <Elegantbeef> Yea but `=>` and `->` are ass |
10:14:22 | FromDiscord | <Clonkk> When you do simple stuff it works |
10:14:25 | FromDiscord | <Elegantbeef> I want to define a typedef then instantiate off of it `=>` does not resolve that |
10:14:26 | FromDiscord | <nnsee> no, `))` and `((` are ass |
10:14:50 | FromDiscord | <Elegantbeef> `=>` also lets people rename the parameters which encourages bad names 😛 |
11:25:11 | * | coldfeet quit (Ping timeout: 265 seconds) |
12:11:11 | * | alexdaguy quit (Quit: w) |
12:30:04 | * | SchweinDeBurg quit (Quit: WeeChat 4.5.0-dev) |
12:36:35 | * | capocasa joined #nim |
12:39:03 | capocasa | Check this out |
12:39:04 | capocasa | # a.nim |
12:39:04 | capocasa | import b |
12:39:05 | capocasa | # b.nim |
12:39:05 | capocasa | echo "foo" |
12:39:06 | capocasa | $ nim r a |
12:39:06 | capocasa | # nothing happens |
12:39:07 | capocasa | Why doesn't the static block get executed when b is imported during compile? Can I even run a block of static code when a module is compiled? |
12:40:29 | Amun-Ra | works for me |
12:40:34 | capocasa | Correction: The above behaves as expected, the program prints foo. But this has no output: |
12:40:51 | capocasa | # b.nim |
12:40:52 | capocasa | static: |
12:40:52 | capocasa | echo "foo" |
12:41:16 | Amun-Ra | works for me, too |
12:41:23 | Amun-Ra | but… it echoes during compilation |
12:41:27 | Amun-Ra | as requested |
12:41:36 | capocasa | hm, no echo during compilation for me... |
12:41:57 | capocasa | Works now. Weird. |
12:42:12 | Amun-Ra | static https://dpaste.com/3EYAY2Q2J |
12:42:13 | capocasa | Well- thanks for magically looking over my shoulder. |
12:42:19 | Amun-Ra | no worries :) |
12:44:32 | capocasa | Ah, I see- I was walking an empty directory in a loop, so that's why my program didn't work, and then I just fumbled compiling my minimal example right. |
12:59:05 | * | beholders_eye joined #nim |
13:07:29 | * | beholders_eye quit (Ping timeout: 248 seconds) |
13:27:23 | capocasa | Is there a way to append to a file using NimScript? |
14:26:14 | * | capocasa quit (Quit: Client closed) |
14:46:50 | * | ntat joined #nim |
14:50:30 | FromDiscord | <4zv4l> is there a way to get tagged union in Nim ? (with the union pragma?) |
14:51:25 | FromDiscord | <4zv4l> other than making a variant with a `kind` field with the right enum (if possible) |
14:57:11 | FromDiscord | <bostonboston> The union pragma does effectively make tagged unions from what I understand |
15:00:46 | FromDiscord | <4zv4l> sent a code paste, see https://play.nim-lang.org/#pasty=QnXOJNIp |
15:01:28 | * | SchweinDeBurg joined #nim |
15:12:32 | * | beholders_eye joined #nim |
15:15:23 | Amun-Ra | union pragma is for C interop |
15:16:15 | Amun-Ra | https://nim-lang.org/docs/tut2.html#object-oriented-programming-object-variants |
15:16:19 | Amun-Ra | that's the proper way |
15:16:43 | Amun-Ra | using ref types with union pragma is a recipe for disaster |
15:17:14 | Amun-Ra | yes, segfault bc of that string |
15:18:49 | Amun-Ra | https://play.nim-lang.org/#pasty=zHjzZcPD |
15:18:53 | Amun-Ra | there's no other way |
15:19:04 | * | coldfeet joined #nim |
15:19:47 | Amun-Ra | but… object variant does not work like union, you can't access other fields |
15:21:10 | Amun-Ra | you may still use {.union.} with ordinal types (except prolly an enum), unless you want to target JS |
15:21:27 | FromDiscord | <nervecenter> In reply to @4zv4l "is there a way": Yeah object variants exist, and currently the core team has been debating how to actually implement variant syntax for a while |
15:21:37 | FromDiscord | <nervecenter> https://github.com/nim-lang/RFCs/issues/548 |
15:22:06 | FromDiscord | <nervecenter> https://forum.nim-lang.org/t/10836 |
15:26:32 | FromDiscord | <John> sent a long message, see https://pasty.ee/WzTSvfux |
15:40:52 | * | modev joined #nim |
16:11:24 | * | modev quit (Quit: WeeChat 4.4.2) |
16:48:32 | * | coldfeet quit (Ping timeout: 265 seconds) |
16:50:04 | * | coldfeet joined #nim |
16:51:31 | * | coldfeet quit (Client Quit) |
17:53:05 | * | GnuYawk quit (Quit: The Lounge - https://thelounge.chat) |
17:53:25 | * | GnuYawk6 joined #nim |
17:58:06 | Amun-Ra | these bots lately… |
19:29:58 | * | ntat quit (Ping timeout: 265 seconds) |
19:31:54 | * | ntat joined #nim |
19:46:49 | FromDiscord | <.bobbbob> why does nim have subrange types but not refinement types? |
19:54:04 | FromDiscord | <bostonboston> Ranges are a low bar, refinement types seem like a lot of work for not a lot of gain in the majority of cases |
19:56:36 | FromDiscord | <.bobbbob> well the subrange is a run time check, so wouldnt it just be give the type definition a predicate check and check it at run time? |
19:58:36 | FromDiscord | <.bobbbob> and then subrange would just be a refinement type |
20:08:07 | Amun-Ra | "just" |
20:15:49 | FromDiscord | <bostonboston> Real |
20:41:23 | FromDiscord | <pmunch> AoC day 6! https://twitch.tv/pmunche and https://www.youtube.com/watch?v=1_pvl-9H3C8 |
20:41:54 | FromDiscord | <.throwstar> Is there a pragma or something I can use to make a proc appear in the compiled code even when its not used? |
20:43:11 | FromDiscord | <pmunch> `{.used.}` |
20:44:22 | FromDiscord | <pmunch> I think that should work at least |
20:45:38 | * | ehmry quit (Quit: https://quassel-irc.org - Chat comfortably. Anywhere.) |
20:46:10 | FromDiscord | <solitudesf> In reply to @.throwstar "Is there a pragma": exportc |
20:46:41 | FromDiscord | <.throwstar> In reply to @pmunch "I think that should": Makes the hints go away but I dont see it in the output |
20:46:49 | FromDiscord | <.throwstar> In reply to @solitudesf "exportc": Im compiling to js |
20:47:19 | FromDiscord | <.throwstar> Oh that still works |
20:47:21 | FromDiscord | <.throwstar> Thanks |
20:48:40 | * | ntat quit (Quit: Leaving) |
20:49:05 | Amun-Ra | yes, it's exportc |
21:25:19 | * | tokyovigilante quit (Remote host closed the connection) |
21:31:31 | * | tokyovigilante joined #nim |
21:31:39 | * | tokyovigilante quit (Remote host closed the connection) |
21:44:26 | * | tokyovigilante joined #nim |
21:48:13 | * | tokyovigilante quit (Remote host closed the connection) |
21:49:58 | * | tokyovigilante joined #nim |
21:51:35 | * | beholders_eye quit (Ping timeout: 265 seconds) |
22:11:14 | * | beholders_eye joined #nim |
22:23:48 | FromDiscord | <pmunch> Oh right |
22:25:35 | FromDiscord | <leopotam> but `exportc` doesnt help with emscripten, its remove unused code that marked with `exportc` and `used` pragmas |
22:26:45 | * | beholders_eye quit (Ping timeout: 260 seconds) |
22:27:19 | FromDiscord | <leopotam> sent a code paste, see https://play.nim-lang.org/#pasty=BERutsRv |
22:27:51 | FromDiscord | <leopotam> `EMSCRIPTEN_KEEPALIVE` is define for `attribute((used))` |
22:28:46 | FromDiscord | <leopotam> if `emit` section will be removed from code - exported method will not be exported to js |
22:31:35 | * | modev joined #nim |
22:39:59 | * | modev quit (Quit: WeeChat 4.4.2) |
22:48:39 | FromDiscord | <bostonboston> You can use CodegenDecl to add attributes to your procs without emit |
22:57:27 | * | ehmry joined #nim |
23:03:27 | Amun-Ra | emscripten requires passing comma separated list of functions to export passed in via -s EXPORTED_FUNCTIONS=… |
23:04:03 | FromDiscord | <leopotam> In reply to @Amun-Ra "emscripten requires passing comma": yes, but its not very useful when you have more than 10-20 of them |
23:04:17 | FromDiscord | <.throwstar> In reply to @leopotam "i found only one": I believe elegant beef made a macro to do this somewhere |
23:04:39 | FromDiscord | <Elegantbeef> I did but it's not needed anymore |
23:04:45 | FromDiscord | <leopotam> just mark all of them as exported with EMSCRIPTEN_KEEPALIVE attribute and all of them will be exported without compiler arguments tweaks |
23:04:50 | FromDiscord | <Elegantbeef> `{.exportc, dynlib.}` should do everything fine |
23:05:05 | FromDiscord | <.throwstar> Oh neat |
23:05:55 | Amun-Ra | I gotta test that |
23:06:21 | FromDiscord | <leopotam> In reply to @Elegantbeef "`{.exportc, dynlib.}` should do": it works, thanks! |
23:06:58 | * | capocasa joined #nim |
23:07:35 | * | capocasa quit (Client Quit) |
23:26:14 | * | rockcavera joined #nim |
23:55:54 | * | tiorock joined #nim |
23:55:54 | * | rockcavera is now known as Guest610 |
23:55:54 | * | tiorock is now known as rockcavera |
23:57:58 | * | tiorock joined #nim |
23:57:58 | * | tiorock quit (Changing host) |
23:57:58 | * | tiorock joined #nim |
23:57:58 | * | rockcavera quit (Killed (molybdenum.libera.chat (Nickname regained by services))) |
23:57:58 | * | tiorock is now known as rockcavera |
23:59:48 | * | Guest610 quit (Ping timeout: 252 seconds) |