<< 18-10-2023 >>

00:49:55*krux02 quit (Remote host closed the connection)
02:54:00*derpydoo quit (Read error: Connection reset by peer)
03:02:19NimEventerNew Nimble package! gemmaJSON - json parsing library based on bindings of simdjson, see https://github.com/sainttttt/gemmaJSON
03:07:20NimEventerNew Nimble package! fedi_auth - A basic library to authenticate to fediverse instances, see https://codeberg.org/pswilde/fedi_auth
03:07:20NimEventerNew Nimble package! gts_emoji_importer - A tool for admins to import custom emojis into GoToSocial, see https://codeberg.org/pswilde/gts_emoji_importer
03:54:24*beholders_eye quit (Ping timeout: 272 seconds)
03:56:13*beholders_eye joined #nim
04:18:29*beholders_eye quit (Ping timeout: 255 seconds)
06:01:29*advesperacit joined #nim
06:20:07*gooba quit (Ping timeout: 255 seconds)
06:32:29PMunch_At least one way..
06:32:42*PMunch_ is now known as PMunch
06:38:56*FromDiscord quit (Remote host closed the connection)
06:39:10*FromDiscord joined #nim
06:39:38FromDiscord<pmunch> Bridge has been rebooted, trying it now
06:43:50*gooba joined #nim
06:55:23FromDiscord<Chronos [She/Her]> Maybe this is a sign for a new bridge impl :P
06:55:57FromDiscord<Elegantbeef> Nah just let the boomers talk amongst themselves
06:55:59PMunchI mean a slight hickup every other year I think we can live with
06:58:20FromDiscord<Elegantbeef> ps it's hiccup 😛
06:58:44PMunchYeah I felt that was wrong
06:59:01FromDiscord<Elegantbeef> Hickapp is a application written by someone in the boons
06:59:03FromDiscord<Elegantbeef> So my software
06:59:11FromDiscord<ieltan> How do I use term rewriting macros so that they only work on a `let` declaration? I can see it should be possible since it's part of parameter predicate but I'm not sure about the syntax
06:59:50FromDiscord<Elegantbeef> iirc it's `{(let x = y)}(x, y: untyped`
07:00:39FromDiscord<ieltan> Alright, thanks! 😁
07:00:59FromDiscord<Elegantbeef> Remember that TRMs should not change the typed meaning of a statement
07:01:46FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JhP
07:02:07PMunchAre the new concepts documented anywhere?
07:02:14FromDiscord<Chronos [She/Her]> In reply to @PMunch "I mean a slight": It has happened semi-often that the bridge breaks for a bit so
07:02:16FromDiscord<Elegantbeef> Also although you can use `untyped` for parameters TRM happens after typing so it does not particularly matter
07:02:28FromDiscord<Elegantbeef> The matrix bridge
07:02:31PMunchWas looking at that forum topic and wanted to look at the concept docs but couldn't find anything
07:02:37FromDiscord<Elegantbeef> The irc bridge is solid like eating 3lbs of cheese
07:02:49FromDiscord<Elegantbeef> The closest we have to docs are Araq's RFC
07:03:00PMunchRight..
07:03:51FromDiscord<Elegantbeef> New style concepts are just pointless presently, other than a language built in trait syntax really
07:04:10FromDiscord<ieltan> In reply to @Elegantbeef "Remember that TRMs should": Well, I am wrapping a library that has a immutable/mutable api and want to bind the immutable api to let declarations and the mutable one to var declarations. Not sure if that's a good use of the feature but it's the only thing I thought of
07:04:40FromDiscord<ieltan> Both api are wrapped in a single type
07:04:52FromDiscord<Elegantbeef> Uhhuh
07:04:59FromDiscord<Elegantbeef> Sounds more like something for type states
07:05:09FromDiscord<Chronos [She/Her]> What's the use or term rewriting macros anyway?
07:05:25FromDiscord<Elegantbeef> Optimisations is the design
07:05:34FromDiscord<Elegantbeef> But I think it's the best semantic linter
07:05:55FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/9739#64098 I always bring this up
07:05:58FromDiscord<ieltan> In reply to @Elegantbeef "Sounds more like something": What is a type state? I'm a noob as you can see 😅
07:06:06FromDiscord<Chronos [She/Her]> How would you use it for optimisations? I can't see it
07:06:42FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4JhQ
07:06:43FromDiscord<Elegantbeef> Read the manual for them
07:06:54FromDiscord<Elegantbeef> https://nim-lang.org/docs/manual_experimental.html#term-rewriting-macros
07:07:45FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "https://forum.nim-lang.org/t/9739#64098 I always br": Oh that seems useful
07:08:01FromDiscord<Elegantbeef> That's an unintended feature really
07:08:12FromDiscord<Elegantbeef> Once you can introspect ast you can do a bunch of linting
07:08:39FromDiscord<ieltan> sent a code paste, see https://play.nim-lang.org/#ix=4JhR
07:08:44FromDiscord<Elegantbeef> To top it off you can make a bunch of linters and just have a `--import:bleh` in your config
07:08:58FromDiscord<Elegantbeef> So they do not have to be in a single file and it can be quite customizable
07:09:10FromDiscord<Elegantbeef> But I'm told people do style linting, so it's not that great 😄
07:09:47FromDiscord<Elegantbeef> https://forum.nim-lang.org/t/9976#65763 another example of typestates ieltan
07:09:53FromDiscord<Elegantbeef> Much more complete and 'proper'
07:14:23FromDiscord<ieltan> Wow, that's much clearer to me
07:15:04FromDiscord<ieltan> clever use of the type system, i'll steal some of that 😉
07:15:25FromDiscord<Elegantbeef> Hey it's under some public domain or sharealike license 😄
07:15:33FromDiscord<Elegantbeef> Don't recall what the forum uses
07:16:37FromDiscord<Elegantbeef> Anyway type states are an awesome part about having static type information
07:17:00FromDiscord<Elegantbeef> Much more ergonomic than having to have a type per state
07:25:06FromDiscord<ieltan> Seems like I can use your idea of using the term rewriting macros as a linter too
07:59:29FromDiscord<hasnainelahi.> Hello and Good Day!↵just a general question: is there any framework in any language that is faster in terms of the loading time of a simple and static web page? ↵Thank you!
08:08:29*jkl quit (Quit: Gone.)
08:08:44FromDiscord<nnsee> In reply to @hasnainelahi. "Hello and Good Day!": faster than what?
08:09:15FromDiscord<nnsee> are you asking if any framework will be able to produce a site that loads faster than a static web page?
08:09:56FromDiscord<nnsee> because the answer is that it depends on the site itself
08:09:59FromDiscord<nnsee> but generally, no
08:12:22*jkl joined #nim
08:18:41*jkl__ joined #nim
08:20:05*jkl quit (Ping timeout: 240 seconds)
08:20:36*jkl__ quit (Client Quit)
08:26:25FromDiscord<saint._._.> In reply to @chronos.vitaqua "src/gemmaJSON.out": Ooos thank you!
08:26:48FromDiscord<saint._._.> (edit) "Ooos" => "Ooops"
08:27:06FromDiscord<hasnainelahi.> In reply to @nnsee "are you asking if": thank you for answering, i updated my question i hope it is now more clear!
08:27:39FromDiscord<Chronos [She/Her]> In reply to @saint._._. "Ooops thank you!": Np! Also I'm wondering how much converting gemmaJsonNodes into JsonNodes would cost
08:28:22FromDiscord<nnsee> In reply to @hasnainelahi. "Hello and Good Day!": if it's a static website, why are you using a framework at all? use a static site generator
08:28:22FromDiscord<Chronos [She/Her]> Performance wise :p
08:28:44FromDiscord<nnsee> no framework, ever, will be faster than simple HTML + CSS
08:29:00FromDiscord<nnsee> the loading of the framework libs itself is enough overhead that it will negate any performance gains you might get
08:29:07FromDiscord<.aingel.> In reply to @chronos.vitaqua "Np! Also I'm wondering": What would be the use case of it
08:29:22FromDiscord<.aingel.> The main point of using the simdjson parser is that you don't want to parse out the whole object
08:29:28FromDiscord<.aingel.> If you do that you sort of lose the speed up
08:29:44FromDiscord<.aingel.> It's for when you want to access just one field, that's when the speedup increases really
08:29:48FromDiscord<.aingel.> IIRC
08:31:53FromDiscord<Chronos [She/Her]> That's fair enough
08:31:53FromDiscord<.aingel.> But yeah I should look into a way of doing it, just for ease of use or completeness if nothing else
08:32:24FromDiscord<Chronos [She/Her]> May be useful for db-related purposes when you need to store and parse it a lot?
08:32:40FromDiscord<Chronos [She/Her]> Parse, modify then store
08:33:21FromDiscord<.aingel.> Hmm yeah, well at least there should be a way to serialize which I don't have rn
08:34:10FromDiscord<ieltan> Don't need the JsonNodes, just the doc object on top of a std/json like API is enough imo
08:34:48FromDiscord<.aingel.> Gotcha, yeah
08:47:56FromDiscord<Chronos [She/Her]> In reply to @ieltan "Don't need the JsonNodes,": Imo it'd be important for compat with existing libs that take a JsonNode (prologue is one)
08:50:10FromDiscord<hasnainelahi.> In reply to @nnsee "if it's a static": But i want proper routes like domain/blogs ... etc how i can get with simple HTML + CSS !
08:50:55FromDiscord<Elegantbeef> Generate a bunch of different pages then link to them
08:52:41FromDiscord<Elegantbeef> https://github.com/beef331/beef331.github.io/blob/master/website/src/website.nim#L229-L230 all I do in my shittily designed site that uses karax
08:54:10FromDiscord<nnsee> In reply to @hasnainelahi. "But i want proper": like I said, a static site generator. I use Jekyll for my blog, but I've heard good things about Hugo as well. It's also relatively easy to build your own.
09:01:11*PMunch_ joined #nim
09:03:49*azimut quit (Ping timeout: 252 seconds)
09:04:27*PMunch__ joined #nim
09:04:55*PMunch quit (Ping timeout: 252 seconds)
09:05:27*PMunch_ quit (Ping timeout: 240 seconds)
09:06:19*PMunch_ joined #nim
09:09:19*PMunch__ quit (Ping timeout: 252 seconds)
09:23:56FromDiscord<hasnainelahi.> In reply to @nnsee "like I said, a": i just gave the example of a blog site but i want to develop a landing page.
09:26:12FromDiscord<nnsee> i know, i used my blog as an example as well. you can use static site generators for any site
09:26:26FromDiscord<nnsee> https://themes.gohugo.io/tags/landing/
09:35:19FromDiscord<hasnainelahi.> Thank you! 👍
09:42:52*azimut joined #nim
09:59:57FromDiscord<sOkam! 🫐> Is there a way to give a define some value when declared inside a pragma? Something like:↵`{.define: thing = 1.}` replacing `-d:thing:1`
10:37:26FromDiscord<vindaar> sent a code paste, see https://play.nim-lang.org/#ix=4JiF
10:59:31*beholders_eye joined #nim
11:11:19FromDiscord<sOkam! 🫐> In reply to @vindaar "not quite what you": cannot be farthest from the goal. what I ask would serve as a way to define for those
11:11:33FromDiscord<sOkam! 🫐> would/could
11:14:10PMunch_Anyone know what changed in 2.0.0 to have messed this up? /home/peter/.choosenim/toolchains/nim-2.0.0/lib/pure/unicode.nim(849, 36) Error: type mismatch: got 'int32' for 'RuneImpl(toLower(ar)) - RuneImpl(toLower(br))' but expected 'int'
11:14:44*PMunch_ is now known as PMunch
11:24:40PMunchHmm, weren't there someone who wrote a import mapper thing?
11:25:08PMunchI get that error from unicode.nim, but I can't find out where it comes from..
11:30:32*beholders_eye quit (Quit: WeeChat 3.6)
11:31:26FromDiscord<Phil> The only mapping I did was generating mapper procedures
11:31:52FromDiscord<Phil> ~~with excellent documentation~~
11:31:58PMunchI meant creating a map of the imports
11:32:07PMunchBasically a graph of what import what
11:32:39FromDiscord<Phil> Actually that sounds sick if you output it as a mermaid graph
11:33:51PMunchYeah, I'm pretty sure I've seen something like this..
12:32:40FromDiscord<Schelz> sent a code paste, see https://play.nim-lang.org/#ix=4Jj5
12:33:49PMunch--passL:"-fpass-struct=8"?
12:38:08FromDiscord<Schelz> thx i got it working
12:41:03PMunchBy the way, you also have the packed pragma
12:42:34FromDiscord<Schelz> whats that ?
12:47:06PMunchhttps://nim-lang.org/docs/manual.html#foreign-function-interface-packed-pragma
12:50:21*beholders_eye joined #nim
13:01:42FromDiscord<Chronos [She/Her]> In reply to @heysokam "Is there a way": That seems impossible and just not doable in a sensible way
13:02:27FromDiscord<Chronos [She/Her]> Since, point of define toggles is that you know the value at time of compilation, before code is actually compiled so you know that when statements will be ran
13:03:07FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Since, point of define": how do you explain that `{.define:ssl.}` exists, then?
13:03:16FromDiscord<Chronos [She/Her]> Huh? That's a thing?
13:03:25FromDiscord<sOkam! 🫐> it does not exist for asigning values, but it does for non-value symbols
13:03:29advesperacitwow.. not only does testament litter it's trash everywhere, it then goes and reuses some old trash instead of recompiling when running `testament all`
13:03:30FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Huh? That's a thing?": yeah
13:03:42FromDiscord<sOkam! 🫐> (edit) "yeah" => "yeah. hence my question"
13:03:48FromDiscord<Chronos [She/Her]> Huh... Does that apply globally? Or only to the proc you use it on?
13:04:13FromDiscord<sOkam! 🫐> In reply to @chronos.vitaqua "Huh... Does that apply": it applies onwards since the moment you define it↵its just a C `#define thing`
13:04:25FromDiscord<sOkam! 🫐> what i was asking for is `#define thing 1`
13:04:40FromDiscord<sOkam! 🫐> so not that far away... just that I haven't found the syntax to do it
13:05:32FromDiscord<sOkam! 🫐> If its illegal, I figure it could be because of the lack of any type information, i guess 🤔
13:06:11FromDiscord<Chronos [She/Her]> Ah hm
13:06:42FromDiscord<sOkam! 🫐> I hacked it in my compiler with `{.define: thing -> 1.}`... but was looking for a more standard way to write it
13:07:00FromDiscord<sOkam! 🫐> `=` is not allowed in pragmas, apparently
13:07:02FromDiscord<Chronos [She/Her]> Fair enough
13:07:15FromDiscord<Chronos [She/Her]> That seems really weird that this is even allowed to me but ig it makes sense
13:08:36FromDiscord<sOkam! 🫐> why? its just a regular compile-time define, and the code is parsed at compile time for macros, so its a lot less complicated that macros/templates, tbh
13:08:56FromDiscord<sOkam! 🫐> (edit) "the" => "nim" | "nimcode is ... parsed" added "already"
13:09:41FromDiscord<sOkam! 🫐> its also crazy useful to target certain library funcionality from another library↵like only using vulkan-glfw from a vulkan library
13:09:44FromDiscord<Chronos [She/Her]> It seems odd to me because that means midway through compilation you can change the behaviour of code that's compiled after that statement
13:10:07FromDiscord<Chronos [She/Her]> In reply to @heysokam "its also crazy useful": Fair enough
13:10:32FromDiscord<nnsee> In reply to @chronos.vitaqua "It seems odd to": i mean, yeah? that's the whole principle behind push and pop for example
13:10:33FromDiscord<sOkam! 🫐> idk when is parsed, though. i figure it must be interpreted during semantics
13:10:48*PMunch quit (Quit: Leaving)
13:11:09FromDiscord<sOkam! 🫐> so its probably not changing in-between compilation, but rather being stored before it
13:11:23FromDiscord<sOkam! 🫐> (edit) "in-between" => "mid"
13:11:53FromDiscord<sOkam! 🫐> blind guess, don't know for sure. but it seems sensible for it to be that way 🤷‍♂️
13:29:26FromDiscord<Chronos [She/Her]> Fair
13:44:26*derpydoo joined #nim
14:00:55*alphacentauri quit (Quit: WeeChat 4.1.0)
14:15:45*xet7 quit (Remote host closed the connection)
15:09:01*azimut quit (Ping timeout: 252 seconds)
15:24:02*alphacentauri joined #nim
15:31:34FromDiscord<asakura44> hello people
15:43:07FromDiscord<Phil> Cheers
16:00:06*arkanoid joined #nim
16:00:22*alphacentauri quit (Quit: WeeChat 4.1.0)
16:00:54arkanoidis it just me or nimlsp seems much more stable,faster and less resource intensive than nimlangserver/nimsuggest
16:01:21NimEventerNew thread by dlesnoff: Type introspection, see https://forum.nim-lang.org/t/10554
16:20:33FromDiscord<.aingel.> In reply to @arkanoid "is it just me": Theres some big issue with nimlangserver that causes it to not kill the process when it quits or crashes or something
16:21:00FromDiscord<.aingel.> I saw someone else mentioning it and noticed I had loads of nimlangserver processes on my machine, so I switched back to nimlsp
16:33:15*alphacentauri joined #nim
17:35:14FromDiscord<pcarrier> What does vscode use?
17:35:31FromDiscord<pcarrier> (edit) "What does vscode use? ... " added "I’ll take the lighter stabler solution please 😉"
17:36:38FromDiscord<leorize> saem plugin uses nimsuggest directly, but I'd recommend something like nimlsp because it's in a better position to provide semantic data like parameter types
17:36:55FromDiscord<leorize> though it's worth noting that like nimsuggest, nimlsp also crashes a lot
17:45:36FromDiscord<jmgomez> there is an option to use the nimlangserver as well see https://github.com/saem/vscode-nim#nim-lanugage-server-integration-experimental
18:30:06*beholders_eye quit (Ping timeout: 260 seconds)
18:31:45*beholders_eye joined #nim
18:42:55FromDiscord<pcarrier> Is the nimsaem extension better than Konstantin Zaitsev? ngl went for the first one in the results, which seems to be a popularity contest
18:44:13FromDiscord<leorize> one is maintained and the other is not
18:46:18FromDiscord<Chronos [She/Her]> Which one is maintained? :p
18:50:31FromDiscord<pcarrier> Konstantin's hasn't seen a release since Mar 2020
18:50:50FromDiscord<pcarrier> nimsaem's May 2022
19:10:57arkanoidthe difference is that when something goes wrong with nimlangserver and puppet nimsuggest processes, it's very possible (and happens quite a lot for me) that you end up with an army of puppet nimsuggest processes without master nimlangserver eating all your ram
19:11:34arkanoidwhile with nimlsp, which is compiled with nimsuggest logic code internally, it crashes without leaving puppet processes around
19:11:58arkanoidmy personal record is 82 nimsuggest processes in htop
19:14:20*beholders_eye quit (Ping timeout: 255 seconds)
19:16:40FromDiscord<bostonboston> I forgot how many I had but my laptop came to a crawl, couldn't even type anymore
19:16:45*beholders_eye joined #nim
19:20:16FromDiscord<Chronos [She/Her]> Half-tempted to make a plugin for https://github.com/PMunch/nimlsp in VSC
19:23:23FromDiscord<Chronos [She/Her]> But I don't understand that stuff at all f
19:25:36FromDiscord<pcarrier> would love support for vscode's outline, if anybody wants to improve the situation there
19:26:04*azimut joined #nim
19:42:49FromDiscord<taperfade> hii
19:42:55*beholders_eye quit (Ping timeout: 255 seconds)
19:43:05arkanoidthe first candidate for improvements should be nimsuggests, as that would improve basically both LSPs and seam extension when configured to use nimsuggest directly (default)
19:43:54FromDiscord<taperfade> I always get this error when using the unicode module in my code ↵can show code in dms !↵Error: unhandled exception: C:\Users\sillymee\.nimble\pkgs2\unicodedb-0.12.0-4452416471e2fe8726eb6070ed6ea7368171cc09\unicodedb\types.nim(23, 3) `cp.int <= 0x0010FFFF` [AssertionDefect]
19:44:23arkanoidbut considering the possibility of nimsuggest code crashing anyway even after improvement, also improving the current state of LSPs and native vscode extension is valuable
19:44:53FromDiscord<JJ> yeah. i don't love that improvements to tooling have been delegated behind incremental compilation
19:45:03*beholders_eye joined #nim
19:45:16FromDiscord<JJ> In reply to @arkanoid "while with nimlsp, which": i should try out nimlsp again...
19:45:23FromDiscord<TӨMΛ ☠> sent a code paste, see https://play.nim-lang.org/#ix=4Jlh
19:46:48FromDiscord<Chronos [She/Her]> In reply to @arkanoid "the first candidate for": I wonder if a complete rewrite would help
19:48:07FromDiscord<nervecenter> In reply to @toma400 "Stupid question, but how": An array of char pointers? For a 2-D array or something?
19:48:09FromDiscord<JJ> In reply to @toma400 "Stupid question, but how": that looks like `newString(len: Natural)`
19:48:26FromDiscord<JJ> or wait i cannot read
19:49:24FromDiscord<ElegantBeouf> When can you read
19:49:36FromDiscord<ElegantBeouf> `let ptrPtr = cast[ptr cstring](create(cstring, BufSize))`↵or `allocCstringArray`
19:49:40FromDiscord<ElegantBeouf> Bridge be deaded
19:49:41FromDiscord<Elegantbeef> Or `newCstringArray`
19:49:43FromDiscord<Elegantbeef> Sorry `allocCstringArray`
19:49:44FromDiscord<Elegantbeef> sent a code paste, see https://play.nim-lang.org/#ix=4Jlk
19:49:44FromDiscord<ElegantBeouf> There he is
19:49:46FromDiscord<Elegantbeef> Uh oh bridge is dead?
19:49:48FromDiscord<ElegantBeouf> The guy always is slow
19:49:56FromDiscord<JJ> rofl
19:50:14FromDiscord<nervecenter> If we know the context of the original line though, chances are Nim has a better solution, if that's what you might want
19:50:25FromDiscord<nervecenter> Without having to dip into double pointers
19:50:26FromDiscord<TӨMΛ ☠> In reply to @nervecenter "An array of char": I assume so, I got it from friend who is C fanatic and I kinda got him interested in Nim
19:50:43FromDiscord<ElegantBeouf> In reply to @nervecenter "If we know the": of course it's just a `seq[cstring]` afterall
19:50:44FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jlo
19:50:51FromDiscord<Chronos [She/Her]> But idk C that well so
19:50:54FromDiscord<JJ> that'd just be like. `seq[string]` i think
19:50:55FromDiscord<ElegantBeouf> you then just pass `mySeq[0].addr`
19:51:18FromDiscord<nervecenter> In reply to @toma400 "I assume so, I": Asking questions about new languages of C fanatics is kind of a pointless endeavour, they're always going to find pointless magic bullshit that not only serves little purpose but is actively bad practice, just because C can do it and compilers won't complain
19:51:36FromDiscord<JJ> hey nim can do pointless magic bullshit too
19:51:41FromDiscord<ElegantBeouf> Not really magic as much as C is not a typed language 😛
19:52:00FromDiscord<ElegantBeouf> `char` is the same as `char[][]` or w/e the syntax is
19:52:21FromDiscord<nervecenter> Yes and C being untyped allows for all kinds of magic
19:52:31FromDiscord<nervecenter> Well
19:52:33FromDiscord<ElegantBeouf> I mean you can do the same in Nim though
19:52:35FromDiscord<nervecenter> Uniformally integer types I guess
19:52:41FromDiscord<nervecenter> (edit) "types" => "typed"
19:52:47FromDiscord<ElegantBeouf> You just need to use converters/operator overload
19:52:47FromDiscord<TӨMΛ ☠> In reply to @nervecenter "Asking questions about new": True, the only reason I'm dealing with him is that I know my Nim propaganda on the server is pretty working, and he is also open-minded to a degree
19:52:59FromDiscord<TӨMΛ ☠> Thanks everyone for your answers though, appreciating translations a lot ❤️
19:55:19FromDiscord<nervecenter> I've replaced an old C program that had some magic in it with basically stock Nim and no magic, works exceedingly well for our business' needs right now. If anyone proposed moving back to C I'd have to berate them for trying to hamstring maintainability and features.
19:55:58FromDiscord<nervecenter> The old C code was also obfuscated so there's that lol
19:56:02FromDiscord<nervecenter> deliberately
19:56:29FromDiscord<nervecenter> entire algorithms of single-letter variable names
19:58:11FromDiscord<ElegantBeouf> Here I thought C was self obfuscating
20:02:18*rockcavera is now known as Guest5510
20:02:18*tiorock joined #nim
20:02:19*Guest5510 quit (Killed (cadmium.libera.chat (Nickname regained by services)))
20:02:19*tiorock is now known as rockcavera
20:02:25FromDiscord<Chronos [She/Her]> Anyone able to comment on this? Any changes I should make to it so far? https://github.com/Supernovae-Chat/Specification/blob/main/README.md
20:03:16FromDiscord<ElegantBeouf> I find the usage of 3 32bit integers for your semver very optimistic
20:03:55FromDiscord<Chronos [She/Her]> Lol
20:04:06FromDiscord<Chronos [She/Her]> I was gonna use 3 `uint16`s before :p
20:04:06FromDiscord<ElegantBeouf> 1 32bit integer is more than enough
20:04:41FromDiscord<Chronos [She/Her]> I wanted to use semver tho? :p
20:04:47FromDiscord<ElegantBeouf> So?
20:04:57FromDiscord<Chronos [She/Her]> How would I do that in one uint32?
20:05:01FromDiscord<ElegantBeouf> bit shifting?
20:05:14FromDiscord<ElegantBeouf> if you divide it evenly you could have 10 bit semver numbers
20:05:28FromDiscord<ElegantBeouf> if you divide it unequally you could have 10,10,12
20:05:41FromDiscord<ElegantBeouf> which means 1024, 1024, 4096
20:05:46FromDiscord<ElegantBeouf> Which is clearly more than enough
20:06:09FromDiscord<Chronos [She/Her]> Oh that's actually a great idea0
20:06:10FromDiscord<Chronos [She/Her]> -
20:06:25FromDiscord<Chronos [She/Her]> Thank you :D
20:06:45FromDiscord<Chronos [She/Her]> Tho would I still send it as `1.2.3` in the API or just as one int? Hm
20:06:48FromDiscord<ElegantBeouf> > One token will be generated for every time a user
20:06:54FromDiscord<ElegantBeouf> You'd send it as a single uint32
20:07:00FromDiscord<ElegantBeouf> This is networking why would you send a string
20:07:30FromDiscord<ElegantBeouf> "Everytime a user" is really my least favourite thing
20:07:36FromDiscord<ElegantBeouf> I hate everytiming
20:08:19FromDiscord<ElegantBeouf> `string:len == 4` does this mean you'll have 4 byte length strings?
20:08:24FromDiscord<Chronos [She/Her]> My brain was frazzled at that point and I just dropped it for the day :p
20:08:35FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "`string:len == 4` does": Yeah
20:08:42FromDiscord<Chronos [She/Her]> A char is a byte so yes
20:08:48FromDiscord<Chronos [She/Her]> I think
20:08:56FromDiscord<Chronos [She/Her]> Unless I misunderstand...which is very likely tbh
20:11:07FromDiscord<ElegantBeouf> Finally 'for external accounts (such as GitHub backed accounts)' thanks I hate it
20:11:36FromDiscord<Chronos [She/Her]> Lmao
20:11:45FromDiscord<ElegantBeouf> As an aside there isn't much to talk about really
20:12:02FromDiscord<Chronos [She/Her]> Hey, I'd make them enter a password so they can still login without that-
20:12:14FromDiscord<Chronos [She/Her]> Tho idk what to do if they link multiple services with diff emails
20:12:18FromDiscord<ElegantBeouf> Actually "Validation Token.↵↵ Essentially a 'proof of identity' token, should only be valid for 20 minutes at a time, as well as uniquely generated as soon as any app wants access to it."
20:12:24FromDiscord<ElegantBeouf> So you're reimplementing TOTP? 😄
20:13:54FromDiscord<Chronos [She/Her]> Kinda ig? But it's used for implicit access to a website/other service wanting to access data from the account
20:14:21FromDiscord<Chronos [She/Her]> And also will allow for manually invalidating the token
20:16:22FromDiscord<leorize> you mean an app token?
20:16:23FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jlu
20:16:33FromDiscord<leorize> consider the oauth spec
20:16:53FromDiscord<leorize> what do you want for an output?↵(@Chronos [She/Her])
20:17:10FromDiscord<Chronos [She/Her]> In reply to @leorize "consider the oauth spec": I... Completely forgot that existed lol
20:17:43FromDiscord<Chronos [She/Her]> In reply to @leorize "what do you want": Actually my code is fine I think, it's just my brain not working correctly again
20:18:55FromDiscord<0ffh> In reply to @chronos.vitaqua "I think I did": shift major by more, you only allowed two bits for minor
20:19:53FromDiscord<0ffh> sent a long message, see http://ix.io/4Jlv
20:21:02FromDiscord<Chronos [She/Her]> Ah okay I see what I did wrong, thanks!
20:22:15FromDiscord<Chronos [She/Her]> `4202499` is what I have now :D
20:23:13FromDiscord<0ffh> In reply to @chronos.vitaqua "`4202499` is what I": If you make all sizes divisible by 4 you get the distinct numbers neatly divided if you print the resulting number as hex. 😁
20:24:10FromDiscord<Chronos [She/Her]> Hm... Nah, it should be fine I think
20:24:57FromDiscord<Chronos [She/Her]> Only need it as a way to transfer it over the network really
20:31:22FromDiscord<0ffh> sent a long message, see http://ix.io/4JlA
20:34:19FromDiscord<Chronos [She/Her]> Lol fair
20:49:07FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JlH
20:49:21FromDiscord<Chronos [She/Her]> I could return a uint16 instead but there's no point, really
20:50:32FromDiscord<Chronos [She/Her]> Tbf I don't even need the `MAJOR_BITMASK` but it makes my brain happy
20:51:16advesperacitIf I put a test as `batchable: false`, shouldn't testament run that test alone without any other tests running concurrently?
20:55:50FromDiscord<0ffh> In reply to @chronos.vitaqua "Tbf I don't even": That's correct, but if you're lucky the compiler might even optimize the superfluous `and` away.↵Another thing, if you shift before masking you can use `(1 shl FIELD_SIZE)-1` for all the masks and you can reuse the same `FIELD_SIZE`s for the shifts, but it doesn't really make a difference.
20:57:46FromDiscord<Chronos [She/Her]> I don't understand what you mean by that sorry
21:00:53FromDiscord<ElegantBeouf> sent a code paste, see https://play.nim-lang.org/#ix=4JlL
21:00:54FromDiscord<ElegantBeouf> Even better
21:01:28FromDiscord<Chronos [She/Her]> That is also a thing that I can do, that I forgot about-
21:01:29FromDiscord<0ffh> sent a code paste, see https://play.nim-lang.org/#ix=4JlN
21:01:50FromDiscord<leorize> shift everything to the bottom bits then mask the top away
21:02:31FromDiscord<0ffh> In reply to @leorize "shift everything to the": That's what I meant, but it's all over now anyeay.↵Thanks to frech meat guy.
21:02:56FromDiscord<Chronos [She/Her]> Pfff yeah
21:02:58FromDiscord<0ffh> (edit) "anyeay.↵Thanks" => "anyway.↵Thanks" | "frech" => "french" | "tofrenchmeat guy. ... " added "🤣"
21:06:15FromDiscord<0ffh> So to recapitulate:↵1. Bit twiddling is fun↵2. Still, it's good to know your language's features
21:06:42FromDiscord<0ffh> Maybe even use them.
21:06:50FromDiscord<leorize> I'd recommend masking just because bit fields are terrible
21:06:53FromDiscord<Chronos [She/Her]> For sure
21:06:58FromDiscord<Chronos [She/Her]> In reply to @leorize "I'd recommend masking just": Oh? How so?
21:08:58FromDiscord<leorize> they're not very portable and have many undefined behavior
21:09:17FromDiscord<Chronos [She/Her]> Ah good to know
21:09:29FromDiscord<Chronos [She/Her]> I'll stick to masking then
21:09:55FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JlP
21:09:56FromDiscord<Chronos [She/Her]> That's my code then
21:10:04termerNim playground is down again
21:10:10termerPMunch
21:10:22FromDiscord<Elegantbeef> Likely should have a `major=` for all the fields
21:10:48FromDiscord<Elegantbeef> and probably a `semver` constructor that takes in integers
21:10:49*jmdaemon joined #nim
21:10:55FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Likely should have a": I don't think I'd need to edit them at any time tbf
21:11:05FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "and probably a `semver`": That was already planned at least
21:11:36termerCan I write a free money generator in Nim
21:11:49FromDiscord<Chronos [She/Her]> Huh?
21:12:01FromDiscord<Elegantbeef> Of course you can termer
21:12:16FromDiscord<Elegantbeef> Just make your own crypto currency and find some numpties to invest
21:12:23FromDiscord<Elegantbeef> Then pump and dump
21:12:37termerYou got it
21:12:50termerI need to start a discord for dicknutball token
21:13:19FromDiscord<Chronos [She/Her]> In reply to @chronos.vitaqua "I don't think I'd": Ah wait that's useful when actually making the constructor
21:13:47FromDiscord<leorize> and hey, status even helpfully write you all the pieces to make a blockchain
21:14:49termerI will become Status 2.0
21:15:09FromDiscord<Elegantbeef> If they're status, you're progress
21:15:10termerAnd be able to pump Nim full of money so they'll finally implement CPS in the compiler and fix HCR
21:16:24FromDiscord<Chronos [She/Her]> Maybe I still need the bitmasks for major, minor and patch anyway so I can actually set the other fields safely
21:17:43FromDiscord<Chronos [She/Her]> Is there any difference between `s.uint32 shr 22 and BITMASK_10` and `s.uint32 and MAJOR_BITMASK shr 22`?
21:18:05FromDiscord<Chronos [She/Her]> It doesn't seem like there would be any but hey, what do I know
21:18:10FromDiscord<0ffh> In reply to @termer "And be able to": I think CPS will only come after NIR is finished.
21:18:21FromDiscord<Elegantbeef> If you're setting you want to do `or` not `and`
21:18:33termerDude, if they added CPS I'd be so happy
21:18:47termerthen I'd begin rewriting everything async-related
21:18:48FromDiscord<Elegantbeef> Just do not need concurrency, problem solved
21:18:53termerSimple
21:19:14termerI write almost entirely network software, so this has been a thorn in my side
21:19:33FromDiscord<Elegantbeef> Yea I don't even know what a network device is
21:19:37termerThe CPS lib is great, but it's slow because it's a macro
21:19:45FromDiscord<0ffh> In reply to @termer "Dude, if they added": IIRC the BDFL wrote that NIR will make CPS-tranform easier at lesat.
21:19:56termeryeah, I read the thing
21:20:03FromDiscord<Elegantbeef> Are we really going to say BDFL instead of "Araq"
21:20:16termerThe ABDL
21:20:16FromDiscord<Elegantbeef> It's the same letters and way less dictatory
21:20:46FromDiscord<0ffh> In reply to @Elegantbeef "Are we really going": The name just escaped me for a second. 😅
21:20:47advesperacityou can also write it with one hand
21:21:09termerAndreas Rumpf, our dear leader, wrote...
21:21:10FromDiscord<Elegantbeef> You can write anything with one hand
21:21:19FromDiscord<Elegantbeef> Little known fact, one does not have to touch type
21:21:25advesperacitbut then I have to search for the keys..
21:21:32FromDiscord<Elegantbeef> No you do not
21:21:33termerdo you
21:21:34FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "If you're setting you": How would that work though? Since `0b1010 or 0b0100` gives `0b1110`
21:21:42termerI can type with one hand without looking
21:21:46FromDiscord<Elegantbeef> I can mostly touch type with one hand
21:21:47termernot that I want to
21:22:33FromDiscord<Elegantbeef> its not that hard, just fairly errory
21:23:27FromDiscord<Elegantbeef> I always love that I do not even properly touch type with my right hand, I only use my pinky and index finger really
21:24:11termerpretty much
21:24:22termerDoes anyone know why NIR happened all of a sudden
21:24:37FromDiscord<Elegantbeef> Araq probably had a whim and decided he wanted to do it
21:24:37FromDiscord<0ffh> In reply to @chronos.vitaqua "How would that work": Maybe he means, if you want to change a field first clear all the bits with `and` then set the new value with `or`.
21:24:41termerI didn't see anything about it on the forum and then all of a sudden I see an issue open on the GH repo
21:25:03FromDiscord<Chronos [She/Her]> In reply to @0ffh "Maybe he means, if": Ah that was what I was gonna do
21:25:24termerI'm hoping NIR isn't the start of a saga of backend foolery
21:25:38FromDiscord<Chronos [She/Her]> h?
21:25:40FromDiscord<Chronos [She/Her]> Oh?
21:26:25*jmdaemon quit (Ping timeout: 255 seconds)
21:27:28FromDiscord<0ffh> In reply to @termer "I'm hoping NIR isn't": It might be a good move for the medium to long term at least.↵I'm not sure, but I trust that he's thought it through.
21:27:50termerbut why
21:28:11termerIs this another vector for creating toys, or is there actually a purpose
21:28:59FromDiscord<.aingel.> What is NIR?
21:29:10FromDiscord<muddmaker> nim intermediate representation
21:29:22FromDiscord<.aingel.> Oh right
21:29:22termerinternal representation of Nim inside the compiler
21:29:27FromDiscord<0ffh> Kind of a bytecode for Nim.
21:29:31termerright
21:29:37FromDiscord<.aingel.> Right, yeah I remember people talking about that
21:29:44FromDiscord<.aingel.> What benefits will that give us
21:29:53FromDiscord<Chronos [She/Her]> In reply to @termer "Is this another vector": One use is to make it easier to generate code for different backends, and to make NimScript better (as a side-goal) I believe
21:30:12termereasier handling of it for transformations and backends supposedly .aingel.
21:30:36FromDiscord<0ffh> And enabling a REPL.
21:30:39termerI don't want more or different backends, nobody does
21:30:48termerNimScript improvements are good
21:30:52FromDiscord<.aingel.> Gotcha
21:31:31FromDiscord<Elegantbeef> Well that's not true termer, some people want native wasm, and some weirdos even want Java Python and Lua
21:31:58termerNative WASM is good, but having even more toys otherwise sucks
21:32:07termerspreading development effort too thin
21:32:25FromDiscord<Elegantbeef> I mean the more backends is more of a user done thing
21:32:44FromDiscord<Elegantbeef> The idea for more backends is down to users to process the generated IR
21:32:48termerI hope so
21:33:01FromDiscord<0ffh> Yes, it's only supposed to lower the hurdle.
21:33:09FromDiscord<Elegantbeef> A benefit of the IR is that it can be stored to the drive, loaded and handled anyway you want
21:33:24FromDiscord<Elegantbeef> Presently for making any tooling associated with Nim you have to manually plumb the compiler and handle it that way
21:33:28termerI imagine that could help with HCR
21:33:30FromDiscord<Chronos [She/Her]> In reply to @termer "I don't want more": By backends I mean existing ones
21:33:34FromDiscord<Chronos [She/Her]> To make codegen for them better
21:33:51FromDiscord<0ffh> In reply to @Elegantbeef "A benefit of the": Well, you could do that with an AST too.↵Only the AST is not flat.
21:33:51FromDiscord<Chronos [She/Her]> In reply to @Elegantbeef "Well that's not true": 😛
21:34:04FromDiscord<Elegantbeef> Reread what I said
21:34:16FromDiscord<Elegantbeef> Presently to do that with Nim you need to manually call the compiler then process the ast
21:34:23FromDiscord<Chronos [She/Her]> Obviously any other backends would be unofficial and community made (and thus, ignored without a hyperspecific usecase)
21:34:41FromDiscord<Chronos [She/Her]> Isn't another issue that the AST relies heavily on pointers currently?
21:35:23FromDiscord<Chronos [She/Her]> So a bytecode format is also a way of not needing to do some hackery
21:36:08FromDiscord<Chronos [She/Her]> (edit) "So a bytecode format is also a way of not needing to do some hackery ... " added "(or making major breaking changes to macros or something)"
21:36:43FromDiscord<Schelz> hi, how can i specify inside nim.cfg to use custom compile for cc ?
21:37:01FromDiscord<0ffh> In reply to @Elegantbeef "Presently to do that": Actually I was kind of disappointed that Nim has no option for writing and reading ASTs from disc.↵It could be quite useful.
21:37:19FromDiscord<ElegantBeouf> And just like that the bridge died briefly
21:37:25FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4JlX
21:37:31FromDiscord<ElegantBeouf> I mean reading AST from disc is literally IC
21:37:32FromDiscord<ElegantBeouf> 😄
21:37:44FromDiscord<Chronos [She/Her]> `semVer(1, 2, 3)` gives `3.2.0`
21:37:54FromDiscord<ElegantBeouf> In reply to @Schelz "hi, how can i": `--cc:....`
21:38:02FromDiscord<Schelz> i mean not the default one
21:38:10FromDiscord<Schelz> i want to use cl.exe from vs 2020
21:38:34FromDiscord<0ffh> In reply to @elegantbeef "I mean reading AST": IC?
21:38:39FromDiscord<ElegantBeouf> Incremental compilation
21:38:51FromDiscord<0ffh> In reply to @elegantbeef "Incremental compilation": Oh, yes.
21:39:25FromDiscord<0ffh> I wanted to do some AST transforms and found I have to pull in the compiler to get access.
21:39:50FromDiscord<Elegantbeef> You can serialise pointers as just an index into a sequence that's easy
21:40:17FromDiscord<ElegantBeouf> I also do wonder whether the IR will aid in making headers for dynamic libraries easier
21:40:25FromDiscord<0ffh> In reply to @Elegantbeef "You can serialise pointers": Yeah, or just use LISP syntax.
21:40:42FromDiscord<0ffh> Absolutely trivial to generate and parse.
21:41:52FromDiscord<0ffh> It's the best and the worst thing about LISP, all at the same time.
21:42:18FromDiscord<ElegantBeouf> "How we used Lisp as a serialisation format, and how we killed people inccidentally"
21:43:25termerI laughed out loud
21:43:39FromDiscord<ElegantBeouf> Termer it wasn't that funny
21:43:58termerMaking fun of LISP is unreasonably funny
21:44:05FromDiscord<Chronos [She/Her]> Nah, you're comedy gold, Beef
21:44:12FromDiscord<0ffh> My own language started out as a Scheme and I just added syntax and additional semantics on top. 🤷‍♂️ ↵Makes for an easy to implement macro system with tree matching, captures, etc.
21:44:15FromDiscord<ElegantBeouf> I always knew termer was deranged but never knew how deranged
21:45:07FromDiscord<ElegantBeouf> In reply to @chronos.vitaqua "Nah, you're comedy gold,": My friends assure me I have the comedic skill of a beheaded jester
21:45:41FromDiscord<0ffh> Imagine doing structured "regexes" on AST trees.
21:46:36FromDiscord<ElegantBeouf> You've never seen the HTML inspector someone wrote using regex and templates in Nim
21:46:46FromDiscord<0ffh> (edit) "AST trees." => "ASTs."
21:47:16FromDiscord<0ffh> In reply to @elegantbeef "You've never seen the": Must habe been a blast. 😂
21:47:23FromDiscord<ElegantBeouf> It is awful to read
21:47:27FromDiscord<0ffh> (edit) "habe" => "have"
21:47:32FromDiscord<ElegantBeouf> It single handedly destablized the middle east
21:47:32FromDiscord<0ffh> I'm sure.
21:48:25FromDiscord<ElegantBeouf> Not that I like shitting on peoples code, but https://github.com/abdulbadii/HTML-XML-Operations-Nim/blob/main/rmHTMLement.nim
21:48:25FromDiscord<0ffh> I didn't really mean regexes though, that's why I put it in scarequotes. Only the structured analogue.
21:48:41FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jm0
21:48:54FromDiscord<ElegantBeouf> That is 600 lines of completely unmaintainable code
21:49:00FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "My friends assure me": Ah, positively hilarious then
21:49:40FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "That is 600 lines": How so
21:49:48FromDiscord<ElegantBeouf> You didn't click the link did you?
21:50:03FromDiscord<Chronos [She/Her]> Aah I thought you meant what I sent lmao
21:50:07FromDiscord<Chronos [She/Her]> I was so cnfused
21:50:17FromDiscord<ElegantBeouf> Now now I only have 10 fingers I cannot count that high
21:50:18FromDiscord<0ffh> In reply to @elegantbeef "Not that I like": Oof, jep that's bad.↵Whenever I want to do something with HTML, XML or sth like that, I generate an AST and work on that.
21:50:28FromDiscord<ElegantBeouf> I mean of course you parse the code
21:50:32FromDiscord<ElegantBeouf> Why would you not parse the code
21:50:36FromDiscord<0ffh> Mixing parsing and processing is just awful.
21:50:37FromDiscord<ElegantBeouf> Well text rather
21:50:41FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "Not that I like": A) Yes you do↵B) Wow I agree actually
21:51:22FromDiscord<ElegantBeouf> I do not like it
21:51:28FromDiscord<ElegantBeouf> It is just a side product of my humour
21:52:08FromDiscord<Chronos [She/Her]> The best part about it, then?
21:52:10*jmdaemon joined #nim
21:52:30FromDiscord<0ffh> A HTML parser is really a matter of one or two screens full of code. If it's more then something went wrong.
21:52:50FromDiscord<ElegantBeouf> In reply to @0ffh "A HTML parser is": Well as soon as you use regex for anything you've lost a battle
21:53:36FromDiscord<0ffh> In reply to @elegantbeef "Well as soon as": My standard tokenizer actually uses regexes. 😂
21:54:17FromDiscord<0ffh> I maintain that that's actually a good thing.
21:54:35FromDiscord<0ffh> Everything hs it's time and place.
21:54:44FromDiscord<0ffh> (edit) "hs" => "has"
21:54:58FromDiscord<Chronos [She/Her]> Would using `~=` as an operator for "Major versions match" be fine?
21:55:04FromDiscord<Chronos [She/Her]> Just as a shorthand :p
21:55:58FromDiscord<leorize> the typical one for that'd be `^`↵(@Chronos [She/Her])
21:56:00FromDiscord<0ffh> Usually the advice is to skimp on overloaded operators.
21:56:01FromDiscord<leorize> so like `^=`?
21:56:09FromDiscord<Chronos [She/Her]> Ah good to know!
21:56:34FromDiscord<Chronos [She/Her]> In reply to @0ffh "Usually the advice is": Obviously not going overboard, just `==` and `^=` (as well as the ones for assignment of fields)
21:57:57FromDiscord<Chronos [She/Her]> `semVer(1, 2, 3) ^= semVer(1, 0, 12)` epic
21:58:23FromDiscord<0ffh> In reply to @chronos.vitaqua "Obviously not going overboard,": Stuff like '==' is no trouble at all, if it means "check equality". The problems come in if you invent new operators or (god beware!) use known operaters for something completely different.
21:58:45FromDiscord<ElegantBeouf> I don't know that `^=` is better than `sameMajor`
21:59:04FromDiscord<ElegantBeouf> Or `match(a, b, {Major, Minor})` for instance
21:59:08FromDiscord<Chronos [She/Her]> Fair enough, I'll do that then
21:59:19FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "Or `match(a, b, {Major,": Oh that actually looks very pleasant
22:00:58*jmdaemon quit (Ping timeout: 252 seconds)
22:05:26termerIf you guys wanna hear a clusterfuck, let me tell you about the first Rtfl interpreter
22:05:34termerMy scripting lang
22:05:52termerAll weird parsing, it executed line by line as it parsed
22:06:16termerWhile loops would store the source and repeatedly parse and execute the body
22:06:29termersame thing with if blocks, just not repeated
22:06:47FromDiscord<Chronos [She/Her]> sent a code paste, see https://play.nim-lang.org/#ix=4Jm2
22:07:06FromDiscord<Chronos [She/Her]> In reply to @termer "While loops would store": That sounds horrid
22:08:24FromDiscord<0ffh> Quite
22:09:01termerIt was so slow
22:09:05termerabsolutely hilarious
22:09:30FromDiscord<ElegantBeouf> Cmon chronos
22:09:36FromDiscord<ElegantBeouf> `Major in toMatch`
22:09:55termersomeone needs to fix the playground
22:10:04FromDiscord<ElegantBeouf> You also can do `result = result and a.minor == b.minor`
22:10:21FromDiscord<ElegantBeouf> No clue which is nicer
22:10:22FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "`Major in toMatch`": I used autocomplete ✨
22:11:15FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "You also can do": It'd probably be optimised out anyway, but I prefer making sure that the body of an if statement is allowed to run before actually entering the body
22:11:22FromDiscord<Chronos [She/Her]> Rather than not doing a behaviour in an if block
22:11:34FromDiscord<Chronos [She/Her]> ...that doesn't make sense, I'm just a dramatic bitch basically lmao
22:11:50FromDiscord<Chronos [She/Her]> Anyway, done for today! My brain can only handle so much thinking 😛
22:11:58FromDiscord<0ffh> In reply to @elegantbeef "You also can do": One drawback of `and` instead of `&`, no `&=`.
22:12:55FromDiscord<Chronos [She/Her]> Could just implement it yourself but I don't think it's needed, personally
22:14:12termerUse when instead of if
22:14:15FromDiscord<0ffh> In reply to @chronos.vitaqua "Could just implement it": Yeah, but it would be inconsistent.↵It would have to be `and=`, and that wont generate a token, so you'd have to use backticks.
22:14:54FromDiscord<ElegantBeouf> Technically `bleh.and=` should work 😄
22:14:54FromDiscord<0ffh> I think.
22:15:05FromDiscord<ElegantBeouf> Since `and=` would be a field assignment
22:15:19FromDiscord<ElegantBeouf> But you could also do `bleh.and =`
22:15:26FromDiscord<ElegantBeouf> So it's ugly
22:16:02FromDiscord<Chronos [She/Her]> In reply to @termer "Use when instead of": Doesn't work for runtime comparisons though?
22:16:08FromDiscord<0ffh> I might actually run with this, it's genius! 😂
22:16:12FromDiscord<Chronos [She/Her]> That's the entire point :p
22:16:21termerrestructure your code to use when
22:16:32FromDiscord<ElegantBeouf> lol
22:16:36termerit's faster
22:16:43FromDiscord<ElegantBeouf> You can use a `static set[T]`
22:17:03FromDiscord<ElegantBeouf> We're doing a few if statements it's not going to be the bottleneck in anyprogram
22:18:25*advesperacit quit ()
22:19:06termeruse when instead
22:19:06FromDiscord<0ffh> In reply to @elegantbeef "Since `and=` would be": I might actually run with this, it's genius! 😂
22:19:09termerwhen is faster
22:19:17FromDiscord<ElegantBeouf> When is when faster?
22:19:26termerinstant
22:19:31termerit's faster
22:19:37termerno runtime check
22:19:40termerno tradeoffs
22:19:43FromDiscord<ElegantBeouf> The fastest code is code that does not run
22:19:50termereveryone should be using when all the time
22:20:01termerinsane that people keep using if
22:20:28FromDiscord<0ffh> In reply to @termer "insane that people keep": I think it's okay, as long as variables are involved. 😬
22:20:34termerNot really
22:20:40FromDiscord<ElegantBeouf> termer is attempting comedy
22:20:40termeryou're sacrificing performance
22:21:01FromDiscord<0ffh> In reply to @termer "you're sacrificing performance": to an evil demon?
22:21:11FromDiscord<ElegantBeouf> Daemon
22:21:12termerIf requires a runtime check
22:21:16termerJust use when
22:21:19FromDiscord<ElegantBeouf> Only if a goat or virgin is involved though
22:21:19termerno runtime check
22:21:31FromDiscord<0ffh> I think termer is stuck in a loop
22:21:32FromDiscord<ElegantBeouf> Better yet, just don't check
22:21:45FromDiscord<ElegantBeouf> Checking at compile time slows down compile time
22:21:48termerThat's not memory safe
22:21:56termerwe have to make tradeoffs for safety
22:24:49FromDiscord<Chronos [She/Her]> In reply to @termer "restructure your code to": Can't do that via an API :p
22:25:10FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "You can use a": That I could do tbf but
22:25:36FromDiscord<Chronos [She/Her]> In reply to @elegantbeef "termer is attempting comedy": I actually didn't notice that and thought he was being serious... 😓
22:26:08termerhahahaha
22:39:36*jmdaemon joined #nim
23:06:53*jmdaemon quit (Read error: Connection reset by peer)
23:27:09FromDiscord<.aingel.> In reply to @0ffh "A HTML parser is": Is this really true?
23:27:27FromDiscord<.aingel.> libxml which is a widely used html/xml parser is way more than two screens of code
23:28:01FromDiscord<.aingel.> html can be complicated cause there is a lot of broken structure code that still should parse right
23:28:16FromDiscord<.aingel.> There are also special tags like <p> which cannot be nested, and so on
23:36:22FromDiscord<0ffh> In reply to @.aingel. "Is this really true?": Assuming it's well-formed.
23:38:15FromDiscord<0ffh> No trying to fix broken code with a bunch of heuristics.
23:42:57FromDiscord<0ffh> Also syntactic parsing only, no semantic checks or whatever. Just building the AST.
23:43:53FromDiscord<0ffh> Also syntactic parsing only, no semantic checks or whatever.
23:44:20FromDiscord<0ffh> Just building an AST from text source.
23:46:42termerHTML SUCKS
23:46:50termerXHTML is where it's at
23:47:02FromDiscord<0ffh> True.
23:47:32termerallowing malformed and shitty HTML to be accepted by browsers was a retarded idea
23:47:44FromDiscord<0ffh> Absolutely
23:48:01FromDiscord<0ffh> Look, it works on IE, your browser must suck!
23:48:50FromDiscord<0ffh> I do not consider broken HTML code to be HTML
23:49:21FromDiscord<0ffh> That's a mistake which is on Microsoft.
23:49:40FromDiscord<.aingel.> Well I still think there are special cases you have to know like no nested <p> tags
23:49:48FromDiscord<.aingel.> I bet there are other special rules in html
23:50:43FromDiscord<0ffh> In reply to @.aingel. "Well I still think": That's semantics.
23:51:24FromDiscord<0ffh> Doesn't matter for an AST generator.
23:51:25FromDiscord<.aingel.> Well do you just mean xml then?
23:51:50FromDiscord<0ffh> No I mean parsing, which is syntactic.
23:52:06termer<p>para1 <p>para2
23:52:16termertechnically well-formed HTML
23:52:21termer2 paragraphs
23:52:39FromDiscord<.aingel.> Well @0ffh How are you defining html though
23:52:44FromDiscord<.aingel.> Seems like you are defining it as xml
23:54:11FromDiscord<0ffh> In reply to @.aingel. "Seems like you are": Maybe. I mean what I see as describes as "html" on w3schools, for example.
23:54:41FromDiscord<0ffh> (edit) "describes" => "described"
23:54:51FromDiscord<0ffh> https://www.w3schools.com/tags/tag_p.asp
23:54:57termerHTML has a spec
23:55:03termerit's just too lenient
23:55:18termerthings like self-closing tags
23:56:44FromDiscord<0ffh> Well, it seems it has 5 specs at least.↵So maybe the name "html" is a bit fuzzy itself.
23:57:13*derpydoo quit (Read error: Connection reset by peer)