<< 10-03-2021 >>

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:19FromDiscord<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:45FromDiscord<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:12FromDiscord<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:20FromDiscord<ElegantBeef> Ah found `--doccmd`
04:33:38*leorize joined #nim
05:24:59*saem waves
05:27:13FromDiscord<ElegantBeef> Yellow
05:29:16saemsup, beef?
05:29:49FromDiscord<ElegantBeef> Slammed my face into my keyboard adding doc comments to some Nico procs
05:30:08FromDiscord<Rika> Congrats
05:30:09FromDiscord<ElegantBeef> I mean nothing much you? 😄
05:32:31saemlooking at syntax highlighting, feeling sad.
05:36:28FromDiscord<ElegantBeef> Well close one eye so you feel sad at half the rate
05:36:50saemI wish
05:37:08FromDiscord<ElegantBeef> What's making you sad
05:38:48FromDiscord<ElegantBeef> what part exactly is that question
05:39:11*narimiran joined #nim
05:41:47saemhow to textmate grammar
05:43:47*mmohammadi9812 quit (Quit: Quit)
05:45:37FromDiscord<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:15saemprobably
05:46:28saemDo you want to textmate grammar? :)
05:46:53FromDiscord<ElegantBeef> Not particularly, that's the type of stuff that causes me to implode
05:48:09saemdamn it, i thought you liked colours.
05:49:03FromDiscord<ElegantBeef> I do, but i fought with them enough with my silly PR for adding colours to the compiler output
05:49:15FromDiscord<ElegantBeef> Ponders if i should close that
05:50:52saembummer.
05:51:08saemI'll take your colours.
05:52:34FromDiscord<ElegantBeef> I have to applaud you from spelling colours correctly in a dev community 😛
05:52:38FromDiscord<ElegantBeef> (edit) "from" => "for"
05:53:46saemI work for an American company and put 'u' in all sorts of places.
05:54:05saemIt's my mark.
05:56:41saemI'm streaming on discord if you wanna see the colours, or lack thereof.
05:57:18FromDiscord<ElegantBeef> I'm currently in a voip chat, so... uhhhhh smokebomb
05:57:26saemlol
05:58:22FromDiscord<Araq> https://blog.acolyer.org/2017/09/19/to-type-or-not-to-type-quantifying-detectable-bugs-in-javascript/
05:58:58FromDiscord<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:04FromDiscord<ElegantBeef> I feel like there is an emphasis on "committed code", since how many bugs does it prevent in writing code
06:00:18saemI was at a presentation years ago with an MS dev advocate, and they said that's what they found themselves.
06:01:01PrestigeI had to write a paper on the topic to covince my company to make the switch to ts
06:01:26FromDiscord<ElegantBeef> "Static analysis means we statically know types dont fuck us when we're not looking, please switch"
06:01:47PrestigeIt took a LOT of convincing...
06:02:20saemWhat was also interesting is the paper on organizational structure and influence on software quality.
06:03:30FromDiscord<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:34FromDiscord<Araq> it took them decades to produce this result. I always knew it. now spread the word -- Python bad, Nim good.
06:05:54FromDiscord<Araq> 🙂
06:06:06FromDiscord<ElegantBeef> Aw shit that's what i was supposed to say i've been saying "Nim bad, python god"
06:06:26saem🤣
06:06:52idfnim python good bad
06:06:54FromDiscord<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:07FromDiscord<fenrave> bad python good nim
06:07:48FromDiscord<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:05FromDiscord<Araq> "slow you down" -- no, it's an enabling technology. I could not write compiler code (IC, omg....) without it
06:10:15FromDiscord<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:57saemIt's so true, I'm looking at the compiler code and thinking, man I wish I could type a few more things.
06:11:06saemNot the opposite.
06:20:27FromDiscord<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:16halloleoHi! Just joined for the 1st time.
06:43:32FromDiscord<ElegantBeef> Hey you finally want quicker responses? 😛
06:43:52halloleoHave used the forum, but thought for somethings IRC might be better.
06:44:16halloleoQuicker? Maybe - and less permanent...
06:44:26FromDiscord<ElegantBeef> The logs are searchable from browser 😄
06:45:17halloleoSure, but it /feels/ at least more ephemeral (had to look that one up...)
06:45:57FromDiscord<ElegantBeef> That's just cause my shitty jokes are 90% of it
06:46:20halloleo😵
06:46:50*waleee-cl quit (Quit: Connection closed for inactivity)
06:47:09FromDiscord<ElegantBeef> Anywho welcome to realtime chat's it's lovely here
06:47:37halloleoOk, 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:21FromDiscord<ElegantBeef> `openfilestream`?
06:49:02halloleoOk, but only newStringStream - does it still need to be closed?
06:50:34halloleoAnd actually the doco's example lists even for files just newFileStream - which does not need to opened, right?
06:50:44FromDiscord<ElegantBeef> Without closing the stream will not release the string
06:52:12FromDiscord<ElegantBeef> It creates it and opens it
06:52:19FromDiscord<ElegantBeef> So yea you do not need to open it
06:54:37halloleoAlright. Thanks.
06:57:09FromDiscord<ElegantBeef> The difference between `newFileStream` and `openFileStream` is the former returns a nil on failed opening the latter throws an IO exception
07:02:15halloleoGood to know.
07:03:25halloleoSpeaking 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:41FromDiscord<ElegantBeef> If the program crashes the OS will return the memory itself
07:06:06halloleoUps, of course! 🤪
07:17:59FromDiscord<KnorrFG> sent a long message, see http://ix.io/2Sjw
07:18:31FromDiscord<KnorrFG> (edit) "http://ix.io/2Sjw" => "http://ix.io/2Sjx"
07:18:39*vicfred quit (Quit: Leaving)
07:18:58halloleoNo idea. Haven't played with macros yet...
07:19:49FromDiscord<ElegantBeef> A symbol is just a looked up identifier
07:20:20FromDiscord<KnorrFG> does that mean i can always use a symbol node in place of an identifier node?
07:20:30FromDiscord<ElegantBeef> Yes, it should
07:20:59FromDiscord<KnorrFG> and then I use nskUnknown?
07:22:16FromDiscord<ElegantBeef> Uhh i'm uncertain about that
07:22:17*vegai joined #nim
07:22:36FromDiscord<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:42FromDiscord<KnorrFG> body[i] = Asgn(Ident($genSym()), node) ↵works nicely 🙂
07:32:00*lritter quit (Ping timeout: 246 seconds)
07:32:08FromDiscord<haxscramper> Why not just genSym directly
07:33:08FromDiscord<haxscramper> And most likely you need something like nskVar, but it depends on exact ast you want to generate
07:33:35FromDiscord<KnorrFG> because if you write "foo = ElemName:" it generates an ident, and i want to be able to treat those the same
07:35:42FromDiscord<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:45FromDiscord<haxscramper> https://github.com/nim-lang/website/pull/271/files#diff-f40f1b0667ad0d239e3f06cd2760ec8e67510ec2b0ae40a9241b099cc6d2e278 - "intermediate representation" section
07:37:52FromDiscord<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:17FromDiscord<KnorrFG> but for that i have to parse all asigns first, and calls are just hidden assigns, so i do that first
07:38:26FromDiscord<KnorrFG> that was my logic, is there a better way?
07:39:49FromDiscord<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:17FromDiscord<haxscramper> It would be easy to just get list of necessary declarations from the structure to put them on top
07:42:32FromDiscord<haxscramper> If anything it would make it easier to extend in the future
07:42:44FromDiscord<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:57raboofa 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:26ForumUpdaterBotNew Nimble package! tweens - Basic tweening library for Nim, see https://github.com/RainbowAsteroids/tweens
07:48:09FromDiscord<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:28FromDiscord<Yardanico> @raboof I think there was
07:48:30FromDiscord<haxscramper> Or something like that. Own structure does not need to be custom type btw
07:48:49FromDiscord<haxscramper> I think I sounded a bit confusing
07:49:10FromDiscord<haxscramper> You can just pass mutable table around and record everything in it
07:49:29FromDiscord<Yardanico> See https://discourse.nixos.org/t/nix-flake-of-nim-lang-packages/5267 for an example
07:50:05FromDiscord<KnorrFG> ok, will try, thank you
07:50:58raboofYardanico: ah, interesting, in a flake instead of in 'regular' nixpkgs. I guess I'll have to read up on that :D
07:51:22FromDiscord<Yardanico> I've seen a few more repos on GitHub, you can search for those as well
07:52:37FromDiscord<KnorrFG> sent a code paste, see https://play.nim-lang.org/#ix=2SjG
07:52:50*haxscramper joined #nim
07:52:55FromDiscord<KnorrFG> i dont really get the difference between those two btw.
07:53:29*PMunch joined #nim
07:53:34FromDiscord<haxscramper> Symbol is an identifier resolved by semcheck
07:53:45FromDiscord<Gary M> `uint32_t graphics_queue_index = -1` What the fuck. I know this isn't nim but still, why
07:53:55FromDiscord<haxscramper> If you dump `treeRepr()` of `typed` parameter you would see tons of `Sym` nodes
07:54:05FromDiscord<KnorrFG> ah
07:54:36FromDiscord<KnorrFG> but then it seems way easier to just work in the untyped realm, doesnt it?
07:54:45FromDiscord<haxscramper> yes, it always is
07:55:07FromDiscord<haxscramper> In reply to @KnorrFG "this is the code": Can you also show the original DSL code?
07:55:31FromDiscord<KnorrFG> sent a long message, see http://ix.io/2SjI
07:55:49FromDiscord<KnorrFG> (edit) "long message," => "code paste," | "http://ix.io/2Sip" => "https://play.nim-lang.org/#ix=2SjI"
07:58:04FromDiscord<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:14ForumUpdaterBotNew thread by Livingstone1337: Importing modules on Visual Studio Code, see https://forum.nim-lang.org/t/7597
07:58:34FromDiscord<KnorrFG> and returning syms in an untypoed ast is no problem either?
07:58:48FromDiscord<haxscramper> `genSym` is not a symbol
07:59:46FromDiscord<haxscramper> well, not exactly
07:59:54FromDiscord<haxscramper> So no, this is not a problem
08:00:43FromDiscord<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:51FromDiscord<haxscramper> Then just `var seq[NimNode]` for list of identifiers that need to be forward declared
08:02:24FromDiscord<haxscramper> Or rather `var seq[tuple[name, initType: NimNode]]`
08:02:59FromDiscord<haxscramper> Because if you have anything other than `newRectangle` you would need to store initialization kind too
08:03:21FromDiscord<KnorrFG> well, they are always new`name`
08:03:47FromDiscord<KnorrFG> but I understand what you mean. Read as often as you want, byuut write only once
08:04:14FromDiscord<KnorrFG> (edit) "byuut" => "but"
08:04:26FromDiscord<KnorrFG> thanks
08:42:02*quantimnot quit (Ping timeout: 240 seconds)
08:42:17FromDiscord<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:24ForumUpdaterBotNew thread by Icedquinn: RFC: recursive visitor macro, see https://forum.nim-lang.org/t/7598
10:00:00FromDiscord<Yardanico> @hamidb80 https://en.wikipedia.org/wiki/With_great_power_comes_great_responsibility :)
10:01:16FromDiscord<Unaimend> o.O I though yoda first said that in star wars
10:01:50FromDiscord<ElegantBeef> Nah he said "Power great with responsibility comes"
10:12:11FromDiscord<Goel> sent a long message, see http://ix.io/2SkA
10:19:29FromDiscord<Araq> https://github.com/nim-lang/Nim/pull/17281/files are we all happy with "HoleyEnum"?
10:22:02PMunchWait, we're getting enums with holes?
10:22:03FromDiscord<Rika> :👼
10:22:06FromDiscord<Rika> (edit) ":👼" => "👼"
10:22:27PMunchAre we also getting labels pointing to the same value?
10:22:42PMunchHoleyEnum sounds a bit weird, but I don't have a better name
10:23:29FromDiscord<Rika> HoledEnum xd
10:23:39FromDiscord<dk> GapingEnum
10:23:58PMunchPittedEnum?
10:24:09FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2SkE
10:24:09FromDiscord<Rika> CheeseEnum
10:24:13FromDiscord<haxscramper> By only changing GC options
10:24:15PMunchSwissEnum :P
10:24:27FromDiscord<Unaimend> xDD
10:24:55FromDiscord<mratsim> In reply to @Araq "https://github.com/nim-lang/Nim/pull/17281/files ar": Holey shit!
10:25:00FromDiscord<haxscramper> Is it related to some known bug?
10:25:22FromDiscord<haxscramper> Because this is what making pattern matching fail for orc/arc (https://github.com/nim-lang/fusion/issues/76)
10:25:47FromDiscord<haxscramper> And it is really strange that GC affects how VM runs in the first place
10:26:00FromDiscord<haxscramper> Or maybe some subtle difference in semantics that I'm not aware of
10:26:17FromDiscord<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:20FromDiscord<Araq> @haxscramper report it but I think a similar problem has been observed recently
10:26:41FromDiscord<flywind> https://github.com/nim-lang/Nim/issues/17199
10:27:08FromDiscord<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:41FromDiscord<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:17FromDiscord<Yardanico> does the {.pure.} pragma mean anything to enums nowadays?
10:39:40FromDiscord<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:40FromDiscord<hamidb80> Is seq compatible with vector, If i want to use nim with cpp,?
10:39:53FromDiscord<Yardanico> @hamidb80 define "compatible"?
10:40:31FromDiscord<Araq> @Yardanico I messed this up...
10:40:57FromDiscord<Araq> Pure enums can be accessed without the prefix unless it's ambiguous otherwise
10:41:00FromDiscord<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:10FromDiscord<Yardanico> @Araq is that different to normal enums?
10:41:25FromDiscord<Yardanico> ah right it is
10:41:39FromDiscord<Araq> yes and in subtle ways. It's also expensive for IC
10:41:46FromDiscord<Araq> needs dedicated code
10:42:25FromDiscord<Araq> my favorite solution is non-pure enums with UppercaseValue and without prefix
10:42:45FromDiscord<Araq> and to remove `.pure` altogether
10:43:04FromDiscord<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:45FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SkM
10:52:51FromDiscord<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:08FromDiscord<Yardanico> oh that wasn't so hard
11:01:15FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2SkR
11:14:47m4r35n357Just 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:37FromDiscord<Gary M> how do I get the numeric limit of a uint64 in code?
11:15:57FromDiscord<Yardanico> high(uint64)
11:16:02FromDiscord<Yardanico> !eval echo high(uint64)
11:16:04NimBot18446744073709551615
11:17:13FromDiscord<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:14PMunch@Gary M, you can of course do uint64.high as well
11:42:06FromDiscord<Yardanico> no you should do `u_I_n_T_6_4.h_I_G_H()`
11:42:12FromDiscord<Yardanico> !eval echo u_I_n_T_6_4.h_I_G_H()
11:42:14NimBot18446744073709551615
11:45:38*lritter quit (Ping timeout: 260 seconds)
11:47:54FromDiscord<mratsim> This is a bannable offence
11:56:07PMunchAnyone know what might be causing this? https://github.com/PMunch/nimlsp/issues/74
11:56:08FromDiscord<Zachary Carter> what is?
11:56:39PMunch@Zachary Carter, what is a bannable offence? I think he was referring to what Yardanico said :P
11:57:08FromDiscord<Zachary Carter> oh haha
11:57:30PMunchmratsim, have you run into this before?
12:06:33FromDiscord<Yardanico> @PMunch as far as I know mratsim doesn't use nimsuggest at all
12:06:39FromDiscord<Yardanico> one of the reasons being that it doesn't work with weave :)
12:06:53*krux02 joined #nim
12:06:57PMunchAh
12:07:26PMunchWell I was more thinking if he had run into the compiler crashing with that error before
12:07:42FromDiscord<Yardanico> well it's an error from the nimsuggest
12:07:47FromDiscord<Yardanico> nim compiler works for weave
12:12:55PMunchYeah obviously, but if he's using any kind of nimsuggest based plug-in he should have the same issue
12:24:42FromDiscord<mratsim> In reply to @Zachary Carter "what is?": > !eval echo u_I_n_T_6_4.h_I_G_H()
12:25:16FromDiscord<Yardanico> <https://github.com/Yardanico/nuglifier> at its finest
12:25:53FromDiscord<mratsim> In reply to @PMunch "<@570268431522201601>, have you run": I don't use nimlsp, and now I don't use nimsuggest :p
12:26:38FromDiscord<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:59FromDiscord<mratsim> making Nimsuggest crash instead of burning CPU would be better in my book
12:30:33PMunchHmm, 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:20FromDiscord<konsumlamm> i wonder, why is `with` not part of `sugar`?
12:43:24FromDiscord<mratsim> there are a couple of single proc modules besides with
12:43:34FromDiscord<haxscramper> enumerate
12:43:34FromDiscord<mratsim> std/enumerate and std/decls come to mind
12:43:38FromDiscord<haxscramper> fusion/pointers
12:44:36FromDiscord<Yardanico> @mratsim yeah I'm not really a fan of that :P
12:44:53FromDiscord<Yardanico> we have too much separate stdlib modules, a lot of them aren't even documented in the stdlib index
12:47:25FromDiscord<konsumlamm> ye, `enumerate` too...
12:47:33FromDiscord<konsumlamm> In reply to @Yardanico "we have too much": this
12:48:52FromDiscord<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:13FromDiscord<konsumlamm> (edit) "readon" => "reason" | "werem't" => "weren't"
12:49:21FromDiscord<Yardanico> well some people prefer more separation :)
12:49:53FromDiscord<mratsim> sugar is older than 1.0
12:49:57FromDiscord<Yardanico> yeah
12:50:35FromDiscord<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:56FromDiscord<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:16FromDiscord<konsumlamm> In reply to @Solitude "the fact that things": that actually makes sense
12:51:32FromDiscord<Yardanico> @Solitude but enumerate was made after future became sugar
12:51:44FromDiscord<mratsim> and `with` too
12:51:46FromDiscord<Yardanico> much later
12:51:48FromDiscord<mratsim> and `decls` too
12:51:51FromDiscord<Yardanico> https://github.com/nim-lang/Nim/pull/15297
12:51:57FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/819190836217905212/unknown.png
12:51:57FromDiscord<Yardanico> 🤔
12:52:07FromDiscord<konsumlamm> enumerate was added in 1.5, so it's not too late to change that, right?
12:52:16FromDiscord<Yardanico> it's late
12:52:21FromDiscord<mratsim> well it's the first commit for the years to come 😉
12:52:36FromDiscord<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:46FromDiscord<mratsim> it's supposed to replace the `pairs` in std/iterators
12:52:49FromDiscord<Yardanico> @konsumlamm 1.4 got released in october
12:52:53FromDiscord<Yardanico> after enumerate
12:53:00FromDiscord<konsumlamm> ah
12:53:06FromDiscord<mratsim> sugar is for syntax sugar modules
12:53:10FromDiscord<Yardanico> you can always verify that with https://nim-lang.org/1.4.0/enumerate.html
12:53:14FromDiscord<flywind> It was added to `std/sugar` first and then moved to`std/enumerate`.
12:53:20FromDiscord<konsumlamm> perhaps i assumed it was added in 1.4 because it isn't linked
12:53:27FromDiscord<flywind> `std/enumerate` can grow too.
12:53:41FromDiscord<Yardanico> (old hosted nim docs go as back as https://nim-lang.org/0.11.0/manual.html)
12:53:47FromDiscord<Yardanico> (edit) "(old hosted nim docs go as ... back" added "far"
12:54:01FromDiscord<Yardanico> https://nim-lang.org/0.11.0/
12:54:04FromDiscord<Yardanico> even the old website :P
12:54:07FromDiscord<konsumlamm> In reply to @mratsim "sugar is for syntax": it is basically sugar though, for having an explicit counter or something comparable
12:54:09FromDiscord<Yardanico> (I secretly liked it more)
12:54:16FromDiscord<mratsim> In reply to @konsumlamm "it is basically sugar": I agree
12:54:45FromDiscord<mratsim> enumerate was actually written to show how easy it is to use macros to provide syntax sugar
12:54:49FromDiscord<mratsim> and remove pairs
12:55:28FromDiscord<konsumlamm> same with `with`, it's just sugar
12:55:58FromDiscord<konsumlamm> btw, the docs website dpesn't work well on mobile, the left part is cut off
12:56:13FromDiscord<Solitude> and `strformat` is just sugar for concatenation
12:56:28FromDiscord<konsumlamm> strofrmat more deserves it's own module imo
12:56:32FromDiscord<Solitude> this module splitting means almost nothing
12:56:38FromDiscord<konsumlamm> it's more than just a single macro
12:56:49FromDiscord<Yardanico> shall we talk about all the js modules? :)
12:56:55FromDiscord<Solitude> no
12:57:02FromDiscord<Yardanico> https://media.discordapp.net/attachments/371759389889003532/819192119323263026/unknown.png
12:57:08FromDiscord<Yardanico> (ignore the bottom one)
12:57:16FromDiscord<Solitude> they are just sugar for emit
12:57:27FromDiscord<Yardanico> and also https://media.discordapp.net/attachments/371759389889003532/819192223357730846/unknown.png
12:57:28FromDiscord<Yardanico> those too
12:57:46FromDiscord<konsumlamm> i'd prefer having a js namespace and then have js/core, js/bigints, etc.
12:58:00FromDiscord<konsumlamm> but 4raq doesn't like that
12:59:34FromDiscord<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:45FromDiscord<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:59FromDiscord<Yardanico> huh, didn't know we had https://github.com/nim-lang/Nim/blob/devel/lib/std/stackframes.nim either
13:11:40FromDiscord<konsumlamm> for half of those, i'm not sure wether they're supposed to be internal or not
13:12:05FromDiscord<Yardanico> they're all not internal
13:12:16FromDiscord<Yardanico> there's the private dir for private ones
13:12:44FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/lib/std/private/gitutils.nim gitutils has a backoff template :D
13:12:51ForumUpdaterBotNew thread by Drkameleon: Create proc/template that takes 2 blocks of code, see https://forum.nim-lang.org/t/7599
13:30:17FromDiscord<Seedofarson> nim on top
13:30:18FromDiscord<Seedofarson> bro
13:30:31FromDiscord<Seedofarson> but I just saw something that confuses me
13:31:39FromDiscord<Yardanico> so can you ask the question?
13:32:04FromDiscord<Seedofarson> JS
13:32:11FromDiscord<Seedofarson> I knew you could transpile to C
13:32:15FromDiscord<Seedofarson> (edit) "C" => "C/C++"
13:32:39FromDiscord<Yardanico> yeah that's called compilation (but whatever), but what's your question?
13:32:55FromDiscord<Yardanico> compiling to JS in Nim is mainly intended for front-end
13:32:58FromDiscord<Seedofarson> (edit) "transpile" => "compile"
13:33:01FromDiscord<Seedofarson> yeah
13:33:02FromDiscord<Yardanico> E.g. https://forum.nim-lang.org/ has both frontend and backend in Nim
13:33:10FromDiscord<Seedofarson> isn't JS for a totally different thing?
13:34:09FromDiscord<Yardanico> ?
13:34:17FromDiscord<Yardanico> sorry, didn't understand your question
13:34:25FromDiscord<Yardanico> nim has a separate backend for JS, it doesn't use the same as for C/C++ of course
13:34:50FromDiscord<Seedofarson> nim has the ability to compile to JS, but why? is the nim website actually written in nim!?
13:35:00FromDiscord<Seedofarson> (edit) removed "actually"
13:35:05FromDiscord<Yardanico> as I said, so you can develop website front-ends in Nim
13:35:24FromDiscord<Yardanico> forum.nim-lang.org has the frontend implemented in Nim as well
13:36:32FromDiscord<Seedofarson> sorry for the noob questions!
13:36:40FromDiscord<Seedofarson> still learning about all of htis
13:36:42FromDiscord<Seedofarson> (edit) "htis" => "this"
13:36:46FromDiscord<Rika> why? its hard to answer that
13:36:59FromDiscord<Seedofarson> but, that really cool! The frontend of a website in nim!
13:37:19FromDiscord<Seedofarson> then, do you think a webapp would be possible in nim?
13:39:17*waleee-cl joined #nim
13:41:42FromDiscord<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:55FromDiscord<Goel> (edit) "I need" => "Do ineed"
13:42:03FromDiscord<Goel> (edit) "ineed" => "i need"
13:42:30FromDiscord<Yardanico> as it says, add it to your ~/.profile or ~/.bashrc
13:42:36FromDiscord<Yardanico> those are text files, not dirs
13:43:10FromDiscord<Goel> But where is this ~/.profile folder?
13:43:19FromDiscord<Yardanico> it's not a folder
13:43:42FromDiscord<Goel> I mean in which folder is this file i need to modify for the PATH
13:43:46FromDiscord<Yardanico> It's just a text file, and ~ (tilda) in nix means "home dir"
13:43:49FromDiscord<Yardanico> you already have the full path
13:43:57FromDiscord<Yardanico> ~/.profile expands to "/home/youruser/.profile" automatically
13:44:11FromDiscord<Yardanico> so just use something like `nano ~/.profile` or other text editor of your choice
13:44:29FromDiscord<Yardanico> and if that file doesn't exist, just create it
13:45:25FromDiscord<Goel> I just checked i dont have that file in my home or root direct
13:45:32FromDiscord<Yardanico> create it.
13:45:33FromDiscord<Solitude> > and if that file doesn't exist, just create it
13:45:41FromDiscord<Rika> or maybe its not shown
13:45:43FromDiscord<Goel> Is this? .bash_profile
13:45:49FromDiscord<Solitude> .profile
13:45:53FromDiscord<Rika> a file starting with a dot is hidden
13:46:22FromDiscord<Rika> just make the `.profile` file if you cant find it
13:47:14FromDiscord<Goel> Oh ok i dont have the .profile but i have .bashrc
13:47:58FromDiscord<dk> just type `vim ~/.profile`
13:48:56FromDiscord<Solitude> `echo "export PATH=$HOME/.nimble/bin:$PATH" >> ~/.profile`
14:02:41giaco_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:27FromDiscord<Yardanico> did you strip it? :P
14:03:52FromDiscord<Yardanico> also that big size might be because of some stdlib/other module adding a lot of stuff
14:03:56FromDiscord<Yardanico> I really can't say much without the code
14:04:42giaco_Yardanico: is just a ~200 line program that does just some string fiddling with incoming udp packets, here's the imports
14:04:54FromDiscord<Yardanico> then 1.3mb is surely a big size]
14:04:55FromDiscord<Yardanico> (edit) "size]" => "size"
14:05:09giaco_std/[sugar,net,asyncdispatch,asyncnet,strutils,strformat,httpclient,times] , binarylang, bitstreams
14:05:34FromDiscord<Yardanico> maybe it's binarylang and binstreams that make the binary size much larger?
14:05:43FromDiscord<Yardanico> anyway, try to do "strip -s binary"
14:05:46FromDiscord<Yardanico> and check binary size again
14:06:39giaco_this is binarylang: https://github.com/sealmove/binarylang/blob/main/binarylang.nim , and bitstream is part of it
14:07:05FromDiscord<Yardanico> yeah I know
14:07:24FromDiscord<Yardanico> so what's the size after stripping?
14:07:35FromDiscord<Yardanico> and also, maybe you embed a lot of stuff in `const`s ?
14:07:45giaco_1.1MB
14:08:11giaco_just a array[256, uint16]
14:08:39FromDiscord<Yardanico> then I'm sorry, don't have any ideas without checking the actual src :P
14:09:34narimiranwild guess: maybe some `const` that shouldn't be? :)
14:10:17giaco_I have just 2 consts in my program, an int and an array[256, uint16]
14:10:35giaco_anctually 2 ints and an array[256, uint16]
14:10:55narimiran(only now i see that @Yardanico already went in that direction)
14:10:59FromDiscord<Yardanico> well, as I said the size might come from binarylang
14:11:06giaco_maybe binarylang, yeah
14:11:14FromDiscord<Yardanico> can you share the definition for binarylang?
14:11:15giaco_I should ask SealMove
14:11:18FromDiscord<Yardanico> of the parser thing
14:12:19*xet7 quit (Quit: Leaving)
14:12:40giaco_parser is parsing 42 strings for a total of 140 chars, so on average 3 chars long string
14:13:13FromDiscord<Yardanico> I just meant the definition for binarylang itself, but okay :P
14:13:50giaco_I already pasted it
14:14:04giaco_and you said "yeah I know"
14:14:17FromDiscord<Yardanico> sorry if I wasn't clear, I meant the parser definition for binarylang, not the lib itself
14:14:26FromDiscord<Yardanico> but I just checked a test from binarylang and it doesn't seem to inflate binary size that much
14:14:33FromDiscord<Yardanico> so yeah, I'm clueless without the complete source code, sorry
14:14:55giaco_and this is bitstreams: https://github.com/sealmove/bitstreams/blob/main/bitstreams.nim
14:15:12FromDiscord<Yardanico> just to check - you use -d:release on the command line and not in nim.cfg/config.nims right?
14:15:36giaco_I wrote a myprogram.nim.cfg file next to myprogram.nim
14:15:45FromDiscord<Yardanico> yeah, -d:release doesn't work when put in a config file
14:15:52FromDiscord<Yardanico> it'll display "release build" but it's not gonna be applied
14:16:00FromDiscord<Yardanico> you have to provide it on the actual command line
14:16:13FromDiscord<Yardanico> see https://github.com/nim-lang/Nim/issues/14272
14:17:39FromDiscord<Yardanico> so what's the binary size now? :P
14:17:56FromDiscord<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:40giaco_wait a second I did a silly copy paste move and now it doesn't compile anymore lol, let me fix this
14:20:35FromDiscord<dom96> 1.3mb is big now?
14:20:47FromDiscord<Yardanico> It's big for a small CLI tool :)
14:20:51FromDiscord<mratsim> Aren't you the one running Nim on embedded?
14:20:59FromDiscord<Yardanico> and as you can see we found the root cause which was the -d:release
14:21:24FromDiscord<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:35giaco_not running on embedeed now, x86 ubuntu here
14:22:00FromDiscord<Yardanico> mratsim was replying to dom
14:22:06giaco_please be patient I'm struggling finding what I've done with my silly copypaste move :P
14:22:10FromDiscord<Yardanico> hehe
14:23:32FromDiscord<dom96> for embedded it's big
14:23:40FromDiscord<dom96> for anything else, why worry about it?
14:23:55FromDiscord<Yardanico> you can apply same logic to performance
14:24:06FromDiscord<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:27FromDiscord<Yardanico> If it doesn't take a lot of time, I don't see why caring about binary size is bad
14:24:27giaco_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:10FromDiscord<dom96> In reply to @Yardanico ""why nim when you": js is actually pretty fast nowadays lol
14:25:20FromDiscord<dom96> and yes, lots of people make that judgement
14:26:23giaco_with -d:release is 673KB, with -d:danger is 610KB, now it looks correct
14:26:46FromDiscord<Yardanico> and now you're actually running a release build and not a slow debug one :)
14:26:54giaco_well I didn't know that .cfg files were ignoring -d:release
14:27:08FromDiscord<dom96> yeah, that's an annoying gotcha
14:27:22FromDiscord<dom96> the Nim compiler outputs the mode it's compiling in though
14:27:44FromDiscord<Yardanico> it'll output release if you have -d:release in nim.cfg
14:28:33giaco_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:46FromDiscord<Yardanico> you can also use nimble + nimble tasks
14:30:12FromDiscord<dom96> just create a task in your .nimble file
14:30:55giaco_I should probably learn how to nimble properly (how cool is saying this to the inventor?)
14:31:12idfvery
14:31:55FromDiscord<dom96> haha 🙂
14:32:55FromDiscord<VinKer> Hi, what tool is you guys are using to debug your nim code ?
14:33:15FromDiscord<Yardanico> main answer would be `echo`
14:33:18idfecho
14:33:20idfwtf
14:33:28FromDiscord<VinKer> @Yardanico Ha ha
14:33:38FromDiscord<dom96> That is actually a serious answer lol
14:33:51FromDiscord<VinKer> I know
14:33:56FromDiscord<haxscramper> I never used debugger in the last 2? years I guess
14:34:07FromDiscord<haxscramper> Basically when I switched from C++ to nim
14:34:27FromDiscord<haxscramper> never had to
14:34:43FromDiscord<VinKer> But what if the conditional debugging like visual studio ?
14:35:01FromDiscord<VinKer> I mean breaking 2nd hit of a loop
14:35:19FromDiscord<Yardanico> you can use traditional gdb/lldb with nim of course
14:35:25FromDiscord<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:28FromDiscord<Yardanico> there are also scripts that help to ease access to some stuff
14:35:48FromDiscord<VinKer> @Yardanico Let me check.
14:35:50FromDiscord<Yardanico> https://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py
14:35:57FromDiscord<haxscramper> I think last time I tried to debug a series of mutually recursive functions for AST traversal it ended badly
14:35:58FromDiscord<Seedofarson> on top
14:36:37FromDiscord<Yardanico> also https://www.reddit.com/r/nim/comments/lhaaa6/debugging_support_formatters_for_lldb_in_vscode/ for lldb
14:36:52FromDiscord<Yardanico> Also there's https://github.com/hediet/vscode-debug-visualizer/ which can be useful sometimes
14:37:06FromDiscord<Yardanico> I contributed a small nim demo to it https://github.com/hediet/vscode-debug-visualizer/tree/master/demos/nim
14:38:13FromDiscord<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:33FromDiscord<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:09FromDiscord<VinKer> @Yardanico thanks for the answer. Let me check
14:39:39FromDiscord<Yardanico> I think that it's more for debugging the data modifications and not the code flow itself
14:42:43FromDiscord<Seedofarson> sent a code paste, see https://play.nim-lang.org/#ix=2SlF
14:42:48FromDiscord<Seedofarson> with benchmarking
14:42:53FromDiscord<Seedofarson> I think
14:49:03ForumUpdaterBotNew thread by Livingstone1337: Is there a module for nim that acts like matplotlib?, see https://forum.nim-lang.org/t/7600
14:53:40m4r35n357Quick 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:33FromDiscord<haxscramper> https://nim-lang.org/docs/system.html#abs%2Cfloat64
14:55:26m4r35n357haxscramper, thanks, not sure if I ever would have found that, why is it in system?
14:55:47haxscramperBecause it is used commonly enough?
14:56:05m4r35n357hmmm, not convinced ;)
14:56:24haxscramperCan 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:47haxscramperAnd 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:12FromDiscord<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:25FromDiscord<Seedofarson> what do I track then?
15:10:34*drsensor is now known as dr_sensor
15:10:38FromDiscord<dom96> use `epochTime`
15:10:48FromDiscord<dom96> (or one of the more high resolution timers if you want)
15:10:51FromDiscord<Seedofarson> epochTime()
15:10:54FromDiscord<Seedofarson> ok
15:10:55FromDiscord<Seedofarson> ty!
15:11:16FromDiscord<mratsim> even for CPu tasks, cpuTime is the wrong thing to track.
15:11:23FromDiscord<mratsim> (edit) "CPu" => "CPU"
15:11:33FromDiscord<mratsim> CPU time has absolutely no use-case.
15:11:54FromDiscord<Yardanico> @dom96 what about monotimes?
15:12:03FromDiscord<dom96> In reply to @Yardanico "<@!132595483838251008> what about monotimes?": sure?
15:13:50FromDiscord<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:10FromDiscord<Yardanico> (sorry miran :D)
15:14:16FromDiscord<Yardanico> github notifications are fast :)
15:15:53FromDiscord<haxscramper> well finally
15:16:25FromDiscord<haxscramper> Getting ready to read comparisons with python pattern matching
15:16:37FromDiscord<Yardanico> yours is much better :)
15:17:22FromDiscord<haxscramper> yeah, though I have already come up with pretty decent response anyway
15:17:57FromDiscord<haxscramper> That manages to simultaneously admit all my screw-ups (if any) and still promote nim over python
15:19:00FromDiscord<konsumlamm> is it too late to fix grammar issues? :p
15:19:17FromDiscord<Yardanico> no, you can always make a PR
15:19:25FromDiscord<Yardanico> and yeah, I've noticed some :P
15:22:21FromDiscord<konsumlamm> time for some PRs xd
15:23:19FromDiscord<Yardanico> @haxscramper in `[any in (2 .. 10)] := [1, 2, 3]` the result is discarded?
15:23:27FromDiscord<Yardanico> or maybe I didn't understand the meaning of this example
15:24:06Prestigewhat is that syntax
15:24:16FromDiscord<Yardanico> pattern matching
15:24:23FromDiscord<Yardanico> have a read of the blog post and https://nim-lang.github.io/fusion/src/fusion/matching.html
15:25:46FromDiscord<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:48FromDiscord<haxscramper> (edit) "..10`" => ".. 10`"
15:26:04FromDiscord<haxscramper> `:=` is `assertMatch`
15:26:13FromDiscord<haxscramper> `?=` is `matches`
15:26:21*johannes quit (Ping timeout: 264 seconds)
15:28:04giaco_what is strip -s doing on a binary compiled with -d:danger? It is reducing its size quite a lot
15:29:15FromDiscord<konsumlamm> it reduces debug (and more) symbols
15:29:24FromDiscord<konsumlamm> aka deletes them
15:30:17giaco_doesn't -d:danger imply -d:release, and so no debug?
15:30:23FromDiscord<Yardanico> -d:danger implies release, yes
15:30:28FromDiscord<Yardanico> but debug symbols are a different kind of thing
15:32:29FromDiscord<dom96> pygments having trouble with that code hah
15:34:11FromDiscord<haxscramper> Only `_.startsWith("systemd"), .._]`
15:34:23FromDiscord<haxscramper> and `_<something-else>`
15:35:00FromDiscord<dom96> awesome that it just works (tm) with JSON
15:36:29FromDiscord<haxscramper> The hardest part was type inference
15:36:43FromDiscord<haxscramper> `@a | "int"` will make it `Option[]` for `a`
15:37:02FromDiscord<haxscramper> But `@a | (@a, "int")` gives just `T`
15:38:12FromDiscord<haxscramper> Everything else is relatively easy, though it probably has the most cursed proc signature I've ever written
15:38:19FromDiscord<haxscramper> sent a code paste, see https://play.nim-lang.org/#ix=2Sm9
15:51:49FromDiscord<Yardanico> sent a code paste, see https://play.nim-lang.org/#ix=2Sma
15:51:49FromDiscord<Yardanico> matching string length
15:52:06FromDiscord<Yardanico> (I know it's quite pointless since it can be easily replaced with ifs but still)
15:52:20FromDiscord<Yardanico> right now it says `Error: cannot generate VM code for len`
15:56:36FromDiscord<haxscramper> sent a code paste, see https://paste.rs/yrd
15:56:42FromDiscord<Yardanico> ah right
15:56:59FromDiscord<haxscramper> And `[len: > 5]` is malformed
15:57:04FromDiscord<haxscramper> DSL
15:57:14FromDiscord<Yardanico> what if you offer a `match` overload (IIRC it was used before?) in addition to `case`?
15:57:29FromDiscord<Yardanico> I think some people might prefer that so it's clear to differentiate between `case` and pattern matching
15:59:02FromDiscord<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:48FromDiscord<haxscramper> That's the only `match` overload that I've seen intended for common use (because it was/still is 'experiemental' feature)
16:03:11ForumUpdaterBotNew 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:23FromDiscord<konsumlamm> @haxscramper very nice article!
16:33:35*PMunch quit (Quit: leaving)
16:38:50*fputs joined #nim
16:47:19FromDiscord<mratsim> @haxscramper trail -> tail
16:57:54*rockcavera joined #nim
17:00:58FromDiscord<dom96> In reply to @haxscramper "That's not my problem": in other words, PRs welcome @Yardanico 😄
17:01:29FromDiscord<haxscramper> No, I don't think that's even a "PR" problem
17:01:51FromDiscord<haxscramper> 332 is not even accepted, and I think it is a language design issue
17:02:36FromDiscord<haxscramper> Designing framework to address all of these requirements at once is out of the fusion scope
17:08:49FromDiscord<รєคɭ๓๏שє> hey guys, is there a dissassemble nim API?
17:09:19FromDiscord<รєคɭ๓๏שє> I extract sections from PE files and want to dissassemble them (for example .rdata .text etc)
17:09:59FromDiscord<รєคɭ๓๏שє> if it works for x86 / 64 it's enough
17:11:50leorizehaxscramper: nice blogpost :)
17:12:25leorizeanyone posted it on HN yet?
17:13:35ForumUpdaterBotNew 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:37FromDiscord<Hi02Hi> In reply to @รєคɭ๓๏שє "hey guys, is there": if you mean generate assembly, you can compile with `--asm`
17:14:59FromDiscord<haxscramper> And you can use radare bindings, or make one if there is none already
17:15:12FromDiscord<รєคɭ๓๏שє> what do you mean `--asm`? basically i have a `seq[byte]` with the machine code
17:15:27FromDiscord<รєคɭ๓๏שє> and I want to turn it into assembly programmatically
17:17:30saemFor 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:28leorizesealmove: libbfd can probably perform disassembly, but there are no nim bindings that I know of
17:19:31FromDiscord<รєคɭ๓๏שє> similar to this https://github.com/zyantific/zydis
17:20:08FromDiscord<รєคɭ๓๏שє> In reply to @leorize "sealmove: libbfd can probably": ah ok, so I'll probably need to make my own bindings
17:20:46FromDiscord<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:29FromDiscord<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:36reversem3how can I parse out now() for format yyyy-dd-mm ,I tried to use split (':') and it didn't work
17:21:48reversem3sorry now() is from times library
17:21:56reversem3let current_date = now()
17:22:08reversem32021-03-10T11:06:47-06:00
17:22:39reversem3typeof(DateTime) === type DateTime
17:22:43FromDiscord<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:59FromDiscord<queersorceress> this is covered in the `times` module docs at the top.
17:23:18reversem3can you still format now() ?
17:24:25saem@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:56saemI can hop on discord for 15 minutes if you want a quick run through
17:25:14leorizefor the pretty printing you have to use gdb
17:25:23reversem3ahh I got it
17:25:38reversem3it was just confusing with the example I thought I had to parse then use format
17:25:42FromDiscord<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:53reversem3echo current_date.format("yyyy-MM-dd")
17:26:28saemYeah, it is using that. Haven't gotten as far as what you're suggesting but it's something I'm mulling over
17:26:40FromDiscord<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:23saemAnyhow, of you're interested I can show you what I've setup.
17:29:49FromDiscord<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:30FromDiscord<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:57saemThat's not my forte.
17:34:15saemI'll be on in a minute... updates
17:35:32leorizelcov 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:04FromDiscord<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:56leorizedid you compile nim code with `--debugger:native`?
17:39:25ForumUpdaterBotNew 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:45giaco_Hi รєคɭ๓๏שє! Would you mind a quick question about binarylang?
17:40:13FromDiscord<queersorceress> In reply to @leorize "did you compile nim": yes, i have.
17:40:31*junland joined #nim
17:40:35leorizethen it's weird that you can't set breakpoints/step through code
17:40:55saemUp 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:30saemI have a hard stop in 15 minutes
17:41:45FromDiscord<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:00saemhttps://github.com/nim-lang/Nim/blob/devel/tools/nim-gdb.py
18:11:55*Jjp137 quit (Ping timeout: 240 seconds)
18:13:28ForumUpdaterBotNew 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:45giaco_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:03ForumUpdaterBotNew 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:55FromDiscord<dk> In reply to @giaco_ "I have a function": https://nim-lang.org/docs/manual.html#exception-handling-try-expression
18:46:09FromDiscord<dk> you can do a `return` in a try expression
18:46:23FromDiscord<dk> or break control flow in general
18:47:48giaco_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:34FromDiscord<Seedofarson> Oh my god
20:08:41FromDiscord<Seedofarson> I did some real solid research into Nim
20:08:47FromDiscord<Seedofarson> Nim is the 🐐
20:08:52FromDiscord<mratsim> goat?
20:08:55FromDiscord<Seedofarson> JavaScript connectivity?!
20:08:59FromDiscord<Seedofarson> Greatest of all time
20:09:02FromDiscord<Seedofarson> (edit) "JavaScript connectivity?!" => "JavaScript?!"
20:09:18FromDiscord<mratsim> Did you know that it had a PHP backend 😉
20:09:32FromDiscord<Seedofarson> Whhhhattatatatt
20:09:54leorizethe keyword here is "had"
20:09:56FromDiscord<Seedofarson> It’s fast as hell
20:10:04FromDiscord<Seedofarson> Python linking
20:10:11FromDiscord<Seedofarson> C interfacing
20:10:18FromDiscord<Seedofarson> (edit) "linking" => "interfacing"
20:10:31FromDiscord<Seedofarson> HTML DSL!!! NATIVELYLYLYLYYYY
20:11:15FromDiscord<Seedofarson> C compiling
20:13:19FromDiscord<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:05FromDiscord<Seedofarson> And somehow, it still manages to be fast as fuck
20:14:41PrestigeIt's pretty sweet.
20:16:00FromDiscord<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:17FromDiscord<mratsim> (edit) "CLosure" => "Closure"
20:16:45FromDiscord<Seedofarson> Yeah
20:16:48FromDiscord<Seedofarson> That’s cool
20:17:16FromDiscord<Seedofarson> I didn’t know about the “google closure compiler”, it looks amazing though
20:17:55FromDiscord<mratsim> https://github.com/nim-lang/Nim/commit/35b0cc67e89a929270e77c07ecbf06f7cced3668#diff-5bfae5b518d4ab360a8cd26e9d7fdfef1d24dbf9f9922c6f77d8660a23792f51L194
20:19:12FromDiscord<Seedofarson> Rip, I haven’t even ever touched PHP though
20:19:14FromDiscord<Seedofarson> So
20:20:33FromDiscord<Seedofarson> I feel no loss
20:20:33FromDiscord<mratsim> Don't try
20:21:50FromDiscord<Seedofarson> Why not?
20:22:13FromDiscord<ElegantBeef> It's a mostly deprecated language that was looks like it designed intentionally to cause harm
20:22:21FromDiscord<Seedofarson> Lmaooooo
20:25:50FromDiscord<Seedofarson> Also, Nimpy is like, awesome
20:33:44FromDiscord<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:53FromDiscord<zetashift> But early PHP, please no have mercy on my soul
20:33:56FromDiscord<ElegantBeef> The bar of "Better than js" isnt that high
20:34:01FromDiscord<mratsim> both have the `===` operator :p
20:34:19FromDiscord<zetashift> In reply to @ElegantBeef "The bar of "Better": Very true, yet people still chose it
20:35:03FromDiscord<ElegantBeef> Hey if people put toothpicks under their toes and kick walls i'm not going to tell them no
20:37:12FromDiscord<Solitude> In reply to @ElegantBeef "Hey if people put": i will
20:37:32qwrimho its unfair, PHP was not designed at all
20:37:38FromDiscord<zetashift> Hey me neither, just saying PHP7+ isn't _that_ bad.
20:38:08FromDiscord<ElegantBeef> lol qwr
20:38:13FromDiscord<zetashift> I wonder how the world would've looked if C never got popular but languages like Pascal and Ada did.
20:38:22FromDiscord<ElegantBeef> It'd be a much better place 😛
20:38:36FromDiscord<zetashift> Yes I think so too haha
20:38:41FromDiscord<ElegantBeef> ~~Meanwhile we're in a wirth-like language discord~~
20:39:34FromDiscord<Hi02Hi> i mean c allowed systems programming, and nim is a systems programming language (but not only one)
20:40:03FromDiscord<haxscramper> I didn't "allow system programming". They wrote unix in it, but it could be any other language
20:40:29FromDiscord<haxscramper> That is less ugly, less error-prone, with less syntactic and semantic clutches
20:41:26FromDiscord<haxscramper> One thing for example that I still can't understand is this horrible macro preprocessor that is extremely inefficient too
20:41:33FromDiscord<zetashift> People don't care about those things if it's unfamiliar I guess?
20:43:48FromDiscord<Hi02Hi> true, but doesnt system programming require performance?
20:44:11FromDiscord<Hi02Hi> (edit) "performance?" => "performance/access to memory?"
20:44:19FromDiscord<Hi02Hi> (edit) "performance/access to memory?" => "performance?"
20:44:29leorizepascal is pretty fast :P
20:44:59FromDiscord<Hi02Hi> i dunno, but does it compete with asm/c
20:45:01FromDiscord<Hi02Hi> (edit) "asm/c" => "asm/c?"
20:45:04FromDiscord<Seedofarson> Have y’all seen crystal?
20:45:09FromDiscord<haxscramper> PL design does not immediately correspond to slow/fast performance
20:45:16FromDiscord<Seedofarson> It’s super super super premature, but it looks cool
20:45:33FromDiscord<haxscramper> Having pointers and `{{{}}}` with some `&&&&&` does not make your code faster
20:47:19FromDiscord<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:42ForumUpdaterBotNew 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:58FromDiscord<Hi02Hi> gc?↵but still, nim compiles to c, so that makes sense
20:49:25FromDiscord<haxscramper> `--gc:none`, `var myHappyString: ptr char` and you are set
20:49:33FromDiscord<haxscramper> For segfaults at least
20:49:55FromDiscord<Hi02Hi> i dont know much about --gc:none, teach me
20:50:33FromDiscord<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:49FromDiscord<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:23FromDiscord<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:28FromDiscord<ElegantBeef> Just dont touch the stdlib 😄
21:11:03FromDiscord<mratsim> you can use bitops
21:11:22FromDiscord<ElegantBeef> Yea some modules dont touch gc'd memory, so you can use some
21:13:05FromDiscord<ElegantBeef> Math for instance 😄
21:13:42FromDiscord<ElegantBeef> Or you know just `--gc:arc` and live life with scoped memory management
21:14:27FromDiscord<haxscramper> macros, sugar, pattern matching should also work for any GC, so you are getting C-with-lisp-macros
21:15:14FromDiscord<ElegantBeef> Yep
21:15:31FromDiscord<haxscramper> Generics, first-class functions, closures, which is a very good deal in itself
21:15:33FromDiscord<ElegantBeef> And a strong type systems
21:15:34FromDiscord<ElegantBeef> (edit) "systems" => "system"
21:15:40FromDiscord<haxscramper> `distinct void`
21:19:53ForumUpdaterBotNew thread by CaptainBland: Template varargs syntax sugar for procs accepting tuples - good idea?, see https://forum.nim-lang.org/t/7604
21:24:54FromDiscord<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:10PrestigeHow do you quantify fast enough?
21:35:22*birdspider joined #nim
21:40:07reversem3How do you change the output for calculating variables using times module
21:40:09reversem3Difference Between the two dates is: 52 weeks, 1 day, and 1 hour
21:40:27reversem3How can I turn that in to days only ?
21:40:47*birdspider quit (Quit: Leaving)
21:41:08*birdspider joined #nim
21:42:09FromDiscord<Recruit_main707> weeks 7 + days + hours / 24
21:42:13FromDiscord<Araq> huh, my IC test is red on OSX, time to switch computers
21:42:45FromDiscord<dom96> In reply to @Prestige "How do you quantify": My game can sustain 60 FPS on most machines (stardust.dev)
21:44:55reversem3Ok so you have to calculate that yourself then , so the default for times module is weeks
21:45:11leorizereversem3: have you tried inDays()?
21:46:38*idf quit (Ping timeout: 272 seconds)
21:47:25reversem3<leorize "nixfreak: have you tried inDays("> No I found it now , inDays , inWeeks, inYears thanks
21:48:59reversem3I still have issues reading the documentation sorry
21:51:37*idf joined #nim
21:54:49*arecaceae joined #nim
21:55:57ForumUpdaterBotNew 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:06FromDiscord<รєคɭ๓๏שє> I've never used nimterop. Where do I begin if I want to wrap this library? https://github.com/zyantific/zydis
22:19:18FromDiscord<Solitude> with c2nim'ing the headers and manually cleaning them up
22:22:39FromDiscord<รєคɭ๓๏שє> do you recommend I use c2nim and not nimterop? or use c2nim from nimterop somehow?
22:22:55Prestige@dom96 a benchmark would be nice, but yeah
22:24:35*birdspider quit (Quit: Leaving)
22:25:03FromDiscord<mratsim> In reply to @รєคɭ๓๏שє "I've never used nimterop.": You begin by sacrificing a goat on the altar of C build systems.
22:25:18FromDiscord<รєคɭ๓๏שє> :D
22:26:06FromDiscord<dom96> In reply to @Prestige "<@132595483838251008> a benchmark would": Real people playing the game is the benchmark 😉
22:26:22FromDiscord<mratsim> That doesn't seem hard to wrap/build though
22:26:53FromDiscord<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:20FromDiscord<mratsim> and for wrapper generation nimterop should be able to deal with C files cleanly
22:28:08FromDiscord<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:53FromDiscord<mratsim> original: https://github.com/pytorch/cpuinfo
22:40:28FromDiscord<รєคɭ๓๏שє> 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:06FromDiscord<mratsim> Try to wrap a C library with a single C file or 2 for starter.
22:42:05FromDiscord<mratsim> for example this one is pretty small: https://github.com/plasma-umass/coz/tree/master/libcoz
22:42:21FromDiscord<mratsim> but an image library might work as well
22:43:37FromDiscord<g33kidd> In reply to @Seedofarson "I think I’m becoming": same
22:45:54PrestigeThat's anecdotal
22:46:11PrestigeI meant a real benchmark to see how Nim's js performance is dom
22:46:29PrestigeIt's good that it's able to run such applications, though
22:53:42*tane quit (Quit: Leaving)
22:57:37FromDiscord<ElegantBeef> Is there any documentation on how to make a macro compliant with `push`?
22:57:38FromDiscord<Seedofarson> So
22:57:41FromDiscord<Seedofarson> Would that work
22:57:48FromDiscord<Seedofarson> For a webapp
22:57:52FromDiscord<Seedofarson> If I want to use Nim
22:57:55FromDiscord<Seedofarson> I have to do
22:58:05FromDiscord<ElegantBeef> You can use wasm or the js backend
22:58:08FromDiscord<Seedofarson> Button —> JS —-> Nim script
22:58:26FromDiscord<ElegantBeef> No cause nimscript isnt what you'd be running
22:58:32FromDiscord<ElegantBeef> You'd be running Nim's js backend
22:58:47FromDiscord<ElegantBeef> Nimscript is a subset of nim that is interpreted
22:59:45PrestigeIt sort of works how typescript does - it compiles nim to js, and that js is executed
23:00:12FromDiscord<Anonymous Poet> sent a code paste, see https://play.nim-lang.org/#ix=2SoC
23:00:21FromDiscord<Seedofarson> Ahhhh
23:00:22FromDiscord<Seedofarson> Ok
23:00:27FromDiscord<ElegantBeef> Jeez i think i can partially read that poet
23:00:32FromDiscord<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:02FromDiscord<Anonymous Poet> uhm, theres generic type params L and R, and possible outputs LO (Left out) and RO (right out)
23:01:54FromDiscord<ElegantBeef> So either is just a `bool` and two values?
23:02:14FromDiscord<Seedofarson> In reply to @Seedofarson "Button —> JS —->": Now it’s ↵Button -> JS(secretly compiled Nim)
23:02:18FromDiscord<Seedofarson> ?
23:02:28FromDiscord<Anonymous Poet> In reply to @Seedofarson "Now it’s Button": thats probably right
23:02:32FromDiscord<ElegantBeef> Nah it's not secretly compiled, it says right in it it was output from the Nim compiler 😛
23:02:38FromDiscord<Seedofarson> Lmaooo
23:02:41FromDiscord<Seedofarson> Ok
23:02:48FromDiscord<Seedofarson> Hmmmm
23:02:57FromDiscord<Seedofarson> Do all libraries and stuff still work with ITV
23:03:01FromDiscord<Seedofarson> (edit) "ITV" => "it?"
23:03:03FromDiscord<ElegantBeef> It's really not much different than typescript except that it's got more fancy features
23:03:09FromDiscord<Anonymous Poet> @ElegantBeef https://play.nim-lang.org/#ix=2SoG still wip on what im trying to get at
23:03:14FromDiscord<ElegantBeef> Not all libraries, anything that requires C interop will not
23:03:20FromDiscord<ElegantBeef> Or running natively
23:03:21FromDiscord<Anonymous Poet> In reply to @Seedofarson "Do all libraries and": i think certain things like filesystem also doesnt work
23:03:31FromDiscord<Seedofarson> Will HTTP client?
23:03:37FromDiscord<Anonymous Poet> should do, yes
23:03:39FromDiscord<ElegantBeef> Nope
23:03:43FromDiscord<Anonymous Poet> anything thats written in pure nim should be good
23:03:49FromDiscord<Seedofarson> Request
23:03:51FromDiscord<ElegantBeef> The http client uses system sockets
23:03:53FromDiscord<Seedofarson> (edit) "Request" => "Requests go brrrr"
23:03:56FromDiscord<Anonymous Poet> oh rip 😦
23:04:01FromDiscord<Seedofarson> In reply to @ElegantBeef "The http client uses": Fuck.
23:04:09FromDiscord<ElegantBeef> I mean you can wrap JS code yourself
23:04:13FromDiscord<Seedofarson> Yeah
23:04:16FromDiscord<Seedofarson> Is it readable
23:04:18FromDiscord<ElegantBeef> https://github.com/beef331/mrapi/blob/master/src/mrapi.nim
23:04:21FromDiscord<ElegantBeef> I mean check it yourself
23:04:36FromDiscord<ElegantBeef> That's my wrapping of a the webrtc screen recording/mic recording
23:04:41FromDiscord<Seedofarson> That sucksss
23:04:51FromDiscord<Seedofarson> Ok
23:05:26*D_ quit (Ping timeout: 264 seconds)
23:05:35FromDiscord<ElegantBeef> Hmm poet dont really see the point of the variant
23:05:50FromDiscord<Seedofarson> What is it though, it looks weird
23:06:33*D_ joined #nim
23:07:14FromDiscord<Seedofarson> Webapp --> Nim with all the native libraries
23:07:23FromDiscord<Seedofarson> (edit) "Webapp" => "I just wanna do↵↵Webapp"
23:07:27FromDiscord<Seedofarson> Rip
23:09:33FromDiscord<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:07FromDiscord<ElegantBeef> So what's the issue with the mapping?
23:13:42FromDiscord<ElegantBeef> @Anonymous Poet doesnt this work? https://play.nim-lang.org/#ix=2SoL
23:28:11ForumUpdaterBotNew 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