00:03:48 | FromDiscord | <retkid> not nemo |
00:04:00 | FromDiscord | <retkid> nano |
00:04:02 | FromDiscord | <retkid> my brain went ded |
00:04:31 | FromDiscord | <ElegantBeef> Well it's more like vim than nano, but yea |
00:04:57 | FromDiscord | <retkid> its vim but emacs |
00:05:15 | FromDiscord | <retkid> In reply to @ElegantBeef "Advertising Nim programs in": gotta keep it in the family |
00:05:49 | FromDiscord | <retkid> Advertising Nim written programs in a Nim discord to Nim programmers |
00:05:51 | FromDiscord | <retkid> #not-a-cult |
00:06:30 | FromDiscord | <ElegantBeef> Hey we dont have a rewrite it in Nim initiative so clearly arent culty |
00:07:32 | Prestige | We could start one |
00:07:54 | * | Prestige rewrites coreutils in Nim |
00:08:11 | FromDiscord | <retkid> rewrite python |
00:08:12 | FromDiscord | <retkid> in nim |
00:08:41 | FromDiscord | <ElegantBeef> So instead of cpython it'd be nimpython |
00:09:12 | FromDiscord | <retkid> better threading and garbage collecting! |
00:09:46 | Prestige | why not just use nim at that point |
00:09:59 | FromDiscord | <ElegantBeef> Cause you want python for pythony things like making me cry |
00:10:53 | FromDiscord | <retkid> why does python make you sad |
00:11:40 | FromDiscord | <ElegantBeef> Cause it's got the language design of a person that likes to test a circuit by licking an outlet |
00:11:57 | FromDiscord | <ElegantBeef> "Yea jim it's still on, my tongue is frying!" |
00:12:36 | Prestige | hahaha |
00:13:30 | FromDiscord | <retkid> lemme find some disgusting python i wrote yesterday |
00:13:39 | FromDiscord | <retkid> i didn't comment any my code because i was kinda in the zone |
00:13:42 | FromDiscord | <retkid> and reallly regret it |
00:14:15 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/834582837150875658/unknown.png |
00:14:16 | FromDiscord | <ElegantBeef> it also relies a lot on programmer contracts like dont touch `_name` and `name` |
00:14:42 | FromDiscord | <retkid> i had to convert it back to a list because dicts aren't ordered.... |
00:14:46 | FromDiscord | <retkid> for really no reason |
00:14:58 | FromDiscord | <ElegantBeef> Now rewrite it in Nim |
00:15:12 | FromDiscord | <retkid> its already been written |
00:15:21 | FromDiscord | <retkid> i wish i went back and wrote some stuff in nim |
00:15:29 | FromDiscord | <retkid> but im not rewriting a lot of this lol |
00:15:44 | FromDiscord | <retkid> though i might rewrite my write functions in nim |
00:16:03 | FromDiscord | <retkid> https://media.discordapp.net/attachments/371759389889003532/834583287582294056/unknown.png |
00:16:10 | FromDiscord | <retkid> i need to replace os.system(0 with pathlib |
00:16:13 | FromDiscord | <retkid> (edit) "pathlib" => "pathlib, ignore that" |
00:16:20 | FromDiscord | <retkid> (edit) "os.system(0" => "os.system()" |
00:16:29 | FromDiscord | <ElegantBeef> I mean i'm ignoring most of it |
00:16:36 | FromDiscord | <retkid> its disgusting |
00:16:42 | FromDiscord | <retkid> and i hope its better in nim |
00:17:17 | FromDiscord | <ElegantBeef> It can be if you believe in yourself |
00:18:05 | FromDiscord | <retkid> but i dont :( |
00:18:13 | FromDiscord | <ElegantBeef> Not with that attitude |
00:18:31 | FromDiscord | <zetashift> In reply to @uuuu "Is <@!77574388035100672> here? I": sup |
00:19:40 | FromDiscord | <retkid> @ElegantBeef do you know how to turn on syntax highlighting in moe |
00:19:52 | FromDiscord | <ElegantBeef> Should be on by default if the language is supported |
00:20:00 | FromDiscord | <retkid> using it on python and nope |
00:20:13 | FromDiscord | <ElegantBeef> Should be `:syntaxhighlighting on` |
00:41:44 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
00:42:02 | * | njoseph joined #nim |
00:53:00 | * | thomasross joined #nim |
01:11:18 | * | Tanger joined #nim |
02:05:33 | * | krux02 quit (Remote host closed the connection) |
02:09:05 | FromDiscord | <exelotl> is this normal? https://play.nim-lang.org/#ix=2WV1 |
02:12:02 | FromDiscord | <ElegantBeef> Seems it only invokes destructors for if any field is assigned https://play.nim-lang.org/#ix=2WV3 |
02:12:24 | FromDiscord | <ElegantBeef> Odd, but might make sense to someone |
02:18:17 | FromDiscord | <exelotl> it also invokes it if you do `a = Foo()` |
02:29:21 | FromDiscord | <exelotl> man I've really been missing a trick with this move semantics stuff :P |
02:33:03 | FromDiscord | <demotomohiro> Maybe, `b` is assumed to be not initialized and compiler think it does not need to be destoried? |
02:34:31 | FromDiscord | <demotomohiro> Or b is not modified and doesn't need to be destroyed. |
02:35:19 | FromDiscord | <exelotl> yeah, makes sense I guess |
02:44:53 | FromGitter | <gogolxdong> How is weave going? https://github.com/mratsim/weave |
02:47:52 | * | thomasross quit (Ping timeout: 240 seconds) |
03:27:07 | * | tefter_ joined #nim |
03:29:06 | * | tefter quit (Ping timeout: 245 seconds) |
03:35:11 | * | tefter joined #nim |
03:35:16 | * | tefter_ quit (Ping timeout: 252 seconds) |
03:59:50 | * | spiderstew joined #nim |
04:00:46 | * | spiderstew_ quit (Ping timeout: 245 seconds) |
04:45:11 | * | rockcavera quit (Ping timeout: 240 seconds) |
05:26:10 | * | narimiran joined #nim |
05:44:43 | * | tefter_ joined #nim |
05:45:28 | * | tefter quit (Ping timeout: 252 seconds) |
06:21:16 | * | filcuc_ joined #nim |
06:31:26 | * | tefter_ is now known as tefter |
06:33:42 | * | ecs quit (Remote host closed the connection) |
06:42:06 | ForumUpdaterBot | New question by Alex Craft: How to make pragma to work like a standalone macro?, see https://stackoverflow.com/questions/67208008/how-to-make-pragma-to-work-like-a-standalone-macro |
06:50:29 | * | Vladar joined #nim |
06:52:11 | FromDiscord | <lantos> toolchains/nim-1.4.4/lib/pure/unittest.nim(654, 43) Error: type mismatch: got <int literal(5), int literal(5)>↵👀 |
06:59:46 | * | PMunch joined #nim |
07:02:46 | ForumUpdaterBot | New thread by Araq: On term rewriting macros, see https://forum.nim-lang.org/t/7837 |
07:23:54 | FromDiscord | <no name fits> How do I go through an array by pointer? Something like: https://play.nim-lang.org/#ix=2WW3 |
07:27:40 | FromDiscord | <ElegantBeef> @no name fits https://play.nim-lang.org/#ix=2WW4 should work for you |
07:28:03 | FromDiscord | <no name fits> Thanks |
07:39:10 | FromDiscord | <Ricky Spanish> whats the use-case? im kind of curious to know the benefits of doing it that way |
07:41:16 | FromDiscord | <ElegantBeef> There really isnt much of a usecase since it makes more sense to use a proc that takes the array, we'll just hope they're working on their own collection type and wanted to learn for that |
07:42:13 | FromDiscord | <Ricky Spanish> ah, i assumed it was for wrapping a raw array or something from c since still learning nim so seemed unusual to use a c like way to iterate an array |
07:42:22 | FromDiscord | <no name fits> Oh I was just looking for different ways to iterate collections |
07:43:18 | FromDiscord | <no name fits> When I figure out how to do performance testing reliably I wanted to set up some different test cases |
07:43:42 | FromDiscord | <ElegantBeef> I'm scared what you're testing |
07:44:02 | FromDiscord | <ElegantBeef> Nims iterators are templates so they're 0 cost |
07:44:02 | FromDiscord | <Ricky Spanish> ahaha, regardless if you do it tag me please im curious |
07:44:13 | FromDiscord | <no name fits> I'm just drawing a hex grid currently so nothing fancy |
07:45:24 | FromDiscord | <no name fits> I'm most likely just going to use a seq doe |
07:45:25 | FromDiscord | <no name fits> so |
07:46:09 | FromDiscord | <ElegantBeef> I'm slightly scared your alternative iteration methods |
07:47:32 | FromDiscord | <Rika> Do whatever in the name of performance? |
07:51:25 | FromDiscord | <sealmove> hi folks! |
07:51:37 | FromDiscord | <sealmove> noob question but how to make a 2d array? |
07:51:42 | FromDiscord | <sealmove> (not seq) |
07:51:50 | FromDiscord | <ElegantBeef> `array[w h, T]` |
07:52:00 | FromDiscord | <no name fits> I was more just curious if there actually was a difference 😛 |
07:52:10 | FromDiscord | <ElegantBeef> There isn it's just a indexing difference |
07:52:14 | * | vicfred quit (Quit: Leaving) |
07:52:15 | FromDiscord | <no name fits> yeah |
07:52:18 | FromDiscord | <ElegantBeef> I can write a small example |
07:52:41 | FromDiscord | <no name fits> I'm just weird and like to test it for myself |
07:52:42 | FromDiscord | <sealmove> In reply to @ElegantBeef "`array[w * h, T]`": no thanks, I'll use seqs then :P |
07:55:45 | FromDiscord | <haxscramper> you can also use `array[w, array[h, T]]` |
07:56:04 | FromDiscord | <sealmove> In reply to @haxscramper "you can also use": oh that's what I want |
07:56:29 | FromDiscord | <sealmove> right, my brain stuck and I couldn't figure out the syntax lol |
07:56:58 | FromDiscord | <Rika> And in this case there is no down side over the w h one |
07:57:08 | FromDiscord | <ElegantBeef> Cmon this is wonderful! https://play.nim-lang.org/#ix=2WW7 |
07:57:35 | FromDiscord | <sealmove> true, it's nice |
07:58:25 | FromDiscord | <sealmove> I am trying to reconstruct 2d image from dissected data channel of an 128x64 oled :D |
08:00:55 | FromDiscord | <no name fits> why is it there's no collisions even though multiplication is commutative? |
08:01:32 | * | liblq-devel joined #nim |
08:01:33 | FromDiscord | <ElegantBeef> What do you mean? |
08:01:42 | FromDiscord | <no name fits> 2 1 = 1 2 |
08:02:00 | FromDiscord | <ElegantBeef> w |
08:02:09 | FromDiscord | <Rika> In reply to @no name fits "why is it there's": What do you mean |
08:02:20 | FromDiscord | <ElegantBeef> Assume they mean with the array indexing |
08:02:27 | FromDiscord | <no name fits> Isn't it a flat array? Am I missing something? |
08:02:40 | FromDiscord | <ElegantBeef> 2 5 + 0 = 10 |
08:02:48 | FromDiscord | <ElegantBeef> You cannot get 10 with any other combination |
08:03:37 | FromDiscord | <no name fits> oooooh |
08:03:42 | FromDiscord | <ElegantBeef> in a 5x5 array 0-4 are the first 5 elements and 5 is the 6th |
08:03:48 | FromDiscord | <no name fits> That took me longer to get than I'd like |
08:04:19 | FromDiscord | <no name fits> I'm not very smart |
08:04:25 | FromDiscord | <ElegantBeef> i know it took me a while to solve it myself forever ago |
08:04:36 | FromDiscord | <ElegantBeef> I refused to use any documentation to figure out the 3D mapping for a 1D array |
08:05:10 | FromDiscord | <ElegantBeef> and now it makes a ton of sense and is simple expressed as "For each dimension you first calculate the area of a slice of a lower dimension" |
08:05:55 | FromDiscord | <ElegantBeef> So in a 2D array you calculate the area of a single dimension which is just either the width or height depending on your array layout |
08:06:23 | FromDiscord | <ElegantBeef> in 3D you use width and height, the very odd thing is the last dimension actually isnt a concern for indexing |
08:07:08 | FromDiscord | <sealmove> guys do you think a monochrome 128x64 oled will be use 1-bit per pixel? |
08:07:21 | FromDiscord | <ElegantBeef> I'd hope so |
08:07:33 | FromDiscord | <ElegantBeef> Might even do less |
08:07:34 | FromDiscord | <sealmove> ok, I'll make this assumption |
08:07:54 | FromDiscord | <ElegantBeef> could do the more efficient "how many of this state" |
08:08:21 | FromDiscord | <ElegantBeef> Though that's only more efficient if there is a lot of contiguous blocks |
08:09:29 | FromDiscord | <ElegantBeef> first bit being "this state" remaining being "how many" |
08:09:29 | FromDiscord | <no name fits> Also last time I asked, the answer were a little all over the place, but what do I do for automated performance testing in Nim? |
08:10:17 | FromDiscord | <ElegantBeef> As i dont know what that really classifies as, i say use benchy 😄 |
08:10:31 | FromDiscord | <ElegantBeef> I'm a terrible developer |
08:11:07 | FromDiscord | <haxscramper> Benchy is good & simple to use, so I would also recommend it |
08:11:26 | FromDiscord | <ElegantBeef> Hey you only agreed with 1 of my sentences! |
08:12:04 | FromDiscord | <haxscramper> Give me a break, I can only process that much text at one time |
08:12:09 | FromDiscord | <ElegantBeef> lol |
08:12:10 | FromDiscord | <no name fits> this one? https://github.com/treeform/benchy |
08:12:13 | FromDiscord | <haxscramper> yes |
08:12:15 | FromDiscord | <ElegantBeef> Yes |
08:12:17 | FromDiscord | <no name fits> tyty |
08:13:33 | FromDiscord | <no name fits> does it give me a warning if I forget to run in something not debug? |
08:13:43 | FromDiscord | <no name fits> because I know I'll forget that |
08:14:10 | FromDiscord | <ElegantBeef> Just make a nimble task |
08:14:18 | FromDiscord | <no name fits> oh yeah that's thing |
08:14:23 | FromDiscord | <no name fits> (edit) "" => "a" |
08:14:48 | FromDiscord | <no name fits> you guys are really helpful btw |
08:17:32 | FromDiscord | <ElegantBeef> Dont say that it'll go right to my head and no one wants that |
08:19:55 | FromDiscord | <Nisha's alt> How would i use this C++ library in Nim? https://github.com/adepierre/Botcraft |
08:19:56 | FromDiscord | <Nisha's alt> :p |
08:20:05 | FromDiscord | <ElegantBeef> By wrapping it |
08:20:42 | FromDiscord | <ElegantBeef> Go to https://github.com/adepierre/Botcraft/blob/master/Examples/0_HelloWorld/src/main.cpp and replicate it in Nim, wrapping all the types you need |
08:21:19 | FromDiscord | <Nisha's alt> Ah okay! |
08:21:55 | FromDiscord | <ElegantBeef> Atleast that's what i've done for the Rpi Pico, remade the examples and wrote bindings for the code as i needed it so it could be idiomatic |
08:35:19 | * | krux02 joined #nim |
08:40:10 | * | jess joined #nim |
08:48:47 | FromDiscord | <Rika> In reply to @รєคɭ๓๏שє "guys do you think": Refer to the data sheet |
08:48:52 | FromDiscord | <Rika> It will be mentioned there |
08:54:47 | FromDiscord | <sealmove> why doesn't `\b` work? stdout.write "\b".repeat((h+1)w) |
08:54:53 | FromDiscord | <sealmove> (edit) removed " stdout.write "\b".repeat((h+1)w)" |
08:55:06 | FromDiscord | <sealmove> (edit) "why doesn't `\b` work? ... " added "https://play.nim-lang.org/#ix=2WWm" |
08:55:37 | FromDiscord | <ElegantBeef> It's an escaped character |
08:55:45 | FromDiscord | <ElegantBeef> !eval echo echo r"a\bb" |
08:55:46 | NimBot | Compile failed: /usercode/in.nim(1, 6) Error: type mismatch: got <void> |
08:55:47 | FromDiscord | <ElegantBeef> Shit |
08:55:50 | FromDiscord | <ElegantBeef> !eval echo r"a\bb" |
08:55:51 | NimBot | a\bb |
08:56:13 | FromDiscord | <sealmove> it is supposed to print `b`, but it prints `ab`, ignoring `\b` |
08:57:13 | FromDiscord | <haxscramper> terminal has to have support for this control code |
08:57:59 | FromDiscord | <haxscramper> I doubt playground implements a full ANSI terminal specification. Most likely it only supports color codes |
08:58:23 | FromDiscord | <sealmove> then my konsole doesn't either? |
08:58:54 | FromDiscord | <sealmove> i doupt it |
08:58:54 | FromDiscord | <haxscramper> `kitty` works as expected https://media.discordapp.net/attachments/371759389889003532/834714869965389825/unknown.png |
08:59:05 | FromDiscord | <sealmove> (edit) "doupt" => "doupb" |
09:00:05 | * | watzon quit (Quit: Idle for 30+ days) |
09:00:29 | FromDiscord | <sealmove> Ok thanks. Konsole not supporting this is so surprising |
09:05:08 | FromDiscord | <sealmove> ohhh |
09:05:28 | FromDiscord | <sealmove> it just doesn't delete new lines |
09:05:55 | FromDiscord | <sealmove> is it possible to go back lines? |
09:06:50 | * | liblq-devel quit (Quit: WeeChat 3.1) |
09:10:39 | FromDiscord | <sealmove> ok apparently the opposite of `\n` is `\e[F` |
09:30:54 | FromDiscord | <sealmove> ok, I need the simplest library to write an image, even bitmap, since printing to terminal doesn't do the trick |
09:32:12 | * | wasted_youth2 quit (Quit: Leaving) |
09:41:23 | ForumUpdaterBot | New thread by Drkameleon: Capturing external variables in closure, see https://forum.nim-lang.org/t/7838 |
09:41:24 | * | m4r35n357 quit (Quit: Ex-Chat) |
09:42:05 | * | mwbrown quit (Ping timeout: 246 seconds) |
09:44:10 | * | mwbrown joined #nim |
09:46:28 | * | tefter_ joined #nim |
09:48:10 | * | tefter quit (Ping timeout: 252 seconds) |
09:50:21 | * | tefter_ is now known as tefter |
10:18:04 | * | wasted_youth2 joined #nim |
10:34:55 | * | NimBot joined #nim |
11:04:41 | * | Gustavo6046 quit (Ping timeout: 240 seconds) |
12:05:07 | PMunch | Hmm, is there a way to get the position of an item in an ordered set |
12:06:42 | * | Vladar quit (Remote host closed the connection) |
12:10:43 | FromDiscord | <uuuu> @zetashift Sorry for the late reply. What did you mean by "bleeding edge" in your nim tetris game repo? How is it bleeding edge when the stable releases of godot and nim are being used? |
12:21:54 | FromDiscord | <zetashift> In reply to @uuuu "<@!77574388035100672> Sorry for the": because it uses ARC/ORC and gdnim itself isn't stable |
12:22:47 | FromDiscord | <uuuu> When will gdnim be stable? |
12:23:34 | FromDiscord | <zetashift> If you set the `build.ini` to not use ARC/ORC or other experimental features you can just have godot-nim functionality |
12:23:42 | FromDiscord | <zetashift> and thus have it act "stable" |
12:24:06 | * | sagax quit (Ping timeout: 245 seconds) |
12:24:56 | * | d10n-work quit (Ping timeout: 245 seconds) |
12:27:45 | * | d10n-work joined #nim |
12:30:05 | * | Vladar joined #nim |
12:30:29 | FromDiscord | <zetashift> fwiw I had 0 problems with it until now @uuuu |
12:34:21 | * | wasted_youth2 quit (Read error: Connection reset by peer) |
12:35:19 | FromDiscord | <exelotl> If you have a custom container with a delete operation, do you have to call `=destroy` manually on the item to be deleted? |
12:35:46 | * | wasted_youth2 joined #nim |
12:35:46 | * | wasted_youth2 quit (Remote host closed the connection) |
12:36:17 | * | wasted_youth2 joined #nim |
12:37:23 | * | letto_ joined #nim |
12:37:51 | * | letto quit (Ping timeout: 245 seconds) |
12:42:34 | * | rockcavera joined #nim |
12:47:26 | * | wasted_youth2 quit (Ping timeout: 245 seconds) |
12:48:15 | * | wasted_youth2 joined #nim |
12:54:16 | FromDiscord | <clyybber> In reply to @exelotl "is this normal? https://play.nim-lang.org/#ix=2WV1": It's because of cursorInference; if you turn that off via --cursorInference:off then you get both destroy calls |
12:54:35 | * | NimBot joined #nim |
12:54:55 | FromDiscord | <clyybber> In reply to @exelotl "If you have a": Yeah; depends on what your container builds though; if it builds on a seq for example; seq's already do that |
12:55:02 | FromDiscord | <clyybber> (edit) "seq's" => "seqs" |
13:01:23 | * | natrys joined #nim |
13:04:06 | * | wasted_youth2 quit (*.net *.split) |
13:04:07 | * | jess quit (*.net *.split) |
13:04:09 | * | ckafi[m] quit (*.net *.split) |
13:04:11 | * | crem quit (*.net *.split) |
13:05:33 | * | wasted_youth2 joined #nim |
13:05:33 | * | jess joined #nim |
13:05:33 | * | ckafi[m] joined #nim |
13:05:33 | * | crem joined #nim |
13:07:01 | * | wasted_youth2 quit (Ping timeout: 245 seconds) |
13:07:38 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
13:11:08 | * | johnnynitwits joined #nim |
13:12:47 | FromDiscord | <exelotl> ah cool, thanks :) |
13:14:51 | * | jess quit (Quit: Reconnecting) |
13:15:19 | * | jess joined #nim |
13:17:40 | * | filcuc_ quit (Quit: KVIrc 5.0.0 Aria http://www.kvirc.net/) |
13:20:28 | * | Gustavo6046 joined #nim |
13:21:34 | FromDiscord | <pietroppeter> In reply to @PMunch "Hmm, is there a": @PMunch: looking at implementation I think it is not possible to have it O(1), you can of course have it in O(n) by traversing the set: https://github.com/nim-lang/Nim/blob/version-1-4/lib/pure/collections/sets.nim#L72 |
13:26:39 | PMunch | Yeah that is what I ended up doing |
13:27:14 | PMunch | I only have 24 values in the set max |
13:38:14 | * | johnnynitwits quit (Quit: Bridge terminating on SIGTERM) |
13:38:46 | * | johnnynitwits joined #nim |
13:41:16 | * | johnnynitwits quit (Client Quit) |
13:53:27 | * | tefter quit (Remote host closed the connection) |
13:56:21 | * | johnnynitwits joined #nim |
13:56:21 | * | johnnynitwits quit (Excess Flood) |
13:56:48 | * | NimBot joined #nim |
14:04:46 | FromDiscord | <jtiai> Is there map/dict datatype nim or way to do that relatively easily? |
14:08:40 | ForumUpdaterBot | New Nimble package! xgboost.nim - Nim wrapper of libxgboost, see https://github.com/jackhftang/xgboost.nim |
14:20:29 | FromDiscord | <zetashift> You could use `tables` https://nim-lang.org/docs/tables.html or one of it's variants |
14:20:55 | FromDiscord | <zetashift> (edit) |
14:41:09 | * | casaca quit (Ping timeout: 260 seconds) |
15:00:34 | FromDiscord | <Ricky Spanish> where does the forumupdaterbot get its information from? its querying githubs api for nim repo's? or people submit their work urls to some central repo? |
15:02:00 | FromDiscord | <Rika> Querying |
15:02:06 | FromDiscord | <Rika> Ah wait no |
15:02:25 | FromDiscord | <Rika> The central repo is Nim-Lang/packages I believe |
15:04:10 | FromDiscord | <Ricky Spanish> ah right 👍 thanks for the info |
15:04:32 | FromDiscord | <Rika> I might have that wrong but it’s a similar name |
15:05:21 | FromDiscord | <Ricky Spanish> yeh just wondered how it was being handled, thought there was gonna be some crazy nim magic going on again that was worth asking about |
15:06:43 | FromDiscord | <Rika> Yeah actually all the messages listed here as from bots are actually from bots, a super intelligent AI coded in Nim |
15:09:51 | FromDiscord | <Ricky Spanish> mratsim....? it feels like something he'd do |
15:21:09 | FromDiscord | <Rika> lmao |
15:23:49 | * | fredrikhr joined #nim |
15:31:28 | reversem3 | Has anyone does any p2p programming using nim? |
15:32:09 | reversem3 | I am interested how to create an app that uses a decentralized database so I don't have to rely on a server. |
15:34:02 | reversem3 | * Has anyone here created a p2p program ? |
15:34:32 | reversem3 | I know there is libp2p but the only examples are a chat application |
15:38:44 | * | xet7 quit (Quit: Leaving) |
15:39:15 | * | vicfred joined #nim |
15:45:31 | * | xet7 joined #nim |
15:46:12 | * | teasea quit (Quit: teasea) |
15:48:11 | * | teasea joined #nim |
15:59:50 | FromDiscord | <mlokis> where do i find assembly output when i use --asm |
16:05:11 | reversem3 | Just use xxd or radare2 on the binary or exe |
16:34:37 | * | Gustavo6046 quit (Quit: ZNC 1.8.2 - https://znc.in) |
16:34:42 | FromDiscord | <carpal> if nim's compiler uses c as main IR, then why is it considered a compiler and not a transpiler? |
16:36:23 | Prestige | Probably because it does more than just translated to c |
16:36:41 | Prestige | Translate* |
16:38:28 | Prestige | But I don't think the terminology really matters in this case |
16:39:37 | * | casaca joined #nim |
16:41:23 | Prestige | If it were called a transpiler, I would assume that I would end up with C code and not a binary in the end |
16:42:55 | FromDiscord | <haxscramper> In reply to @carpal "if nim's compiler uses": it does not use `C` as "main IR" |
16:43:05 | FromDiscord | <haxscramper> It uses C as backed language |
16:44:16 | FromDiscord | <haxscramper> Just as Js/C++. For IR nim uses it's AST |
16:49:32 | FromDiscord | <carpal> In reply to @Prestige "Probably because it does": but the definition of transpiler is literaly a high level to another one |
16:50:12 | Prestige | At a high level, the nim compiler compiles nim code to a binary |
16:50:19 | Prestige | (when using c or c++ backends) |
16:50:43 | FromDiscord | <carpal> In reply to @haxscramper "It uses C as": this means that generates c |
16:50:48 | FromDiscord | <carpal> (edit) "this" => "that" |
16:51:26 | Prestige | the compiler's function/use is not to generate c code |
16:53:36 | Prestige | just how the purpose of walking isn't to put my feet on the ground |
16:55:45 | FromDiscord | <carpal> good point |
17:02:25 | FromDiscord | <WSECU> How can I have nim show what gcc commands its doing when I compile? |
17:03:08 | FromDiscord | <Solitude> look at json file in nimcache |
17:04:00 | giaco__ | how would you go from "let foo={"a":1,"b":2}" to string "a=1,b=2" (I need to urlencode a table-like thingy) |
17:05:01 | FromDiscord | <haxscramper> https://nim-lang.org/docs/sugar.html#collect.m%2Cuntyped%2Cuntyped collect for pairs |
17:05:15 | FromDiscord | <haxscramper> Or just iterate and add to result |
17:05:25 | FromDiscord | <WSECU> What if I want nim to just compile to C and then stop? |
17:05:30 | FromDiscord | <haxscramper> The best solution. IIRC there is no `mapIt` for pairs |
17:06:01 | FromDiscord | <haxscramper> In reply to @WSECU "What if I want": See `--fullhelp` for options, I we have something like `--noLink` |
17:07:00 | * | Gustavo6046 joined #nim |
17:07:23 | FromDiscord | <demotomohiro> In reply to @WSECU "How can I have": --listCmd option prints gcc commands Nim compiler calls |
17:09:09 | giaco__ | haxscramper, last time I tried collect, it failed with strings |
17:09:59 | giaco__ | haxscramper: https://github.com/nim-lang/Nim/issues/16078 |
17:11:12 | FromDiscord | <haxscramper> https://play.nim-lang.org/#ix=2WZ0 |
17:12:09 | FromDiscord | <haxscramper> Good old loop will get you almost anywhere with not too much syntactic noise |
17:12:59 | FromDiscord | <haxscramper> And I forgot that `collect` uses it's body to infer the generic parameters for result type, so it does not work for strings |
17:19:30 | * | dsrw joined #nim |
17:22:21 | dsrw | Is there any way to tell if a macro is being called as a statement, or as an expression without nesting it inside another macro? |
17:22:56 | dsrw | I guess I want the NimNode for the macro itself. I'm not sure if that's a thing. |
17:23:14 | * | Prestige quit (Quit: Prestige) |
17:23:39 | * | Prestige joined #nim |
17:23:59 | FromDiscord | <haxscramper> No, macro cannot access it's surrounding context |
17:24:39 | dsrw | Thanks @hexscramper |
17:25:04 | FromDiscord | <haxscramper> With some exceptions like TRM macros, but this is usually the wrong solution to the problem |
17:26:37 | * | vicfred quit (Remote host closed the connection) |
17:27:09 | * | vicfred joined #nim |
17:27:24 | dsrw | Yeah, I don't think I want a TRM. This is just for a bit of sugar. Having two different macros with different names will do the job fine. |
17:27:58 | * | vicfred quit (Max SendQ exceeded) |
17:29:02 | * | vicfred joined #nim |
17:29:43 | * | vicfred quit (Max SendQ exceeded) |
17:30:23 | * | vicfred joined #nim |
17:36:01 | FromDiscord | <jtiai> I am using OrderedTable. I couldn't find how to get range of entries, like entry of key 31173 and next 9 (10 in total). |
17:36:39 | FromDiscord | <haxscramper> Ordered table only remembers insertion order, you need to use fusion/btreetables in order to query for ranges. |
17:37:01 | FromDiscord | <haxscramper> Though I don't exactly remember if it has this API or not |
17:37:23 | FromDiscord | <haxscramper> https://nim-lang.github.io/fusion/src/fusion/btreetables.html#keysBetween.i%2CTable%5BA%2CB%5D%2CA%2CA |
17:40:58 | * | def-- joined #nim |
17:41:00 | * | blackpawn joined #nim |
17:42:18 | FromDiscord | <jtiai> Too bad that I don't know ending key. |
17:42:29 | FromDiscord | <jtiai> Only start. |
17:43:13 | FromDiscord | <jtiai> Though I could start iterating and breakout upon reached count. |
17:43:28 | * | WilhelmV1nWeiner joined #nim |
17:48:34 | * | def- quit (*.net *.split) |
17:48:34 | * | WilhelmVonWeiner quit (*.net *.split) |
17:48:35 | * | blackpawn_ quit (*.net *.split) |
17:48:44 | * | def-- is now known as def- |
18:04:53 | FromDiscord | <ellliottt> can i set nim to compile with TCC rather than clang when im not in release mode? |
18:08:25 | FromDiscord | <Hi02Hi> `nim c --cc:tcc file.nim` |
18:09:06 | FromDiscord | <ellliottt> is there a way to set that flag as default for debug builds? |
18:09:27 | FromDiscord | <ellliottt> unless im compiling a release build i dont care about the performance of the binary, id rather have a quicker compiler |
18:13:54 | FromDiscord | <Recruit_main707> you can use .nims configuration files |
18:15:56 | FromDiscord | <Recruit_main707> pretty sure this works https://media.discordapp.net/attachments/371759389889003532/834855055801974824/your_main_file_name.nims |
18:16:12 | FromDiscord | <Recruit_main707> why no preview :( |
18:16:45 | FromDiscord | <Recruit_main707> sent a code paste, see https://play.nim-lang.org/#ix=2X0M |
18:16:49 | FromDiscord | <zetashift> needs a `not` right? |
18:16:51 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2X0N |
18:16:52 | FromDiscord | <haxscramper> in `nim.cfg` |
18:17:09 | FromDiscord | <zetashift> what is more idiomatic `nim.cfg` or `config.nims`? |
18:17:10 | FromDiscord | <Recruit_main707> ah yeah |
18:17:15 | FromDiscord | <haxscramper> `cc:"gcc"` |
18:17:17 | FromDiscord | <Recruit_main707> .nims |
18:17:39 | reversem3 | p2p apps are no joke |
18:18:03 | reversem3 | wish there was bindings for ipfs though for nim |
18:19:01 | FromDiscord | <ellliottt> oh neat. can you do that system wide rather than per project? |
18:19:10 | ForumUpdaterBot | New thread by Gekkonier: Csfml, and the warning that it's not used and where to put that..., see https://forum.nim-lang.org/t/7839 |
18:20:01 | FromDiscord | <zetashift> In reply to @ellliottt "oh neat. can you": you can I think: https://nim-lang.org/docs/nims.html (section 1) |
18:20:27 | FromDiscord | <haxscramper> tldr `~/.config/nims/nim.cfg` |
18:20:46 | FromDiscord | <haxscramper> (edit) "`~/.config/nims/nim.cfg`" => "`~/.config/nim/nim.cfg`" |
18:21:42 | FromDiscord | <zetashift> ^ yes, sorry, or `%APPDATA%/nim/config.nims` if you're on Windows |
18:22:06 | FromDiscord | <ellliottt> ah perfect, tysm :) |
18:33:11 | * | natrys quit (Ping timeout: 240 seconds) |
18:33:35 | * | natrys joined #nim |
18:36:16 | reversem3 | !search importjs |
18:44:43 | reversem3 | Does anyone have some good example of importing a javascript library ? |
18:50:52 | PMunch | The playground imports the parts it needs to interface with the code editor |
19:10:05 | * | vicfred_ joined #nim |
19:12:45 | * | vicfred quit (Ping timeout: 268 seconds) |
19:14:02 | * | tane joined #nim |
19:23:40 | FromDiscord | <zidsal> @haxscramper thanks for the help yesturday, I've come to the conclusion that the macro based approach has too many draw backs, so I guess I'll use a object variant 😦 |
19:32:09 | reversem3 | The CType int64 is only for arch right (so if I'm compiling for a 64 bit I use 64 or 32 )? |
19:32:12 | reversem3 | type |
19:32:12 | reversem3 | CTime = int64 |
19:32:12 | reversem3 | proc time(arg: ptr CTime): CTime {.importc, header: "<time.h>".} |
19:32:38 | reversem3 | * The CTime int64 is only for arch right (so if I'm compiling for a 64 bit I use 64 or 32 )? |
19:37:23 | ForumUpdaterBot | New thread by Alexeypetrushin: Do I need to publish with `nimble publish` or just submit my repo name to `package.json`?, see https://forum.nim-lang.org/t/7840 |
19:37:57 | * | Kaivo quit (Ping timeout: 260 seconds) |
19:51:46 | FromDiscord | <WSECU> Is it possible to run into a project that only works with C or C++? |
19:51:49 | FromDiscord | <WSECU> for nim |
19:52:02 | FromDiscord | <jtiai> sent a code paste, see https://paste.rs/uMJ |
19:52:23 | * | fowl quit (Ping timeout: 260 seconds) |
19:52:25 | FromDiscord | <haxscramper> In reply to @WSECU "Is it possible to": By "only works with" you mean supporting only one backend? |
19:52:35 | FromDiscord | <WSECU> yeah |
19:52:43 | * | robertmeta quit (Read error: Connection reset by peer) |
19:52:46 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/Zb4 |
19:52:51 | FromDiscord | <haxscramper> In reply to @WSECU "yeah": sure, why not |
19:52:51 | * | sz0 quit (Read error: Connection reset by peer) |
19:53:07 | FromDiscord | <jtiai> I've seen a few. Usually bindings. |
19:53:14 | FromDiscord | <Recruit_main707> i think he is asking if there is some kind of limit |
19:53:22 | FromDiscord | <Recruit_main707> pretty sure not with c and c++ |
19:53:45 | FromDiscord | <haxscramper> If you write pure nim it automatically supports all targets. For the most part |
19:53:57 | FromDiscord | <WSECU> If I made a project and normally compile with C, if another user decided to compile with C++ instead, would it break it? |
19:54:06 | FromDiscord | <haxscramper> no, most likely not |
19:54:16 | FromDiscord | <ElegantBeef> The otherway around might if you rely on compiling C++ code |
19:54:31 | FromDiscord | <Recruit_main707> why |
19:54:36 | FromDiscord | <jtiai> I would be useful that docs would indicate which import it needs. Quite frustrating as an enduser to make guesses and see weird errors. |
19:54:43 | * | kwilczynski quit (Ping timeout: 260 seconds) |
19:54:56 | FromDiscord | <haxscramper> In reply to @jtiai "I would be useful": https://media.discordapp.net/attachments/371759389889003532/834879964502556672/unknown.png |
19:55:16 | FromDiscord | <haxscramper> `src/` part is not needed of course, |
19:55:18 | FromDiscord | <Recruit_main707> afaik the only limitation of a backend is the js one about something, it was either manual allocations or something low level related |
19:55:26 | FromDiscord | <Recruit_main707> i dont remember now |
19:55:36 | FromDiscord | <ElegantBeef> When using non stdlibs your kinda expected to know how to import stuff 😄 |
19:56:04 | FromDiscord | <jtiai> I know how. But question is what. |
19:57:27 | FromDiscord | <ElegantBeef> It says right there `fusion/btreetables` |
19:58:02 | FromDiscord | <ElegantBeef> nim 1.6 will have the import path as the title as that does so all modules will have the import path in the docs |
19:58:15 | * | robertmeta joined #nim |
19:58:19 | * | kwilczynski joined #nim |
19:58:48 | FromDiscord | <jtiai> Apparently devs have more important things to do than docs as the usual story is. |
19:58:53 | * | fowl joined #nim |
19:59:03 | FromDiscord | <ElegantBeef> i mean `nim doc` takes all of 3 seconds to run |
19:59:08 | * | sz0 joined #nim |
19:59:51 | FromDiscord | <jtiai> yea. "command expects filename". |
20:00:00 | FromDiscord | <jtiai> That was really helpful. |
20:00:17 | FromDiscord | <ElegantBeef> Why are you being so snide |
20:00:20 | FromDiscord | <zidsal> gah @ElegantBeef sorry I thanked @haxscramper for you helping me yesturday! thanks again for the help |
20:01:30 | FromDiscord | <jtiai> In reply to @ElegantBeef "Why are you being": Because I'm one of those people that care about the docs (I'm documentarian partly) |
20:01:46 | FromDiscord | <ElegantBeef> Ah so you mean you're a developer |
20:01:57 | FromDiscord | <ElegantBeef> I dont see what you're bitching at |
20:01:58 | FromDiscord | <jtiai> No, i write the docs. |
20:02:50 | FromDiscord | <ElegantBeef> Lol zidsal it's fine i didnt do much |
20:02:53 | FromDiscord | <haxscramper> In reply to @jtiai "Because I'm one of": nim documentation story is not as stellar as it could've been, that is true |
20:03:08 | FromDiscord | <haxscramper> to put it lightly |
20:03:22 | FromDiscord | <haxscramper> Well, the core part is documented well enough |
20:03:29 | FromDiscord | <jtiai> And I know it's one of the hard parts. Speciall put all common 4 parts together. |
20:04:02 | FromDiscord | <ElegantBeef> The wonderful part is it's all OSS, so whenever you find docs that are subpar or wrong you can update them |
20:04:17 | FromDiscord | <haxscramper> when you know what to write in docs |
20:04:28 | FromDiscord | <haxscramper> that is - when you already got the info |
20:04:34 | FromDiscord | <ElegantBeef> Well yea |
20:04:43 | FromDiscord | <jtiai> I probably will since I got somewhat fond of Nim. |
20:05:28 | FromDiscord | <jtiai> what this "nim doc" is really supposed to do? I couldn't get any output from it even trying to type some libs I use... |
20:05:30 | FromDiscord | <haxscramper> I think it also has a lot to do with `nim doc` tool being somewhat limited |
20:05:45 | FromDiscord | <haxscramper> In reply to @jtiai "what this "nim doc"": `nim doc file.nim` generates documentation for `file.nim` |
20:05:47 | FromDiscord | <ElegantBeef> nim doc will generate html documents from doc comments and the rst in contained |
20:06:06 | FromDiscord | <ElegantBeef> It's what drives the entire stdlib docs |
20:06:30 | FromDiscord | <jtiai> Ah, since I write more comprehensive docs I've been using sphinx mainly. and asciidoc a bit. |
20:06:34 | FromDiscord | <ElegantBeef> Also runs the tests which are contained inside the `runableExample:` |
20:07:02 | FromDiscord | <ElegantBeef> Dont get what you mean by that, you can write entire tutorials in the RST as many modules have |
20:07:06 | FromDiscord | <haxscramper> https://nim-lang.org/blog/2017/10/02/documenting-profiling-and-debugging-nim-code.html↵https://nim-lang.org/docs/docgen.html |
20:07:24 | FromDiscord | <haxscramper> https://nim-lang.org/docs/docstyle.html |
20:07:34 | FromDiscord | <jtiai> Well sphinx is rst too. + ability to parse some reference docs from python if wanted to. |
20:08:20 | FromDiscord | <haxscramper> Though to be completely honest something on the doxygen level is needed to properly support all nim features |
20:08:29 | FromDiscord | <haxscramper> There is just so much things |
20:08:43 | FromDiscord | <haxscramper> That demand careful separate handling |
20:08:46 | FromDiscord | <ElegantBeef> Well nim doc does a fair bit. Tests, code highlighting, index, and so on |
20:08:53 | FromDiscord | <ElegantBeef> But yea |
20:09:07 | FromDiscord | <haxscramper> And I'm only talking about machinery of code generation, not people writing text |
20:09:20 | FromDiscord | <haxscramper> (edit) "code" => "documentation" |
20:09:25 | FromDiscord | <haxscramper> For example documenting macros |
20:09:32 | FromDiscord | <haxscramper> OR specifically macro transforms |
20:09:35 | FromDiscord | <haxscramper> Injected variables |
20:09:45 | FromDiscord | <haxscramper> expected AST patterns |
20:09:55 | FromDiscord | <zidsal> what is this documentation you guys speak of!, understanding code I have written should be a right of passage... an honor if you will |
20:09:56 | FromDiscord | <haxscramper> surrounding scope expectations |
20:10:12 | FromDiscord | <haxscramper> like what you need to import in order for macro to work |
20:10:15 | FromDiscord | <ElegantBeef> lol zid |
20:10:24 | FromDiscord | <jtiai> tutorials, how-tos and discussions. + reference. |
20:10:38 | FromDiscord | <jtiai> that's the commmon 4 blocks of documentation. |
20:11:21 | FromDiscord | <haxscramper> tooling is also important, it is possible to have stellar documentation using only text files, but still |
20:11:34 | FromDiscord | <ElegantBeef> Discussions? |
20:11:46 | FromDiscord | <haxscramper> as a part of the documentation? |
20:11:49 | FromDiscord | <ElegantBeef> Yea |
20:11:52 | FromDiscord | <jtiai> tutorials do take user by hand and walks through an example. how-tos are like recipes to get things done and discussion is more like explanations about design decisions etc. |
20:11:54 | FromDiscord | <ElegantBeef> That's what i dont get |
20:12:06 | FromDiscord | <haxscramper> I though about running text miner on IRC logs |
20:12:09 | FromDiscord | <haxscramper> and forum posts |
20:12:12 | FromDiscord | <ElegantBeef> That's not discussion, that's "explanation" 😄 |
20:12:15 | FromDiscord | <haxscramper> But the information is very fuzzy |
20:12:29 | FromDiscord | <jtiai> In documentarian vocabulary it's discussion. |
20:12:32 | FromDiscord | <ElegantBeef> Plus you'd have to filter all my messages and there is a lot of them |
20:12:41 | FromDiscord | <haxscramper> So you need somewhat good NLP skills to have something useful out of it, which I don't have yet |
20:13:06 | FromDiscord | <haxscramper> but we have 10+ years of discussions here, so it has to worth somehting |
20:13:21 | FromDiscord | <haxscramper> (edit) "somehting" => "something in terms of documentation source" |
20:13:36 | FromDiscord | <dk> I like how most of the manual and most of the system.nim doc is on one page |
20:13:42 | FromDiscord | <haxscramper> actually no, IRC logs date back to 2013 so it ls less than ten years. Still a lot |
20:13:56 | FromDiscord | <dk> much easier to keep track of what you've already read than when it's on multiple pages |
20:14:14 | FromDiscord | <haxscramper> one-page-per-proc documentation sounds |
20:14:14 | FromDiscord | <ElegantBeef> Ah you heard dk make all the stdlib on a single page with header seperating it 😛 |
20:15:38 | FromDiscord | <ElegantBeef> And jtiai can you do me a favour and change that dot operators issue title to "Dot operators with type mismatch, shows assertion instead of compiler error"? |
20:16:05 | FromDiscord | <jtiai> Definitely. Just a sec. |
20:16:14 | FromDiscord | <ElegantBeef> Thanks |
20:16:57 | FromDiscord | <jtiai> Done. |
20:17:32 | FromDiscord | <ElegantBeef> And yea like i mentioned that'll never compile in Nim withough a int to bool `converter` |
20:17:38 | FromDiscord | <ElegantBeef> (edit) "withough" => "without" |
20:18:27 | * | jess quit () |
20:18:42 | * | jess joined #nim |
20:19:27 | FromDiscord | <jtiai> sent a code paste, see https://play.nim-lang.org/#ix=2Xc4 |
20:19:54 | FromDiscord | <ElegantBeef> `TableRef` != `Table` |
20:20:08 | FromDiscord | <jtiai> and play.nim-lang.org went down. |
20:20:42 | FromDiscord | <ElegantBeef> The error consicely says the issue, the `valuesFrom` only works on a `Table` not a `TableRef` |
20:21:08 | FromDiscord | <ElegantBeef> you can do `t[]` instead of `t` and it should work but i dont know the implications if any |
20:22:34 | FromDiscord | <jtiai> But as Table it would be copied all over when using it? |
20:23:09 | FromDiscord | <ElegantBeef> Iterators are just fancy templates really so it shouldnt change much afaik |
20:23:52 | FromDiscord | <dk> Even in procs the compiler can pass a pointer if it can infer it's ok |
20:24:00 | FromDiscord | <dk> Even if it's value type |
20:24:03 | FromDiscord | <jtiai> Well it's 0xFFFF 10 to 15 char strings at max |
20:25:05 | FromDiscord | <jtiai> Scary. My CPU emulator compiled. |
20:26:54 | * | Vladar quit (Quit: Leaving) |
20:27:10 | * | xet7 quit (Quit: Leaving) |
20:29:13 | * | xet7 joined #nim |
20:33:17 | FromDiscord | <Phytolizer> sent a code paste, see https://paste.rs/Mv4 |
20:33:46 | FromDiscord | <ElegantBeef> There is no running code there |
20:33:50 | FromDiscord | <ElegantBeef> That compiles fine |
20:34:25 | FromDiscord | <Phytolizer> it doesn't compile when I call toString on an Identifier |
20:34:39 | FromDiscord | <Phytolizer> i have this split across many files so didn't get a complete example |
20:35:15 | FromDiscord | <ElegantBeef> do you do `Identifier(token: "Something")`? |
20:35:22 | FromDiscord | <haxscramper> wandbox support multi-file nim examples |
20:35:54 | FromDiscord | <ElegantBeef> You probably forgot to import both the node and identifier in the file calling `toString` or didnt create the object |
20:36:22 | FromDiscord | <Phytolizer> i definitely import both Node and Identifier |
20:36:28 | FromDiscord | <Phytolizer> the object is created in the parser |
20:36:38 | FromDiscord | <Phytolizer> and this error occurs in my tests |
20:36:42 | FromDiscord | <ElegantBeef> I notice `toString` isnt exported |
20:37:30 | * | vicfred__ joined #nim |
20:37:33 | FromDiscord | <Phytolizer> you're right, i forgot to export them. after doing so, the error persists |
20:38:21 | FromDiscord | <dk> the errors suggests your variable is a nil |
20:38:28 | * | narimiran quit (Ping timeout: 265 seconds) |
20:38:52 | FromDiscord | <dk> https://nim-lang.org/docs/system.html#NilAccessDefect |
20:39:48 | FromDiscord | <Phytolizer> so the "dispatcher" is a variable? |
20:40:19 | * | vicfred_ quit (Ping timeout: 252 seconds) |
20:41:44 | FromDiscord | <Phytolizer> https://github.com/onContentStop/monkey here is the full context |
20:41:48 | FromDiscord | <dk> I dunno, I don't use methods, but the exception type is ducumented in system |
20:42:04 | FromDiscord | <Phytolizer> i know what a nilaccessdefect is, but my variables are not nil |
20:42:43 | FromDiscord | <dk> Is there no stack trace? |
20:42:50 | FromDiscord | <Phytolizer> it's in the toString call |
20:43:15 | FromDiscord | <Phytolizer> sent a code paste, see https://play.nim-lang.org/#ix=2Xgi |
20:48:18 | FromDiscord | <Phytolizer> using `tokenLiteral` instead of `toString` works fine |
20:48:45 | FromDiscord | <Phytolizer> wait i found it |
20:48:46 | FromDiscord | <Phytolizer> hang on |
20:50:24 | FromDiscord | <Phytolizer> yeah im real dumb |
20:50:28 | FromDiscord | <Phytolizer> here's what happened: |
20:50:53 | FromDiscord | <Phytolizer> LetStatement contains an optional Expression (a ref object). |
20:51:01 | FromDiscord | <Phytolizer> I hadn't yet implemented expression parsing. |
20:51:12 | FromDiscord | <Phytolizer> So it tried to call toString on the Expression and did that thing above. |
20:51:26 | FromDiscord | <Phytolizer> thanks for y'all's patience |
20:51:56 | FromDiscord | <dk> May that discourage you from using methods 😐 |
20:52:10 | FromDiscord | <Phytolizer> i can't think of a better way to represent an AST |
20:52:22 | FromDiscord | <dk> Nim has an AST and it doesn't use methods |
20:52:33 | FromDiscord | <Phytolizer> oh i totally believe it's possible |
20:52:55 | FromDiscord | <dk> I was never as much confused by an error in Nim |
20:52:58 | FromDiscord | <dk> so there's that |
20:53:24 | FromDiscord | <Phytolizer> i come for Rust/C# so there's that |
20:53:26 | FromDiscord | <Phytolizer> from |
20:54:13 | FromDiscord | <haxscramper> In reply to @Phytolizer "i can't think of": the way to write AST in nim https://nim-lang.org/docs/macros.html#the-ast-in-nim |
20:54:47 | FromDiscord | <haxscramper> I've done 20+ different AST-like data structures at this point for various projects - never seen this approach fail |
20:54:54 | FromDiscord | <haxscramper> Works with pattern matching |
20:55:18 | FromDiscord | <haxscramper> Node type matching is checked for completeness when using `case` |
20:55:41 | FromDiscord | <haxscramper> Can put all implementation logic in a single procedure instead of spreading it over 20+ method overloads |
20:55:58 | FromDiscord | <haxscramper> Zero `ref` up/down-casting |
20:56:11 | FromDiscord | <Phytolizer> so just a tagged union |
20:56:17 | FromDiscord | <haxscramper> yep |
20:56:19 | FromDiscord | <Phytolizer> ok |
20:56:25 | FromDiscord | <Phytolizer> ill try both and see where im at |
20:56:35 | FromDiscord | <Phytolizer> i do like Rust enums |
20:59:11 | * | natrys quit (Ping timeout: 240 seconds) |
21:01:17 | FromDiscord | <jtiai> Showoff: https://media.discordapp.net/attachments/371759389889003532/834896666947223602/unknown.png |
21:05:27 | FromDiscord | <jtiai> <https://github.com/jtiai/nimoric> and there you can see the sources if interested in. Messy stuff because I've been learning. |
21:19:40 | * | PMunch quit (Quit: leaving) |
21:23:00 | * | natrys joined #nim |
21:23:59 | * | natrys quit (Client Quit) |
21:38:24 | * | tane quit (Quit: Leaving) |
21:42:24 | FromDiscord | <Recruit_main707> it looks nice :) |
21:49:45 | * | rockcavera quit (Killed (orwell.freenode.net (Nickname regained by services))) |
21:49:46 | * | rockcavera joined #nim |
21:53:52 | * | rockcavera is now known as Guest83940 |
21:53:52 | * | Guest83940 quit (Killed (verne.freenode.net (Nickname regained by services))) |
21:53:53 | * | rockcavera joined #nim |
22:15:46 | * | thomasross joined #nim |
22:32:51 | * | couven92 joined #nim |
22:33:10 | * | fredrikhr quit (Disconnected by services) |
22:33:16 | * | couven92 is now known as fredrikhr |
22:34:23 | ForumUpdaterBot | New Nimble package! nodem - Call remote Nim functions as if it's local, see https://github.com/al6x/nim/tree/main/nodem |
22:36:04 | * | vicfred__ quit (Quit: Leaving) |
23:09:53 | * | dsrw quit (Ping timeout: 246 seconds) |
23:22:35 | * | fredrikhr quit (Quit: Client Disconnecting) |
23:37:08 | * | dsrw joined #nim |
23:47:20 | FromDiscord | <uuuu> Can I force a nim program to be compiled only as C or C++, throw an error if compiled any other way? |
23:50:09 | FromDiscord | <ElegantBeef> !eval when defined(c): {.error: "Only supports C backend".} |
23:50:10 | NimBot | Compile failed: /usercode/in.nim(1, 25) Error: Only supports C backend |
23:50:33 | FromDiscord | <ElegantBeef> Well probably `C++ backend` but there you go |
23:51:06 | FromDiscord | <uuuu> What was the code to force compile as C? |
23:51:34 | FromDiscord | <ElegantBeef> `nim cc` |
23:51:45 | FromDiscord | <ElegantBeef> or `compileToC` |
23:52:09 | FromDiscord | <uuuu> No I meant the code to give an error if a program expected to be compiled as C and got C++ |
23:52:20 | FromDiscord | <ElegantBeef> I showed you in the !eval message |
23:52:30 | FromDiscord | <ElegantBeef> `when defined(cpp)` |
23:53:02 | FromDiscord | <uuuu> What about `when not defined(c)`? |
23:53:12 | FromDiscord | <ElegantBeef> works aswell |
23:53:38 | FromDiscord | <ElegantBeef> But i cannot think of a reason C cannot be compiled with C++ |
23:56:23 | krux02 | @ElegantBeef, C++ has more keywords than C. |
23:56:48 | krux02 | therefore, some C++ keywords are valid variable names in C, but invalid in C++ |
23:57:14 | krux02 | and C has implicit forward declaration. |