01:02:53 | * | grobe0ba quit (Quit: ZNC 1.7.5 - https://znc.in) |
01:03:05 | * | grobe0ba joined #nim |
01:09:11 | * | njoseph quit (Quit: http://quassel-irc.org - Chat comfortably. Anywhere.) |
01:09:31 | * | njoseph joined #nim |
01:37:19 | FromDiscord | <Tristan> sent a code paste, see https://play.nim-lang.org/#ix= |
01:38:59 | * | k0mpjut0r quit (*.net *.split) |
01:38:59 | * | BitPuffin quit (*.net *.split) |
01:39:00 | * | Benjamin[m]2 quit (*.net *.split) |
01:39:00 | * | watzon quit (*.net *.split) |
01:42:42 | * | Tlangir joined #nim |
01:42:45 | FromDiscord | <Tristan> sent a code paste, see https://play.nim-lang.org/#ix=2SiB |
01:46:47 | * | Benjamin[m]2 joined #nim |
01:49:32 | * | watzon joined #nim |
01:54:21 | * | muffindrake quit (Quit: muffindrake) |
01:55:20 | * | BitPuffin joined #nim |
01:59:12 | * | k0mpjut0r joined #nim |
02:11:41 | * | krux02 quit (Remote host closed the connection) |
02:14:26 | * | lritter quit (Ping timeout: 264 seconds) |
02:14:54 | * | lritter joined #nim |
02:18:20 | * | wasted_youth2 joined #nim |
03:37:22 | * | ubert1 quit (Ping timeout: 260 seconds) |
03:37:22 | * | ubert joined #nim |
03:44:35 | * | Lord_Nightmare quit (Quit: ZNC - http://znc.in) |
03:48:24 | * | Lord_Nightmare joined #nim |
04:16:12 | FromDiscord | <ElegantBeef> Does `nim doc` set a define for checking if you're in docgen? |
04:18:51 | * | spiderstew_ joined #nim |
04:19:50 | * | spiderstew quit (Ping timeout: 264 seconds) |
04:29:20 | FromDiscord | <ElegantBeef> Ah found `--doccmd` |
04:33:38 | * | leorize joined #nim |
05:24:59 | * | saem waves |
05:27:13 | FromDiscord | <ElegantBeef> Yellow |
05:29:16 | saem | sup, beef? |
05:29:49 | FromDiscord | <ElegantBeef> Slammed my face into my keyboard adding doc comments to some Nico procs |
05:30:08 | FromDiscord | <Rika> Congrats |
05:30:09 | FromDiscord | <ElegantBeef> I mean nothing much you? 😄 |
05:32:31 | saem | looking at syntax highlighting, feeling sad. |
05:36:28 | FromDiscord | <ElegantBeef> Well close one eye so you feel sad at half the rate |
05:36:50 | saem | I wish |
05:37:08 | FromDiscord | <ElegantBeef> What's making you sad |
05:38:48 | FromDiscord | <ElegantBeef> what part exactly is that question |
05:39:11 | * | narimiran joined #nim |
05:41:47 | saem | how to textmate grammar |
05:43:47 | * | mmohammadi9812 quit (Quit: Quit) |
05:45:37 | FromDiscord | <ElegantBeef> Ah i think this is a case of you're either born with it, or scrape your head into it like it's 60grit sandapaper |
05:46:15 | saem | probably |
05:46:28 | saem | Do you want to textmate grammar? :) |
05:46:53 | FromDiscord | <ElegantBeef> Not particularly, that's the type of stuff that causes me to implode |
05:48:09 | saem | damn it, i thought you liked colours. |
05:49:03 | FromDiscord | <ElegantBeef> I do, but i fought with them enough with my silly PR for adding colours to the compiler output |
05:49:15 | FromDiscord | <ElegantBeef> Ponders if i should close that |
05:50:52 | saem | bummer. |
05:51:08 | saem | I'll take your colours. |
05:52:34 | FromDiscord | <ElegantBeef> I have to applaud you from spelling colours correctly in a dev community 😛 |
05:52:38 | FromDiscord | <ElegantBeef> (edit) "from" => "for" |
05:53:46 | saem | I work for an American company and put 'u' in all sorts of places. |
05:54:05 | saem | It's my mark. |
05:56:41 | saem | I'm streaming on discord if you wanna see the colours, or lack thereof. |
05:57:18 | FromDiscord | <ElegantBeef> I'm currently in a voip chat, so... uhhhhh smokebomb |
05:57:26 | saem | lol |
05:58:22 | FromDiscord | <Araq> https://blog.acolyer.org/2017/09/19/to-type-or-not-to-type-quantifying-detectable-bugs-in-javascript/ |
05:58:58 | FromDiscord | <Araq> "both Flow and TypeScript are pretty good, and conservatively either of them can prevent about 15% of the bugs that end up in committed code." |
06:00:04 | FromDiscord | <ElegantBeef> I feel like there is an emphasis on "committed code", since how many bugs does it prevent in writing code |
06:00:18 | saem | I was at a presentation years ago with an MS dev advocate, and they said that's what they found themselves. |
06:01:01 | Prestige | I had to write a paper on the topic to covince my company to make the switch to ts |
06:01:26 | FromDiscord | <ElegantBeef> "Static analysis means we statically know types dont fuck us when we're not looking, please switch" |
06:01:47 | Prestige | It took a LOT of convincing... |
06:02:20 | saem | What was also interesting is the paper on organizational structure and influence on software quality. |
06:03:30 | FromDiscord | <ElegantBeef> My way of showing that static analysis is warranted is just a function that does `print("Hello" + 100)` only when a random value is `42`, the program can run successfully, many times but hits that occasionally 😄 |
06:05:34 | FromDiscord | <Araq> it took them decades to produce this result. I always knew it. now spread the word -- Python bad, Nim good. |
06:05:54 | FromDiscord | <Araq> 🙂 |
06:06:06 | FromDiscord | <ElegantBeef> Aw shit that's what i was supposed to say i've been saying "Nim bad, python god" |
06:06:26 | saem | 🤣 |
06:06:52 | idf | nim python good bad |
06:06:54 | FromDiscord | <ElegantBeef> I've got a lot of "What the hell are you doing at my door, and what is Nim or Python", followed by a "Where are your pants" |
06:07:07 | FromDiscord | <fenrave> bad python good nim |
06:07:48 | FromDiscord | <ElegantBeef> I mean the general consensus is types slow you down, and by that i mean they make it so you cannot run the bad code nearly as fast |
06:10:05 | FromDiscord | <Araq> "slow you down" -- no, it's an enabling technology. I could not write compiler code (IC, omg....) without it |
06:10:15 | FromDiscord | <fenrave> personally python would be a whole lot more interesting to me if it had a similar coroutine library to the one that comes standard with lua |
06:10:57 | saem | It's so true, I'm looking at the compiler code and thinking, man I wish I could type a few more things. |
06:11:06 | saem | Not the opposite. |
06:20:27 | FromDiscord | <ElegantBeef> Yea when i type more things in the compiler it just tells me "You clearly dont know what the hell you're doing" |
06:39:03 | * | johannes joined #nim |
06:42:31 | * | halloleo joined #nim |
06:43:16 | halloleo | Hi! Just joined for the 1st time. |
06:43:32 | FromDiscord | <ElegantBeef> Hey you finally want quicker responses? 😛 |
06:43:52 | halloleo | Have used the forum, but thought for somethings IRC might be better. |
06:44:16 | halloleo | Quicker? Maybe - and less permanent... |
06:44:26 | FromDiscord | <ElegantBeef> The logs are searchable from browser 😄 |
06:45:17 | halloleo | Sure, but it /feels/ at least more ephemeral (had to look that one up...) |
06:45:57 | FromDiscord | <ElegantBeef> That's just cause my shitty jokes are 90% of it |
06:46:20 | halloleo | 😵 |
06:46:50 | * | waleee-cl quit (Quit: Connection closed for inactivity) |
06:47:09 | FromDiscord | <ElegantBeef> Anywho welcome to realtime chat's it's lovely here |
06:47:37 | halloleo | Ok, but I /do/ have a question: I'm looking at streams. Doco says "open" - "use" - "close" pattern - but I cannot find any open! |
06:48:21 | FromDiscord | <ElegantBeef> `openfilestream`? |
06:49:02 | halloleo | Ok, but only newStringStream - does it still need to be closed? |
06:50:34 | halloleo | And actually the doco's example lists even for files just newFileStream - which does not need to opened, right? |
06:50:44 | FromDiscord | <ElegantBeef> Without closing the stream will not release the string |
06:52:12 | FromDiscord | <ElegantBeef> It creates it and opens it |
06:52:19 | FromDiscord | <ElegantBeef> So yea you do not need to open it |
06:54:37 | halloleo | Alright. Thanks. |
06:57:09 | FromDiscord | <ElegantBeef> The difference between `newFileStream` and `openFileStream` is the former returns a nil on failed opening the latter throws an IO exception |
07:02:15 | halloleo | Good to know. |
07:03:25 | halloleo | Speaking of exceptions - should I wrap the processing in a try and do the close otside afterwrads, just to be sure teh string will be released on a crash? |
07:04:41 | FromDiscord | <ElegantBeef> If the program crashes the OS will return the memory itself |
07:06:06 | halloleo | Ups, of course! 🤪 |
07:17:59 | FromDiscord | <KnorrFG> sent a long message, see http://ix.io/2Sjw |
07:18:31 | FromDiscord | <KnorrFG> (edit) "http://ix.io/2Sjw" => "http://ix.io/2Sjx" |
07:18:39 | * | vicfred quit (Quit: Leaving) |
07:18:58 | halloleo | No idea. Haven't played with macros yet... |
07:19:49 | FromDiscord | <ElegantBeef> A symbol is just a looked up identifier |
07:20:20 | FromDiscord | <KnorrFG> does that mean i can always use a symbol node in place of an identifier node? |
07:20:30 | FromDiscord | <ElegantBeef> Yes, it should |
07:20:59 | FromDiscord | <KnorrFG> and then I use nskUnknown? |
07:22:16 | FromDiscord | <ElegantBeef> Uhh i'm uncertain about that |
07:22:17 | * | vegai joined #nim |
07:22:36 | FromDiscord | <ElegantBeef> I only use symbols as symbols when i need them looked up you can always do `ident($sym)` but that's fairly redundant i figure |
07:27:52 | * | halloleo quit (Quit: rcirc on GNU Emacs 27.1) |
07:31:42 | FromDiscord | <KnorrFG> body[i] = Asgn(Ident($genSym()), node) ↵works nicely 🙂 |
07:32:00 | * | lritter quit (Ping timeout: 246 seconds) |
07:32:08 | FromDiscord | <haxscramper> Why not just genSym directly |
07:33:08 | FromDiscord | <haxscramper> And most likely you need something like nskVar, but it depends on exact ast you want to generate |
07:33:35 | FromDiscord | <KnorrFG> because if you write "foo = ElemName:" it generates an ident, and i want to be able to treat those the same |
07:35:42 | FromDiscord | <haxscramper> From description of your problem it seems like you could add some sort of IR, because doing double AST rewrite is slow (like I had 80% of the time sometimes spent only on this part) |
07:37:45 | FromDiscord | <haxscramper> https://github.com/nim-lang/website/pull/271/files#diff-f40f1b0667ad0d239e3f06cd2760ec8e67510ec2b0ae40a9241b099cc6d2e278 - "intermediate representation" section |
07:37:52 | FromDiscord | <KnorrFG> what im trying is to produce something similar to qml. And if you define two elements in the same scope that depend on each other, the definition for both must occur before the first one, so i figured i just put a var block on top |
07:38:17 | FromDiscord | <KnorrFG> but for that i have to parse all asigns first, and calls are just hidden assigns, so i do that first |
07:38:26 | FromDiscord | <KnorrFG> that was my logic, is there a better way? |
07:39:49 | FromDiscord | <haxscramper> I'd advise you to first parse your DSL into some intermediate structure and then generate whatever you need from it, in correct order. |
07:39:56 | * | lritter joined #nim |
07:40:17 | FromDiscord | <haxscramper> It would be easy to just get list of necessary declarations from the structure to put them on top |
07:42:32 | FromDiscord | <haxscramper> If anything it would make it easier to extend in the future |
07:42:44 | FromDiscord | <KnorrFG> but why would my own structure be faster than the ast of the macro input which is already quite the concise and useful representation? |
07:44:57 | raboof | a quick web search didn't really turn up anything, but just checking here: I don't think there's been any work done around tooling for packaging nim/nimble applications in NixOS/nixpkgs, right? |
07:47:26 | ForumUpdaterBot | New Nimble package! tweens - Basic tweening library for Nim, see https://github.com/RainbowAsteroids/tweens |
07:48:09 | FromDiscord | <haxscramper> @KnorrFG it is not only about speed, but also about extensibility, ease of implementation and so on. You can just scan the tree twice, first to generate all forward declarations, and then remaining parts. Scan the tree, replace all identifiers with symbols, store what ident was replaced with what genSym and then at the end of the pass prepend var section to output |
07:48:28 | FromDiscord | <Yardanico> @raboof I think there was |
07:48:30 | FromDiscord | <haxscramper> Or something like that. Own structure does not need to be custom type btw |
07:48:49 | FromDiscord | <haxscramper> I think I sounded a bit confusing |
07:49:10 | FromDiscord | <haxscramper> You can just pass mutable table around and record everything in it |
07:49:29 | FromDiscord | <Yardanico> See https://discourse.nixos.org/t/nix-flake-of-nim-lang-packages/5267 for an example |
07:50:05 | FromDiscord | <KnorrFG> ok, will try, thank you |
07:50:58 | raboof | Yardanico: ah, interesting, in a flake instead of in 'regular' nixpkgs. I guess I'll have to read up on that :D |
07:51:22 | FromDiscord | <Yardanico> I've seen a few more repos on GitHub, you can search for those as well |
07:52:37 | FromDiscord | <KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2SjG |
07:52:50 | * | haxscramper joined #nim |
07:52:55 | FromDiscord | <KnorrFG> i dont really get the difference between those two btw. |
07:53:29 | * | PMunch joined #nim |
07:53:34 | FromDiscord | <haxscramper> Symbol is an identifier resolved by semcheck |
07:53:45 | FromDiscord | <Gary M> `uint32_t graphics_queue_index = -1` What the fuck. I know this isn't nim but still, why |
07:53:55 | FromDiscord | <haxscramper> If you dump `treeRepr()` of `typed` parameter you would see tons of `Sym` nodes |
07:54:05 | FromDiscord | <KnorrFG> ah |
07:54:36 | FromDiscord | <KnorrFG> but then it seems way easier to just work in the untyped realm, doesnt it? |
07:54:45 | FromDiscord | <haxscramper> yes, it always is |
07:55:07 | FromDiscord | <haxscramper> In reply to @KnorrFG "this is the code": Can you also show the original DSL code? |
07:55:31 | FromDiscord | <KnorrFG> sent a long message, see http://ix.io/2SjI |
07:55:49 | FromDiscord | <KnorrFG> (edit) "long message," => "code paste," | "http://ix.io/2Sip" => "https://play.nim-lang.org/#ix=2SjI" |
07:58:04 | FromDiscord | <haxscramper> yeah, traversing the tree and replacing `foo` with `genSym(nskVar)` (and then storing replacement identifier in `table["foo"]`) would be sufficient. And then replacing all subsequent `foo` encounters with `table["foo"]` value |
07:58:14 | ForumUpdaterBot | New thread by Livingstone1337: Importing modules on Visual Studio Code, see https://forum.nim-lang.org/t/7597 |
07:58:34 | FromDiscord | <KnorrFG> and returning syms in an untypoed ast is no problem either? |
07:58:48 | FromDiscord | <haxscramper> `genSym` is not a symbol |
07:59:46 | FromDiscord | <haxscramper> well, not exactly |
07:59:54 | FromDiscord | <haxscramper> So no, this is not a problem |
08:00:43 | FromDiscord | <KnorrFG> but foo should not be replaced, foo should stay accessible for the user, there should only be a new unaccasseable symbol for the call without asignment |
08:01:51 | FromDiscord | <haxscramper> Then just `var seq[NimNode]` for list of identifiers that need to be forward declared |
08:02:24 | FromDiscord | <haxscramper> Or rather `var seq[tuple[name, initType: NimNode]]` |
08:02:59 | FromDiscord | <haxscramper> Because if you have anything other than `newRectangle` you would need to store initialization kind too |
08:03:21 | FromDiscord | <KnorrFG> well, they are always new`name` |
08:03:47 | FromDiscord | <KnorrFG> but I understand what you mean. Read as often as you want, byuut write only once |
08:04:14 | FromDiscord | <KnorrFG> (edit) "byuut" => "but" |
08:04:26 | FromDiscord | <KnorrFG> thanks |
08:42:02 | * | quantimnot quit (Ping timeout: 240 seconds) |
08:42:17 | FromDiscord | <hamidb80> https://media.discordapp.net/attachments/371759389889003532/819128010724081694/unknown.png |
09:07:56 | * | Tlangir quit (Remote host closed the connection) |
09:09:09 | * | teasea quit (Quit: teasea) |
09:11:15 | * | teasea joined #nim |
09:12:47 | * | ubert quit (Ping timeout: 260 seconds) |
09:36:52 | * | MarderIII joined #nim |
09:42:24 | ForumUpdaterBot | New thread by Icedquinn: RFC: recursive visitor macro, see https://forum.nim-lang.org/t/7598 |
10:00:00 | FromDiscord | <Yardanico> @hamidb80 https://en.wikipedia.org/wiki/With_great_power_comes_great_responsibility :) |
10:01:16 | FromDiscord | <Unaimend> o.O I though yoda first said that in star wars |
10:01:50 | FromDiscord | <ElegantBeef> Nah he said "Power great with responsibility comes" |
10:12:11 | FromDiscord | <Goel> sent a long message, see http://ix.io/2SkA |
10:19:29 | FromDiscord | <Araq> https://github.com/nim-lang/Nim/pull/17281/files are we all happy with "HoleyEnum"? |
10:22:02 | PMunch | Wait, we're getting enums with holes? |
10:22:03 | FromDiscord | <Rika> :👼 |
10:22:06 | FromDiscord | <Rika> (edit) ":👼" => "👼" |
10:22:27 | PMunch | Are we also getting labels pointing to the same value? |
10:22:42 | PMunch | HoleyEnum sounds a bit weird, but I don't have a better name |
10:23:29 | FromDiscord | <Rika> HoledEnum xd |
10:23:39 | FromDiscord | <dk> GapingEnum |
10:23:58 | PMunch | PittedEnum? |
10:24:09 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2SkE |
10:24:09 | FromDiscord | <Rika> CheeseEnum |
10:24:13 | FromDiscord | <haxscramper> By only changing GC options |
10:24:15 | PMunch | SwissEnum :P |
10:24:27 | FromDiscord | <Unaimend> xDD |
10:24:55 | FromDiscord | <mratsim> In reply to @Araq "https://github.com/nim-lang/Nim/pull/17281/files ar": Holey shit! |
10:25:00 | FromDiscord | <haxscramper> Is it related to some known bug? |
10:25:22 | FromDiscord | <haxscramper> Because this is what making pattern matching fail for orc/arc (https://github.com/nim-lang/fusion/issues/76) |
10:25:47 | FromDiscord | <haxscramper> And it is really strange that GC affects how VM runs in the first place |
10:26:00 | FromDiscord | <haxscramper> Or maybe some subtle difference in semantics that I'm not aware of |
10:26:17 | FromDiscord | <mratsim> enums with hole have a history of causing problems because large part of the code assumes that enums are ordinal which is not true if they have holes. |
10:26:20 | FromDiscord | <Araq> @haxscramper report it but I think a similar problem has been observed recently |
10:26:41 | FromDiscord | <flywind> https://github.com/nim-lang/Nim/issues/17199 |
10:27:08 | FromDiscord | <Araq> @mratsim we fixed the known bugs and enums with holes are here to stay, too much code depends on them, esp for C interop |
10:27:41 | FromDiscord | <Araq> "mind the gap enums" |
10:36:20 | * | Avatarfighter[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:25 | * | gollark[m]1 quit (Quit: Bridge terminating on SIGTERM) |
10:36:25 | * | unclechu quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | ShalokShalom[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | drbixx[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | Clonkk[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | Yardanico[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | nxnl[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | alex[m]28 quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | liblq-dev quit (Quit: Bridge terminating on SIGTERM) |
10:36:27 | * | headache quit (Quit: Bridge terminating on SIGTERM) |
10:36:29 | * | rwiser[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:29 | * | Benjamin[m]2 quit (Quit: Bridge terminating on SIGTERM) |
10:36:29 | * | Zoom[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:29 | * | BitPuffin quit (Quit: Bridge terminating on SIGTERM) |
10:36:30 | * | reversem3 quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | antholop[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | ee7[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | retroedgetech[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | Avahe[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | kaputse[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | MTRNord quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | stisa quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | vindaar[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | lnxw37d4 quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | watzon quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | k0mpjut0r quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | Stephen[m]2 quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | leorize[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | sekao[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | vegai1 quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | i_use_arch_btw[4 quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | j-james[m] quit (Quit: Bridge terminating on SIGTERM) |
10:36:49 | * | zazi[m] quit (Quit: Bridge terminating on SIGTERM) |
10:39:17 | FromDiscord | <Yardanico> does the {.pure.} pragma mean anything to enums nowadays? |
10:39:40 | FromDiscord | <Yardanico> https://nim-lang.org/docs/manual.html#pragmas-pure-pragma "An enum type can be marked as pure. Then access of its fields always requires full qualification." and this is also a bit outdated :P |
10:39:40 | FromDiscord | <hamidb80> Is seq compatible with vector, If i want to use nim with cpp,? |
10:39:53 | FromDiscord | <Yardanico> @hamidb80 define "compatible"? |
10:40:31 | FromDiscord | <Araq> @Yardanico I messed this up... |
10:40:57 | FromDiscord | <Araq> Pure enums can be accessed without the prefix unless it's ambiguous otherwise |
10:41:00 | FromDiscord | <Yardanico> I also read https://github.com/nim-lang/Nim/issues/8066 but didn't quite get what's the purpose of "pure" nowadays |
10:41:10 | FromDiscord | <Yardanico> @Araq is that different to normal enums? |
10:41:25 | FromDiscord | <Yardanico> ah right it is |
10:41:39 | FromDiscord | <Araq> yes and in subtle ways. It's also expensive for IC |
10:41:46 | FromDiscord | <Araq> needs dedicated code |
10:42:25 | FromDiscord | <Araq> my favorite solution is non-pure enums with UppercaseValue and without prefix |
10:42:45 | FromDiscord | <Araq> and to remove `.pure` altogether |
10:43:04 | FromDiscord | <Araq> but I cannot imagine this solution will get a majority |
10:45:29 | * | Vladar joined #nim |
10:48:40 | * | vegai1 joined #nim |
10:52:45 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SkM |
10:52:51 | FromDiscord | <Yardanico> (the compiler says "/home/dian/Things/Nim/lib/pure/asyncmacro.nim(262, 33) Error: cannot generate destructor for generic type: seq[tuple[key: int64, val: ObjectTable]]") |
10:54:28 | * | ubert joined #nim |
11:01:08 | FromDiscord | <Yardanico> oh that wasn't so hard |
11:01:15 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SkR |
11:14:47 | m4r35n357 | Just a _little bit_ of fun with Inim and dual numbers . . . https://pastebin.com/qwhcndX9, if you want to play dual.nim looks like this . . . https://pastebin.com/0RH5u0W0 |
11:15:37 | FromDiscord | <Gary M> how do I get the numeric limit of a uint64 in code? |
11:15:57 | FromDiscord | <Yardanico> high(uint64) |
11:16:02 | FromDiscord | <Yardanico> !eval echo high(uint64) |
11:16:04 | NimBot | 18446744073709551615 |
11:17:13 | FromDiscord | <Gary M> thanks |
11:33:27 | * | antholop[m] joined #nim |
11:33:27 | * | GitterIntegratio joined #nim |
11:33:27 | * | Avatarfighter[m] joined #nim |
11:33:27 | * | Benjamin[m]2 joined #nim |
11:33:28 | * | BitPuffin joined #nim |
11:33:28 | * | stisa joined #nim |
11:33:28 | * | reversem3 joined #nim |
11:33:28 | * | leorize[m] joined #nim |
11:33:28 | * | vindaar[m] joined #nim |
11:33:28 | * | k0mpjut0r joined #nim |
11:33:28 | * | liblq-dev joined #nim |
11:33:28 | * | kaputse[m] joined #nim |
11:33:28 | * | i_use_arch_btw[4 joined #nim |
11:33:28 | * | unclechu joined #nim |
11:33:28 | * | Avahe[m] joined #nim |
11:33:29 | * | lnxw37d4 joined #nim |
11:33:29 | * | gollark[m] joined #nim |
11:33:29 | * | watzon joined #nim |
11:33:29 | * | j-james[m] joined #nim |
11:33:29 | * | MTRNord joined #nim |
11:33:29 | * | headache joined #nim |
11:33:34 | * | rwiser[m] joined #nim |
11:33:34 | * | Clonkk[m] joined #nim |
11:33:34 | * | drbixx[m] joined #nim |
11:33:35 | * | Stephen[m]1 joined #nim |
11:33:35 | * | sekao[m] joined #nim |
11:33:35 | * | nxnl[m] joined #nim |
11:33:35 | * | retroedgetech[m] joined #nim |
11:33:35 | * | zazi[m] joined #nim |
11:33:35 | * | ShalokShalom[m] joined #nim |
11:33:35 | * | Yardanico[m] joined #nim |
11:33:53 | * | alex[m]21 joined #nim |
11:34:04 | * | ee7[m] joined #nim |
11:34:39 | * | Zoom[m] joined #nim |
11:35:14 | * | tane joined #nim |
11:37:14 | PMunch | @Gary M, you can of course do uint64.high as well |
11:42:06 | FromDiscord | <Yardanico> no you should do `u_I_n_T_6_4.h_I_G_H()` |
11:42:12 | FromDiscord | <Yardanico> !eval echo u_I_n_T_6_4.h_I_G_H() |
11:42:14 | NimBot | 18446744073709551615 |
11:45:38 | * | lritter quit (Ping timeout: 260 seconds) |
11:47:54 | FromDiscord | <mratsim> This is a bannable offence |
11:56:07 | PMunch | Anyone know what might be causing this? https://github.com/PMunch/nimlsp/issues/74 |
11:56:08 | FromDiscord | <Zachary Carter> what is? |
11:56:39 | PMunch | @Zachary Carter, what is a bannable offence? I think he was referring to what Yardanico said :P |
11:57:08 | FromDiscord | <Zachary Carter> oh haha |
11:57:30 | PMunch | mratsim, have you run into this before? |
12:06:33 | FromDiscord | <Yardanico> @PMunch as far as I know mratsim doesn't use nimsuggest at all |
12:06:39 | FromDiscord | <Yardanico> one of the reasons being that it doesn't work with weave :) |
12:06:53 | * | krux02 joined #nim |
12:06:57 | PMunch | Ah |
12:07:26 | PMunch | Well I was more thinking if he had run into the compiler crashing with that error before |
12:07:42 | FromDiscord | <Yardanico> well it's an error from the nimsuggest |
12:07:47 | FromDiscord | <Yardanico> nim compiler works for weave |
12:12:55 | PMunch | Yeah obviously, but if he's using any kind of nimsuggest based plug-in he should have the same issue |
12:24:42 | FromDiscord | <mratsim> In reply to @Zachary Carter "what is?": > !eval echo u_I_n_T_6_4.h_I_G_H() |
12:25:16 | FromDiscord | <Yardanico> <https://github.com/Yardanico/nuglifier> at its finest |
12:25:53 | FromDiscord | <mratsim> In reply to @PMunch "<@570268431522201601>, have you run": I don't use nimlsp, and now I don't use nimsuggest :p |
12:26:38 | FromDiscord | <mratsim> Weave does work with nimsuggest last time I tried it. It does send it at 100% CPU reliably but it works until then. |
12:26:59 | FromDiscord | <mratsim> making Nimsuggest crash instead of burning CPU would be better in my book |
12:30:33 | PMunch | Hmm, interesting. I wonder if the bug is related, or if it is something completely different |
12:35:57 | * | vsantana quit (Quit: vsantana) |
12:38:41 | * | vsantana joined #nim |
12:41:20 | FromDiscord | <konsumlamm> i wonder, why is `with` not part of `sugar`? |
12:43:24 | FromDiscord | <mratsim> there are a couple of single proc modules besides with |
12:43:34 | FromDiscord | <haxscramper> enumerate |
12:43:34 | FromDiscord | <mratsim> std/enumerate and std/decls come to mind |
12:43:38 | FromDiscord | <haxscramper> fusion/pointers |
12:44:36 | FromDiscord | <Yardanico> @mratsim yeah I'm not really a fan of that :P |
12:44:53 | FromDiscord | <Yardanico> we have too much separate stdlib modules, a lot of them aren't even documented in the stdlib index |
12:47:25 | FromDiscord | <konsumlamm> ye, `enumerate` too... |
12:47:33 | FromDiscord | <konsumlamm> In reply to @Yardanico "we have too much": this |
12:48:52 | FromDiscord | <konsumlamm> though is there any particular readon those werem't included in std/sugar in the first place? perhaps it didn't exist back then? or was it just an oversight? |
12:49:13 | FromDiscord | <konsumlamm> (edit) "readon" => "reason" | "werem't" => "weren't" |
12:49:21 | FromDiscord | <Yardanico> well some people prefer more separation :) |
12:49:53 | FromDiscord | <mratsim> sugar is older than 1.0 |
12:49:57 | FromDiscord | <Yardanico> yeah |
12:50:35 | FromDiscord | <Solitude> In reply to @konsumlamm "though is there any": the fact that things were put in sugar feel like legacy, because before it was called `future`, so it was like testing ground |
12:50:56 | FromDiscord | <konsumlamm> In reply to @Yardanico "well some people prefer": separation for a single macro that would fit perfectly in sugar? not a very convincing reason tbh |
12:51:16 | FromDiscord | <konsumlamm> In reply to @Solitude "the fact that things": that actually makes sense |
12:51:32 | FromDiscord | <Yardanico> @Solitude but enumerate was made after future became sugar |
12:51:44 | FromDiscord | <mratsim> and `with` too |
12:51:46 | FromDiscord | <Yardanico> much later |
12:51:48 | FromDiscord | <mratsim> and `decls` too |
12:51:51 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/pull/15297 |
12:51:57 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/819190836217905212/unknown.png |
12:51:57 | FromDiscord | <Yardanico> 🤔 |
12:52:07 | FromDiscord | <konsumlamm> enumerate was added in 1.5, so it's not too late to change that, right? |
12:52:16 | FromDiscord | <Yardanico> it's late |
12:52:21 | FromDiscord | <mratsim> well it's the first commit for the years to come 😉 |
12:52:36 | FromDiscord | <Solitude> yes, im implying that these thing were supposed to be separate modules, and the only reason why sugar is a module with mupltiple helpers is because of `future` legacy |
12:52:46 | FromDiscord | <mratsim> it's supposed to replace the `pairs` in std/iterators |
12:52:49 | FromDiscord | <Yardanico> @konsumlamm 1.4 got released in october |
12:52:53 | FromDiscord | <Yardanico> after enumerate |
12:53:00 | FromDiscord | <konsumlamm> ah |
12:53:06 | FromDiscord | <mratsim> sugar is for syntax sugar modules |
12:53:10 | FromDiscord | <Yardanico> you can always verify that with https://nim-lang.org/1.4.0/enumerate.html |
12:53:14 | FromDiscord | <flywind> It was added to `std/sugar` first and then moved to`std/enumerate`. |
12:53:20 | FromDiscord | <konsumlamm> perhaps i assumed it was added in 1.4 because it isn't linked |
12:53:27 | FromDiscord | <flywind> `std/enumerate` can grow too. |
12:53:41 | FromDiscord | <Yardanico> (old hosted nim docs go as back as https://nim-lang.org/0.11.0/manual.html) |
12:53:47 | FromDiscord | <Yardanico> (edit) "(old hosted nim docs go as ... back" added "far" |
12:54:01 | FromDiscord | <Yardanico> https://nim-lang.org/0.11.0/ |
12:54:04 | FromDiscord | <Yardanico> even the old website :P |
12:54:07 | FromDiscord | <konsumlamm> In reply to @mratsim "sugar is for syntax": it is basically sugar though, for having an explicit counter or something comparable |
12:54:09 | FromDiscord | <Yardanico> (I secretly liked it more) |
12:54:16 | FromDiscord | <mratsim> In reply to @konsumlamm "it is basically sugar": I agree |
12:54:45 | FromDiscord | <mratsim> enumerate was actually written to show how easy it is to use macros to provide syntax sugar |
12:54:49 | FromDiscord | <mratsim> and remove pairs |
12:55:28 | FromDiscord | <konsumlamm> same with `with`, it's just sugar |
12:55:58 | FromDiscord | <konsumlamm> btw, the docs website dpesn't work well on mobile, the left part is cut off |
12:56:13 | FromDiscord | <Solitude> and `strformat` is just sugar for concatenation |
12:56:28 | FromDiscord | <konsumlamm> strofrmat more deserves it's own module imo |
12:56:32 | FromDiscord | <Solitude> this module splitting means almost nothing |
12:56:38 | FromDiscord | <konsumlamm> it's more than just a single macro |
12:56:49 | FromDiscord | <Yardanico> shall we talk about all the js modules? :) |
12:56:55 | FromDiscord | <Solitude> no |
12:57:02 | FromDiscord | <Yardanico> https://media.discordapp.net/attachments/371759389889003532/819192119323263026/unknown.png |
12:57:08 | FromDiscord | <Yardanico> (ignore the bottom one) |
12:57:16 | FromDiscord | <Solitude> they are just sugar for emit |
12:57:27 | FromDiscord | <Yardanico> and also https://media.discordapp.net/attachments/371759389889003532/819192223357730846/unknown.png |
12:57:28 | FromDiscord | <Yardanico> those too |
12:57:46 | FromDiscord | <konsumlamm> i'd prefer having a js namespace and then have js/core, js/bigints, etc. |
12:58:00 | FromDiscord | <konsumlamm> but 4raq doesn't like that |
12:59:34 | FromDiscord | <Yardanico> it's just that quite a lot of stdlib modules are not documented in the lib index, maybe it's better to employ some automatic generation for that index? :P |
12:59:45 | FromDiscord | <Yardanico> check https://github.com/nim-lang/Nim/tree/devel/lib/std and https://nim-lang.github.io/Nim/lib.html and compare :D |
13:01:56 | * | leorize quit (Remote host closed the connection) |
13:02:24 | * | leorize joined #nim |
13:10:59 | FromDiscord | <Yardanico> huh, didn't know we had https://github.com/nim-lang/Nim/blob/devel/lib/std/stackframes.nim either |
13:11:40 | FromDiscord | <konsumlamm> for half of those, i'm not sure wether they're supposed to be internal or not |
13:12:05 | FromDiscord | <Yardanico> they're all not internal |
13:12:16 | FromDiscord | <Yardanico> there's the private dir for private ones |
13:12:44 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/std/private/gitutils.nim gitutils has a backoff template :D |
13:12:51 | ForumUpdaterBot | New thread by Drkameleon: Create proc/template that takes 2 blocks of code, see https://forum.nim-lang.org/t/7599 |
13:30:17 | FromDiscord | <Seedofarson> nim on top |
13:30:18 | FromDiscord | <Seedofarson> bro |
13:30:31 | FromDiscord | <Seedofarson> but I just saw something that confuses me |
13:31:39 | FromDiscord | <Yardanico> so can you ask the question? |
13:32:04 | FromDiscord | <Seedofarson> JS |
13:32:11 | FromDiscord | <Seedofarson> I knew you could transpile to C |
13:32:15 | FromDiscord | <Seedofarson> (edit) "C" => "C/C++" |
13:32:39 | FromDiscord | <Yardanico> yeah that's called compilation (but whatever), but what's your question? |
13:32:55 | FromDiscord | <Yardanico> compiling to JS in Nim is mainly intended for front-end |
13:32:58 | FromDiscord | <Seedofarson> (edit) "transpile" => "compile" |
13:33:01 | FromDiscord | <Seedofarson> yeah |
13:33:02 | FromDiscord | <Yardanico> E.g. https://forum.nim-lang.org/ has both frontend and backend in Nim |
13:33:10 | FromDiscord | <Seedofarson> isn't JS for a totally different thing? |
13:34:09 | FromDiscord | <Yardanico> ? |
13:34:17 | FromDiscord | <Yardanico> sorry, didn't understand your question |
13:34:25 | FromDiscord | <Yardanico> nim has a separate backend for JS, it doesn't use the same as for C/C++ of course |
13:34:50 | FromDiscord | <Seedofarson> nim has the ability to compile to JS, but why? is the nim website actually written in nim!? |
13:35:00 | FromDiscord | <Seedofarson> (edit) removed "actually" |
13:35:05 | FromDiscord | <Yardanico> as I said, so you can develop website front-ends in Nim |
13:35:24 | FromDiscord | <Yardanico> forum.nim-lang.org has the frontend implemented in Nim as well |
13:36:32 | FromDiscord | <Seedofarson> sorry for the noob questions! |
13:36:40 | FromDiscord | <Seedofarson> still learning about all of htis |
13:36:42 | FromDiscord | <Seedofarson> (edit) "htis" => "this" |
13:36:46 | FromDiscord | <Rika> why? its hard to answer that |
13:36:59 | FromDiscord | <Seedofarson> but, that really cool! The frontend of a website in nim! |
13:37:19 | FromDiscord | <Seedofarson> then, do you think a webapp would be possible in nim? |
13:39:17 | * | waleee-cl joined #nim |
13:41:42 | FromDiscord | <Goel> https://resizeimage.net/mypic/mZUudPUe9Z4XMa2n/IYgF5/screenshot-from-2021-03-10-14-.png↵How do i add it to my PATH? I need to change the word ".profile" with my User or my Home? |
13:41:55 | FromDiscord | <Goel> (edit) "I need" => "Do ineed" |
13:42:03 | FromDiscord | <Goel> (edit) "ineed" => "i need" |
13:42:30 | FromDiscord | <Yardanico> as it says, add it to your ~/.profile or ~/.bashrc |
13:42:36 | FromDiscord | <Yardanico> those are text files, not dirs |
13:43:10 | FromDiscord | <Goel> But where is this ~/.profile folder? |
13:43:19 | FromDiscord | <Yardanico> it's not a folder |
13:43:42 | FromDiscord | <Goel> I mean in which folder is this file i need to modify for the PATH |
13:43:46 | FromDiscord | <Yardanico> It's just a text file, and ~ (tilda) in nix means "home dir" |
13:43:49 | FromDiscord | <Yardanico> you already have the full path |
13:43:57 | FromDiscord | <Yardanico> ~/.profile expands to "/home/youruser/.profile" automatically |
13:44:11 | FromDiscord | <Yardanico> so just use something like `nano ~/.profile` or other text editor of your choice |
13:44:29 | FromDiscord | <Yardanico> and if that file doesn't exist, just create it |
13:45:25 | FromDiscord | <Goel> I just checked i dont have that file in my home or root direct |
13:45:32 | FromDiscord | <Yardanico> create it. |
13:45:33 | FromDiscord | <Solitude> > and if that file doesn't exist, just create it |
13:45:41 | FromDiscord | <Rika> or maybe its not shown |
13:45:43 | FromDiscord | <Goel> Is this? .bash_profile |
13:45:49 | FromDiscord | <Solitude> .profile |
13:45:53 | FromDiscord | <Rika> a file starting with a dot is hidden |
13:46:22 | FromDiscord | <Rika> just make the `.profile` file if you cant find it |
13:47:14 | FromDiscord | <Goel> Oh ok i dont have the .profile but i have .bashrc |
13:47:58 | FromDiscord | <dk> just type `vim ~/.profile` |
13:48:56 | FromDiscord | <Solitude> `echo "export PATH=$HOME/.nimble/bin:$PATH" >> ~/.profile` |
14:02:41 | giaco_ | I wrote my first real nim program to be deployed on server to replace old tool. It is quite simple really and it works nicely, but surprisingly it ended up with a size of 1.3MB using --gc:arc, -d:release and -d:ssl |
14:03:27 | FromDiscord | <Yardanico> did you strip it? :P |
14:03:52 | FromDiscord | <Yardanico> also that big size might be because of some stdlib/other module adding a lot of stuff |
14:03:56 | FromDiscord | <Yardanico> I really can't say much without the code |
14:04:42 | giaco_ | Yardanico: is just a ~200 line program that does just some string fiddling with incoming udp packets, here's the imports |
14:04:54 | FromDiscord | <Yardanico> then 1.3mb is surely a big size] |
14:04:55 | FromDiscord | <Yardanico> (edit) "size]" => "size" |
14:05:09 | giaco_ | std/[sugar,net,asyncdispatch,asyncnet,strutils,strformat,httpclient,times] , binarylang, bitstreams |
14:05:34 | FromDiscord | <Yardanico> maybe it's binarylang and binstreams that make the binary size much larger? |
14:05:43 | FromDiscord | <Yardanico> anyway, try to do "strip -s binary" |
14:05:46 | FromDiscord | <Yardanico> and check binary size again |
14:06:39 | giaco_ | this is binarylang: https://github.com/sealmove/binarylang/blob/main/binarylang.nim , and bitstream is part of it |
14:07:05 | FromDiscord | <Yardanico> yeah I know |
14:07:24 | FromDiscord | <Yardanico> so what's the size after stripping? |
14:07:35 | FromDiscord | <Yardanico> and also, maybe you embed a lot of stuff in `const`s ? |
14:07:45 | giaco_ | 1.1MB |
14:08:11 | giaco_ | just a array[256, uint16] |
14:08:39 | FromDiscord | <Yardanico> then I'm sorry, don't have any ideas without checking the actual src :P |
14:09:34 | narimiran | wild guess: maybe some `const` that shouldn't be? :) |
14:10:17 | giaco_ | I have just 2 consts in my program, an int and an array[256, uint16] |
14:10:35 | giaco_ | anctually 2 ints and an array[256, uint16] |
14:10:55 | narimiran | (only now i see that @Yardanico already went in that direction) |
14:10:59 | FromDiscord | <Yardanico> well, as I said the size might come from binarylang |
14:11:06 | giaco_ | maybe binarylang, yeah |
14:11:14 | FromDiscord | <Yardanico> can you share the definition for binarylang? |
14:11:15 | giaco_ | I should ask SealMove |
14:11:18 | FromDiscord | <Yardanico> of the parser thing |
14:12:19 | * | xet7 quit (Quit: Leaving) |
14:12:40 | giaco_ | parser is parsing 42 strings for a total of 140 chars, so on average 3 chars long string |
14:13:13 | FromDiscord | <Yardanico> I just meant the definition for binarylang itself, but okay :P |
14:13:50 | giaco_ | I already pasted it |
14:14:04 | giaco_ | and you said "yeah I know" |
14:14:17 | FromDiscord | <Yardanico> sorry if I wasn't clear, I meant the parser definition for binarylang, not the lib itself |
14:14:26 | FromDiscord | <Yardanico> but I just checked a test from binarylang and it doesn't seem to inflate binary size that much |
14:14:33 | FromDiscord | <Yardanico> so yeah, I'm clueless without the complete source code, sorry |
14:14:55 | giaco_ | and this is bitstreams: https://github.com/sealmove/bitstreams/blob/main/bitstreams.nim |
14:15:12 | FromDiscord | <Yardanico> just to check - you use -d:release on the command line and not in nim.cfg/config.nims right? |
14:15:36 | giaco_ | I wrote a myprogram.nim.cfg file next to myprogram.nim |
14:15:45 | FromDiscord | <Yardanico> yeah, -d:release doesn't work when put in a config file |
14:15:52 | FromDiscord | <Yardanico> it'll display "release build" but it's not gonna be applied |
14:16:00 | FromDiscord | <Yardanico> you have to provide it on the actual command line |
14:16:13 | FromDiscord | <Yardanico> see https://github.com/nim-lang/Nim/issues/14272 |
14:17:39 | FromDiscord | <Yardanico> so what's the binary size now? :P |
14:17:56 | FromDiscord | <Yardanico> you can also try -d:danger if you want (although that disables all runtime checks, so if those are important for your program you should continue using -d:release) |
14:18:40 | giaco_ | wait a second I did a silly copy paste move and now it doesn't compile anymore lol, let me fix this |
14:20:35 | FromDiscord | <dom96> 1.3mb is big now? |
14:20:47 | FromDiscord | <Yardanico> It's big for a small CLI tool :) |
14:20:51 | FromDiscord | <mratsim> Aren't you the one running Nim on embedded? |
14:20:59 | FromDiscord | <Yardanico> and as you can see we found the root cause which was the -d:release |
14:21:24 | FromDiscord | <Yardanico> It's honestly quite bad that new Nim users can stumble upon this and they won't have a clue that it's not being applied (except slow speed and big binaries) |
14:21:35 | giaco_ | not running on embedeed now, x86 ubuntu here |
14:22:00 | FromDiscord | <Yardanico> mratsim was replying to dom |
14:22:06 | giaco_ | please be patient I'm struggling finding what I've done with my silly copypaste move :P |
14:22:10 | FromDiscord | <Yardanico> hehe |
14:23:32 | FromDiscord | <dom96> for embedded it's big |
14:23:40 | FromDiscord | <dom96> for anything else, why worry about it? |
14:23:55 | FromDiscord | <Yardanico> you can apply same logic to performance |
14:24:06 | FromDiscord | <Yardanico> "why nim when you can just use js, why worry about performance?" |
14:24:08 | * | zielmicha__ quit () |
14:24:22 | * | zielmicha__ joined #nim |
14:24:27 | FromDiscord | <Yardanico> If it doesn't take a lot of time, I don't see why caring about binary size is bad |
14:24:27 | giaco_ | yeah I'm not worried about size, just it smells strange to see 1.3M on this simple program, so I'm just puzzled |
14:25:10 | FromDiscord | <dom96> In reply to @Yardanico ""why nim when you": js is actually pretty fast nowadays lol |
14:25:20 | FromDiscord | <dom96> and yes, lots of people make that judgement |
14:26:23 | giaco_ | with -d:release is 673KB, with -d:danger is 610KB, now it looks correct |
14:26:46 | FromDiscord | <Yardanico> and now you're actually running a release build and not a slow debug one :) |
14:26:54 | giaco_ | well I didn't know that .cfg files were ignoring -d:release |
14:27:08 | FromDiscord | <dom96> yeah, that's an annoying gotcha |
14:27:22 | FromDiscord | <dom96> the Nim compiler outputs the mode it's compiling in though |
14:27:44 | FromDiscord | <Yardanico> it'll output release if you have -d:release in nim.cfg |
14:28:33 | giaco_ | should I rely on makefiles or bash to compile single nim project? Don't want to change global nim.cfg, I want all info to stay in project folder |
14:28:46 | FromDiscord | <Yardanico> you can also use nimble + nimble tasks |
14:30:12 | FromDiscord | <dom96> just create a task in your .nimble file |
14:30:55 | giaco_ | I should probably learn how to nimble properly (how cool is saying this to the inventor?) |
14:31:12 | idf | very |
14:31:55 | FromDiscord | <dom96> haha 🙂 |
14:32:55 | FromDiscord | <VinKer> Hi, what tool is you guys are using to debug your nim code ? |
14:33:15 | FromDiscord | <Yardanico> main answer would be `echo` |
14:33:18 | idf | echo |
14:33:20 | idf | wtf |
14:33:28 | FromDiscord | <VinKer> @Yardanico Ha ha |
14:33:38 | FromDiscord | <dom96> That is actually a serious answer lol |
14:33:51 | FromDiscord | <VinKer> I know |
14:33:56 | FromDiscord | <haxscramper> I never used debugger in the last 2? years I guess |
14:34:07 | FromDiscord | <haxscramper> Basically when I switched from C++ to nim |
14:34:27 | FromDiscord | <haxscramper> never had to |
14:34:43 | FromDiscord | <VinKer> But what if the conditional debugging like visual studio ? |
14:35:01 | FromDiscord | <VinKer> I mean breaking 2nd hit of a loop |
14:35:19 | FromDiscord | <Yardanico> you can use traditional gdb/lldb with nim of course |
14:35:25 | FromDiscord | <haxscramper> Yeah, but if I try to debug the kind of code I write usually, I will just melt my brain on debugger |
14:35:28 | FromDiscord | <Yardanico> there are also scripts that help to ease access to some stuff |
14:35:48 | FromDiscord | <VinKer> @Yardanico Let me check. |
14:35:50 | FromDiscord | <Yardanico> https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py |
14:35:57 | FromDiscord | <haxscramper> I think last time I tried to debug a series of mutually recursive functions for AST traversal it ended badly |
14:35:58 | FromDiscord | <Seedofarson> on top |
14:36:37 | FromDiscord | <Yardanico> also https://www.reddit.com/r/nim/comments/lhaaa6/debugging_support_formatters_for_lldb_in_vscode/ for lldb |
14:36:52 | FromDiscord | <Yardanico> Also there's https://github.com/hediet/vscode-debug-visualizer/ which can be useful sometimes |
14:37:06 | FromDiscord | <Yardanico> I contributed a small nim demo to it https://github.com/hediet/vscode-debug-visualizer/tree/master/demos/nim |
14:38:13 | FromDiscord | <Yardanico> the concept is quite simple - you use a debugger to get the JSON value from a string, and the extension uses that JSON to visualize stuff |
14:38:33 | FromDiscord | <Yardanico> so all you need in your program is to have a variable that will contain this json content, and update it accordingly |
14:39:09 | FromDiscord | <VinKer> @Yardanico thanks for the answer. Let me check |
14:39:39 | FromDiscord | <Yardanico> I think that it's more for debugging the data modifications and not the code flow itself |
14:42:43 | FromDiscord | <Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2SlF |
14:42:48 | FromDiscord | <Seedofarson> with benchmarking |
14:42:53 | FromDiscord | <Seedofarson> I think |
14:49:03 | ForumUpdaterBot | New thread by Livingstone1337: Is there a module for nim that acts like matplotlib?, see https://forum.nim-lang.org/t/7600 |
14:53:40 | m4r35n357 | Quick question, is there a floating point abs() function, I couldn't find one in the math docs, so just used a "ternary" when I wanted one. Now I have got my stuff working I have become curious again . . . |
14:54:33 | FromDiscord | <haxscramper> https://nim-lang.org/docs/system.html#abs%2Cfloat64 |
14:55:26 | m4r35n357 | haxscramper, thanks, not sure if I ever would have found that, why is it in system? |
14:55:47 | haxscramper | Because it is used commonly enough? |
14:56:05 | m4r35n357 | hmmm, not convinced ;) |
14:56:24 | haxscramper | Can std/macrocache be used to avoid re-running whole macro if AST is unchanged between compilations, or it is only for 'macros that need to collect compile time information across module boundaries in global variables'? And will it work for `nnkSym` nodes (i.e. `typed` parameters). |
14:57:47 | haxscramper | And is there a way (or plans) to add support for custom data types stored in the macrocache? Because a lot of time might be spent parsing AST into some internal structure |
15:06:08 | * | drsensor joined #nim |
15:08:53 | * | xet7 joined #nim |
15:10:12 | FromDiscord | <dom96> In reply to @Seedofarson "```nim import times import": CPU time is not the right metric to track there, you're doing IO |
15:10:25 | FromDiscord | <Seedofarson> what do I track then? |
15:10:34 | * | drsensor is now known as dr_sensor |
15:10:38 | FromDiscord | <dom96> use `epochTime` |
15:10:48 | FromDiscord | <dom96> (or one of the more high resolution timers if you want) |
15:10:51 | FromDiscord | <Seedofarson> epochTime() |
15:10:54 | FromDiscord | <Seedofarson> ok |
15:10:55 | FromDiscord | <Seedofarson> ty! |
15:11:16 | FromDiscord | <mratsim> even for CPu tasks, cpuTime is the wrong thing to track. |
15:11:23 | FromDiscord | <mratsim> (edit) "CPu" => "CPU" |
15:11:33 | FromDiscord | <mratsim> CPU time has absolutely no use-case. |
15:11:54 | FromDiscord | <Yardanico> @dom96 what about monotimes? |
15:12:03 | FromDiscord | <dom96> In reply to @Yardanico "<@!132595483838251008> what about monotimes?": sure? |
15:13:50 | FromDiscord | <Yardanico> https://nim-lang.org/blog/2021/03/10/fusion-and-pattern-matching.html |
15:14:00 | * | dr_sensor is now known as drsensor |
15:14:10 | FromDiscord | <Yardanico> (sorry miran :D) |
15:14:16 | FromDiscord | <Yardanico> github notifications are fast :) |
15:15:53 | FromDiscord | <haxscramper> well finally |
15:16:25 | FromDiscord | <haxscramper> Getting ready to read comparisons with python pattern matching |
15:16:37 | FromDiscord | <Yardanico> yours is much better :) |
15:17:22 | FromDiscord | <haxscramper> yeah, though I have already come up with pretty decent response anyway |
15:17:57 | FromDiscord | <haxscramper> That manages to simultaneously admit all my screw-ups (if any) and still promote nim over python |
15:19:00 | FromDiscord | <konsumlamm> is it too late to fix grammar issues? :p |
15:19:17 | FromDiscord | <Yardanico> no, you can always make a PR |
15:19:25 | FromDiscord | <Yardanico> and yeah, I've noticed some :P |
15:22:21 | FromDiscord | <konsumlamm> time for some PRs xd |
15:23:19 | FromDiscord | <Yardanico> @haxscramper in `[any in (2 .. 10)] := [1, 2, 3]` the result is discarded? |
15:23:27 | FromDiscord | <Yardanico> or maybe I didn't understand the meaning of this example |
15:24:06 | Prestige | what is that syntax |
15:24:16 | FromDiscord | <Yardanico> pattern matching |
15:24:23 | FromDiscord | <Yardanico> have a read of the blog post and https://nim-lang.github.io/fusion/src/fusion/matching.html |
15:25:46 | FromDiscord | <haxscramper> In reply to @Yardanico "<@!608382355454951435> in `[any in": No, there is no result, I just check that any of the `[1,2,3]` is in `2 ..10` |
15:25:48 | FromDiscord | <haxscramper> (edit) "..10`" => ".. 10`" |
15:26:04 | FromDiscord | <haxscramper> `:=` is `assertMatch` |
15:26:13 | FromDiscord | <haxscramper> `?=` is `matches` |
15:26:21 | * | johannes quit (Ping timeout: 264 seconds) |
15:28:04 | giaco_ | what is strip -s doing on a binary compiled with -d:danger? It is reducing its size quite a lot |
15:29:15 | FromDiscord | <konsumlamm> it reduces debug (and more) symbols |
15:29:24 | FromDiscord | <konsumlamm> aka deletes them |
15:30:17 | giaco_ | doesn't -d:danger imply -d:release, and so no debug? |
15:30:23 | FromDiscord | <Yardanico> -d:danger implies release, yes |
15:30:28 | FromDiscord | <Yardanico> but debug symbols are a different kind of thing |
15:32:29 | FromDiscord | <dom96> pygments having trouble with that code hah |
15:34:11 | FromDiscord | <haxscramper> Only `_.startsWith("systemd"), .._]` |
15:34:23 | FromDiscord | <haxscramper> and `_<something-else>` |
15:35:00 | FromDiscord | <dom96> awesome that it just works (tm) with JSON |
15:36:29 | FromDiscord | <haxscramper> The hardest part was type inference |
15:36:43 | FromDiscord | <haxscramper> `@a | "int"` will make it `Option[]` for `a` |
15:37:02 | FromDiscord | <haxscramper> But `@a | (@a, "int")` gives just `T` |
15:38:12 | FromDiscord | <haxscramper> Everything else is relatively easy, though it probably has the most cursed proc signature I've ever written |
15:38:19 | FromDiscord | <haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Sm9 |
15:51:49 | FromDiscord | <Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Sma |
15:51:49 | FromDiscord | <Yardanico> matching string length |
15:52:06 | FromDiscord | <Yardanico> (I know it's quite pointless since it can be easily replaced with ifs but still) |
15:52:20 | FromDiscord | <Yardanico> right now it says `Error: cannot generate VM code for len` |
15:56:36 | FromDiscord | <haxscramper> sent a code paste, see https://paste.rs/yrd |
15:56:42 | FromDiscord | <Yardanico> ah right |
15:56:59 | FromDiscord | <haxscramper> And `[len: > 5]` is malformed |
15:57:04 | FromDiscord | <haxscramper> DSL |
15:57:14 | FromDiscord | <Yardanico> what if you offer a `match` overload (IIRC it was used before?) in addition to `case`? |
15:57:29 | FromDiscord | <Yardanico> I think some people might prefer that so it's clear to differentiate between `case` and pattern matching |
15:59:02 | FromDiscord | <haxscramper> That's not my problem to be honest, someone in https://github.com/nim-lang/RFCs/issues/332 will decide whatever, but I don't really care |
15:59:48 | FromDiscord | <haxscramper> That's the only `match` overload that I've seen intended for common use (because it was/still is 'experiemental' feature) |
16:03:11 | ForumUpdaterBot | New thread by Livingstone1337: Are sequences the nim equivalent of python lists?, see https://forum.nim-lang.org/t/7601 |
16:04:26 | * | vicfred joined #nim |
16:31:23 | FromDiscord | <konsumlamm> @haxscramper very nice article! |
16:33:35 | * | PMunch quit (Quit: leaving) |
16:38:50 | * | fputs joined #nim |
16:47:19 | FromDiscord | <mratsim> @haxscramper trail -> tail |
16:57:54 | * | rockcavera joined #nim |
17:00:58 | FromDiscord | <dom96> In reply to @haxscramper "That's not my problem": in other words, PRs welcome @Yardanico 😄 |
17:01:29 | FromDiscord | <haxscramper> No, I don't think that's even a "PR" problem |
17:01:51 | FromDiscord | <haxscramper> 332 is not even accepted, and I think it is a language design issue |
17:02:36 | FromDiscord | <haxscramper> Designing framework to address all of these requirements at once is out of the fusion scope |
17:08:49 | FromDiscord | <รєคɭ๓๏שє> hey guys, is there a dissassemble nim API? |
17:09:19 | FromDiscord | <รєคɭ๓๏שє> I extract sections from PE files and want to dissassemble them (for example .rdata .text etc) |
17:09:59 | FromDiscord | <รєคɭ๓๏שє> if it works for x86 / 64 it's enough |
17:11:50 | leorize | haxscramper: nice blogpost :) |
17:12:25 | leorize | anyone posted it on HN yet? |
17:13:35 | ForumUpdaterBot | New post on r/nim by XxDiCaprioxX: Is there any development related to this?, see https://reddit.com/r/nim/comments/m22k7b/is_there_any_development_related_to_this/ |
17:14:37 | FromDiscord | <Hi02Hi> In reply to @รєคɭ๓๏שє "hey guys, is there": if you mean generate assembly, you can compile with `--asm` |
17:14:59 | FromDiscord | <haxscramper> And you can use radare bindings, or make one if there is none already |
17:15:12 | FromDiscord | <รєคɭ๓๏שє> what do you mean `--asm`? basically i have a `seq[byte]` with the machine code |
17:15:27 | FromDiscord | <รєคɭ๓๏שє> and I want to turn it into assembly programmatically |
17:17:30 | saem | For those curious, I use debugging with vscode and conditional breakpoints at least once a week. Overall debugging on the compiler works pretty well with gdb. I'm itching to make some more improvements so variants and sets are rendered better too when looking at AST. |
17:19:28 | leorize | sealmove: libbfd can probably perform disassembly, but there are no nim bindings that I know of |
17:19:31 | FromDiscord | <รєคɭ๓๏שє> similar to this https://github.com/zyantific/zydis |
17:20:08 | FromDiscord | <รєคɭ๓๏שє> In reply to @leorize "sealmove: libbfd can probably": ah ok, so I'll probably need to make my own bindings |
17:20:46 | FromDiscord | <queersorceress> @saem could you explain/detail your setup in vscode for getting gdb to work? i use to have a working setup but since updating nim to 1.4 i haven't been able to get my debugger to resolve symbols from my code. |
17:21:29 | FromDiscord | <queersorceress> granted, i use llvm (clang and lldb) instead of gnu compiler and debugger, but the setup should be the same for the most part. |
17:21:36 | reversem3 | how can I parse out now() for format yyyy-dd-mm ,I tried to use split (':') and it didn't work |
17:21:48 | reversem3 | sorry now() is from times library |
17:21:56 | reversem3 | let current_date = now() |
17:22:08 | reversem3 | 2021-03-10T11:06:47-06:00 |
17:22:39 | reversem3 | typeof(DateTime) === type DateTime |
17:22:43 | FromDiscord | <queersorceress> In reply to @reversem3 "how can I parse": you should be using the `format()` call, where you specify the formatters as such `"YYYY-dd-mm"` |
17:22:59 | FromDiscord | <queersorceress> this is covered in the `times` module docs at the top. |
17:23:18 | reversem3 | can you still format now() ? |
17:24:25 | saem | @queersorceress sure, first thing is often fixing the way choosenim sets things up. The tools directory needs to be findable (beside) the compiler, per the contents of the shell script that looks up Python script |
17:24:56 | saem | I can hop on discord for 15 minutes if you want a quick run through |
17:25:14 | leorize | for the pretty printing you have to use gdb |
17:25:23 | reversem3 | ahh I got it |
17:25:38 | reversem3 | it was just confusing with the example I thought I had to parse then use format |
17:25:42 | FromDiscord | <queersorceress> In reply to @saem "<@352997242531086338> sure, first thing": oh, is this using that nim-gdb python script i've seen? i was hoping that you had your system configured to make it resolve automatically, like it should for C code. |
17:25:53 | reversem3 | echo current_date.format("yyyy-MM-dd") |
17:26:28 | saem | Yeah, it is using that. Haven't gotten as far as what you're suggesting but it's something I'm mulling over |
17:26:40 | FromDiscord | <queersorceress> In reply to @reversem3 "it was just confusing": ah, no, the parse is to turn a string into a DateTime, format is to get a DateTime into a string. |
17:29:23 | saem | Anyhow, of you're interested I can show you what I've setup. |
17:29:49 | FromDiscord | <queersorceress> In reply to @saem "Yeah, it is using": i see, hmm, i use to have it working on my system for 0.19.6, but then stopped coding for a while and when i came back it didn't work in 1.2, and broke even further in 1.4; but that might be related to my system as well. i was able to get lcov to work basically out of the box, without using one of the existing tools on nimble, so next was hoping to get debugging working again as i have `.nim |
17:30:30 | FromDiscord | <queersorceress> ah! yes, please! that would be helpful, though i hope once you are finished you would blog or publish a document/tutorial for it somewhere anyway 🙂 |
17:33:57 | saem | That's not my forte. |
17:34:15 | saem | I'll be on in a minute... updates |
17:35:32 | leorize | lcov doesn't work very well with nim due to the lack of tooling to handle "hidden branches" caused by exceptions |
17:35:36 | * | drsensor quit (Quit: Connection closed for inactivity) |
17:38:04 | FromDiscord | <queersorceress> with the branching conf option enabled it works well enough to get an idea of test coverage; but i'm more concerned about being able to step through code like i use to. if you can make a text document that shows how you configured your environment that would be enough for me, in your own time. |
17:38:56 | leorize | did you compile nim code with `--debugger:native`? |
17:39:25 | ForumUpdaterBot | New thread by Livingstone1337: Question on the use of Nimpy, see https://forum.nim-lang.org/t/7602 |
17:39:39 | * | junland quit (Quit: %ZNC Disconnected%) |
17:39:45 | giaco_ | Hi รєคɭ๓๏שє! Would you mind a quick question about binarylang? |
17:40:13 | FromDiscord | <queersorceress> In reply to @leorize "did you compile nim": yes, i have. |
17:40:31 | * | junland joined #nim |
17:40:35 | leorize | then it's weird that you can't set breakpoints/step through code |
17:40:55 | saem | Up to you, I can screen share now real quick. Otherwise, it's the tools directory, compile with the various debug flags, vs code cppdbg, maybe the latest Python script from devel, and that's about it. |
17:41:30 | saem | I have a hard stop in 15 minutes |
17:41:45 | FromDiscord | <queersorceress> i mean, i can, it just doesn't symbolicate properly, maybe i need a closer look at that python script. if you link me that then i'll start there. |
17:43:00 | saem | https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py |
18:11:55 | * | Jjp137 quit (Ping timeout: 240 seconds) |
18:13:28 | ForumUpdaterBot | New thread by ShinraTensei: Ncurses trouble, see https://forum.nim-lang.org/t/7603 |
18:33:24 | * | rockcavera quit (Remote host closed the connection) |
18:39:16 | * | vsantana quit (Quit: vsantana) |
18:40:02 | * | vsantana joined #nim |
18:40:21 | * | vsantana quit (Client Quit) |
18:41:07 | * | vsantana joined #nim |
18:41:11 | * | krux02 quit (Remote host closed the connection) |
18:41:45 | giaco_ | I have a function that returns a complex tuple, so I'm relying on type inference by doing "let myVar = myproc()". Problem is now I'm wrapping this line with a try/except and I cannot read myVar from outside the try/except block. |
18:42:03 | ForumUpdaterBot | New post on r/nim by blockchain_dev: How to format on save Nim code in VsCode?, see https://reddit.com/r/nim/comments/m24zez/how_to_format_on_save_nim_code_in_vscode/ |
18:45:55 | FromDiscord | <dk> In reply to @giaco_ "I have a function": https://nim-lang.org/docs/manual.html#exception-handling-try-expression |
18:46:09 | FromDiscord | <dk> you can do a `return` in a try expression |
18:46:23 | FromDiscord | <dk> or break control flow in general |
18:47:48 | giaco_ | this is brilliant! Thanks |
19:00:33 | * | xet7 quit (Remote host closed the connection) |
19:16:14 | * | rockcavera joined #nim |
19:32:52 | * | ^Q-Master^ joined #nim |
19:32:53 | * | zedeus_ quit (Ping timeout: 260 seconds) |
19:33:52 | * | zedeus_ joined #nim |
19:34:44 | * | vsantana1 joined #nim |
19:35:34 | * | ryanhowe joined #nim |
19:35:35 | * | idxu_ joined #nim |
19:35:46 | * | Mister_Magister_ joined #nim |
19:35:49 | * | rockcavera quit (Ping timeout: 276 seconds) |
19:35:57 | * | blackpawn joined #nim |
19:35:58 | * | kitech1- joined #nim |
19:38:01 | * | Lord_Nightmare2 joined #nim |
19:38:11 | * | evbo joined #nim |
19:42:43 | * | vsantana quit (*.net *.split) |
19:42:43 | * | fputs quit (*.net *.split) |
19:42:43 | * | Lord_Nightmare quit (*.net *.split) |
19:42:43 | * | sacredfrog quit (*.net *.split) |
19:42:43 | * | idxu quit (*.net *.split) |
19:42:44 | * | Q-Master quit (*.net *.split) |
19:42:44 | * | blackpawn_ quit (*.net *.split) |
19:42:44 | * | Mister_Magister quit (*.net *.split) |
19:42:51 | * | kitech1 quit (*.net *.split) |
19:42:51 | * | idxu_ is now known as idxu |
19:42:51 | * | Mister_Magister_ is now known as Mister_Magister |
19:42:51 | * | vsantana1 is now known as vsantana |
19:42:51 | * | Lord_Nightmare2 is now known as Lord_Nightmare |
20:03:21 | * | Jjp137 joined #nim |
20:06:20 | * | NimBot joined #nim |
20:08:34 | FromDiscord | <Seedofarson> Oh my god |
20:08:41 | FromDiscord | <Seedofarson> I did some real solid research into Nim |
20:08:47 | FromDiscord | <Seedofarson> Nim is the 🐐 |
20:08:52 | FromDiscord | <mratsim> goat? |
20:08:55 | FromDiscord | <Seedofarson> JavaScript connectivity?! |
20:08:59 | FromDiscord | <Seedofarson> Greatest of all time |
20:09:02 | FromDiscord | <Seedofarson> (edit) "JavaScript connectivity?!" => "JavaScript?!" |
20:09:18 | FromDiscord | <mratsim> Did you know that it had a PHP backend 😉 |
20:09:32 | FromDiscord | <Seedofarson> Whhhhattatatatt |
20:09:54 | leorize | the keyword here is "had" |
20:09:56 | FromDiscord | <Seedofarson> It’s fast as hell |
20:10:04 | FromDiscord | <Seedofarson> Python linking |
20:10:11 | FromDiscord | <Seedofarson> C interfacing |
20:10:18 | FromDiscord | <Seedofarson> (edit) "linking" => "interfacing" |
20:10:31 | FromDiscord | <Seedofarson> HTML DSL!!! NATIVELYLYLYLYYYY |
20:11:15 | FromDiscord | <Seedofarson> C compiling |
20:13:19 | FromDiscord | <Seedofarson> It’s like C, python, JS, Go, HTML (not a language but still) and Rust had a beautiful lovechild with the best parts of all of them and then Go came out |
20:14:05 | FromDiscord | <Seedofarson> And somehow, it still manages to be fast as fuck |
20:14:41 | Prestige | It's pretty sweet. |
20:16:00 | FromDiscord | <mratsim> The JS backend is not that fast though, you need to pass it to Google CLosure compiler for a round of optimization if you have "performance-critical" javascript (whatever that alien beast is). |
20:16:17 | FromDiscord | <mratsim> (edit) "CLosure" => "Closure" |
20:16:45 | FromDiscord | <Seedofarson> Yeah |
20:16:48 | FromDiscord | <Seedofarson> That’s cool |
20:17:16 | FromDiscord | <Seedofarson> I didn’t know about the “google closure compiler”, it looks amazing though |
20:17:55 | FromDiscord | <mratsim> https://github.com/nim-lang/Nim/commit/35b0cc67e89a929270e77c07ecbf06f7cced3668#diff-5bfae5b518d4ab360a8cd26e9d7fdfef1d24dbf9f9922c6f77d8660a23792f51L194 |
20:19:12 | FromDiscord | <Seedofarson> Rip, I haven’t even ever touched PHP though |
20:19:14 | FromDiscord | <Seedofarson> So |
20:20:33 | FromDiscord | <Seedofarson> I feel no loss |
20:20:33 | FromDiscord | <mratsim> Don't try |
20:21:50 | FromDiscord | <Seedofarson> Why not? |
20:22:13 | FromDiscord | <ElegantBeef> It's a mostly deprecated language that was looks like it designed intentionally to cause harm |
20:22:21 | FromDiscord | <Seedofarson> Lmaooooo |
20:25:50 | FromDiscord | <Seedofarson> Also, Nimpy is like, awesome |
20:33:44 | FromDiscord | <zetashift> In reply to @ElegantBeef "It's a mostly deprecated": Didn't PHP 7 clean up a lot of the warts of the language? I think it's a better choice for backend than JS for example. |
20:33:53 | FromDiscord | <zetashift> But early PHP, please no have mercy on my soul |
20:33:56 | FromDiscord | <ElegantBeef> The bar of "Better than js" isnt that high |
20:34:01 | FromDiscord | <mratsim> both have the `===` operator :p |
20:34:19 | FromDiscord | <zetashift> In reply to @ElegantBeef "The bar of "Better": Very true, yet people still chose it |
20:35:03 | FromDiscord | <ElegantBeef> Hey if people put toothpicks under their toes and kick walls i'm not going to tell them no |
20:37:12 | FromDiscord | <Solitude> In reply to @ElegantBeef "Hey if people put": i will |
20:37:32 | qwr | imho its unfair, PHP was not designed at all |
20:37:38 | FromDiscord | <zetashift> Hey me neither, just saying PHP7+ isn't _that_ bad. |
20:38:08 | FromDiscord | <ElegantBeef> lol qwr |
20:38:13 | FromDiscord | <zetashift> I wonder how the world would've looked if C never got popular but languages like Pascal and Ada did. |
20:38:22 | FromDiscord | <ElegantBeef> It'd be a much better place 😛 |
20:38:36 | FromDiscord | <zetashift> Yes I think so too haha |
20:38:41 | FromDiscord | <ElegantBeef> ~~Meanwhile we're in a wirth-like language discord~~ |
20:39:34 | FromDiscord | <Hi02Hi> i mean c allowed systems programming, and nim is a systems programming language (but not only one) |
20:40:03 | FromDiscord | <haxscramper> I didn't "allow system programming". They wrote unix in it, but it could be any other language |
20:40:29 | FromDiscord | <haxscramper> That is less ugly, less error-prone, with less syntactic and semantic clutches |
20:41:26 | FromDiscord | <haxscramper> One thing for example that I still can't understand is this horrible macro preprocessor that is extremely inefficient too |
20:41:33 | FromDiscord | <zetashift> People don't care about those things if it's unfamiliar I guess? |
20:43:48 | FromDiscord | <Hi02Hi> true, but doesnt system programming require performance? |
20:44:11 | FromDiscord | <Hi02Hi> (edit) "performance?" => "performance/access to memory?" |
20:44:19 | FromDiscord | <Hi02Hi> (edit) "performance/access to memory?" => "performance?" |
20:44:29 | leorize | pascal is pretty fast :P |
20:44:59 | FromDiscord | <Hi02Hi> i dunno, but does it compete with asm/c |
20:45:01 | FromDiscord | <Hi02Hi> (edit) "asm/c" => "asm/c?" |
20:45:04 | FromDiscord | <Seedofarson> Have y’all seen crystal? |
20:45:09 | FromDiscord | <haxscramper> PL design does not immediately correspond to slow/fast performance |
20:45:16 | FromDiscord | <Seedofarson> It’s super super super premature, but it looks cool |
20:45:33 | FromDiscord | <haxscramper> Having pointers and `{{{}}}` with some `&&&&&` does not make your code faster |
20:47:19 | FromDiscord | <haxscramper> I mean you can write 'almost C' in nim pretty easily, with all pointers and whatever, but still get much better syntax, with exactly the same speed if I'm not mistaken |
20:48:42 | ForumUpdaterBot | New post on r/nim by richardd08: Can you call Cython from Nim?, see https://reddit.com/r/nim/comments/m281qw/can_you_call_cython_from_nim/ |
20:48:58 | FromDiscord | <Hi02Hi> gc?↵but still, nim compiles to c, so that makes sense |
20:49:25 | FromDiscord | <haxscramper> `--gc:none`, `var myHappyString: ptr char` and you are set |
20:49:33 | FromDiscord | <haxscramper> For segfaults at least |
20:49:55 | FromDiscord | <Hi02Hi> i dont know much about --gc:none, teach me |
20:50:33 | FromDiscord | <haxscramper> I don't know anything either, but that is just what it says - no gc, just use manual memory allocations like you could do in C |
20:54:49 | FromDiscord | <Seedofarson> I think I’m becoming a Nim fanboy |
21:01:32 | * | MarderIII quit (Ping timeout: 260 seconds) |
21:02:36 | * | narimiran quit (Ping timeout: 246 seconds) |
21:04:19 | * | rockcavera joined #nim |
21:10:23 | FromDiscord | <ElegantBeef> You use `alloc` `realloc` and `dealloc` and a healthy dose of `ptr UncheckedArray[T]` and there you go you now can preted Nim is C |
21:10:28 | FromDiscord | <ElegantBeef> Just dont touch the stdlib 😄 |
21:11:03 | FromDiscord | <mratsim> you can use bitops |
21:11:22 | FromDiscord | <ElegantBeef> Yea some modules dont touch gc'd memory, so you can use some |
21:13:05 | FromDiscord | <ElegantBeef> Math for instance 😄 |
21:13:42 | FromDiscord | <ElegantBeef> Or you know just `--gc:arc` and live life with scoped memory management |
21:14:27 | FromDiscord | <haxscramper> macros, sugar, pattern matching should also work for any GC, so you are getting C-with-lisp-macros |
21:15:14 | FromDiscord | <ElegantBeef> Yep |
21:15:31 | FromDiscord | <haxscramper> Generics, first-class functions, closures, which is a very good deal in itself |
21:15:33 | FromDiscord | <ElegantBeef> And a strong type systems |
21:15:34 | FromDiscord | <ElegantBeef> (edit) "systems" => "system" |
21:15:40 | FromDiscord | <haxscramper> `distinct void` |
21:19:53 | ForumUpdaterBot | New thread by CaptainBland: Template varargs syntax sugar for procs accepting tuples - good idea?, see https://forum.nim-lang.org/t/7604 |
21:24:54 | FromDiscord | <dom96> In reply to @mratsim "The JS backend is": It's fast enough 🙂 |
21:33:29 | * | saem quit () |
21:33:45 | * | saem joined #nim |
21:34:10 | Prestige | How do you quantify fast enough? |
21:35:22 | * | birdspider joined #nim |
21:40:07 | reversem3 | How do you change the output for calculating variables using times module |
21:40:09 | reversem3 | Difference Between the two dates is: 52 weeks, 1 day, and 1 hour |
21:40:27 | reversem3 | How can I turn that in to days only ? |
21:40:47 | * | birdspider quit (Quit: Leaving) |
21:41:08 | * | birdspider joined #nim |
21:42:09 | FromDiscord | <Recruit_main707> weeks 7 + days + hours / 24 |
21:42:13 | FromDiscord | <Araq> huh, my IC test is red on OSX, time to switch computers |
21:42:45 | FromDiscord | <dom96> In reply to @Prestige "How do you quantify": My game can sustain 60 FPS on most machines (stardust.dev) |
21:44:55 | reversem3 | Ok so you have to calculate that yourself then , so the default for times module is weeks |
21:45:11 | leorize | reversem3: have you tried inDays()? |
21:46:38 | * | idf quit (Ping timeout: 272 seconds) |
21:47:25 | reversem3 | <leorize "nixfreak: have you tried inDays("> No I found it now , inDays , inWeeks, inYears thanks |
21:48:59 | reversem3 | I still have issues reading the documentation sorry |
21:51:37 | * | idf joined #nim |
21:54:49 | * | arecaceae joined #nim |
21:55:57 | ForumUpdaterBot | New thread by Thegrapevine: How is the Nim "file_regex" for SublimeText error capture?, see https://forum.nim-lang.org/t/7605 |
21:59:13 | * | evbo is now known as fputs |
22:04:01 | * | ubert quit (Ping timeout: 268 seconds) |
22:13:40 | * | nikki93 quit () |
22:13:56 | * | nikki93 joined #nim |
22:17:23 | * | haxscramper quit (Remote host closed the connection) |
22:18:06 | FromDiscord | <รєคɭ๓๏שє> I've never used nimterop. Where do I begin if I want to wrap this library? https://github.com/zyantific/zydis |
22:19:18 | FromDiscord | <Solitude> with c2nim'ing the headers and manually cleaning them up |
22:22:39 | FromDiscord | <รєคɭ๓๏שє> do you recommend I use c2nim and not nimterop? or use c2nim from nimterop somehow? |
22:22:55 | Prestige | @dom96 a benchmark would be nice, but yeah |
22:24:35 | * | birdspider quit (Quit: Leaving) |
22:25:03 | FromDiscord | <mratsim> In reply to @รєคɭ๓๏שє "I've never used nimterop.": You begin by sacrificing a goat on the altar of C build systems. |
22:25:18 | FromDiscord | <รєคɭ๓๏שє> :D |
22:26:06 | FromDiscord | <dom96> In reply to @Prestige "<@132595483838251008> a benchmark would": Real people playing the game is the benchmark 😉 |
22:26:22 | FromDiscord | <mratsim> That doesn't seem hard to wrap/build though |
22:26:53 | FromDiscord | <mratsim> passL all the lib there and {.compile: "..../.c".} here: https://github.com/zyantific/zydis/blob/master/CMakeLists.txt#L124-L142 |
22:27:12 | * | Vladar quit (Quit: Leaving) |
22:27:20 | FromDiscord | <mratsim> and for wrapper generation nimterop should be able to deal with C files cleanly |
22:28:08 | FromDiscord | <mratsim> here is a more complex C project I've wrapped: https://github.com/numforge/laser/blob/master/laser/cpuinfo.nim#L277-L329 |
22:28:53 | FromDiscord | <mratsim> original: https://github.com/pytorch/cpuinfo |
22:40:28 | FromDiscord | <รєคɭ๓๏שє> In reply to @mratsim "That doesn't seem hard": Thanks :) seems useful advice, although I feel clueless and it still seems scary to me :3 |
22:41:06 | FromDiscord | <mratsim> Try to wrap a C library with a single C file or 2 for starter. |
22:42:05 | FromDiscord | <mratsim> for example this one is pretty small: https://github.com/plasma-umass/coz/tree/master/libcoz |
22:42:21 | FromDiscord | <mratsim> but an image library might work as well |
22:43:37 | FromDiscord | <g33kidd> In reply to @Seedofarson "I think I’m becoming": same |
22:45:54 | Prestige | That's anecdotal |
22:46:11 | Prestige | I meant a real benchmark to see how Nim's js performance is dom |
22:46:29 | Prestige | It's good that it's able to run such applications, though |
22:53:42 | * | tane quit (Quit: Leaving) |
22:57:37 | FromDiscord | <ElegantBeef> Is there any documentation on how to make a macro compliant with `push`? |
22:57:38 | FromDiscord | <Seedofarson> So |
22:57:41 | FromDiscord | <Seedofarson> Would that work |
22:57:48 | FromDiscord | <Seedofarson> For a webapp |
22:57:52 | FromDiscord | <Seedofarson> If I want to use Nim |
22:57:55 | FromDiscord | <Seedofarson> I have to do |
22:58:05 | FromDiscord | <ElegantBeef> You can use wasm or the js backend |
22:58:08 | FromDiscord | <Seedofarson> Button —> JS —-> Nim script |
22:58:26 | FromDiscord | <ElegantBeef> No cause nimscript isnt what you'd be running |
22:58:32 | FromDiscord | <ElegantBeef> You'd be running Nim's js backend |
22:58:47 | FromDiscord | <ElegantBeef> Nimscript is a subset of nim that is interpreted |
22:59:45 | Prestige | It sort of works how typescript does - it compiles nim to js, and that js is executed |
23:00:12 | FromDiscord | <Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2SoC |
23:00:21 | FromDiscord | <Seedofarson> Ahhhh |
23:00:22 | FromDiscord | <Seedofarson> Ok |
23:00:27 | FromDiscord | <ElegantBeef> Jeez i think i can partially read that poet |
23:00:32 | FromDiscord | <Anonymous Poet> the best solution i can come up with is to require two input functions, one for left, and one for right, but thats eh :/ |
23:01:02 | FromDiscord | <Anonymous Poet> uhm, theres generic type params L and R, and possible outputs LO (Left out) and RO (right out) |
23:01:54 | FromDiscord | <ElegantBeef> So either is just a `bool` and two values? |
23:02:14 | FromDiscord | <Seedofarson> In reply to @Seedofarson "Button —> JS —->": Now it’s ↵Button -> JS(secretly compiled Nim) |
23:02:18 | FromDiscord | <Seedofarson> ? |
23:02:28 | FromDiscord | <Anonymous Poet> In reply to @Seedofarson "Now it’s Button": thats probably right |
23:02:32 | FromDiscord | <ElegantBeef> Nah it's not secretly compiled, it says right in it it was output from the Nim compiler 😛 |
23:02:38 | FromDiscord | <Seedofarson> Lmaooo |
23:02:41 | FromDiscord | <Seedofarson> Ok |
23:02:48 | FromDiscord | <Seedofarson> Hmmmm |
23:02:57 | FromDiscord | <Seedofarson> Do all libraries and stuff still work with ITV |
23:03:01 | FromDiscord | <Seedofarson> (edit) "ITV" => "it?" |
23:03:03 | FromDiscord | <ElegantBeef> It's really not much different than typescript except that it's got more fancy features |
23:03:09 | FromDiscord | <Anonymous Poet> @ElegantBeef https://play.nim-lang.org/#ix=2SoG still wip on what im trying to get at |
23:03:14 | FromDiscord | <ElegantBeef> Not all libraries, anything that requires C interop will not |
23:03:20 | FromDiscord | <ElegantBeef> Or running natively |
23:03:21 | FromDiscord | <Anonymous Poet> In reply to @Seedofarson "Do all libraries and": i think certain things like filesystem also doesnt work |
23:03:31 | FromDiscord | <Seedofarson> Will HTTP client? |
23:03:37 | FromDiscord | <Anonymous Poet> should do, yes |
23:03:39 | FromDiscord | <ElegantBeef> Nope |
23:03:43 | FromDiscord | <Anonymous Poet> anything thats written in pure nim should be good |
23:03:49 | FromDiscord | <Seedofarson> Request |
23:03:51 | FromDiscord | <ElegantBeef> The http client uses system sockets |
23:03:53 | FromDiscord | <Seedofarson> (edit) "Request" => "Requests go brrrr" |
23:03:56 | FromDiscord | <Anonymous Poet> oh rip 😦 |
23:04:01 | FromDiscord | <Seedofarson> In reply to @ElegantBeef "The http client uses": Fuck. |
23:04:09 | FromDiscord | <ElegantBeef> I mean you can wrap JS code yourself |
23:04:13 | FromDiscord | <Seedofarson> Yeah |
23:04:16 | FromDiscord | <Seedofarson> Is it readable |
23:04:18 | FromDiscord | <ElegantBeef> https://github.com/beef331/mrapi/blob/master/src/mrapi.nim |
23:04:21 | FromDiscord | <ElegantBeef> I mean check it yourself |
23:04:36 | FromDiscord | <ElegantBeef> That's my wrapping of a the webrtc screen recording/mic recording |
23:04:41 | FromDiscord | <Seedofarson> That sucksss |
23:04:51 | FromDiscord | <Seedofarson> Ok |
23:05:26 | * | D_ quit (Ping timeout: 264 seconds) |
23:05:35 | FromDiscord | <ElegantBeef> Hmm poet dont really see the point of the variant |
23:05:50 | FromDiscord | <Seedofarson> What is it though, it looks weird |
23:06:33 | * | D_ joined #nim |
23:07:14 | FromDiscord | <Seedofarson> Webapp --> Nim with all the native libraries |
23:07:23 | FromDiscord | <Seedofarson> (edit) "Webapp" => "I just wanna do↵↵Webapp" |
23:07:27 | FromDiscord | <Seedofarson> Rip |
23:09:33 | FromDiscord | <ElegantBeef> poet the issue i see with this "Either" and using a variant is that you cannot switch to the right side without reconstructing the object, so it's not really an either |
23:10:07 | FromDiscord | <ElegantBeef> So what's the issue with the mapping? |
23:13:42 | FromDiscord | <ElegantBeef> @Anonymous Poet doesnt this work? https://play.nim-lang.org/#ix=2SoL |
23:28:11 | ForumUpdaterBot | New thread by Thegrapevine: There are a Nim Linter for SublimeText?, see https://forum.nim-lang.org/t/7606 |
23:28:56 | * | rayman22201 quit () |
23:29:12 | * | rayman22201 joined #nim |